diff --git a/app/Http/Livewire/BillingPortalPurchase.php b/app/Http/Livewire/BillingPortalPurchase.php index c864cc666f3d..a1614a3cc65d 100644 --- a/app/Http/Livewire/BillingPortalPurchase.php +++ b/app/Http/Livewire/BillingPortalPurchase.php @@ -330,9 +330,9 @@ class BillingPortalPurchase extends Component $is_eligible = $this->subscription->service()->isEligible($this->contact); - if (is_array($is_eligible)) { + if ($is_eligible['exception']['message'] != 'Success') { $this->steps['not_eligible'] = true; - $this->steps['not_eligible_message'] = $is_eligible['exception']; + $this->steps['not_eligible_message'] = $is_eligible['exception']['message']; $this->steps['show_loading_bar'] = false; return; diff --git a/app/Services/Subscription/SubscriptionService.php b/app/Services/Subscription/SubscriptionService.php index ccabe124506f..a75e9d0f0c75 100644 --- a/app/Services/Subscription/SubscriptionService.php +++ b/app/Services/Subscription/SubscriptionService.php @@ -677,7 +677,7 @@ class SubscriptionService /* Stop the recurring invoice and archive */ $recurring_invoice->service()->stop()->save(); $recurring_invoice_repo = new RecurringInvoiceRepository(); - $recurring_invoice_repo->archive($$old_recurring_invoice); + $recurring_invoice_repo->archive($recurring_invoice); if($refund_end_date->greaterThan(now()) && (int)$outstanding_invoice->balance == 0) { @@ -698,7 +698,7 @@ class SubscriptionService ]; - $payment->refundPayment($data); + $payment->refund($data); } }