ReRoute pay now links to show invoice if no gateways are present

This commit is contained in:
David Bomba 2021-12-16 13:04:46 +11:00
parent 3673f17a23
commit 6860ea9795

View File

@ -224,7 +224,7 @@ class InvitationController extends Controller
$gateways = $invitation->contact->client->service()->getPaymentMethods($amount);
if(is_array($gateways))
if(is_array($gateways) && count($gateways) >=1)
{
$data = [
@ -241,6 +241,11 @@ class InvitationController extends Controller
return (new InstantPayment($request))->run();
}
$entity = 'invoice';
if($invoice && is_array($gateways) && count($gateways) == 0)
return redirect()->route('client.invoice.show', ['invoice' => $this->encodePrimaryKey($invitation->invoice_id)]);
abort(404, "Invoice not found");
}
}