From 4c6342916f3a154c4b83a71f6d8d7b687582a972 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 9 Dec 2022 09:42:40 +1100 Subject: [PATCH] Add proper description to mollie credit card transactions --- app/PaymentDrivers/Mollie/CreditCard.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/PaymentDrivers/Mollie/CreditCard.php b/app/PaymentDrivers/Mollie/CreditCard.php index f8427a60e142..601aafe1f27e 100644 --- a/app/PaymentDrivers/Mollie/CreditCard.php +++ b/app/PaymentDrivers/Mollie/CreditCard.php @@ -52,6 +52,8 @@ class CreditCard { $amount = $this->mollie->convertToMollieAmount((float) $this->mollie->payment_hash->data->amount_with_fee); + $description = sprintf('%s: %s', ctrans('texts.invoices'), \implode(', ', collect($this->mollie->payment_hash->invoices())->pluck('invoice_number')->toArray())); + $this->mollie->payment_hash ->withData('gateway_type_id', GatewayType::CREDIT_CARD) ->withData('client_id', $this->mollie->client->id); @@ -68,7 +70,7 @@ class CreditCard 'mandateId' => $request->token, 'customerId' => $cgt->gateway_customer_reference, 'sequenceType' => 'recurring', - 'description' => \sprintf('Hash: %s', $this->mollie->payment_hash->hash), + 'description' => $description, 'webhookUrl' => $this->mollie->company_gateway->webhookUrl(), 'idempotencyKey' => uniqid("st",true), 'metadata' => [ @@ -108,7 +110,7 @@ class CreditCard 'currency' => $this->mollie->client->currency()->code, 'value' => $amount, ], - 'description' => \sprintf('Hash: %s', $this->mollie->payment_hash->hash), + 'description' => $description, 'redirectUrl' => route('mollie.3ds_redirect', [ 'company_key' => $this->mollie->client->company->company_key, 'company_gateway_id' => $this->mollie->company_gateway->hashed_id,