I am working with Stripe Laravel php billing system.
I created a client with a subscription and a trial period.
An invoice with 0 amount is getting created. Once the trial period is completed I can see an upcoming invoice and I can preview this invoice.
Below is what I see in stripe..
Upcoming invoice for $67.50 Preview
Next invoice for subscription to Pro|Will be billed on Mar 19
Problem is invoice is not getting created once the trial period is over and upcoming invoice stays upcoming today is Mar21 and you it is the same status..
What am I doing wrong here.
Below my laravel code to create the subscription in question with a coupon code and trial period.
//create subscription with calculated trial period
$subscription = $stripeObj->subscriptions->create([
'coupon' => $this->stripe_discount_coupons["$discount_percent"],
'customer' => $firmData->stripe_id,
'items' => [
[
'price' => $firmData->commitment->stripe_price_id,
'quantity'=> $firmData->number_of_users
],
],
'cancel_at_period_end'=> false,
'metadata'=>[
'firm_id'=>$firmData->id,
'firm_name'=>$firmData->firm_name,
'subscription_name'=>$firmData->subscription->subscription_type,
],
'expand' => ['latest_invoice.payment_intent'],
'trial_end' => $final_trial_period
]);