DataTransferObjects
5 years ago
Models
5 years ago
Repositories
5 years ago
Webhooks
5 years ago
AccountAdminNotices.php
5 years ago
AdminSettingFields.php
5 years ago
AdvancedCardFields.php
5 years ago
AjaxRequestHandler.php
5 years ago
DonationDetailsPage.php
5 years ago
DonationFormPaymentMethod.php
5 years ago
DonationProcessor.php
5 years ago
PayPalClient.php
5 years ago
PayPalCommerce.php
5 years ago
RefreshToken.php
5 years ago
RefundPaymentHandler.php
5 years ago
ScriptLoader.php
5 years ago
Utils.php
5 years ago
onBoardingRedirectHandler.php
5 years ago
Utils.php
37 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Give\PaymentGateways\PayPalCommerce; |
| 4 | |
| 5 | use Give\PaymentGateways\PayPalCommerce\Models\MerchantDetail; |
| 6 | |
| 7 | /** |
| 8 | * Class Utils |
| 9 | * |
| 10 | * @since 2.9.0 |
| 11 | */ |
| 12 | class Utils { |
| 13 | /** |
| 14 | * Returns whether or not the PayPal Commerce gateway is active |
| 15 | * |
| 16 | * @since 2.9.0 |
| 17 | * |
| 18 | * @return bool |
| 19 | */ |
| 20 | public static function gatewayIsActive() { |
| 21 | return give_is_gateway_active( PayPalCommerce::GATEWAY_ID ); |
| 22 | } |
| 23 | |
| 24 | /** |
| 25 | * Return whether or not payment gateway accept payment. |
| 26 | * |
| 27 | * @since 2.9.6 |
| 28 | * @return bool |
| 29 | */ |
| 30 | public static function isAccountReadyToAcceptPayment() { |
| 31 | /* @var MerchantDetail $merchantDetail */ |
| 32 | $merchantDetail = give( MerchantDetail::class ); |
| 33 | |
| 34 | return (bool) $merchantDetail->accountIsReady; |
| 35 | } |
| 36 | } |
| 37 |