-
Notifications
You must be signed in to change notification settings - Fork 216
Description
Description
When a store has taxes enabled and being computed based on billing address and Amazon Pay is enabled, we are hitting a situation where we only receive the shopper's billing address after they have confirmed the payment amount, but that may result in a different tax amount being applied during checkout as a result of the billing address being set. When the amount changes like this, the Amazon Pay payment is declined.
In the initial report, the symptom was the creation of a payment intent that didn't include any taxes for the express checkout, but that was one manifestation driven by the specific tax configurations involved.
Steps to reproduce
The issue here is partially driven by your store configuration, specifically around taxes for shopper locations and your billing address in Amazon Pay (which will drive which tax location you're in), as well as whether we have a billing address for the current user, either in the current session, or in the customer database. To get the best reproduction, it's best to test from a completely new, logged-out session, as we want to have no billing details set up for the user.
- Enable the Amazon Pay feature flag -
wp option update _wcstripe_feature_amazon_pay 'yes' - Configure your store to include taxes for purchases.
- Configure the tax to be driven by the customer billing address.
- Note: this step was missing in my initial report.
- Enable Amazon Pay as an express checkout method, and ensure that it is displayed on the product page
- Ensure you have a taxable product in your store.
- Go to the product page for your product while in a new, logged-out browser session.
- Click on the Amazon Pay express checkout button.
- Log into the Amazon Pay sandbox or create a new sandbox account.
- Pick or create a supported shipping address.
- Pick a valid card.
- Note the total includes taxes for the item.
- Complete the checkout.
- Note that the payment fails. If you then review the logs, you can see that we're creating a payment intent for the item total plus shipping, but we are sending a different amount for the taxes.
Expected behavior
The payment should include the correct taxes, and it should be processed successfully.