View Issue Details

IDProjectCategoryView StatusLast Update
0007440module PayPal Checkoutmodule PayPal checkout - subpublic2023-05-17 15:11
Reporterthomas_g Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionreopened 
Product Version2.2.3 / 1.2.3 
Fixed in Version2.3.0 / 1.3.0 
Summary0007440: Pending orders with oxordernr 0 are deleted before the payment process can be completed
DescriptionPending orders with oxordernr 0 are deleted before the payment process can be completed if the customer takes longer than 10 minutes to pay.
This is a problem, especially with Sofort, since the customer's money is then withdrawn from the account anyway. After that there is neither an order nor a receipt of payment at PayPal.
 
This is caused by any webhook arriving >10 minutes after the oxorderdate of the pending order. An order that has the following conditions:
   oxordernr = 0
   oxtransstatus = NOT_FINISHED
   oxpaymenttype = %oscpaypal%
   oxorderdate < Time of the webhook - 10 minutes

See WebhookHandlerBase::handle() and OrderRepository::cleanUpNotFinishedOrders().
The use of cleanUpNotFinishedOrders should be reconsidered. But at least the period of 10 minutes increased.
Steps To ReproducePut some things in the shopping cart, choose sofort in the payment selection and complete the order in Oxid.
Select your bank in the Klarna window and log in. Don't proceed at first. Leave the window open. The order exists as a pending order with order number 0 in Oxid.
Wait at least 10 minutes and place another order. Complete this further order by paying for it with PayPal, for example.
Now you could theoretically complete the payment of the first order in the Klarna window. The money would be withdrawn from the customer account, but there are no longer any orders in Oxid.
TagsNo tags attached.

Activities

thomas_g

2023-03-03 09:51

reporter   ~0015072

A note on reproducing the bug:

After the second order has been paid, you have to wait for the webhook requests to arrive.
Actually, on PAYMENT.CAPTURE.COMPLETED.
For CHECKOUT.ORDER.APPROVED there is an override of the method handle() in which cleanUpNotFinishedOrders() is not called.

QA

2023-05-17 15:11

administrator   ~0015185

With upcoming version of PayPal Checkout module, there's an option in the module settings to whether delete orders with order number 0 or not. Default is no deletion. If you choose to delete such orders, you also have a second option to define the time a order must be aged. Default is 60 minutes. This should be enough in most cases, but if you prefer even a longer time, you can set so.

[sp]