Reference customer when paying with Checkout.com

This commit is contained in:
Benjamin Beganović 2021-10-25 16:06:19 +02:00
parent e7a9576fd4
commit d0665e8311

View File

@ -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();