webhook updated

This commit is contained in:
Hritikkk9
2024-07-11 16:21:05 +05:30
parent 7cf9bf0c54
commit 8500eb6535

View File

@@ -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");