Giter VIP home page Giter VIP logo

Comments (16)

sims-smith-corona avatar sims-smith-corona commented on September 23, 2024 1

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.

from magento2.

sims-smith-corona avatar sims-smith-corona commented on September 23, 2024 1

@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: []});

            });

        }

    },`

from magento2.

m2-assistant avatar m2-assistant commented on September 23, 2024

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:


Join Magento Community Engineering Slack and ask your questions in #github channel.
⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
πŸ•™ 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, join the Community Contributions Triage session to discuss the appropriate ticket.

from magento2.

gene-roussetos avatar gene-roussetos commented on September 23, 2024

@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?

from magento2.

sims-smith-corona avatar sims-smith-corona commented on September 23, 2024

@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.

from magento2.

gene-roussetos avatar gene-roussetos commented on September 23, 2024

@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.

from magento2.

sumeetmagento avatar sumeetmagento commented on September 23, 2024

Is there any update ?

from magento2.

m2-assistant avatar m2-assistant commented on September 23, 2024

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: πŸ‘‡

    1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
    1. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
    1. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
    1. Verify that the issue is reproducible on 2.4-develop branch
      Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
      - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
      - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

from magento2.

sumeetmagento avatar sumeetmagento commented on September 23, 2024

any update please ?

from magento2.

engcom-Dash avatar engcom-Dash commented on September 23, 2024

@magento give me 2.4-develop instance

from magento2.

magento-deployment-service avatar magento-deployment-service commented on September 23, 2024

Hi @engcom-Dash. Thank you for your request. I'm working on Magento instance for you.

from magento2.

magento-deployment-service avatar magento-deployment-service commented on September 23, 2024

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

from magento2.

engcom-Dash avatar engcom-Dash commented on September 23, 2024

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

insufficient.balance.1.mov

from magento2.

engcom-Dash avatar engcom-Dash commented on September 23, 2024

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.

from magento2.

ou86 avatar ou86 commented on September 23, 2024

@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?

from magento2.

ou86 avatar ou86 commented on September 23, 2024

@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.

from magento2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.