Closed patrick3Dgroup closed 1 year ago
Thanks for this, really helped me!
Hi @patrick3Dgroup
Thank you for raising this. We have updated the README to reflect the current best practices when it comes to creating a payment form.
As of Commerce 4, payment forms are all namespaced by the gateway's handle this is detailed in the upgrade guide: https://craftcms.com/docs/commerce/4.x/upgrading.html#payment-forms
Hopefully, the update to the plugin's README will avoid confusion in the future.
Thanks!
Hi @patrick3Dgroup
Thank you for raising this. We have updated the README to reflect the current best practices when it comes to creating a payment form.
As of Commerce 4, payment forms are all namespaced by the gateway's handle this is detailed in the upgrade guide: https://craftcms.com/docs/commerce/4.x/upgrading.html#payment-forms
Hopefully, the update to the plugin's README will avoid confusion in the future.
Thanks!
Hi, apologies if I've missed something but there still seems to be the incorrect line of code in the readme:
hiddenInput.setAttribute('name', 'paymentMethodId'); // Craft Commerce only needs this
Just wasted a couple of hours on this and eventually came across this issue in the closed pile. Like I say, apologies if I got the wrong end of the stick somehow, I just don't want anyone else to be thrown by this.
Just had the same issue. Took 3 hours of searching around to find this. 'https://github.com/craftcms/commerce-stripe' is still showing the incorrect code for paymentMethodId.
Yeah, this issue is definitely not closed. This is a glaring error in the sample documentation and is next to impossible to debug. @nfourtythree
@nfourtythree Can you reopen the issue please? The readme is still not updated with that fix.
Can confirm I've ran into this issue as well yesterday.
Hi All
Thank you for bringing this to our attention. We have just pushed an update to the README that we believe solves the issue.
Please let us know if you have any further issues.
Thanks!
Description
Following the example template causes an error with a message - 'Invalid payment or order. Please review.". Using 'gateway.getPaymentFormHtml()' works fine but when you follow the example template to create your own custom form, you will encounter an error.
I solved the issue by passing in 'paymentForm[stripe][paymentMethodId]' as the hidden input name attribute instead of what the example gave.
Steps to reproduce
Additional info