# fluent-cart/1.6.4/app/Modules/Subscriptions/Services/EarlyPaymentFeature.php

FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler, version 1.6.4. 31 lines.

- Page: https://pluginprobe.com/plugins/fluent-cart/1.6.4/code/app/Modules/Subscriptions/Services/EarlyPaymentFeature.php
- Raw: https://pluginprobe.com/plugins/fluent-cart/1.6.4/raw/app/Modules/Subscriptions/Services/EarlyPaymentFeature.php
- Modified: 2026-03-04T14:04:34+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/fluent-cart/1.6.4/code/app/Modules/Subscriptions/Services/EarlyPaymentFeature.php#L10-L20`.

```php
<?php

namespace FluentCart\App\Modules\Subscriptions\Services;

use FluentCart\App\App;
use FluentCart\App\Helpers\Status;
use FluentCart\App\Models\Subscription;

class EarlyPaymentFeature
{
    public static function isEnabled(): bool
    {
        $isEnabledBySettings = App::storeSettings()->get('enable_early_payment_for_installment', 'yes') === 'yes';
        $isEnabled = apply_filters('fluent_cart/subscription/early_payment_enabled', $isEnabledBySettings);

        return App::isProActive() && (bool) $isEnabled;
    }

    public static function canPay(Subscription $subscription): bool
    {
        $canPay = self::isEnabled()
            && $subscription->bill_times > 0
            && $subscription->bill_count < $subscription->bill_times
            && in_array($subscription->status, [Status::SUBSCRIPTION_ACTIVE, Status::SUBSCRIPTION_TRIALING], true);

        return (bool) apply_filters('fluent_cart/subscription/can_early_pay', $canPay, [
            'subscription' => $subscription
        ]);
    }
}

```
