#ndureja-android-subscriptions
1 messages · Page 1 of 1 (latest)
For normal payments, a prebuilt ui from the stripe sdk opens in the app to process the payment, but how do I do that for subscriptions
Yeah, our Billing documentation is missing mobile/Android examples right now
Checking the samples GH org to see if there's anything useful there: https://github.com/stripe-samples
I know that I have to create a payment intent from the backend but in that payment intent, how do I specify that it's a subscription
oh okay I'll go through it
You wouldn't, you'd create a Subscription
The server components here are relevant: https://stripe.com/docs/billing/subscriptions/build-subscription
There's just no Android examples for the UI components
Yes I saw this
To open the prebuilt ui, I need the client secret to be returned from the server but there's no provision to do so here
yep we don't have specific documentation for it
the only way I can think of is to to return the redirect url from the server and open it in webView in the app
you get the client secret from the first invoice of the subscription
no, don't do that.
what's wrong with it?
it won't work for Google Pay for example.
either way I would start by building a flow that does one-time payments first so you know how the library works and how to do a basic one-time payment using our Android library. have you done that?
yes
after that you can expand to Subscriptions
did that few months ago
ok, then you get the client secret from the first invoice of the subscription
On the backend, create the subscription with status incomplete using payment_behavior=default_incomplete. Then return the client_secret from the subscription’s first payment intent to the frontend to complete payment.
it's the same idea, except you pass that client secret to the Android SDK instead, you pass it the same way you pass the client secret of your one-time PaymentIntent
it works but it's just not documented or in a sample