DataTransferObjects
4 years ago
Exceptions
3 years ago
Migrations
2 years ago
Models
3 years ago
PayPalCheckoutSdk
2 years ago
Repositories
2 years ago
Webhooks
4 years ago
AccountAdminNotices.php
4 years ago
AdminSettingFields.php
3 years ago
AdvancedCardFields.php
4 years ago
AjaxRequestHandler.php
2 years ago
DonationDetailsPage.php
4 years ago
DonationFormPaymentMethod.php
4 years ago
PayPalClient.php
3 years ago
PayPalCommerce.php
3 years ago
RefreshToken.php
2 years ago
RefundPaymentHandler.php
4 years ago
ScriptLoader.php
2 years ago
Utils.php
4 years ago
onBoardingRedirectHandler.php
2 years ago
Utils.php
40 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 | /** |
| 15 | * Returns whether or not the PayPal Commerce gateway is active |
| 16 | * |
| 17 | * @since 2.9.0 |
| 18 | * |
| 19 | * @return bool |
| 20 | */ |
| 21 | public static function gatewayIsActive() |
| 22 | { |
| 23 | return give_is_gateway_active(PayPalCommerce::GATEWAY_ID); |
| 24 | } |
| 25 | |
| 26 | /** |
| 27 | * Return whether or not payment gateway accept payment. |
| 28 | * |
| 29 | * @since 2.9.6 |
| 30 | * @return bool |
| 31 | */ |
| 32 | public static function isAccountReadyToAcceptPayment() |
| 33 | { |
| 34 | /* @var MerchantDetail $merchantDetail */ |
| 35 | $merchantDetail = give(MerchantDetail::class); |
| 36 | |
| 37 | return (bool)$merchantDetail->accountIsReady; |
| 38 | } |
| 39 | } |
| 40 |