[Solved] Buy in VM but Enrollment is not happening in Moodle

  • senthil
  • Topic Author
  • Offline
  • New Member
  • New Member
More
14 years 9 months ago - 14 years 9 months ago #1 by senthil
Hi,

I am usng Joomla 1.5.23 stable, Moodle 2.0, Joomdle 0.53 and VIrtuemart 1.1.8

I did the settings as mentioned in www.joomdle.com/wiki/VirtueMart

The course that i created is visible in VM. Initially it displayed $0. I went to Joomla's Joomdle and gave reload the moodle course. Then the amout is displayed in Joomla VM with tax added. ex. $100 means $110 is displayed in Virtuemart.

Even when i pay successfully using the sandbox and the VM order status is set as "Confirmed". Enrollment is not working. The user is created in Moodle and logged in automatically but in his "my course" section no course is present.

This is the main functionality. Its not working. Please assist how to resolve this

How to debug and how to resolve this issue.
Last edit: 14 years 9 months ago by Antonio Durán.

Please Log in or Create an account to join the conversation.

More
14 years 9 months ago #2 by Antonio Durán
Replied by Antonio Durán on topic Re: Buy in VM but Enrollment is not happening in Moodle
If the order is being confirmed, and enroling not happens, it seems you forgot to change the notify url:
www.joomdle.com/wiki/VirtueMart#Enable_Paypal

Please Log in or Create an account to join the conversation.

  • senthil
  • Topic Author
  • Offline
  • New Member
  • New Member
More
14 years 9 months ago #3 by senthil
Hi Antonio

I did that properly on the initial level itself. I don't know where its goign wrong.

Please Log in or Create an account to join the conversation.

  • senthil
  • Topic Author
  • Offline
  • New Member
  • New Member
More
14 years 9 months ago #4 by senthil
Hi Antonio

When i debugged the code wise the com_joomdle/paypal_notify.php is called properly and when i debugged i am getting the following things




1. Finished Initialization of the notify.php script


2. Received this POST: mc_gross=10.98&invoice=79_b9dd7821c75169e7d1845312a6d5c&protection_eligibility=Ineligible&payer_id=X5EDZJYHTQVCJ&tax=0.00&payment_date=13:52:06 Aug 11, 2011 PDT&payment_status=Completed&charset=windows-1252&first_name=Test&mc_fee=0.62&notify_version=3.2&custom=&payer_status=verified&business=spsent_1303853744_biz@gmail.com&quantity=1&verify_sign=AjatdwyS3YfFpIj5aRBt-uIPq7jbAJ33VijgCLJlK8H1Tp4FUnilWjy5&payer_email=spsent_1311115776_per@gmail.com&txn_id=5N9444267D492612H&payment_type=instant&last_name=User&receiver_email=spsent_1303853744_biz@gmail.com&payment_fee=0.62&receiver_id=7CTBNC769TFWL&txn_type=web_accept&item_name=Order Number: 19&mc_currency=USD&item_number=&residence_country=US&test_ipn=1&handling_amount=0.00&transaction_subject=Order Number: 19&payment_gross=10.98&shipping=0.00&ipn_track_id=cXc3Ezwr0Sweze4P6VXU0A&


3. Connecting to: www.sandbox.paypal.com/cgi-bin/webscr
Using these http Headers:

