From 70c3d7456ee77a6f516b927988483f8f228e641a Mon Sep 17 00:00:00 2001 From: Hritikkk9 Date: Thu, 11 Jul 2024 16:30:46 +0530 Subject: [PATCH] fillable removed --- .../Customer_API/StripeWebhookController.php | 4 ++- app/Models/Subscriptions.php | 25 +------------------ 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/app/Http/Controllers/APIs/Customer_API/StripeWebhookController.php b/app/Http/Controllers/APIs/Customer_API/StripeWebhookController.php index b99b5fe..6689771 100644 --- a/app/Http/Controllers/APIs/Customer_API/StripeWebhookController.php +++ b/app/Http/Controllers/APIs/Customer_API/StripeWebhookController.php @@ -27,7 +27,6 @@ class StripeWebhookController extends Controller { // dd("ssssss",$request); Log::info('Stripe Webhook Received= in getWebhook '); - Log::info('Stripe Webhook Received: ' . $request->getContent()); } public function handleWebhook(Request $request) { @@ -137,6 +136,9 @@ class StripeWebhookController extends Controller $upcoming_invoice = $stripe->invoices->upcoming([ 'subscription' => $referralUserSubscriptionData->subscription_id, // use retrieved id from subscription ]); + Log::info("UPCOMING INVOICE"); + + Log::info($upcoming_invoice); $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); diff --git a/app/Models/Subscriptions.php b/app/Models/Subscriptions.php index 7ad8b5e..7dfe187 100644 --- a/app/Models/Subscriptions.php +++ b/app/Models/Subscriptions.php @@ -11,30 +11,7 @@ class Subscriptions extends Model protected $table = 'subscriptions'; protected $guarded = []; - protected $fillable = - [ - 'id', - 'subscription_product_xid', - 'iam_principal_xid', - 'amount', - 'stripe_customer_id', - 'payment_intent_id', - 'payment_intent_client_secret', - 'subscription_id', - 'subscription_status', - 'current_period_start', - 'current_period_end', - 'status', - 'next_payment_date', - 'is_cancelled_subscription', - 'cancelled_at', - 'is_active', - 'deleted_at', - 'created_by', - 'modified_by', - 'created_at', - 'updated_at' - ]; + public function subscription() {