From 6c82beaf0227a2bdf477512e2142e34c65c06749 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 6 Feb 2023 08:20:32 +1100 Subject: [PATCH] Minor fixes for subscriptionsg --- app/PaymentDrivers/BaseDriver.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/PaymentDrivers/BaseDriver.php b/app/PaymentDrivers/BaseDriver.php index 1af79af33999..9f5c2cf8cee5 100644 --- a/app/PaymentDrivers/BaseDriver.php +++ b/app/PaymentDrivers/BaseDriver.php @@ -359,7 +359,11 @@ class BaseDriver extends AbstractPaymentDriver event(new PaymentWasCreated($payment, $payment->company, Ninja::eventVars())); if (property_exists($this->payment_hash->data, 'billing_context') && $status == Payment::STATUS_COMPLETED) { - $billing_subscription = \App\Models\Subscription::find($this->decodePrimaryKey($this->payment_hash->data->billing_context->subscription_id)); + + if(is_int($this->payment_hash->data->billing_context->subscription_id)) + $billing_subscription = \App\Models\Subscription::find($this->payment_hash->data->billing_context->subscription_id); + else + $billing_subscription = \App\Models\Subscription::find($this->decodePrimaryKey($this->payment_hash->data->billing_context->subscription_id)); // To access campaign hash => $this->payment_hash->data->billing_context->campaign; // To access campaign data => Cache::get(CAMPAIGN_HASH)