Vauxoo / odoo

Fork of Odoo (formerly OpenERP). [This project is not publically mantained just born for internal usage with some little patches] go to official repository on github.com/odoo/odoo
https://www.odoo.com
Other
9 stars 9 forks source link

[FIX] payment_stripe: Fixed checkout bug when using multiple stripe cards #530

Closed sebasdrk17 closed 1 year ago

sebasdrk17 commented 1 year ago

Description of the issue/feature this PR addresses:

1. Bug when using multiple stripe cards at checkout

The selector is not properly enclosed to the clicked stripe card, therefore the card is mounted to the first element found with #card-element. The problem with this is that if we have multiple stripe cards they won't be having the widget to fill the credit card information.

Screen Shot 2022-12-02 at 12 44 11 p m Screen Shot 2022-12-02 at 12 44 05 p m

2. Bug when stripe card is invalid, the button is disabled forever

When the stripe card is invalid, we break the PayEvent workflow to prevent purchases, the problem is that the button is never enabled again.

This gives the wrong impression that something is happening because the payment button is disabled and the spinning icon is there.

https://user-images.githubusercontent.com/47955967/205364532-b0a46a47-23ed-4630-a77e-d0b4257d170a.mp4

Current behavior before PR:

1. Bug when using multiple stripe cards at checkout

Only the first stripe card will have the widget to fill the credit card

2. Bug when stripe card is invalid, the button is disabled forever

After the card is invalid, the payment button is always disabled and is displaying the loading animation

Desired behavior after PR is merged:

1. Bug when using multiple stripe cards at checkout

By using a more specific selector, we ensure that #card-selector is searched in the current stripe card, therefore, the card will be mounted on the clicked stripe card.

2. Bug when stripe card is invalid, the button is disabled forever

By enabling the button again, we ensure that if the card is invalid, the user changes its values and tries again.

-- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

sebasdrk17 commented 1 year ago

Closing as this changes were directly made in odoo here: https://github.com/odoo/odoo/pull/107446