From d0665e8311dc8a6c93ca6dac2ee25df36e4ce89d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Mon, 25 Oct 2021 16:06:19 +0200 Subject: [PATCH] Reference customer when paying with Checkout.com --- app/PaymentDrivers/CheckoutCom/CreditCard.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/PaymentDrivers/CheckoutCom/CreditCard.php b/app/PaymentDrivers/CheckoutCom/CreditCard.php index 317153749afa..4a858b0ffddf 100644 --- a/app/PaymentDrivers/CheckoutCom/CreditCard.php +++ b/app/PaymentDrivers/CheckoutCom/CreditCard.php @@ -112,7 +112,7 @@ class CreditCard implements MethodInterface $data['currency'] = $this->checkout->client->getCurrencyCode(); $data['value'] = $this->checkout->convertToCheckoutAmount($data['total']['amount_with_fee'], $this->checkout->client->getCurrencyCode()); $data['raw_value'] = $data['total']['amount_with_fee']; - $data['customer_email'] = $this->checkout->client->present()->email; + $data['customer_email'] = $this->checkout->client->present()->email(); return render('gateways.checkout.credit_card.pay', $data); } @@ -173,6 +173,10 @@ class CreditCard implements MethodInterface $payment = new Payment($method, $this->checkout->payment_hash->data->currency); $payment->amount = $this->checkout->payment_hash->data->value; $payment->reference = $this->checkout->getDescription(); + $payment->customer = [ + 'name' => $this->checkout->client->present()->name() , + 'email' => $this->checkout->client->present()->email(), + ]; $this->checkout->payment_hash->data = array_merge((array)$this->checkout->payment_hash->data, ['checkout_payment_ref' => $payment]); $this->checkout->payment_hash->save();