Pay Pal GB Pounds Bug

Pay Pal GB Pounds Bug

by Kelvin Furze -
Number of replies: 5

I've posted this on the Enrolment Plugin board but have not received a response.  I guess it is more of a bug than a problem that can be helped by giving advice.

Here's the problem:

I have set up a course requiring payment via Paypal.

I tested the facility by enrolling in the course as another user.   However, even though I pay for the course (and as a customer receive a receipt to confirm that payment has been made)  I am not allowed to access the course.  Instead I receive the following message:  

  'Thank you for your payment!  Unfortunately your payment has not yet been fully processed, and you are not yet registered to enter the course \"course name\".  Please try continuing to the course in a few seconds, but if you continue to have trouble then please alert the $a->teacher or the site administrator'   

When I wait the mandatory few seconds (I left it for ten minutes) and try again, nothing happens and I get taken back to the screen informing me that I need to pay for this course.   If I was a genuine customer I would be feeling really annoyed at this point.

The funny thing is,  I also receive as the supplier, an email confirming that payment has been made.  When I log onto my Paypal account I can see the payment there.  It has definitely gone through.    However, I also receive an email from my moodle site with the subject header:  PAYPALL ERROR, AMOUNT PAID IS NOT ENOUGH with various lines of garbled text.  

I notice that another user had a similar problem but it does not appear to have been resolved.  On that occasion he was requesting payment in British Pounds.  I am also requesting payment in British Pounds.  Could it be that the bug lies here somewhere?

Here is a copy of the automated email response sent by Moodle

No one seems to be unduly concerned about this flaw, but for the record, here is the email that you receive from the moodle administrator:

: Transaction failed.

Amount paid is not enough ( < 1.00))

txn_type => web_accept
payment_date => 06:26:03 Nov 04, 2004 PST
last_name => Name
option_selection1 => User
item_name => Course Name
payment_gross =>
mc_currency => GBP
business => Paypal account
payment_type => instant
payer_status => verified
verify_sign =>
payer_email => email of customer
tax => 0.00
txn_id =>
quantity => 1
first_name => name of customer
receiver_email => email of seller
option_name1 => User
payer_id =>
receiver_id =>
item_number => FullPT1
payment_status => Completed
payment_fee =>
mc_fee => 0.23
mc_gross => 1.00
custom => 82-7
notify_version => 1.6
userid => 82
courseid => 7
payment_amount => 1.00
payment_currency => GBP

Any help would be gratefully accepted.

Many thanks

Average of ratings: -
In reply to Kelvin Furze

Re: Pay Pal GB Pounds Bug

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
How much are you expecting the user to pay to start the course, and in what currency?
In reply to Howard Miller

Re: Pay Pal GB Pounds Bug

by Kelvin Furze -

Hi Howard.

Thanks for your answer.  In order to avoid paying PayPal too much in the way of commision, I set up a test course with a price of £0.20 (GBP). Payment was made through Pay Pal in GBP.

I set up a similar course with an entry fee of 0.20 USD, paid in USD, and everything worked fine. 

In reply to Kelvin Furze

Re: Pay Pal GB Pounds Bug

by Martin Millmore -

I hit this issue too today. It seems to be because in the file enrol/paypal/ipn.php, it expects the data returned from paypal to have a payment_gross parameter, but it doesn't. I looked at the code, and noticed that it did have this line though;

    $data->payment_amount   = $data->mc_gross;

but payment_amount is never used. What I did to get it working is I added the following line below that;

    $data->payment_gross    = $data->mc_gross;

and now the payment works fine for me. I didn't want to totally remove the payment_amount line since I don't know if that would have any implications, and didn't fancy mucking about that much. I also don't know what implications this has on other currencies, but it works fine for GBP. I hope this helps.

Martin

In reply to Martin Millmore

Re: Pay Pal GB Pounds Bug

by Kelvin Furze -

Thanks a lot Martin.

I've entered the extra line of code and everything now works perfectly.

I appreciate your help.