From 5c89fdab0288218b13e6ea2808e017b757f8d439 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Mon, 7 Dec 2020 14:50:43 +0100 Subject: [PATCH] pass client id in paymentResponse --- app/PaymentDrivers/CheckoutCom/CreditCard.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/PaymentDrivers/CheckoutCom/CreditCard.php b/app/PaymentDrivers/CheckoutCom/CreditCard.php index aeffd153351c..d56acdc3c7ad 100644 --- a/app/PaymentDrivers/CheckoutCom/CreditCard.php +++ b/app/PaymentDrivers/CheckoutCom/CreditCard.php @@ -13,6 +13,7 @@ namespace App\PaymentDrivers\CheckoutCom; use App\Http\Requests\ClientPortal\Payments\PaymentResponseRequest; +use App\Models\GatewayType; use App\PaymentDrivers\CheckoutComPaymentDriver; use Checkout\Library\Exceptions\CheckoutHttpException; use Checkout\Models\Payments\IdSource; @@ -82,6 +83,7 @@ class CreditCard 'currency' => $request->currency, 'payment_hash' => $request->payment_hash, 'reference' => $request->payment_hash, + 'client_id' => $this->checkout->client->id, ]; $state = array_merge($state, $request->all()); @@ -121,8 +123,17 @@ class CreditCard $payment->amount = $this->checkout->payment_hash->data->value; $payment->reference = $this->checkout->payment_hash->data->reference; + $this->checkout->payment_hash->data = array_merge((array) $this->checkout->payment_hash->data, ['checkout_payment_ref' => $payment]); + $this->checkout->payment_hash->save(); + if ($this->checkout->client->currency()->code === 'EUR') { $payment->{'3ds'} = ['enabled' => true]; + + $payment->{'success_url'} = route('payment_webhook', [ + 'gateway_key' => $this->checkout->company_gateway->gateway_key, + 'company_key' => $this->checkout->client->company->company_key, + 'hash' => $this->checkout->payment_hash->hash, + ]); } try {