subscriptions
kyoukhana opened this issue · 5 comments
I didn't see any examples on subscriptions. Can somebody provide me with a example.
I haven't used this library yet, but from reading the docs of this and Stripe I assume it's like so:
-
Get your token with createToken, if valid send it to your server and on your server you should request Stripe's API and save the customer for later as shown here:
https://stripe.com/docs/saving-cards#saving-credit-card-details-for-later -
Afterwards you can use their customer ID to subscribe them to a subscription:
https://stripe.com/docs/api/subscriptions/create -
Make sure you have already created the plans in Stripe. Next up you just listen for webhooks as per usual.
Thanks. I have all that setup but using your library is there a example you can put together for this
The purpose of this library is only to securely collect the user data and generate a secure token with Stripe (with the added bonus of Vue bindings). After you have the token you need to use Stripe's API through whatever back-end programming language you are using.
Thanks. So technically it’s possible to use the library for subscriptions once everything is setup in stripe and laravel
Yeah. Once you have the token you can use it with Laravel/PHP to create a subscription for a customer using their customer object that you generate using the token with Stripe's API. That's all there is to it 😃