#zendron
1 messages ยท Page 1 of 1 (latest)
Hello ๐
Typically, you create a subscription server-side as shown in the custom code flow here
https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements
and then use the client-secret from the invoice with PaymentSheet in your ReactNative app
We don't have a guide for it but you'll follow step 1 to 4 from the link above
& then combine that with this guide starting step 4
https://stripe.com/docs/payments/accept-a-payment?platform=react-native&ui=payment-sheet#react-native-collect-payment-details
That was EXACTLY what I was looking for. I really appreciate your quick support
Thank you very much, have a great day! :)
NP! ๐ Happy to help
Oh and I do have one more question: Is it possible to use Coupons with the react native stripe sdk? Or rather: How would you suggest on how to implement coupons?
Coupons aren't something PaymentSheet support. So what you can do is build your own text input in your checkout flow, collect promo/coupon and apply it when you create subscription server-side
I see, how would I redeem this coupon in conjunction with the payment intent?
You can't update the PaymentIntent since its linked to the invoice (which has been finalized already)
You'd need to collect the coupon/promo before you create subscription server-side
So basically the payment flow would look like this:
- Create a subscription
- Collect the coupon and redeem it on the created subscription
- Create a payment intent
- Collect the payment information to pay for the subcription
Is that correct or am I misunderstanding something?
Ah sorry there's a misunderstanding here, the subscription itself generates a PaymentIntent so you don't need to generate one separately.
If you look at this step in custom subscription flow with PaymentElement
https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements#create-subscription
Once the subscription is created, the server responds with subscription.latest_invoice.payment_intent.client_secret
That's the client-secret you'd fetch at step 4 in RN guide
https://stripe.com/docs/payments/accept-a-payment?platform=react-native&ui=payment-sheet#react-native-collect-payment-details
so the flow would look something like,
- Collect the coupon/promo code
- Create a subscription with the coupon/promo code (if any)
- Use the PaymentIntent created by the subscription to collect payment method information with PaymentSheet
The client-secret created by the subscription creation in the previous screenshot is what you'd set in initPaymentSheet(...)
does that clarify? @prime night