From 403a30685ea9cd9d42ab6a6c6f0edf18cf22ed8f Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 2 Feb 2017 08:53:40 +0200 Subject: [PATCH] Check for default payment method --- app/Services/PaymentService.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Services/PaymentService.php b/app/Services/PaymentService.php index e3c5101a7035..6f72a7c46c63 100644 --- a/app/Services/PaymentService.php +++ b/app/Services/PaymentService.php @@ -95,6 +95,10 @@ class PaymentService extends BaseService $paymentMethod = $customer->default_payment_method; + if (! $paymentMethod) { + return false; + } + if ($paymentMethod->requiresDelayedAutoBill()) { $invoiceDate = \DateTime::createFromFormat('Y-m-d', $invoice->invoice_date); $minDueDate = clone $invoiceDate;