Adyen / adyen-salesforce-commerce-cloud

Salesforce Commerce Cloud (formerly Demandware)
MIT License
90 stars 75 forks source link

Authorize Hook order vs orderNumber #976

Closed fghezzo closed 11 months ago

fghezzo commented 11 months ago

When an order is placed, the app_storefront_base/cartridge/scripts/checkoutHelpers.js handlePayments method calls the authorize hook using the order number as an argument. This hook call is catch by the following code.

https://github.com/Adyen/adyen-salesforce-commerce-cloud/blob/6d0e22cf23183ac5e89fcfd452945133b4bb2e7b/cartridges/int_adyen_SFRA/cartridge/scripts/hooks/payment/processor/adyen_component.js#L11-L22

The code above calls the following methods middlewares.authorize that accept as an argument an order and NOT an order number. https://github.com/Adyen/adyen-salesforce-commerce-cloud/blob/6d0e22cf23183ac5e89fcfd452945133b4bb2e7b/cartridges/int_adyen_SFRA/cartridge/scripts/hooks/payment/processor/middlewares/authorize.js#L25-L34

Expected behavior The authorize hook before calling the middlewares.authorize must convert the order number in an demandware Order.

Desktop (please complete the following information):

amihajlovski commented 11 months ago

Hello @fghezzo

Thanks for raising this issue. We updated the function docs cause the first parameter is demandware order and not the order number.

Kind Regards Aleksandar Adyen