From 88b428aae057037244170b6038e941c2f76cb24c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Tue, 27 Oct 2020 13:44:16 +0100 Subject: [PATCH] checkout.com payments using token --- app/PaymentDrivers/BaseDriver.php | 4 ++-- app/PaymentDrivers/CheckoutCom/CreditCard.php | 2 +- app/PaymentDrivers/CheckoutCom/Utilities.php | 4 ++-- .../ninja2020/gateways/checkout/credit_card/pay.blade.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/PaymentDrivers/BaseDriver.php b/app/PaymentDrivers/BaseDriver.php index ff5ccc51f105..ce55da9e558e 100644 --- a/app/PaymentDrivers/BaseDriver.php +++ b/app/PaymentDrivers/BaseDriver.php @@ -309,11 +309,11 @@ class BaseDriver extends AbstractPaymentDriver ); SystemLogger::dispatch( - $this->checkout->payment_hash, + $gateway->payment_hash, SystemLog::CATEGORY_GATEWAY_RESPONSE, SystemLog::EVENT_GATEWAY_ERROR, $gateway::SYSTEM_LOG_TYPE, - $this->checkout->client, + $gateway->client, ); throw new PaymentFailed($error, $e->getCode()); diff --git a/app/PaymentDrivers/CheckoutCom/CreditCard.php b/app/PaymentDrivers/CheckoutCom/CreditCard.php index ca946750713f..55f7f2af9e73 100644 --- a/app/PaymentDrivers/CheckoutCom/CreditCard.php +++ b/app/PaymentDrivers/CheckoutCom/CreditCard.php @@ -146,7 +146,7 @@ class CreditCard } catch (\Checkout\Library\Exceptions\CheckoutHttpException $e) { $this->checkout->unWindGatewayFees($this->checkout->payment_hash); - return $this->processInternallyFailedPayment($e); + return $this->checkout->processInternallyFailedPayment($this->checkout, $e); } } } diff --git a/app/PaymentDrivers/CheckoutCom/Utilities.php b/app/PaymentDrivers/CheckoutCom/Utilities.php index 5f24015e074f..291eeb4b80f4 100644 --- a/app/PaymentDrivers/CheckoutCom/Utilities.php +++ b/app/PaymentDrivers/CheckoutCom/Utilities.php @@ -134,11 +134,11 @@ trait Utilities $data = [ 'payment_meta' => $payment_meta, - 'token' => $response->id, + 'token' => $response->source['id'], 'payment_method_id' => $this->checkout->payment_hash->data->payment_method_id, ]; - return $this->checokut->saveCard($data); + return $this->checkout->storePaymentMethod($data); } catch (\Exception $e) { session()->flash('message', ctrans('texts.payment_method_saving_failed')); } diff --git a/resources/views/portal/ninja2020/gateways/checkout/credit_card/pay.blade.php b/resources/views/portal/ninja2020/gateways/checkout/credit_card/pay.blade.php index 71f54319f938..169c5be7ef43 100644 --- a/resources/views/portal/ninja2020/gateways/checkout/credit_card/pay.blade.php +++ b/resources/views/portal/ninja2020/gateways/checkout/credit_card/pay.blade.php @@ -24,7 +24,7 @@ @isset($token) - + @endisset