Post by rheuvel » 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&notify_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


Newbie

Posts

Joined
Thu Nov 17, 2016 4:55 pm


Post by rheuvel » Thu Nov 17, 2016 9:23 pm

BTW: using Opencard 2.3.0.2

After some further digging, it seems that the information passed to PayPal is done excl. VAT/TAX and due to the order in which the final payment is calculate the including VAT/TAX price differs from the invoice.

This also happens when you do NOT use coupon...

Sample from another order:

Item 1 2x 6.99 (incl 21% tax)
Item 2 2 x9.99 (incl 21% tax)
Free shipping

Total: 33.96 (incl 21% tax)

In the DB this is Order_info['total']: 33.9601

Info passed to paypal:

Item 1 mc_gross_1 - 11.56 (excl 21%tax)
Item 2 mc_gross_2 - 16.52 (excl 21%tax)
Item 3 mc_gross_3 - 5.89 (Shipping, Handling, Discounts & Taxes)
Total: 33.97 (incl 21% tax)

Added some additonal log enties in pp_standard.php module:

2016-11-17 12:26:32 - mc_gross - 33.97
2016-11-17 12:26:32 - item_number1 - Sok 1
2016-11-17 12:26:32 - tax - 0.00
2016-11-17 12:26:32 - item_number2 - sok 2
2016-11-17 12:26:32 - item_number3 -
2016-11-17 12:26:32 - mc_shipping - 0.00
2016-11-17 12:26:32 - mc_handling - 0.00
2016-11-17 12:26:32 - mc_fee - 1.50
2016-11-17 12:26:32 - num_cart_items - 3
2016-11-17 12:26:32 - mc_handling1 - 0.00
2016-11-17 12:26:32 - mc_handling2 - 0.00
2016-11-17 12:26:32 - mc_handling3 - 0.00
2016-11-17 12:26:32 - mc_shipping1 - 0.00
2016-11-17 12:26:32 - mc_shipping2 - 0.00
2016-11-17 12:26:32 - mc_shipping3 - 0.00
2016-11-17 12:26:32 - tax1 - 0.00
2016-11-17 12:26:32 - tax2 - 0.00
2016-11-17 12:26:32 - tax3 - 0.00
2016-11-17 12:26:32 - payment_type - instant
2016-11-17 12:26:32 - last_name - buyer
2016-11-17 12:26:32 - item_name1 - Sok 1
2016-11-17 12:26:32 - item_name2 - sok 2
2016-11-17 12:26:32 - payment_fee -
2016-11-17 12:26:32 - item_name3 - Shipping, Handling, Discounts & Taxes
2016-11-17 12:26:32 - quantity1 - 2
2016-11-17 12:26:32 - quantity2 - 2
2016-11-17 12:26:32 - quantity3 - 1
2016-11-17 12:26:32 - mc_gross_1 - 11.56
2016-11-17 12:26:32 - mc_currency - EUR
2016-11-17 12:26:32 - mc_gross_2 - 16.52
2016-11-17 12:26:32 - mc_gross_3 - 5.89


How to rework this that the same info is passed to paypal as on the invoice, as customers are asking why they pay 1 or 2 cents more on their orders...


Newbie

Posts

Joined
Thu Nov 17, 2016 4:55 pm


Post by paradoxx » Sat Jan 21, 2017 6:25 pm

I'm just having this exactly same issue with OC 1.5.5.1. I have also read some old posts about the issue but there is not really a solution for that. I also thought that it was only when a coupon was used but is not like that.

I can really get in trouble if I cannot fix this issue. I hope someone can help here.

New member

Posts

Joined
Sun Jun 30, 2013 5:56 am
Who is online

Users browsing this forum: No registered users and 32 guests