-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Express Checkout: amount displayed does not match charged amount #2304
Comments
This issue is related to the one I describe here: #2322 |
Hi, |
Hi, Afaik this has not been solved. It feels like the authors deliberately want to keep this functionality closed so tons of (non-Woo) plugins can not properly integrate? |
This is causing a bit of a headache for some custom functionality I'm working on where the item price is calculated depending on data the customer provides via cart_item_data. I too am calculating this as part of the What is the solution/workaround for this? None of the threads I've read actually specify how/when express payments fetch the cart total - is there an earlier action I should be using instead of Appreciate any help! |
@jonas-hoebenreich Did you find a workaround or solution for this issue in the end, or did you end up disabling Stripe Express Checkouts? Cheers |
Describe the bug
I am currently trying to make a plugin of mine (https://wordpress.org/plugins/wc-donation-platform/) compatible with Stripe Express Checkout. In the process, I've stumbled across an issue that is causing an incorrect amount to be charged.
When Express Checkout is enabled on the product page, every time the product selection field is changed, the total amount is calculated using an AJAX request (stripe-payment-request.js, wc-ajax=wc_stripe_get_selected_product_data).
When someone clicks on the payment button, the total amount is calculated one more time (stripe-payment-request.js, wc-ajax=wc_stripe_add_to_cart).
The payment modal displays the amount calculated using wc_stripe_get_selected_product_data, but the amount calculated using wc_stripe_add_to_cart is actually charged.
Normally this is not a problem, because the two amounts are the same, but if the amounts differ the user's trust in the Google Pay modal is betrayed.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The amount displayed in the Google Pay window matches the charged amount. At the very least, some form of error message should pop up.
Screenshots

Screenshot 1:
Screenshot 2:

Environment (please complete the following information):
Additional context
By the way, the Express Checkout handling is implemented much more elegantly by the official PayPal plugin (the amount is calculated only once when clicking the button, which saves server resources.)
In addition, it is easier to pass additional individual parameters, because PayPal sends all parameters matching "[name^='attribute_']". Stripe uses $(".variations_form").find(".variations select") here, which makes it much more difficult, because the same selectors are also used by WooCommerce itself, which causes conflicts if you want to sneak additional parameters along. This makes it much easier to make WooCommerce PayPal Payments compatible with other plugins.
The text was updated successfully, but these errors were encountered: