mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Catching exceptions when payment gateway throw exceptions
This commit is contained in:
parent
77bac77df3
commit
6b4aee77b1
@ -23,6 +23,7 @@ use App\Models\PaymentType;
|
||||
use App\Services\AbstractService;
|
||||
use App\Utils\Ninja;
|
||||
use Illuminate\Support\Str;
|
||||
use PDO;
|
||||
|
||||
class AutoBillInvoice extends AbstractService
|
||||
{
|
||||
@ -113,10 +114,17 @@ class AutoBillInvoice extends AbstractService
|
||||
|
||||
nlog("Payment hash created => {$payment_hash->id}");
|
||||
|
||||
$payment = false;
|
||||
|
||||
try{
|
||||
$payment = $gateway_token->gateway
|
||||
->driver($this->client)
|
||||
->setPaymentHash($payment_hash)
|
||||
->tokenBilling($gateway_token, $payment_hash);
|
||||
}
|
||||
catch(\Exception $e){
|
||||
nlog($e->getMessage());
|
||||
}
|
||||
|
||||
if($payment){
|
||||
info("Auto Bill payment captured for ".$this->invoice->number);
|
||||
|
Loading…
Reference in New Issue
Block a user