Skip to content

Commit 1fbc626

Browse files
committed
if remove payment method
1 parent bcfe579 commit 1fbc626

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Http/Controllers/Payment.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use \App\Events\Document\PaymentReceived;
77
use App\Http\Requests\Portal\InvoicePayment as PaymentRequest;
88
use App\Models\Document\Document;
9+
use App\Utilities\Modules;
910
use Illuminate\Http\Request;
1011

1112
class Payment extends PaymentController
@@ -28,6 +29,18 @@ public function show(Document $invoice, PaymentRequest $request)
2829
}
2930
}
3031

32+
if (empty($setting)) {
33+
Modules::clearPaymentMethodsCache();
34+
35+
return response()->json([
36+
'code' => '',
37+
'name' => 'N/A',
38+
'description' => '',
39+
'redirect' => redirect()->back()->getTargetUrl(),
40+
'html' => '',
41+
]);
42+
}
43+
3144
$confirm_url = $this->getConfirmUrl($invoice);
3245

3346
$html = view('offline-payments::show', compact('setting', 'invoice', 'confirm_url'))->render();

0 commit comments

Comments
 (0)