Can not place order with "Pay by Bancontact card"
EGxw opened this issue · 3 comments
Describe the bug
We have many feedbacks that our Belgian customers could not place their orders with the option "Pay by Bancontact card" on our production site after an upgrade of the module to v3.7.1.
The same problem has been also reproduced in test mode on our test site. With several debug by our dev teams, we found the cause : it seems like that in checkout-component-renderer.js
the onChange handler can not put correctly 'bcmc' ( type code for Bancontact card ) in 'state', therefore, this payment method will not be in 'placeOrderAllowed' array which controls the triggers for the payment-form.submit() events.
To Reproduce
- select Pay by Bancontact card at payment method stage
- fill the form : card number, date, name of card holder
- click on "pay my order" button
- nothing will happen.......
Expected behavior
Place the order as other payment methods
and in chrome dev tool, i don't see any ajax from 'checkout-component-renderer.js', which means nothing triggered for the payment method form.
Desktop (please complete the following information):
- OS: WIN + Mac
- Browser chrome + Safari tested, but also others i think
- The last version
Smartphone (please complete the following information):
- Device: iPhone
- OS: iOS
- Browser chrome + Safari tested, but also others i think
- The last version
Additional context
Our debugs :
if we put a log in this place , we can see the changes triggered by filling the form :
For me it means no "bcmc" type will be putted in placeOrderAllowed array, however this placeOrderAllowed array is used for checking if this payment method is allowed to placing the order:
In my option: it has something wrong by confusing the brand "bcmc" and the type "bcmc" , or taking the wrong paymentForm between "Bancontact" and "Pay by bank card" in our case.
Please let me know if you need further informations.
Thank you
Best regards
Hi,
Thanks @EGxw for the detailed report. Starting from where you ended, I found that: on form submit the lines:
if (!paymentMethod.details) {
placeOrderAllowed[paymentMethod.type] = true;
}
are the cause of the problem.
paymentMethod.details
is not empty and the code in if
statement doesn't execute.
We need the type bcmc
to be allowed (i.e placeOrderAllowed['bcmc'] = true;)
console.log(placeOrderAllowed);` just before it. You will find that in all cases, the scheme type is allowed. That's why bank card works but not bancontact.
When I remove the if statement and execute only its body, tho order starts to be processed.
placeOrderAllowed[paymentMethod.type] = true;
I am using this solution as a temporary fix because a PR needs more than removing an if statement. I am not yet convinced that we need empty details so that we add bcmc
to allowed payments! And why bank card is allowed by default!?
Hi guys,
Apologies for the delay. As @arouiadib pointed out that particular code snippet was the cause of the issue. In #245 we have updated the Adyen checkout component version which means that we are now provided a nicer way to validate if the placeOrderAllowed
buttons is set to true.
This PR will be released in the near future. In the meantime if you want, you can replicate on your end.
Best regards,
Jean
Adyen
Dear reporter, we would like to notify you that the Adyen x Prestashop integration has received a full overhaul. From Oktober 1st 2023, we will offer a full featured, new integration that has been built from scratch. Thank you for your product feedback. We will take your suggestion into consideration and prioritize accordingly. If you are experiencing any ongoing issues with this integration please contact Adyen Support and we will make sure you will get the answers you need to get going.