#mattman-begins_best-practices
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1473749152453230745
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
The payment sheet shows and resolves successfully if user finishes the flow, but if they abort the payment sheet an "orphaned" invoice and unpaid subscription are created in the system
I'm not sure what you mean by "Elements API" - Elements are frontend UI components for collecting payment method details securely. Or what you mean by saying the RN library is based on the Checkout API.
Are you asking how can you confirm the PaymentIntent of a Subscription's first Invoice when you create a Subscription? Like you create a Subscription on the server, and then you want to return a PaymentIntent client secret to the frontend for use with the mobile payment element or Payment Sheet?
Sorry, I was referring to https://docs.stripe.com/payments/elements for our web interface and https://docs.stripe.com/payments/accept-a-payment?payment-ui=mobile&platform=react-native for react native. With Elements on web they are able to show the components that collect a new or existing payment method before the payment intent is generated, but on mobile we need a payment intent client secret in order to present the payment sheet. My question is: how we would present the payment sheet without creating the pending subscription? Would we have to create a separate endpoint for mobile that only generates the payment intent and resolve subscription via a webhook or is there a mechanism in the React native library that would allow us to handle this case natively?
Okay, let me see
I see in the network tab on our web interface that there is a flag in the elements payload "decoupled_intent: true" Not sure if that has any bearing on this, but it looked like it might be related
Yeah, you have to create the Subscription first. Here are the docs for this flow: https://docs.stripe.com/billing/subscriptions/build-subscriptions?payment-ui=mobile&platform=react-native
You'll create a Subscription with payment_behavior: 'default_incomplete' and the status will be "incomplete" and if the first Invoice doesn't get paid, it will transition to incomplete_expired after 24 hours