From e55da32e5593d412c8b4dd43dce8707478218c99 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 17 Aug 2021 19:48:40 +1000 Subject: [PATCH] Adjustments for authorize --- VERSION.txt | 2 +- .../Authorize/AuthorizeCreditCard.php | 21 +++++++++++++++++++ config/ninja.php | 4 ++-- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index d6701612336e..1c26b6f22f62 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.2.18 \ No newline at end of file +5.2.19 \ No newline at end of file diff --git a/app/PaymentDrivers/Authorize/AuthorizeCreditCard.php b/app/PaymentDrivers/Authorize/AuthorizeCreditCard.php index cac57328bb92..0bdeb119229d 100644 --- a/app/PaymentDrivers/Authorize/AuthorizeCreditCard.php +++ b/app/PaymentDrivers/Authorize/AuthorizeCreditCard.php @@ -214,6 +214,27 @@ class AuthorizeCreditCard PaymentFailureMailer::dispatch($this->authorize->client, $response->getTransId(), $this->authorize->client->company, $amount); + $payment_hash = PaymentHash::whereRaw('BINARY `hash`= ?', [$request->input('payment_hash')])->firstOrFail(); + + $vars = [ + 'invoices' => $payment_hash->invoices(), + 'amount' => array_sum(array_column($payment_hash->invoices(), 'amount')) + $payment_hash->fee_total, + ]; + + $logger_message = [ + 'server_response' => $response->getErrors(), + 'data' => $this->formatGatewayResponse($data, $vars), + ]; + + SystemLogger::dispatch( + $logger_message, + SystemLog::CATEGORY_GATEWAY_RESPONSE, + SystemLog::EVENT_GATEWAY_ERROR, + $gateway::SYSTEM_LOG_TYPE, + $this->authorize->client, + $this->authorize->client->company, + ); + throw new PaymentFailed($description, $code); } diff --git a/config/ninja.php b/config/ninja.php index eb3f54f5b066..3533b1a7b2f7 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -14,8 +14,8 @@ return [ 'require_https' => env('REQUIRE_HTTPS', true), 'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'), - 'app_version' => '5.2.18', - 'app_tag' => '5.2.18', + 'app_version' => '5.2.19', + 'app_tag' => '5.2.19', 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', ''),