Billing with Laravel Cashier and Stripe
Hi guys,
Currently I'm adding a registration page on our site with the billing details of the client. So on the page I have
For Customer Information :
- firstname -lastname -birthdate -address
For Subscription Details
- number of calendar users ( $25 per month)
For Billing Details
- card number -expiration,cvc
What I want to do is to create new client, add their subscription and charge them depending on how many users will they subscribe. So e.g I want 5 users, 5 x 25 = $125.
I tried this one, yeah it updated the quantity on my subscriptions table but stripe billed it only $25, it must be $125.
$token = $request->stripeToken; $quantity = $request->quantity; $user = App\User::find(1);
$user->newSubscription('main', 'BASICPLAN')->create($token);
$user->subscription('main')->updateQuantity($quantity);
\Stripe\Stripe::setApiKey(env('STRIPE_SECRET',''));
\Stripe\Customer::create(array(
"source" => $token,
"plan" => "BASICPLAN",
"email" => $user->email,
"quantity" => $quantity
));
I get this error after trying the code.
"You cannot use a Stripe token more than once:token_string_here"
Anyone please, help me with this burden. Lara-thanks. :)
Please or to participate in this conversation.