Merge pull request #6767 from turbo124/v5-develop

Catching exceptions when payment gateway throw exceptions
This commit is contained in:
David Bomba 2021-10-04 22:29:52 +11:00 committed by GitHub
commit 616e783f9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);