$39 GRAYBYTE WORDPRESS FILE MANAGER $24

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.15.130 | ADMIN IP 216.73.216.51
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/home/bravetechrwanda/itiministry.org/plugins/give/src/PaymentGateways/Stripe/

HOME
Current File : /home/bravetechrwanda/itiministry.org/plugins/give/src/PaymentGateways/Stripe//ApplicationFee.php
<?php

namespace Give\PaymentGateways\Stripe;

use Give\License\Repositories\LicenseRepository;
use Give\PaymentGateways\Stripe\Models\AccountDetail as AccountDetailModel;

/**
 * Class ApplicationFee
 * @package Give\PaymentGateways\Stripe
 *
 * @see https://github.com/impress-org/givewp/issues/5555#issuecomment-759596226
 *
 * @since 2.10.2
 */
class ApplicationFee
{
    /**
     * @since 2.10.2
     */
    protected AccountDetailModel $accountDetail;

    /**
     * @since 4.3.0
     */
    protected LicenseRepository $licenseRepository;

    /**
     * @since 4.3.0 added LicenseRepository
     * @since 2.10.2
     */
    public function __construct(AccountDetailModel $accountDetail)
    {
        $this->accountDetail = $accountDetail;
        $this->licenseRepository = give(LicenseRepository::class);
    }

    /**
     * Returns true or false based on whether the Stripe fee should be applied or not
     *
     * @since 4.3.0 updated logic to check license for gateway fee
     * @since 2.10.2
     */
    public static function canAddFee(): bool
    {
        /* @var self $gate */
        $gate = give(static::class);

        if (!$gate->doesCountrySupportApplicationFee()) {
            return false;
        }

        return $gate->licenseRepository->hasPlatformFeePercentage();
    }

    /**
     * Return whether country support application fee.
     *
     * @since 4.5.0 Add India, Malaysia, Mexico, Singapore, Thailand to the list of unsupported countries
     * @since 2.10.2
     */
    public function doesCountrySupportApplicationFee(): bool
    {
        $unsupportedCountries = [
            'BR', // Brazil
            'IN', // India
            'MY', // Malaysia
            'MX', // Mexico
            'SG', // Singapore
            'TH', // Thailand
        ];

        return !in_array($this->accountDetail->accountCountry, $unsupportedCountries);
    }
}

Current_dir [ WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
25 May 2026 4.20 PM
bravetechrwanda / bravetechrwanda
0755
Admin
--
25 May 2026 4.20 PM
bravetechrwanda / bravetechrwanda
0755
Controllers
--
25 May 2026 4.20 PM
bravetechrwanda / bravetechrwanda
0755
DataTransferObjects
--
25 May 2026 4.20 PM
bravetechrwanda / bravetechrwanda
0755
Exceptions
--
25 May 2026 4.20 PM
bravetechrwanda / bravetechrwanda
0755
Models
--
25 May 2026 4.20 PM
bravetechrwanda / bravetechrwanda
0755
Repositories
--
25 May 2026 4.20 PM
bravetechrwanda / bravetechrwanda
0755
Traits
--
25 May 2026 4.20 PM
bravetechrwanda / bravetechrwanda
0755
ApplicationFee.php
1.853 KB
9 Jul 2025 5.09 PM
bravetechrwanda / bravetechrwanda
0644
DonationFormElements.php
0.626 KB
24 Nov 2021 4.55 AM
bravetechrwanda / bravetechrwanda
0644
DonationFormSettingPage.php
2.321 KB
24 Nov 2021 4.55 AM
bravetechrwanda / bravetechrwanda
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF Static GIF