Skip to content

Google pay button doesn't include shipping address/methods when you close and re-open #3077

@twm-jamieb

Description

@twm-jamieb

Describe the bug
When using the Google pay express checkout button, the first time you click it, it will prompt for shipping address and method selection, so that you can complete the checkout in one step. However, if you close the google pay popup and then re-open it, it won't prompt for the shipping method and options the 2nd time.

This is caused by a consignment being created the first time you open it using the address in Google Pay, and then on the second time it already has a consignment so it doesn't include address and methods in the google pay window. This is despite the address being malformed in the consignment, so the user is required to actually go through the regular shipping step and enter their address and choose a shipping method.

I think there are 2 potential fixes.

  1. The onError callback is not currently called when the PaymentMethodCancelledError is thrown. If it's thrown then we can handle it outside the checkout-sdk to remove the created consignment when there's an error

  2. A requireShippingAddress prop can be added to the initialize options for Google Pay which and when true it can request the ship[ping address and methods, regardless of whether there is already a consignment.

To Reproduce
Steps to reproduce the behavior:

  1. Go to a checkout
  2. Click on a Google Pay express button
  3. Close the google pay popup after it initializes
  4. Click again on the Google Pay express button
  5. The shipping address and method will no longer be requested

Expected behavior
When using the express checkout button, the shipping address and method should always be requested so the user can checkout in one click

Screenshots
First time

Image

Second time

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions