mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Unset the BCDC button if merchant is eligible for ACDC.
This commit is contained in:
parent
f83449090b
commit
e46039fe63
1 changed files with 21 additions and 0 deletions
|
@ -520,6 +520,27 @@ class SettingsModule implements ServiceModule, ExecutableModule {
|
|||
2
|
||||
);
|
||||
|
||||
/**
|
||||
* Unsets the BCDC black button if merchant is eligible for ACDC.
|
||||
*/
|
||||
add_filter(
|
||||
'woocommerce_paypal_payments_disabled_funding_sources',
|
||||
static function ( $disable_funding ) use ( $container ) {
|
||||
if ( ! is_array( $disable_funding ) || in_array( 'card', $disable_funding, true ) ) {
|
||||
return $disable_funding;
|
||||
}
|
||||
|
||||
$dcc_product_status = $container->get( 'wcgateway.helper.dcc-product-status' );
|
||||
assert( $dcc_product_status instanceof DCCProductStatus );
|
||||
|
||||
if ( $dcc_product_status->is_active() ) {
|
||||
$disable_funding[] = 'card';
|
||||
}
|
||||
|
||||
return $disable_funding;
|
||||
}
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue