MONEI / MONEI-Salesforce-Commerce-Cloud

Salesforce Commerce Cloud module for MONEI
https://docs.monei.com/docs/e-commerce/salesforce/
MIT License
0 stars 0 forks source link

Transaction order ID error #3

Closed federicogiampietro closed 1 year ago

federicogiampietro commented 1 year ago

Hello,

during integration tests we noticed that the payment in Monei is saved using the SFCC order ID the order ID is reserved for the whole basket duration, meaning that if the transaction for any reason is approved but returns an error (i.e. on return callback there is an error on the form) the user can't complete the checkout

consider the following flow: 1- the user fill shipping data 2- the user fill billing data without a required field 3- the user submit the payment 4- the payment is authorized 5- upon return callback, the billing form shows the error 6- the user fix the billing form data and clicks on "continue" 6- from that point on the user can't proceed forward to the next step of the checkout: the continue button always tries to authorize the transaction again which returns an error from the create payment endpoint due to the fact that the payment, identified by the order ID, is already authorized

only way for the user to use MONEI at this point is to clear cookies and create a completely new basket

there should be a flow implemented with the payment form "continue" button that checks if the payment that it is going to create is already created and if so, to check the status and if already authorized it should only go to the next step of the checkout without trying to create a new payment each time

jimmyn commented 1 year ago

MONEI Order ID is unique for successful payments, meaning you can't have multiple successful payments with the same order (pending and failed payments are allowed). Could you please describe in details how is it possible that the payment is authorized, but the checkout form is invalid?

Are you able to continue with the payment even if the billing form is invalid?

federicogiampietro commented 1 year ago

You're referring to capturing. Capturing should happen only once, but authorization could and should happen more than once. There are 2 cases when the user can authorize more than once:

1 - billing invalid form : server side billing form validation happens on action submitPayment, which is called after the MONEI popup flow which authorizes or not the transaction. Client-side validation of the form mitigate the issue but it's no reason for ignoring the issue 2 - Confirmation page : the next step from billing page is Confirmation page. On that page the user can change his billing details, his shipping details or shipping method which will lead the user to billing page again. With current implementation, this flow is ignored and if the user goes from Confirmation to Billing or Shipping, he is unable to select MONEI again due to the fact that the authorization flow always fails after the transaction is authorized the first time

alexandresaiz commented 1 year ago

@federicogiampietro Is this solved?

fgiampietro commented 1 year ago

@alexandresaiz not yet, this needs an update on the flow implemented with the cartridge, which will require more time than the other issues. I've already discussed it with @jimmyn and by fixing this we will also pave the road for other payment methods than bizum (meaning that they will still require to be implemented but without having major changes on the cartridge itself)

alexandresaiz commented 1 year ago

@federicogiampietro thanks Federico! good to have this approach as I smell Mastercard willing to support Hawkers in mkt if they connect with MONEI the card processing.