GooglePay dialog box showing wrong total price
-
I got a strange problem with a total price that Google Pay is showing to the user. I’m using the plugin in the test mode.
We are using the Avalara AvaTax plugin for tax calculation.
- I’m adding the taxable product to the cart
- Proceeding to checkout, where the Google Pay button is displayed for the user
- Woo checkout is showing $227.16 of total amount ($199 for product, $18.16 of tax, $10 for shipping)
- Clicking the Google Pay button
- For a second or two, I can see the correct price but then the price is reduced by the tax amount (it’s showing $209).
- When I complete the order by using the “Pay” button within the dialog box, order is completed and I can see the full price again
- So what user sees is not what he is paying for some reason
- The problem is inconsistent, sometimes I’m seeing the correct price until the end of the payment process
Now lets look at the requests body
wc-ajax: wc_stripe_get_shipping_options security: 484cc05c6e country: US state: CA postcode: 94043 city: Mountain View address: address_2: payment_request_type: google_pay is_product_page:
As you can see, for some reason the “address” field is empty. I’m using the Google test account (https://developers.google.com/pay/api/android/guides/resources/test-card-suite) and I can see that the street is there:
The response body is as follows:
{ "shipping_options": [ { "id": "flat_rate:2", "label": "Standard shipping", "detail": "", "amount": 1000 } ], "displayItems": [ { "label": "Subtotal", "amount": 19900 }, { "label": "Tax", "amount": 0 }, { "label": "Shipping", "amount": 1000 } ], "total": { "label": " (via WooCommerce)", "amount": 20900, "pending": false }, "result": "success" }
The tax here is 0, so probably thats why it is not included in the total price, but the question is why.
Apart from that, I got a questions what is happening in the background of this plugin. All the price-related stuff is taken from Woo (products subtotal, tax, shipping) this information is sent to Google Pay and based on that we price is displayed?
I also see something strange – I have multiple Google Accounts within my Chrome browser. I’m seeing the correct shipping price for the first account:
Then I changed the account and this happened:
For some reason shipping option is “pending”, where both of those examples are from the same state, so there is no option that some settings are wrong (for example, because we ship to specific states, by Woo settings). The request is as follows after changing the account:
wc-ajax: wc_stripe_get_shipping_options security: 484cc05c6e country: US state: CA postcode: 90404 city: Santa Monica address: address_2: payment_request_type: google_pay is_product_page:
Again, address field is empty.
I’m able to share the URL with a support member, but I’m not allowed to share it here publicly.
- The topic ‘GooglePay dialog box showing wrong total price’ is closed to new replies.