The documentation on Laravel Cashier is quite vague and misses some very important details like what the $stripeToken
is and where does it come from?
So to create a new subscription we do this:
$user->newSubscription('main', 'premium')->create($stripeToken);
This is the first time a user will be subscribing so where does $stripeToken
come from exactly?
In the docs it says:
The create method, which accepts a Stripe credit card / source token, will begin the subscription as well as update your database with the customer ID and other relevant billing information.
Does this mean I have to manually create the customer object in Stripe first and then pass the customer id as the $stripeToken
? It mentions card details but how do I pass them? What is the format and what do I expect in return?
If $stripeToken
is the customer id in Stripe then Cashier is assuming that we already have customers created in Stripe which we won't have the first time.
Can anyone shed some light on this?
stripeToken
to the form. – thefallen