Add meta data to checkout payments

This commit is contained in:
David Bomba 2022-02-09 18:48:08 +11:00
parent 23d6a69573
commit 6f5145a049

View File

@ -170,6 +170,7 @@ class CreditCard implements MethodInterface
private function completePayment($method, PaymentResponseRequest $request) private function completePayment($method, PaymentResponseRequest $request)
{ {
$payment = new Payment($method, $this->checkout->payment_hash->data->currency); $payment = new Payment($method, $this->checkout->payment_hash->data->currency);
$payment->amount = $this->checkout->payment_hash->data->value; $payment->amount = $this->checkout->payment_hash->data->value;
$payment->reference = $this->checkout->getDescription(); $payment->reference = $this->checkout->getDescription();
@ -178,6 +179,10 @@ class CreditCard implements MethodInterface
'email' => $this->checkout->client->present()->email(), 'email' => $this->checkout->client->present()->email(),
]; ];
$payment->metadata = [
'udf1' => "Invoice Ninja",
];
$this->checkout->payment_hash->data = array_merge((array)$this->checkout->payment_hash->data, ['checkout_payment_ref' => $payment]); $this->checkout->payment_hash->data = array_merge((array)$this->checkout->payment_hash->data, ['checkout_payment_ref' => $payment]);
$this->checkout->payment_hash->save(); $this->checkout->payment_hash->save();