Adyen / adyen-salesforce-commerce-cloud

Salesforce Commerce Cloud (formerly Demandware)
MIT License
91 stars 76 forks source link

Support Auto-Failing of orders #613

Open taurgis opened 2 years ago

taurgis commented 2 years ago

Most projects have "auto-failing" enabled of orders to free up inventory for people not finishing their order within a certain timeframe.

In one of our projects we hade the following scenario with this setting:

Scenario

1) Consumer clicks pay on the website 2) Consumer is redirected for 3DS 3) Consumer paid for the order, but does not return to the website (for whatever reason - closing the browser, ...) 4) Auto fail triggers after 1 hour 5) Notification was received 12 hours - 24 hours after the order 6) Order remains on failed because only created orders are placed (in our version of the cartridge we had an exception- not the latest release)

Solution

Also check for the "failed" status and automatically attempt to do an "undo" (https://documentation.b2c.commercecloud.salesforce.com/DOC1/topic/com.demandware.dochelp/DWAPI/scriptapi/html/api/class_dw_order_OrderMgr.html?resultof=%22%6f%72%64%65%72%6d%67%72%22%20#dw_order_OrderMgr_undoFailOrder_Order_DetailAnchor) and attempt to place it after the undo.

There are scenario's where the product might have already been sold out, so error handling during placing the order still needs to be in place.

Likelihood of scenario

Quite small, we have not seen it happen often that a notification is sent to late.

Payment method: directEbanking

https://github.com/Adyen/adyen-salesforce-commerce-cloud/blob/b4cfd7d2aa231ffc6e9debd5e22190a4fd5f9c71/src/cartridges/int_adyen_SFRA/cartridge/scripts/adyenService.js#L42

wboereboom commented 2 years ago

Hi @taurgis,

Thanks for raising this issue, and for elaborating to such an extent. I will take this discussion to our team to see if and how we should act if a situation like this occurs. I shall get back to you on this ticket once we've decided.

Kind Regards, Wouter Adyen

prestarihab commented 1 year ago

Hello @wboereboom Any update for this issue ? Thanks Rihab