# hyperpay-gateways/trunk/src/Helpers/SubscriptionsManager.php

HyperPay Payments, version trunk. 34 lines.

- Page: https://pluginprobe.com/plugins/hyperpay-gateways/trunk/code/src/Helpers/SubscriptionsManager.php
- Raw: https://pluginprobe.com/plugins/hyperpay-gateways/trunk/raw/src/Helpers/SubscriptionsManager.php
- Modified: 2025-12-16T07:47:04+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/hyperpay-gateways/trunk/code/src/Helpers/SubscriptionsManager.php#L10-L20`.

```php
<?php

namespace Hyperpay\Gateways\Helpers;

use \WC_Order;

class SubscriptionsManager
{

    public static function orderContainsSubscription(WC_Order $order)
    {
        if (!\function_exists('wcs_order_contains_subscription')) {
            return false;
        }
        return wcs_order_contains_subscription($order->get_id());
    }

    public static function getSubscriptionsForOrder(WC_Order $order, $options = [])
    {
        if (!\function_exists('wcs_get_subscriptions_for_order')) {
            return [];
        }
        return wcs_get_subscriptions_for_order($order, $options);
    }

    public static function getUsersSubscriptions($userId)
    {
        if (!\function_exists('wcs_get_users_subscriptions') || !$userId) {
            return [];
        }
        return wcs_get_users_subscriptions($userId);
    }
}

```
