#ndureja-android-subscriptions

1 messages · Page 1 of 1 (latest)

wintry oasis
#

Hey. Specifically which docs are you looking at?

dusk comet
#

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

wintry oasis
#

Yeah, our Billing documentation is missing mobile/Android examples right now

dusk comet
#

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

wintry oasis
#

There's just no Android examples for the UI components

dusk comet
#

Yes I saw this

dusk comet
fast osprey
#

yep we don't have specific documentation for it

dusk comet
#

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

fast osprey
#

you get the client secret from the first invoice of the subscription

#

no, don't do that.

dusk comet
#

what's wrong with it?

fast osprey
#

it won't work for Google Pay for example.

dusk comet
#

security issues?

#

oh

#

yea that's gonna be a problem

fast osprey
#

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?

dusk comet
#

yes

fast osprey
#

after that you can expand to Subscriptions

dusk comet
#

did that few months ago

fast osprey
#

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