0
votes

I have monthly subscription plan setup in Stripe. Creating subscription and charging is working for month by month, but I would like to charge customer 2 months in advance.

Example: user should be subscribed 6 months. I would like to charge him 1st month and last month (6th). So he won't be paying 6th month.

I was trying to charge customer once and then another time but it says that I can use stripe token only once.

How can I make this deposit payments in stripe and PHP?

1
It will be better if you charge 2x amount of a month and then in database, store it in DB as 1st and 6th month payment. - Himanshu Upadhyay
So I will need to make a plan in stripe that is double price? - user3809590
May be this will be helpful to you How to Use single token to create multiple payments - chohan

1 Answers

0
votes

To solve this do the following: Make subscription, then from it take customer ID and charge it.

$customer = Customer::create([
        'card'  => $request->stripe_token,
        'plan'  => $planID,
        'email' => Auth::user()->email
    ]);

This will subscribe user to plan. Then charge him again:

Charge::create([
        'amount'    => $depositPrice,
        'currency'   => 'usd',
        'customer'  => $customer->id,
        "statement_descriptor" => "Company Name Deposit",
    ]);