Skip to content

Conversation

@daledupreez
Copy link
Contributor

Towards STRIPE-757
Towards #4750

Changes proposed in this Pull Request:

This PR explores adding some special logic for Amazon Pay when the store is configured to calculate taxes based on billing address. The core issue is that we are getting the shopper's address in the confirm event, and are then initiating checkout immediately. However, depending on the store's tax setup, this may cause the taxes in checkout to be different from the taxes we sent to Amazon which the user agreed to, as the user's tax rates may change. This results in the payment being declined.

To try and address that problem, this PR does the following:

  • When we receive the confirm event for an express checkout method, we check if taxes are based on billing address and we have an Amazon Pay payment.
    • If we are in that situation, we then extract the billing address from the event payload, pass that address through our standard express checkout address normalisation API, and then update the customer's billing address (which may write to the current session or the persistent customer data), the server returns an update cart, and we use the total amount from the returned cart to update the express checkout element.

This is not working at present, though it is updating the amount of the intent when we update the amount.

Testing instructions


  • Covered with tests (or have a good reason not to test in description ☝️)
  • Tested on mobile (or does not apply)

Changelog entry

  • This Pull Request does not require a changelog entry. (Comment required below)
Changelog Entry Comment

Comment

Post merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants