From 467c059eea19bf9048179b825f12c05fb15a98a0 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Fri, 3 Jan 2025 13:44:54 +0100 Subject: [PATCH] Use new middleware in subscription this is a middle step before removing the class --- src/Payment/MollieSubscription.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Payment/MollieSubscription.php b/src/Payment/MollieSubscription.php index 1eb92bb5..6bf7515e 100644 --- a/src/Payment/MollieSubscription.php +++ b/src/Payment/MollieSubscription.php @@ -4,6 +4,7 @@ use Mollie\Api\Types\SequenceType; use Mollie\WooCommerce\Payment\Request\Middleware\MiddlewareHandler; +use Mollie\WooCommerce\Payment\Request\Middleware\PaymentDescriptionMiddleware; use Mollie\WooCommerce\SDK\Api; use Mollie\WooCommerce\Subscription\MollieSubscriptionGatewayHandler; @@ -89,7 +90,13 @@ protected function getRecurringPaymentDescription($order, $option, $initialPayme ); return $description; } - return $this->getPaymentDescription($order, $option); + $middleware = new PaymentDescriptionMiddleware($this->dataHelper); + $requestData = []; + $context = 'payment'; + $result = $middleware->__invoke($requestData, $order, $context, function($requestData) { + return $requestData; + }); + return $result['description']; } /**