mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-10-17 03:03:01 -04:00
Subscription Module Update - Confirmation update
This commit is contained in:
@@ -758,6 +758,8 @@ class SubscriptionController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$payment_details = $planPrice->plan->title;
|
||||
$coupon_id = null;
|
||||
if($request->promo_code != null){
|
||||
@@ -794,9 +796,13 @@ class SubscriptionController extends Controller
|
||||
|
||||
} else {
|
||||
|
||||
if($request->has('renew_now') && $request->renew_now && $request->has('prorate_discount') && $request->prorate_discount && $planPrice->payment == 'upfront'){
|
||||
if($request->has('renew_now') && $request->renew_now && $request->has('prorate_discount') && $request->prorate_discount){
|
||||
$prorate_discount = $request->prorate_discount;
|
||||
$payment_details .= ' - '.$planPrice->custom_interval.' Months ($'.number_format($planPrice->price - $prorate_discount,2).')';
|
||||
if( $planPrice->payment == 'upfront'){
|
||||
$payment_details .= ' - '.$planPrice->custom_interval.' Months ($'.number_format($planPrice->price - $prorate_discount,2).')';
|
||||
} else if($planPrice->payment == 'monthly' ){
|
||||
$payment_details .= ' - '.$planPrice->custom_interval.' Months ($'.number_format(($planPrice->price / $planPrice->custom_interval) - $prorate_discount,2).' prorated 1st month only then $'.number_format($planPrice->price / $planPrice->custom_interval,2).' per month)' ;
|
||||
}
|
||||
} else if($prorate_discount > 0){
|
||||
$payment_details .= $planPrice->payment == 'monthly' ? ' - '.$planPrice->custom_interval.' Months ($'.number_format(($planPrice->price / $planPrice->custom_interval) - $prorate_discount,2).' prorated 1st month only then $'.number_format($planPrice->price / $planPrice->custom_interval,2).' per month)' : ' - '.$planPrice->custom_interval.' Months ($'.number_format($planPrice->price,2).')';
|
||||
} else {
|
||||
@@ -817,7 +823,7 @@ class SubscriptionController extends Controller
|
||||
'user_name' => auth()->user()->name,
|
||||
'user_email' => auth()->user()->email,
|
||||
'subscription_plan_price_id' => $planPrice->stripe_price_id,
|
||||
'prorate_discount' => (float)$prorate_discount,
|
||||
'prorate_discount' => number_format($prorate_discount,2,'.',''),
|
||||
'coupon_id' => $coupon_id,
|
||||
'renew_now' => $request->has('renew_now') ? $request->renew_now : false
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user