View Issue Details

IDProjectCategoryView StatusLast Update
0007521module Amazon Paymainpublic2023-09-11 16:59
Reportert.laube 
PriorityimmediateSeveritycriticalReproducibilityrandom
Status resolvedResolutionreopened 
Product Version2.0.0 
Target Version2.1.3Fixed in Version2.1.3 
Summary0007521: amazon pay orders not getting exported from shop
DescriptionAbout 1-2% of orders with payment method amazon pay don't get cleared for export from the shop
Capture method is two-step.

It seems, that the function "processCharge" only reacts to the states "Pending" and "Captured". Sometimes the amazon API responds with state "Authorized". I believe, this shouldn't happen with two-step capture?
... ,"convertedAmount":null,"conversionRate":null,"channel":null,"chargeInitiator":null,"statusDetails":
{"state":"Authorized","reasonCode":null,"reasonDescription":null, ...

So there's either a bug in the module or amazon pay sometimes skips states for the order.
Steps To ReproduceIt seems to happen at random. Similarities in the data of the order or time of day aren't obvious. It happens almost every day at varying times.
TagsNo tags attached.

Activities

QA

2023-08-29 19:17

administrator   ~0015501

Last edited: 2023-09-01 16:42

View 2 revisions

If a customer has set up the 2-step verification, it follows the sequence where an order is first authorised and later captured. If an ERP system does not take this sequence into account and always retrieves all information, there is a possibility that orders will be entered that are still in authorised status for the time being. Is this the case for you?

-MF

t.laube

2023-08-31 10:51

reporter   ~0015502

Last edited: 2023-08-31 10:52

View 2 revisions

2-step authentification is set up. The current problem ist, that multiple orders don't get exported to the ERP System (while most of them do).
In this setup the ERP System doesn't pull the orders, but the shop pushes them, when the status is correct. And sometimes the status deviates.
So the ERP System doesn't have any information about the stuck orders and can't access them.

t.laube

2023-08-31 13:25

reporter   ~0015503

We export orders, if:
oxtransid != AMZ_PAYMENT_PENDING, oxfolder = ORDERFOLDER_NEW and oxtransstatus = NOT_FINISHED

And we wonder, why on response of ORDER_STATE_OK or ORDER_STATE_MAILINGERROR the field oxfolder is set to ORDERFOLDER_PROBLEMS and oxtransid gets overwritten with AMZ_PAYMENT_PENDING.

Maybe finalizeOrder in conjunction with updateAmazonPayOrderStatus could be reviewed?

QA

2023-08-31 14:23

administrator   ~0015504

AMZ_PAYMENT_PENDING has not been used for a long time. Therefore, first try the current version v2.1.2 to see if it has the desired behavior.

t.laube

2023-08-31 17:04

reporter   ~0015506

After a short review of the new version it seems, as if this behaviour hasn't changed:
If an order gets the response 200 - completed, its status is set to "AmazonPay Authorisation still pending".
When the next IPN sends 200 - Authorized, the module still only seems to react to "Pending" or "Captured"

Ovrwrite of the oxtransid has just been reported in another Bug report, I believe.

skissin

2023-09-01 11:43

reporter   ~0015509

Hi, can you please provide a feedback to Mr. Laube?

QA

2023-09-01 12:13

administrator   ~0015511

Last edited: 2023-09-01 12:16

View 4 revisions

At the moment, we are having difficulty understanding the behavior you mention, as it doesn't seem to be occurring as described since the last changes. Could you please show us in more detail which section of the code you are referring to? Alternatively, since you say "it seems", what is it referring to. Then we'll take a look at it.

t.laube

2023-09-01 13:28

reporter   ~0015512

function finalizeOrder sets oxtransid to AMZ_PAYMENT_PENDING and oxfolder to ORDERFOLDER_PROBLEMS via function updateAmazonPayOrderStatus, if the parent function returns ORDER_STATE_OK or ORDER_STATE_MAILINGERROR

DispatchController: function init calls on IPN function processCharge. This only seems to react to "Pending" and "Captured". We got an "Authorize" on one order and nothing happened.