Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] Can't request shipping address from Google Pay #580

Closed
YoQuieroDistraerlo opened this issue Sep 10, 2021 · 4 comments · Fixed by #1164
Closed

[Android] Can't request shipping address from Google Pay #580

YoQuieroDistraerlo opened this issue Sep 10, 2021 · 4 comments · Fixed by #1164

Comments

@YoQuieroDistraerlo
Copy link

YoQuieroDistraerlo commented Sep 10, 2021

One advantage of Google Pay is that the user doesn't have to type their billing nor shipping addresses (not to mention card data). Billing address request can be configured with initGooglePay/billingAddressConfig. However, there is no way to request the shipping address from Google Pay.

Taken from the docs (migration from tipsi):

before:

const token = await stripe.paymentRequestWithNativePay({
  total_price: '100.00',
  currency_code: 'USD',
  shipping_address_required: true, //       <== this is missing in this library
  phone_number_required: true,
  shipping_countries: ['US', 'CA'], //      <== this is missing in this library
  line_items: [
    {
      currency_code: 'USD',
      description: 'Whisky',
      total_price: '50.00',
      unit_price: '50.00',
      quantity: '1',
    },
  ],
});

after: initGooglePay and presentGooglePay

const { error } = await initGooglePay({
    merchantName: 'Widget Store'
    countryCode: 'US',
    billingAddressConfig: { //              <== only billing address can be requested
      format: 'FULL',
      isPhoneNumberRequired: true,
      isRequired: false,
    },
    existingPaymentMethodRequired: false,
    isEmailRequired: true,
});

To reproduce the behavior just implement the migration as documented (shown above).
I also checked GooglePayLauncher.Config and didn't see anything there that could help.

Since Google Pay still has a Home address and, a Billing address associated to each payment method, we should be able to request this address and allow the customer to use it.

initGooglePay should have a configuration option to request the shipping address, including a countries list to restrict delivery.

  • Version 0.2.0

Partial workaround

When Payment Intent is modified by this library (i.e., confirmed), billing address from Google Pay can be extracted from the associated charge (billing_details) and that address can be used to update the Payment Intent's shipping address. When the customer is created (on payment intent creation in backend) there is no address available to be set, so the customer's billing address should also be set with said address.

With this partial workaround the possible payment intent rejection by fraud rules checking billing/shipping addresses is still an issue.

@YoQuieroDistraerlo YoQuieroDistraerlo changed the title [Android] Can't request shipping address from Google Play [Android] Can't request shipping address from Google Pay Sep 10, 2021
@arekkubaczkowski
Copy link
Collaborator

arekkubaczkowski commented Oct 4, 2021

@YoQuieroDistraerlo I believe this would need to be implemented in stripe-android at first as I also couldn't find such solution in the current implementation. @michelleb-stripe any chance to put it in your backlog?

@michelleb-stripe
Copy link
Contributor

@arekkubaczkowski and @YoQuieroDistraerlo Let me take a look into why this is currently not supported and get back to you.

@michelleb-stripe
Copy link
Contributor

@arekkubaczkowski and @YoQuieroDistraerlo The Google Pay Android SDK shipping collection functionality is very limited right now and so it is not supported. This is something that we do have in our backlog and we will contact you when support is added.

@tgensol
Copy link
Collaborator

tgensol commented Sep 21, 2022

Hi there,
Any update on this one ? It prevents us from using your SDK

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

Successfully merging a pull request may close this issue.

6 participants