mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 06:52:50 +08:00
check if axo is enabled or not for buttons
This commit is contained in:
parent
d5f0ada0ce
commit
947f20a2a5
3 changed files with 11 additions and 3 deletions
|
@ -44,7 +44,9 @@ return array(
|
|||
|
||||
// If AXO is configured and onboarded.
|
||||
'axo.available' => static function ( ContainerInterface $container ): bool {
|
||||
return true;
|
||||
$settings = $container->get( 'wcgateway.settings' );
|
||||
assert( $settings instanceof Settings );
|
||||
return $settings->has( 'axo_enabled' ) && $settings->get( 'axo_enabled' );
|
||||
},
|
||||
|
||||
'axo.url' => static function ( ContainerInterface $container ): string {
|
||||
|
|
|
@ -246,7 +246,10 @@ class AxoModule implements ServiceModule, ExtendingModule, ExecutableModule {
|
|||
*/
|
||||
add_filter(
|
||||
'woocommerce_paypal_payments_sdk_components_hook',
|
||||
function( $components ) {
|
||||
function( $components ) use ( $c ) {
|
||||
if ( ! $c->has( 'axo.available' ) || ! $c->get( 'axo.available' ) ) {
|
||||
return $components;
|
||||
}
|
||||
$components[] = 'fastlane';
|
||||
return $components;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue