Hi,
Using Moodle Moodle 2.4.3 (Build: 20130318)
This error seems to be appearing in a number of installations. I am using the PayPal sandbox and, apart from this reported error, everything elseappears to work correctly:
- The payment is credited to the business account
- The payment is debited to the customer account
- The website reports payment successful (see attached image)
- The user is enrolled to the course
Perhaps as a consequence of this error neither the admin nor the newly-subscribed user receives emaikl notifications. Instead the admin receives the "PAYPAL ERROR: Transaction <tx code> is being repeated!" email with the following entries:
GCSE science online: Transaction failed. Transaction 76C412249N7239933 is being repeated! mc_gross => 10.00 protection_eligibility => Ineligible payer_id => 9M39WH4N3CCG4 tax => 0.00 payment_date => 06:08:34 May 07, 2013 PDT payment_status => Completed charset => windows-1252 first_name => Ian option_selection1 => <User Name Deleted> mc_fee => 0.54 notify_version => 3.7 custom => 6-2-4 payer_status => verified business => <business e-mail address deleted> quantity => 1 verify_sign => AiKZhEEPLJjSIccz.2M.tbyW5YFwA6cwNgwye3KyZfntvOmptmc9Uato payer_email => <customer e-mail address deleted> option_name1 => User txn_id => 76C412249N7239933 payment_type => instant last_name => Buy receiver_email => <business e-mail address deleted> payment_fee => receiver_id => 8NNQF4NW39H98 txn_type => web_accept item_name => A Test Course mc_currency => GBP item_number => ATC residence_country => GB test_ipn => 1 handling_amount => 0.00 transaction_subject => 6-2-4 payment_gross => 10.00 shipping => 0.00 ipn_track_id => 9c8ffb1ac73ce userid => 6 courseid => 2 instanceid => 4 payment_currency => GBP timeupdated => 1367932154
The code controlling this is here (moodle/enrol/paypal/ipn.php):
if ($existing = $DB->get_record("enrol_paypal", array("txn_id"=>$data->txn_id))) { // Make sure this transaction doesn't exist already
message_paypal_error_to_admin("Transaction $data->txn_id is being repeated!", $data);
die;
}
I repeated thhe PayPal for another new user, brand new account. The txn_id is different for the two transactions, so something is adrift with the code.
I've checked the forum and there does not appear to be a resolution for this error. Either way I'd like to know why it is happening.
Until there is a resolution I shall try commenting-out that section of code to see if it will run to completion (or just remove the "die").
I'll report back if this is a suitable temporary hack. In the meantime any help would be much appreciated.
Thanks,
Ric