From 6f5145a049d6ac2f573930486bd35758711c10b4 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 9 Feb 2022 18:48:08 +1100 Subject: [PATCH] Add meta data to checkout payments --- app/PaymentDrivers/CheckoutCom/CreditCard.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/PaymentDrivers/CheckoutCom/CreditCard.php b/app/PaymentDrivers/CheckoutCom/CreditCard.php index 89cebc3da19d..04fe776dc5c1 100644 --- a/app/PaymentDrivers/CheckoutCom/CreditCard.php +++ b/app/PaymentDrivers/CheckoutCom/CreditCard.php @@ -170,6 +170,7 @@ class CreditCard implements MethodInterface private function completePayment($method, PaymentResponseRequest $request) { + $payment = new Payment($method, $this->checkout->payment_hash->data->currency); $payment->amount = $this->checkout->payment_hash->data->value; $payment->reference = $this->checkout->getDescription(); @@ -178,6 +179,10 @@ class CreditCard implements MethodInterface '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->save();