stripe-android: Incorrect Google Pay with the Payment Intents API Documentation
Contrast to the Stripe documentation here: https://stripe.com/docs/payments/payment-intents/android#using-google-pay-with-the-payment-intents-api
There is no setToken(tokenString) method in PaymentMethodCreateParams.Card.Builder class. See:
https://github.com/stripe/stripe-android/blob/v9.2.0/stripe/src/main/java/com/stripe/android/model/PaymentMethodCreateParams.java
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 22 (4 by maintainers)
@RAJESHKUMAR21TL so from what I can tell, when your Google Pay token is initially created, it is created on your Platform account.
However, in your later request to confirm the PaymentIntent, your integration is using a PaymentIntent that was created on the Connect account, and your stripe-android SDK is also initialized as the Connect account in
Can you double check that when you call your
createPaymentDataRequest, you constructGooglePayConfigwith the Platform’s publishable key, and the Connect account’s ID e.g. acct_123?https://stripe.dev/stripe-android/com/stripe/android/GooglePayConfig.html#getTokenizationSpecification--
new GooglePayConfig("pk_test_123", "acct_1234").getTokenizationSpecification();@jackcsk if you are creating a ConfirmPaymentIntentParams object using PaymentMethodCreateParams, you don’t need to call stripe.createPaymentMethod() in advance. Simply get the token from Google Pay, create the ConfirmPaymentIntentParams object, then pass it to stripe.confirmPayment().
I like your idea of a full example app for Google Pay. This is something we can add.
@jackcsk I’m glad to hear you worked through your issues. Payment authentication will only trigger when required, and will be handled automatically for you when it is required (you won’t need to manage launching a web browser yourself).
@jackcsk https://stripe.com/docs/payments/payment-intents/android#using-google-pay-with-the-payment-intents-api has now been updated
@jackcsk thank you for pointing this out. I’ll update the docs to use the static create method for tokens, PaymentMethodCreateParams.Card#create(String)