From bf6436e350789099c4e09d591e0787c4987e89af Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 14 Jan 2021 11:47:32 +1100 Subject: [PATCH] Catch exception in Authorize - failedResponse method --- .../Authorize/AuthorizeCreditCard.php | 24 +------------------ 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/app/PaymentDrivers/Authorize/AuthorizeCreditCard.php b/app/PaymentDrivers/Authorize/AuthorizeCreditCard.php index b2c34687dd..074619a055 100644 --- a/app/PaymentDrivers/Authorize/AuthorizeCreditCard.php +++ b/app/PaymentDrivers/Authorize/AuthorizeCreditCard.php @@ -98,29 +98,8 @@ class AuthorizeCreditCard /*Refactor and push to BaseDriver*/ if ($data['response'] != null && $data['response']->getMessages()->getResultCode() == 'Ok') { - // $response = $data['response']; - - // $payment_record = []; - // $payment_record['amount'] = $amount; - // $payment_record['payment_type'] = PaymentType::CREDIT_CARD_OTHER;; - // $payment_record['transaction_reference'] = $response->getTransactionResponse()->getTransId(); - - // $this->authorize->createPayment($payment_record); - $this->storePayment($payment_hash, $data); - // $payment = $this->createPaymentRecord($data, $amount); - // $payment->meta = $cgt->meta; - // $payment->save(); - - // $payment_hash->payment_id = $payment->id; - // $payment_hash->save(); - - // $this->authorize->attachInvoices($payment, $payment_hash); - // $payment->service()->updateInvoicePayment($payment_hash); - - // event(new PaymentWasCreated($payment, $payment->company, Ninja::eventVars())); - $vars = [ 'hashed_ids' => $invoice->hashed_id, 'amount' => $amount, @@ -212,8 +191,7 @@ class AuthorizeCreditCard private function processFailedResponse($data, $request) { - //dd($data); -// nlog(print_r($data, 1)); + throw new \Exception(ctrans('texts.error_title')); } private function formatGatewayResponse($data, $vars)