\Stripe\Subscription::create([
"customer" => $customer->id,
"items" => [
[
"plan" => $aplan_id,
"quantity" => $totalQuantity
],
[
"plan" => $kplan_id,
"quantity" => $kidsQuantity
],
],
"coupon" => $selectedDiscountId, // recursive discount is set in percentage
"coupon" => 'one-time-free',// one time discount on a plan
]);
If customer purchased 3 items one should be free as 'coupon' => 'one-time-free' is already set to flat amount and above coupon 'coupon' => $selectedDiscountId, is set to recurring discount in percentage.
Next time only first coupon is applied as it is recurring coupon it should be, and second one should not.
- first coupon is for one time discount 'flat amount'
- second coupon is for recursive discount in percentage