#Chen-subscriptions
1 messages · Page 1 of 1 (latest)
We create a Payment Intent for you automatically when you create the Subscription - I'd suggest reading through (https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements) to get started
Hi @scarlet blade!! Yeah that's what I thought. The key here is I'm not sure how to use Google Pay for it. The flow on this doc (https://stripe.com/docs/stripe-js/elements/payment-request-button?html-or-react=react#react-create-payment) demonstrates how to make a payment using Google Pay, but I still don't know how that works with subscriptions.
You'd skip the "create a payment intent" step, and use the Payment Intent generated from the subscription creation instead
Interesting. How the flow will look like? Should I call create subscription first, then somehow obtain the payment intent from the subscription, then attach the Google Pay info to it?
Our previous flow using credit card is we first obtain the payment method id, which is then attached to the create subscription call. Can we implement Google Pay in a similar way?
If you already have a subscriptions and cards flow implemented then you can definitely leverage what you already have for your google pay integration - as we mention in this step (https://stripe.com/docs/stripe-js/elements/payment-request-button?html-or-react=react#react-complete-payment), we give you back a payment method ID, and then continue with the flow you'd normally use for cards
The flow you're using is an older style of subscription creation - the never flow makes it easier to handle 3ds/authentication steps (where you colelct the payment method details AFTER creating the sub), but if you already have an existing integration that created the Payment Method first you're welcome to keep useing that
Cool! Which api should I call for Google Pay? Assuming it's different from confirmCardPayment.
Did you read through the Payment Request Button guide? We show exactly how to integrate with it, and listening for the paymentmethod event is how you get the Payment Method (the code for this specifically is in the step I already linked you to https://stripe.com/docs/stripe-js/elements/payment-request-button?html-or-react=react#react-complete-payment)
Ah I missed that sentence. That makes sense. Thank you!