Ankit Dubariya
Ankit Dubariya

Reputation: 905

Subscribtion in stripe payment gateway

I want to use stripe android sdk pre build UI payment sheet for recurring payment (Subscription) in my android app. I see payment sheet example for non recurring payment on stripe document but i didn't found document for subscription in android. I have spend lot of time to find example of same but i didn't get any solution.

If anyone help me then it's save my day.

Upvotes: 0

Views: 701

Answers (2)

Pavel K
Pavel K

Reputation: 46

You must use the subscription creation endpoint. This can be done both from the mobile application and from your server.

POST request to https://api.stripe.com/v1/subscriptions with:

  • header - you secret key;
  • body: customer id and price id (you can create new price from the dashboard by creating new product with pricing).

From the response, you can get a payment intent, which can be used to pay for a subscription through a payment sheet.

However, it is recommended to transfer the logic of working with the secret key to the server side

Upvotes: 0

orakaro
orakaro

Reputation: 1971

You are correct that Stripe doesn't have a dedicated Doc for Subscription + PaymentSheet.

However you should be able to follow their general Subscription integration guide, but in step 6 of "Collect payment information", simply use the PaymentSheet instead, with the Subscription's latest_invoice.payment_intent.client_secret property. The implementation in Android should be the same.

Upvotes: 1

Related Questions