Paypal gets wrong total passed by Opencart
Posted: Thu Nov 17, 2016 5:09 pm
Hi,
If I use a coupon paypal standard payments are set to cancelled. I did several tests an my conclusion is that the total amount of the order and the amount passed to paypal are mismatching and that is why the order gets canceled status, although the customer sees a successful payment message afterwards.
If I do not use a coupon, it gets the default "pending" status.
Example from test site:
Order looks like this in Opencart:
iphone 115.20€
Sub-Total 94.45€
Free Shipping 0.00€
Coupon (bedankt) -9.44€
Eco Tax (-2.00) 1.87€
VAT (20%) 17.00€
Total 103.87€
Info passed to paypal for payment:
iPhone 94,45 EUR
Shipping, Handling, Discounts & Taxes 9,43 EUR
Amount 103,88 EUR
Total purchase 103,88 EUR
Total 103,88 EUR
There is 1 cent difference! In the logs I see:
2016-11-17 9:15:12 - PP_STANDARD :: IPN REQUEST: cmd=_notify-validate&mc_gross=103.88&invoice=27+-+Richard+van+den+Heuvel&protection_eligibility=Ineligible&item_number1=product+11&tax=0.00&item_number2=&payer_id=4FDB68YGVNPGJ&payment_date=00%3A12%3A47+Nov+17%2C+2016+PST&payment_status=Completed&charset=windows-1252&mc_shipping=0.00&mc_handling=0.00&first_name=test&mc_fee=3.88¬ify_version=3.8&custom=27&payer_status=verified&business=richard.van.den.heuvel-facilitator%40gmail.com&num_cart_items=2&mc_handling1=0.00&mc_handling2=0.00&verify_sign=AQ-vowUr8.TKjhTKYKZ2Xeka0-qhAta39CGoE6W4fX.hlGENMkk3DWDq&payer_email=richard.van.den.heuvel-buyer%40gmail.com&mc_shipping1=0.00&mc_shipping2=0.00&tax1=0.00&tax2=0.00&txn_id=4BU17221UC2479053&payment_type=instant&last_name=buyer&item_name1=iPhone&receiver_email=richard.van.den.heuvel-facilitator%40gmail.com&item_name2=Shipping%2C+Handling%2C+Discounts+%26+Taxes&payment_fee=&quantity1=1&quantity2=1&receiver_id=HAJQMVSZJ9HRY&txn_type=cart&mc_gross_1=94.45&mc_currency=EUR&mc_gross_2=9.43&residence_country=NL&test_ipn=1&transaction_subject=&payment_gross=&ipn_track_id=5dd85ef2ab678
2016-11-17 9:15:12 - PP_STANDARD :: IPN RESPONSE: VERIFIED
2016-11-17 9:15:12 - PP_STANDARD :: TOTAL PAID MISMATCH! 103.88
Anyone an idea how to fix this rounding issue?
Thanks,
Richard
If I use a coupon paypal standard payments are set to cancelled. I did several tests an my conclusion is that the total amount of the order and the amount passed to paypal are mismatching and that is why the order gets canceled status, although the customer sees a successful payment message afterwards.
If I do not use a coupon, it gets the default "pending" status.
Example from test site:
Order looks like this in Opencart:
iphone 115.20€
Sub-Total 94.45€
Free Shipping 0.00€
Coupon (bedankt) -9.44€
Eco Tax (-2.00) 1.87€
VAT (20%) 17.00€
Total 103.87€
Info passed to paypal for payment:
iPhone 94,45 EUR
Shipping, Handling, Discounts & Taxes 9,43 EUR
Amount 103,88 EUR
Total purchase 103,88 EUR
Total 103,88 EUR
There is 1 cent difference! In the logs I see:
2016-11-17 9:15:12 - PP_STANDARD :: IPN REQUEST: cmd=_notify-validate&mc_gross=103.88&invoice=27+-+Richard+van+den+Heuvel&protection_eligibility=Ineligible&item_number1=product+11&tax=0.00&item_number2=&payer_id=4FDB68YGVNPGJ&payment_date=00%3A12%3A47+Nov+17%2C+2016+PST&payment_status=Completed&charset=windows-1252&mc_shipping=0.00&mc_handling=0.00&first_name=test&mc_fee=3.88¬ify_version=3.8&custom=27&payer_status=verified&business=richard.van.den.heuvel-facilitator%40gmail.com&num_cart_items=2&mc_handling1=0.00&mc_handling2=0.00&verify_sign=AQ-vowUr8.TKjhTKYKZ2Xeka0-qhAta39CGoE6W4fX.hlGENMkk3DWDq&payer_email=richard.van.den.heuvel-buyer%40gmail.com&mc_shipping1=0.00&mc_shipping2=0.00&tax1=0.00&tax2=0.00&txn_id=4BU17221UC2479053&payment_type=instant&last_name=buyer&item_name1=iPhone&receiver_email=richard.van.den.heuvel-facilitator%40gmail.com&item_name2=Shipping%2C+Handling%2C+Discounts+%26+Taxes&payment_fee=&quantity1=1&quantity2=1&receiver_id=HAJQMVSZJ9HRY&txn_type=cart&mc_gross_1=94.45&mc_currency=EUR&mc_gross_2=9.43&residence_country=NL&test_ipn=1&transaction_subject=&payment_gross=&ipn_track_id=5dd85ef2ab678
2016-11-17 9:15:12 - PP_STANDARD :: IPN RESPONSE: VERIFIED
2016-11-17 9:15:12 - PP_STANDARD :: TOTAL PAID MISMATCH! 103.88
Anyone an idea how to fix this rounding issue?
Thanks,
Richard