#maddockst-iOS
1 messages · Page 1 of 1 (latest)
Thanks a lot. Essentially I want the simplest way to take subscriptions through iOS using Apple Pay or entering card details
Hello! Yep, your approach is correct. We have a guide for what you're describing here, and you're correct that you would use the Payment Intent belonging to the Subscription's Invoice instead of creating the Payment Intent directly: https://stripe.com/docs/apple-pay
To clarify further, that guide linked above is for one-time payments, but the Apple Pay parts are mostly the same for Subscriptions, except that you would probably want to configure what the Apple Pay sheet displays a little differently for recurring payments.
Thanks a lot @kind ruin. Yes, I've already managed to get the sheet looking how I want. Would this kind of approach (from a back end perspective) also follow suit for Google Pay?
At a high level, yes. Here's the guide for Google Pay: https://stripe.com/docs/google-pay
Perfect. I'll probably build this separately to the current CardElements approach for manually entering card details, seperate APIs etc and then look to combine the two later.
Do you have a link to a basic subscription flow which uses client_secrets instead of createPaymentMethod? (apologies if my terminology is off
For iOS specifically or just in general?
iOS preferably
I don't think we have anything that specific. We do have a web-based guide to Subscriptions here which may be helpful: https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements
You're not using the PaymentSheet on iOS, correct?
I'm using CardElement
Yeah, so that web-based guide should be very similar conceptually.
Ok perfect
But really it's very similar to one-time payments, you just use the Payment Intent from the Subscription Invoice instead.
That makes sense.
Apologies, last question. With Apple Pay, for failures with the card etc. I am assuming I will have to attach and update the customers new payment method. However, what happens to the old subscription? Do I use the same client_secret to confirm the payment a second time around or should I be deleting the subscription and setting a new one up again?
You would keep the existing Subscription. The latest Invoice will have a Payment Intent that will need to be successfully confirmed. Once you confirm it with the new Payment Method you can then set it as the default for either the specific Subscription or the Customer.
That's awesome. You've been very very helpful. Thanks a lot!