PluginProbe
MONEI Payments for WooCommerce / trunk
MONEI Payments for WooCommerce vtrunk
7.3.3 7.3.2 7.3.1 7.3.0 7.2.4 7.2.3 7.2.2 7.2.0 7.2.1 7.1.3 2.1.0 3.0.0 3.1.0 3.1.1 4.0.0 4.1.0 4.1.1 4.2.0 4.2.1 5.0 5.1.0 5.1.1 5.1.2 5.2.2 5.2.3 All 87 releases
monei / src / Features / Subscriptions / SubscriptionService.php

SubscriptionService.php in MONEI Payments for WooCommerce trunk, at src/Features/Subscriptions/SubscriptionService.php

29 lines 616 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Monei\Features\Subscriptions;
4
5 use WC_Order;
6
7 class SubscriptionService {
8
9 private $wooHandler;
10 private $yithHandler;
11
12 public function __construct( WooCommerceSubscriptionsHandler $wooHandler, YithSubscriptionPluginHandler $yithHandler ) {
13 $this->wooHandler = $wooHandler;
14 $this->yithHandler = $yithHandler;
15 }
16
17 public function getHandler(): ?SubscriptionHandlerInterface {
18 if ( $this->wooHandler->is_subscriptions_addon_enabled() ) {
19 return $this->wooHandler;
20 }
21
22 if ( $this->yithHandler->is_subscriptions_addon_enabled() ) {
23 return $this->yithHandler;
24 }
25
26 return null;
27 }
28 }
29