POST /cgi-bin/webscr HTTP/1.0
User-Agent: PHP/5.3.5
Referer: 115.242.150.30/Joomla1523/administrator/components/com_joomdle/paypal_notify.php
Server: Apache/2.2.17 (Win32) SVN/1.6.16 DAV/2 mod_ssl/2.2.17 OpenSSL/0.9.8q PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1
Host: www.sandbox.paypal.com:80
Content-Type: application/x-www-form-urlencoded
Content-Length: 872
Accept: */*



and this String:

cmd=_notify-validate&mc_gross=10.98&invoice=79_b9dd7821c75169e7d1845312a6d5c&protection_eligibility=Ineligible&payer_id=X5EDZJYHTQVCJ&tax=0.00&payment_date=13%3A52%3A06+Aug+11%2C+2011+PDT&payment_status=Completed&charset=windows-1252&first_name=Test&mc_fee=0.62&notify_version=3.2&custom=&payer_status=verified&business=spsent_1303853744_biz%40gmail.com&quantity=1&verify_sign=AjatdwyS3YfFpIj5aRBt-uIPq7jbAJ33VijgCLJlK8H1Tp4FUnilWjy5&payer_email=spsent_1311115776_per%40gmail.com&txn_id=5N9444267D492612H&payment_type=instant&last_name=User&receiver_email=spsent_1303853744_biz%40gmail.com&payment_fee=0.62&receiver_id=7CTBNC769TFWL&txn_type=web_accept&item_name=Order+Number%3A+19&mc_currency=USD&item_number=&residence_country=US&test_ipn=1&handling_amount=0.00&transaction_subject=Order+Number%3A+19&payment_gross=10.98&shipping=0.00&ipn_track_id=cXc3Ezwr0Sweze4P6VXU0A


4. Connection successful. Now posting to www.sandbox.paypal.com/cgi-bin/webscr


5. Response from www.sandbox.paypal.com : HTTP/1.1 200 OK
Date: Thu, 11 Aug 2011 20:52:15 GMT
Server: Apache
Set-Cookie: c9MWDuvPtT9GIMyPc3jwol1VSlO=BKuGmrKv1fNGFgeqLH5LoRN9PaNJNSFQO2RKlp0lZRKFJiFoZsp5tYR9rPpHyLAURINOmPJNQLQJ9mWKGSghfuSlKhxldB7NbUaNMR6Vdbu1TNGM6bRrlUC7HYLtH0eoloIydm%7cvKHZExofiUhbKm_oyID_MmINYLabt-d1GK19IV8N1SoHcbmPvUWGCjYE4FOrZSEuVr99E0%7c-1XgQ9PpzknkQEkE5JHyRdNZHtOWHpJ0QSOQB7fapC_79hEoCDd-775RDOlQWWxEdEyHK0%7c1313095935; domain=.paypal.com; path=/; HttpOnly
Set-Cookie: cookie_check=yes; expires=Sun, 08-Aug-2021 20:52:15 GMT; domain=.paypal.com; path=/; HttpOnly
Set-Cookie: navcmd=_notify-validate; domain=.paypal.com; path=/; HttpOnly
Set-Cookie: navlns=0.0; expires=Wed, 06-Aug-2031 20:52:15 GMT; domain=.paypal.com; path=/; HttpOnly
Set-Cookie: Apache=10.72.109.11.1313095935038498; path=/; expires=Sat, 03-Aug-41 20:52:15 GMT
Connection: close
Content-Type: text/html; charset=UTF-8

VERIFIED



6. amt cmp 10.98 10.98


6. PT Completed


6. courses_in_order 1


6. Pdid 22


6. ODP 0


add_order_enrols invoked


mtd create_joomdle_user


params usern


params2 -775577


params3 -775577


Content msg 1

Method is create_joomdle_user Response is 1

\Update user profile in Moodle with VM data invoked


buy_for_children 0

\enroll user called

\enroll user ws called


mtd enrol_user


params usern


params2 7


params3 -775577


Content msg Array
(
[faultCode] => 0
[faultString] => Coding error detected, it must be fixed by a programmer: invalid enrol instance!
)



Error msg is Coding error detected, it must be fixed by a programmer: invalid enrol instance!

And in my apache logs gettting the followng logs



[Fri Aug 12 02:21:01 2011] [error] [client 115.242.150.30] PHP Notice: Trying to get property of non-object in

F:\\xampp\\htdocs\\Joomla1523\\plugins\\user\\joomdlehooks.php on line 128, referer:

115.242.150.30/Joomla1523/index.php?page...directed=1&Itemid=53

[Fri Aug 12 02:21:01 2011] [error] [client 115.242.150.30] PHP Notice: Trying to get property of non-object in

F:\\xampp\\htdocs\\Joomla1523\\plugins\\user\\joomdlehooks.php on line 128, referer:

115.242.150.30/Joomla1523/index.php?page...directed=1&Itemid=53

[Fri Aug 12 02:22:04 2011] [error] [client 115.242.150.30] PHP Warning: Invalid argument supplied for foreach() in

F:\\xampp\\htdocs\\Joomla1523\\administrator\\components\\com_joomdle\\helpers\\mappings.php on line 432

[Fri Aug 12 02:22:44 2011] [error] [client 115.242.150.30] PHP Notice: Undefined variable: product_types in

F:\\xampp\\htdocs\\Joomla1523\\administrator\\components\\com_virtuemart\\classes\\ps_product_type.php on line 579, referer:

115.242.150.30/Joomla1523/index.php?opti..._details&order_id=19

Please Log in or Create an account to join the conversation.

  • senthil
  • Topic Author
  • Offline
  • New Member
  • New Member
More
14 years 9 months ago #5 by senthil
Please let me know where its going wrong ?

Please Log in or Create an account to join the conversation.

More
14 years 9 months ago #6 by Antonio Durán
Replied by Antonio Durán on topic Re: Buy in VM but Enrollment is not happening in Moodle
Ok, it seems you disabled the manual enrolment plugin in the moodle course, and so it will not work.

Please Log in or Create an account to join the conversation.

  • senthil
  • Topic Author
  • Offline
  • New Member
  • New Member
More
14 years 9 months ago #7 by senthil
Hi
Thank you. After enabling Manual enrollment plugin, Now its working but when i buy a course from virtuemart it should set to Joomdle enrollment type for that particular user.

But it moodle's admin when i login and see for the enrolled user , i can see that particular user is enrolled using manual enrollment but actually via Joomdle webservice using Joomdle enrollment mtd only it happens.

Does that make sense ?

Because i am buying a course from Virtuemart via Joomdle web service.

Its enrolling the person in moodle, but instead of setting the enrolled user's enrollment method as "Joomdle EnrollmentName" its showing "Manual Enrollment".

Please explain.

Please Log in or Create an account to join the conversation.

More
14 years 9 months ago #8 by Antonio Durán
Replied by Antonio Durán on topic Re: Buy in VM but Enrollment is not happening in Moodle
Joomdle does not really use the joomdle enrolment method at this point, it enrols users with manual method, so it is working fine.

Please Log in or Create an account to join the conversation.

  • senthil
  • Topic Author
  • Offline
  • New Member
  • New Member
More
14 years 9 months ago #9 by senthil
Yes, its working fine. Thanks a lot. I have a couple of question.

1. So Joomdle enrollment method is used to display the course price in Joomla's Virtuemart product items. Is my understanding is correct ?
2. When i add a course in moodle and add a enrollment mtd with price. Then in Joomla's Virtuemart product items its initially showing as zero. When i login in to Joomla's Admin panel and inside the Joomdle -> Shops -> clicking Reload moodle course by selecting the newly added course. I am able to see the price in Joomla's Virtuemart product items. Why its happening like this ? Ideally when we add the enrollment mtd itself the price of the product in VM should get updated . Please explain

Please Log in or Create an account to join the conversation.

More
14 years 9 months ago #10 by Antonio Durán
Replied by Antonio Durán on topic Re: Buy in VM but Enrollment is not happening in Moodle
1. yes

2. Did you create the course in shop after setting a price in Moodle? Price is not auto-updated when set in Moodle, thus you need to reload, if you change something after creation in shop.

I just re-tested: created a new course in moodle, added joomdle enrol method with a price. Then go to joomdle->shop and publish: it gets greated in VM/Tienda with correct price.

Please Log in or Create an account to join the conversation.