2

I have a strange behaviour in magento 2. Sometimes an order paid via paypal express or paypal plus creates a duplicate invoice. There seems to be no error. Aside from the invoice id they are completely identical and are created in the same second.

I found this inside the PayPal.log file:

[20-03-2019 19:41:34] PayPal\Core\PayPalHttpConnection : INFO: GET https://api.paypal.com/v1/payments/payment/PAYID-MYSECRETPAYID
[20-03-2019 19:41:35] PayPal\Core\PayPalHttpConnection : INFO: Response Status  : 200
[20-03-2019 19:41:35] PayPal\Core\PayPalHttpConnection : INFO: PATCH https://api.paypal.com/v1/payments/payment/PAYID-MYSECRETPAYID
[20-03-2019 19:41:36] PayPal\Core\PayPalHttpConnection : INFO: Response Status  : 200
[20-03-2019 19:42:39] PayPal\Core\PayPalHttpConnection : INFO: POST https://api.paypal.com/v1/oauth2/token
[20-03-2019 19:42:40] PayPal\Core\PayPalHttpConnection : INFO: Response Status  : 200
[20-03-2019 19:42:40] PayPal\Core\PayPalHttpConnection : INFO: GET https://api.paypal.com/v1/payments/payment/PAYID-MYSECRETPAYID
[20-03-2019 19:42:41] PayPal\Core\PayPalHttpConnection : INFO: Response Status  : 200
[20-03-2019 19:42:41] PayPal\Core\PayPalHttpConnection : INFO: POST https://api.paypal.com/v1/payments/payment/PAYID-MYSECRETPAYID/execute

The ID in those requests refer to a transaction that created those duplicate invoices.

My assumption is that paypal returns some info back to the shop ("webhook"?). And somthing causes paypal to do it twice.

This is from the order comment history:

20.03.2019 20:43:46 Processing Kunde Nicht benachrichtigt
Benachrichtigung über erfassten Betrag von 1.054,00 € erhalten. Transaktions-ID: "MYSECRETTRANSACTIONID"
20.03.2019 20:43:46 Processing Kunde Nicht benachrichtigt
Benachrichtigung über erfassten Betrag von 1.054,00 € erhalten. Transaktions-ID: "MYSECRETTRANSACTIONID"
20.03.2019 20:42:57 Processing Kunde Nicht benachrichtigt
Benachrichtigung über erfassten Betrag von 1.054,00 € erhalten. Transaktions-ID: "MYSECRETTRANSACTIONID"
20.03.2019 20:42:57 Processing Kunde Nicht benachrichtigt
Benachrichtigung über erfassten Betrag von 1.054,00 € erhalten. Transaktions-ID: "MYSECRETTRANSACTIONID"
20.03.2019 20:42:44 Processing Kunde Nicht benachrichtigt
Autorisierter Betrag von 1.054,00 €. Transaktions-ID: "MYSECRETTRANSACTIONID"

I would like to somehow hook into the process to log if paypal actually DOES return anything multiple times.

Does anybody know where to look?

Thank you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.