Closed fghezzo closed 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.
app_storefront_base/cartridge/scripts/checkoutHelpers.js
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
middlewares.authorize
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):
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
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-L34Expected behavior The authorize hook before calling the
middlewares.authorize
must convert the order number in an demandware Order.Desktop (please complete the following information):