Skip to content

Commit

Permalink
Use new middleware in subscription
Browse files Browse the repository at this point in the history
this is a middle step before removing the class
  • Loading branch information
mmaymo committed Jan 3, 2025
1 parent 8be5cea commit 467c059
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Payment/MollieSubscription.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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'];
}

/**
Expand Down

0 comments on commit 467c059

Please sign in to comment.