diff --git a/app/Http/Controllers/APIs/Customer_API/StripeWebhookController.php b/app/Http/Controllers/APIs/Customer_API/StripeWebhookController.php index 23e3db7..b99b5fe 100644 --- a/app/Http/Controllers/APIs/Customer_API/StripeWebhookController.php +++ b/app/Http/Controllers/APIs/Customer_API/StripeWebhookController.php @@ -140,6 +140,8 @@ class StripeWebhookController extends Controller $referralUserSubscriptionData->current_period_start = date('Y-m-d H:i:s', $SubscriptionObject->current_period_start); $referralUserSubscriptionData->current_period_end = date('Y-m-d H:i:s', $SubscriptionObject->current_period_end); $referralUserSubscriptionData->next_payment_date = date('Y-m-d H:i:s', $upcoming_invoice->next_payment_attempt); + $referralUserSubscriptionData->next_invoice_amount = $upcoming_invoice->amount_due; + $referralUserSubscriptionData->save(); Log::info("Referral User Subscription Updated with Referral"); @@ -186,7 +188,9 @@ class StripeWebhookController extends Controller 'current_period_end' => date('Y-m-d H:i:s', $SubscriptionObject->current_period_end), 'status' => 'complete', - 'next_payment_date' => date('Y-m-d H:i:s', $upcoming_invoice->next_payment_attempt) + 'next_payment_date' => date('Y-m-d H:i:s', $upcoming_invoice->next_payment_attempt), + 'next_invoice_amount' => $upcoming_invoice->amount_due + ] ); @@ -224,6 +228,8 @@ class StripeWebhookController extends Controller $newUserSubscriptionDetails->current_period_start = date('Y-m-d H:i:s', $SubscriptionObject->current_period_start); $newUserSubscriptionDetails->current_period_end = date('Y-m-d H:i:s', $SubscriptionObject->current_period_end); $newUserSubscriptionDetails->next_payment_date = date('Y-m-d H:i:s', $upcoming_invoice->next_payment_attempt); + $newUserSubscriptionDetails->next_invoice_amount = $upcoming_invoice->amount_due; + $newUserSubscriptionDetails->save(); Log::info("new User Subscription Updated with Referral");