#maddockst-iOS

1 messages · Page 1 of 1 (latest)

tribal vapor
#

Hi, taking a look here

shy ginkgo
#

Thanks a lot. Essentially I want the simplest way to take subscriptions through iOS using Apple Pay or entering card details

kind ruin
#

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.

shy ginkgo
#

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?

kind ruin
shy ginkgo
#

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

kind ruin
#

For iOS specifically or just in general?

shy ginkgo
#

iOS preferably

kind ruin
#

You're not using the PaymentSheet on iOS, correct?

shy ginkgo
#

I'm using CardElement

kind ruin
#

Yeah, so that web-based guide should be very similar conceptually.

shy ginkgo
#

Ok perfect

kind ruin
#

But really it's very similar to one-time payments, you just use the Payment Intent from the Subscription Invoice instead.

shy ginkgo
#

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?

kind ruin
#

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.

shy ginkgo
#

That's awesome. You've been very very helpful. Thanks a lot!