1
Answers
Vote up!
0
Vote down!

Incorrect payment type and amount posted after PayPal WPS IPN returned

I am having an issue where an incorrect amount is being posted for the order on the payment screen of the order after the payment processing completes. The order is processed fine at PayPal and the correct amount is being charged at PayPal (sandbox account) and I see the correct amount returned in the IPN (within the watchdog log), but this is NOT the payment amount displayed on the payment tab of the order page (http://www.example.com/admin/commerce/orders/8/payment).

Viewing the order displays the correct amount, but the payment amount on the payment tab is incorrect and has a payment amount that does not make sense (not sure where it is coming from).

Has anyone else experienced this issue?

Thanks!

commerce 7.x-1.8
paypal 7.x-2.2
paypal wps 7.x-2.2

Asked by: fnikola
on January 14, 2014

1 Answer

Vote up!
2
Vote down!

After reviewing this issue in more detail I was causing my own errors. I had not one, but two issues causing the problem.

First, I did not reset the following tables when resetting the order numbers (commerce_order and commerce_order_revision) as described on post http://drupal.stackexchange.com/questions/24838/how-to-reset-the-id-of-t...

commerce_invoice - if using Invoice module
commerce_paypal_ipn - if using PayPal modules
commerce_payment_transaction - if using PayPal modules
commerce_payment_transaction_revision - if using PayPal modules

The second issue was the formatting of my custom invoice number I generated using my custom invoice callback function/module. The way the IPN processing works is that it looks to match the order id to the custom invoice number and eliminates all other text. I had the order id at the end of my custom invoice number (i.e. 2014-XXX-0117-5 where 5 is the order id) and it was not matching/finding the order. When I moved the order id to the beginning of my custom order number (5-2014-XXX-0117) the IPN processing found the order and the payment was associated with the correct order.

You can look at the parsing of the invoice number in the PayPal module to see the exact details, but just wanted to alert anyone if they are having this issue

Answer by: fnikola
Posted: Jan 17, 2014