PluginProbe
HyperPay Payments / trunk
HyperPay Payments vtrunk
6.6.0 trunk 1.7 1.8 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.1.0 2.2.0 2.3.0 2.3.1 2.3.2 2.3.3 3.0.0 3.0.5 4.0.0 4.0.2 All 34 releases
hyperpay-gateways / src / Helpers / SubscriptionsManager.php

SubscriptionsManager.php in HyperPay Payments trunk, at src/Helpers/SubscriptionsManager.php

34 lines 842 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Hyperpay\Gateways\Helpers;
4
5 use \WC_Order;
6
7 class SubscriptionsManager
8 {
9
10 public static function orderContainsSubscription(WC_Order $order)
11 {
12 if (!\function_exists('wcs_order_contains_subscription')) {
13 return false;
14 }
15 return wcs_order_contains_subscription($order->get_id());
16 }
17
18 public static function getSubscriptionsForOrder(WC_Order $order, $options = [])
19 {
20 if (!\function_exists('wcs_get_subscriptions_for_order')) {
21 return [];
22 }
23 return wcs_get_subscriptions_for_order($order, $options);
24 }
25
26 public static function getUsersSubscriptions($userId)
27 {
28 if (!\function_exists('wcs_get_users_subscriptions') || !$userId) {
29 return [];
30 }
31 return wcs_get_users_subscriptions($userId);
32 }
33 }
34