mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-03 08:37:53 +08:00
AXO: Ensure Fastlane scripts do not load when PayPal is disabled
This commit is contained in:
parent
8b5165ddfc
commit
78fda07e8b
1 changed files with 9 additions and 2 deletions
|
@ -77,9 +77,10 @@ class AxoModule implements ModuleInterface {
|
|||
$settings = $c->get( 'wcgateway.settings' );
|
||||
assert( $settings instanceof Settings );
|
||||
|
||||
$is_paypal_enabled = $settings->has( 'paypal_enabled' ) && $settings->get( 'paypal_enabled' ) ?? false;
|
||||
$is_dcc_enabled = $settings->has( 'dcc_enabled' ) && $settings->get( 'dcc_enabled' ) ?? false;
|
||||
|
||||
if ( ! $is_dcc_enabled ) {
|
||||
if ( ! $is_paypal_enabled || ! $is_dcc_enabled ) {
|
||||
return $methods;
|
||||
}
|
||||
|
||||
|
@ -144,11 +145,17 @@ class AxoModule implements ModuleInterface {
|
|||
function () use ( $c ) {
|
||||
$module = $this;
|
||||
|
||||
$settings = $c->get( 'wcgateway.settings' );
|
||||
assert( $settings instanceof Settings );
|
||||
|
||||
$is_paypal_enabled = $settings->has( 'paypal_enabled' ) && $settings->get( 'paypal_enabled' ) ?? false;
|
||||
|
||||
$subscription_helper = $c->get( 'wc-subscriptions.helper' );
|
||||
assert( $subscription_helper instanceof SubscriptionHelper );
|
||||
|
||||
// Check if the module is applicable, correct country, currency, ... etc.
|
||||
if ( ! $c->get( 'axo.eligible' )
|
||||
if ( ! $is_paypal_enabled
|
||||
|| ! $c->get( 'axo.eligible' )
|
||||
|| 'continuation' === $c->get( 'button.context' )
|
||||
|| $subscription_helper->cart_contains_subscription() ) {
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue