# monei/trunk/src/Features/Subscriptions/SubscriptionService.php

MONEI Payments for WooCommerce, version trunk. 29 lines.

- Page: https://pluginprobe.com/plugins/monei/trunk/code/src/Features/Subscriptions/SubscriptionService.php
- Raw: https://pluginprobe.com/plugins/monei/trunk/raw/src/Features/Subscriptions/SubscriptionService.php
- Modified: 2025-10-10T14:08:50+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/monei/trunk/code/src/Features/Subscriptions/SubscriptionService.php#L10-L20`.

```php
<?php

namespace Monei\Features\Subscriptions;

use WC_Order;

class SubscriptionService {

	private $wooHandler;
	private $yithHandler;

	public function __construct( WooCommerceSubscriptionsHandler $wooHandler, YithSubscriptionPluginHandler $yithHandler ) {
		$this->wooHandler  = $wooHandler;
		$this->yithHandler = $yithHandler;
	}

	public function getHandler(): ?SubscriptionHandlerInterface {
		if ( $this->wooHandler->is_subscriptions_addon_enabled() ) {
			return $this->wooHandler;
		}

		if ( $this->yithHandler->is_subscriptions_addon_enabled() ) {
			return $this->yithHandler;
		}

		return null;
	}
}

```
