HEX
Server: LiteSpeed
System: Linux server315.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: globfdxw (6114)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //home/globfdxw/www/wp-content/plugins/give/src/Framework/PaymentGateways/SubscriptionModule.php
<?php

namespace Give\Framework\PaymentGateways;

use Give\Framework\PaymentGateways\Contracts\Subscription\SubscriptionAmountEditable;
use Give\Framework\PaymentGateways\Contracts\Subscription\SubscriptionDashboardLinkable;
use Give\Framework\PaymentGateways\Contracts\Subscription\SubscriptionPausable;
use Give\Framework\PaymentGateways\Contracts\Subscription\SubscriptionPaymentMethodEditable;
use Give\Framework\PaymentGateways\Contracts\Subscription\SubscriptionResumable;
use Give\Framework\PaymentGateways\Contracts\Subscription\SubscriptionTransactionsSynchronizable;
use Give\Framework\PaymentGateways\Contracts\SubscriptionModuleInterface;
use Give\Framework\PaymentGateways\Traits\HasRouteMethods;

/**
 * @since 2.20.0
 *
 * @template G
 */
abstract class SubscriptionModule implements SubscriptionModuleInterface
{
    use HasRouteMethods;

    /**
     * @var G
     */
    protected $gateway;

    /**
     * @param G $gateway
     */
    public function setGateway(PaymentGateway $gateway)
    {
        $this->gateway = $gateway;
    }

    /**
     * @since 3.17.0
     */
    public function canPauseSubscription(): bool
    {
        return $this instanceof SubscriptionPausable;
    }

    /**
     * @inheritDoc
     */
    public function canSyncSubscriptionWithPaymentGateway(): bool
    {
        return $this instanceof SubscriptionTransactionsSynchronizable;
    }

    /**
     * @inheritDoc
     */
    public function canUpdateSubscriptionAmount(): bool
    {
        return $this instanceof SubscriptionAmountEditable;
    }

    /**
     * @inheritDoc
     */
    public function canUpdateSubscriptionPaymentMethod(): bool
    {
        return $this instanceof SubscriptionPaymentMethodEditable;
    }

    /**
     * @since 2.21.2
     */
    public function hasGatewayDashboardSubscriptionUrl(): bool
    {
        return $this instanceof SubscriptionDashboardLinkable;
    }
}