Skip to content

Amazon Pay has mismatched taxes when taxes are based on billing address #4750

@daledupreez

Description

@daledupreez

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.

  1. Enable the Amazon Pay feature flag - wp option update _wcstripe_feature_amazon_pay 'yes'
  2. Configure your store to include taxes for purchases.
  3. Configure the tax to be driven by the customer billing address.
    • Note: this step was missing in my initial report.
  4. Enable Amazon Pay as an express checkout method, and ensure that it is displayed on the product page
  5. Ensure you have a taxable product in your store.
  6. Go to the product page for your product while in a new, logged-out browser session.
  7. Click on the Amazon Pay express checkout button.
  8. Log into the Amazon Pay sandbox or create a new sandbox account.
  9. Pick or create a supported shipping address.
  10. Pick a valid card.
  11. Note the total includes taxes for the item.
  12. Complete the checkout.
  13. 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.

Additional context

Sub-issues

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions