Closed sumeetmagento closed 9 months ago
Hi @sumeetmagento. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
@magento give me 2.4-develop instance
- upcoming 2.4.x release@magento I am working on this
Join Magento Community Engineering Slack and ask your questions in #github channel. :warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting. :clock10: You can find the schedule on the Magento Community Calendar page. :telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
In case it's helpful to you, we observed that the Braintree module would render all transactions error messages in its hosted fields section, even if the transaction error is coming from a vaulted credit card attempt. This was problematic for us because when using a vaulted payment method, the Braintree hosted fields section isn't visible (so neither were the error messages.)
We implemented a workaround where was observe any error messages added to that message container and clone them in a message container that's visible when using vaulted payment methods.
@sims-smith-corona by vaulted payment methods, do you mean payment methods vaulted in Magento (and thereby Braintree as well)? or payment methods vaulted only in Braintree?
To load Braintree only payment methods vaulted, you would require Braintree's customer ID when generating a the braintree client token which is something the current version of the Magento Braintree module does not support for cards. In this case, your issue is not related to the Braintree magento module but probably a 3rd party or some customisaton?
The module supports vaulting payment methods in Magento (with the token) which do not load the Hosted fields at all during checkout.
Apologies, I was just confused. Maybe a video recording of the issue could be useful?
@gene-roussetos Sorry for any confusion, but I'm not trying to report any issue or problem. I was just commenting to the original poster.
Our checkout is extremely customized which leads to a lot of nonstandard behavior, so that may be to blame, in our case, transaction errors resulting from failed authorizations using a vaulted Braintree credit card method would result in error messages being added to the hosted fields method renderer component's message container rather than vaulted method renderer's.
@sims-smith-corona fair, it is true that if the checkout is customised or using 3rd party modules, some errors might not be picked up straight away as this needs to be accommodated if not hitting the place order (set payment information and place order) API endpoint.
For all I know, in general, during the API place order action, PHP code is triggered to execute the Transaction process and a braintree error should be returned within a Localized exception to the frontend and a 400 error. Then the checkout message manager displays that error. Not all errors are visible as is, as some might be hidden on purpose and a generic message is displayed. Or in other cases of course, it's been missed and the message is generic while it shouldn't.
Is there any update ?
Hi @engcom-Dash. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
Area: XXXXX
label to the ticket, indicating the functional areas it may be related to.2.4-develop
branch@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure. 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.any update please ?
@magento give me 2.4-develop instance
Hi @engcom-Dash. Thank you for your request. I'm working on Magento instance for you.
Hi @engcom-Dash, here is your Magento Instance: https://502b55784256e05d31c9c262c7f390de.instances-prod.magento-community.engineering Admin access: https://502b55784256e05d31c9c262c7f390de.instances-prod.magento-community.engineering/admin_c903 Login: 5ce230ee Password: 0d053f7b8747
Hi @sumeetmagento
Thanks for reporting and collaboration.
Verified the issue on Magento 2.4 dev instance but the issue is not reproducible.
When there are insufficient funds in paypal account we are seeing error message.
Please refer the attached screenrecord
https://github.com/magento/magento2/assets/60198592/d04b5f85-9e89-4853-bf1c-1a781d9d5e2f
Hi @sumeetmagento
We have noticed that this issue has not been updated since long time. Hence we assume that this issue is fixed now, so we are closing it. Please feel to raise a fresh ticket or reopen this ticket if you need more assistance on this.
Thanks.
@sims-smith-corona This is the exact problem our site is facing. When placing an order with a vault/stored card that leads to some error, that error will be displayed within the Credit Card payment method which is inactive and hidden. So the customer has no idea why the payment isn't going through. Can you share your fix or what files I need to look at?
@sims-smith-corona This is the exact problem our site is facing. When placing an order with a vault/stored card that leads to some error, that error will be displayed within the Credit Card payment method which is inactive and hidden. So the customer has no idea why the payment isn't going through. Can you share your fix or what files I need to look at?
It's convoluted but effective.
We override the js/view/payment/method-renderer/vault.js with our own. During the component's initialization, we use setInterval() to fire a function that watches the Braintree Hosted Fields messages container HTML element to identify any new message elements that get injected and insert them into the vaulted payment method's component's messageContainer so they get rendered in the appropriate place on the page.
Here's the function that gets triggered by setInterval:
`copyHostedFieldsErrorMessages: function() {
var self = this;
var sourceMessageContainerElement = $('#braintree-hosted-fields .messages');
if(sourceMessageContainerElement.length == 1) {
var errorMessageElements = $(sourceMessageContainerElement).find('.message-error > div:not(.copied)');
$(errorMessageElements).each(function(messageIndex, messageElement) {
$(messageElement).addClass('copied');
self.messageContainer.addErrorMessage({message: $(messageElement).html(), parameters: []});
});
}
},`
@sims-smith-corona
First of all, thank you for your reply on this old thread. I was surprised you actually replied and so quickly too. I faced some issues trying to implement this on Friday, but I tried again today and its working partially. It works on the first stored payment method/card. In my case, I have several stored cards and it doesn't show the error on any of the other cards, only the first one.
Update, i worked on it for the past two days and after a whole lot of changes and customizations I was finally able to make it work. Another big issue I faced was that the error was only showing up the first time not any subsequent times the error was triggered. Anyways, its working now, thank you again, your help gave me a good place to start in solving the issue.
Preconditions and environment
Our concern is that when a customer attempts to place an order and the transaction fails due to insufficient funds, there is no error message being displayed at checkout.
According to our expectations, an error message should appear in such cases. Has anyone encountered this issue before or can offer insights into potential solutions?
Steps to reproduce
1 - Add any product in cart 2 - Proceed to checkout 3 - Pay via credit card braintree payment
Expected result
Error message should show if there is a error message coming from braintree like insufficient funds on checkout page
Actual result
Right now there is no error message is showing on checkout
Additional information
No response
Release note
No response
Triage and priority