mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Add filter to register standrard card button gateway programmatically
This commit is contained in:
parent
47e8fec98c
commit
b08c6f671a
2 changed files with 6 additions and 3 deletions
|
@ -297,7 +297,7 @@ class SettingsModule implements ServiceModule, ExecutableModule {
|
|||
assert( $dcc_applies instanceof DCCApplies );
|
||||
|
||||
// Unset BCDC if merchant is eligible for ACDC.
|
||||
if ( $dcc_product_status->dcc_is_active() ) {
|
||||
if ( $dcc_product_status->dcc_is_active() && ! $container->get( 'wcgateway.settings.allow_card_button_gateway' ) ) {
|
||||
unset( $payment_methods[ CardButtonGateway::ID ] );
|
||||
}
|
||||
|
||||
|
|
|
@ -1659,9 +1659,12 @@ return array(
|
|||
$settings = $container->get( 'wcgateway.settings' );
|
||||
assert( $settings instanceof ContainerInterface );
|
||||
|
||||
return $settings->has( 'allow_card_button_gateway' ) ?
|
||||
return apply_filters(
|
||||
'woocommerce_paypal_payments_enable_standard_card_button_gateway_settings',
|
||||
$settings->has( 'allow_card_button_gateway' ) ?
|
||||
(bool) $settings->get( 'allow_card_button_gateway' ) :
|
||||
$container->get( 'wcgateway.settings.allow_card_button_gateway.default' );
|
||||
$container->get( 'wcgateway.settings.allow_card_button_gateway.default' )
|
||||
);
|
||||
},
|
||||
'wcgateway.settings.has_enabled_separate_button_gateways' => static function ( ContainerInterface $container ): bool {
|
||||
return (bool) $container->get( 'wcgateway.settings.allow_card_button_gateway' );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue