richnologies / ngx-stripe

Angular 6+ wrapper for StripeJS
MIT License
219 stars 77 forks source link

Create Subscription #12

Closed vandanachadha closed 6 years ago

vandanachadha commented 6 years ago

Can I create subscriptions using this package? On trying the following: //create subscription this.stripeService.subscriptions.create({ customer: result.token.id,

, am getting this error: Property 'subscriptions' does not exist on type 'StripeService'.

richnologies commented 6 years ago

I've cheked the Stripe docs about subscriptions, but it seems to be a server task, not for the browser. As long as I get, you get the token as usual, create the customer and then the subscriptions.

Please, point me to the docs where it explains how to create subscriptions, and I will try to add this feature

mo2menelzeiny commented 6 years ago

@richnologies https://stripe.com/docs/api/node#create_subscription

ospaarmann commented 6 years ago

@vandanachadha The workflow to create a subscription is as follows:

Frontend using this package:

Backend, however you implement it:

richnologies commented 6 years ago

As @ospaarmann the create subscription is part of the server workflow, so out of the scope of this package.