-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot place order at checkout with Braintree and 3DS enabled using billing addresses without region set #34204
Comments
Hi @dphilipps. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. Please, add a comment to assign the issue:
🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
@magento give me 2.4-develop instance |
Hi @dphilipps. Thank you for your request. I'm working on Magento instance for you. |
Hi @dphilipps, here is your Magento Instance: https://2e0e748fe9adb6f5da4bafbe39d78c0c-2-4-develop.instances.magento-community.engineering |
Hi @engcom-November Many thanks |
I have verified these steps on a fresh composer install of M2.4.3 |
What do I need to add to this ticket to get it to be triaged @magento/engcom-team-members? This is a serious checkout issue in the latest version of Magento using a mainstream payment gateway? |
Is there any update on this, we are also experiencing the same issue. This is a critical bug and needs addressing, happy to assist with a fix if required. @dphilipps did you happen to find a workaround? Disabling 3DS is a no-go for legal reasons, yet making the state field required is a UX problem. |
@dphilipps For all those who come across this issue, I have created a patch file, attached. ISSUE-34204__PayPal-Braintree-Validation.patch.zip diff --git a/view/frontend/web/js/view/payment/3d-secure.js b/view/frontend/web/js/view/payment/3d-secure.js
index 864d5e53..ef832923 100644
--- a/view/frontend/web/js/view/payment/3d-secure.js
+++ b/view/frontend/web/js/view/payment/3d-secure.js
@@ -55,7 +55,7 @@ define([
totalAmount = parseFloat(quote.totals()['base_grand_total']).toFixed(2),
billingAddress = quote.billingAddress();
- if (billingAddress.regionCode !== undefined && billingAddress.regionCode.length > 2) {
+ if (billingAddress.regionCode != null && billingAddress.regionCode.length > 2) {
billingAddress.regionCode = undefined;
}
This patch file updates the validation to check for null, which naturally covers both 'undefined and null', thus bypassing the 'cannot read properties of null' error when reading the length in the case a region is not set. I have created a PR on the Braintree repo, is this the correct place for it? If I need to raise a PR on a different repo please may somebody assign the issue to me and point me in the right direction. genecommerce/module-braintree-magento2#182 I would question the original code as it seems a bit of a hack having to set regionCode to undefined, a possible workaround for a bug in the system at Braintree's end? |
Hi @nicholasscottfish |
Patch supplied by Gene support directly in response to this issue, however I have not tested it yet. |
Hi @dphilipps, the patch I posted has been tested and fixes the issue, however, looking at the patch they supplied it is fixing the same lines of code but is slightly different in that they still set regionCode as undefined if it was null, possibly what needs to happen. I will get in touch to find out why that is necessary. Thanks for sharing! |
worth noting that while this seems to only occur using saved addresses for logged in users with a blank region, freshly entered ones work fine. (it was mentioned to save the address in the reproduction steps, but not explicitly anywhere else in the body) also someone should include the JS error in this issue as text somewhere so it's not so hard for anyone else with the same issue to find. screenshots aren't searchable
you're welcome, frantic googlers anyway, thanks to @dphilipps for logging this, and @nicholasscottfish for the fix, this has been a particularly nasty one to root out. |
I have updated my patch as it had a strict type check on null when it needed to be !=, to be safe I would use the official patch provided by @dphilipps as I have tested and this fixes the bug. |
Hi @engcom-Hotel. Thank you for working on this issue.
|
Hi @dphilipps, Thank you for reporting the issue. We followed your steps and were able to reproduce it on Magento 2.4-develop/2.4.3/2.4.3-p1. Hence confirming the issue. Thank you |
✅ Jira issue https://jira.corp.magento.com/browse/AC-1830 is successfully created for this GitHub issue. |
✅ Confirmed by @engcom-Hotel. Thank you for verifying the issue. |
Hello @dphilipps, Fix for the issue is added to the 2.4.4-release of Braintree package. With 'paypal/module-braintree' version 4.3.0 issue will be fixed. Below is the patch which is added to 4.3.0 of 'paypal/module-braintree' if (billingAddress.regionCode == null) { billingAddress.regionCode = undefined; } We are closing this issue. Thanks |
Thank you @engcom-Hotel |
Preconditions (*)
Steps to reproduce (*)
PUBLIC: hpbfzdqypph3njjq
PRIVATE: 4de9983821adb24738636e502c557248
MERCHANTID: vq82jrtv65hsgjbk
4242 4242 4242 4242
12/23
123
Expected result (*)
Actual result (*)
Note: If 3DS is disabled, then the same address (above) will complete OK. Likewise, if a state/region is set it will too.
Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
3DS is vital for processing credit card payments as is a regulatory requirement in some jurisdictions and some processors do not approve payments without, therefore disabling it is not a work around. UK addresses which typically do not have state or region set will not be able to place orders with 3DS enabled.
The text was updated successfully, but these errors were encountered: