Merge pull request #3532 from woocommerce/PCP-4989-disabling-credit-and-debit-card-bcdc-payments-does-not-work-in-the-new-ui

Disable the card button if BCDC is disabled (4989)
This commit is contained in:
Niklas Gutberlet 2025-08-04 19:40:28 +02:00 committed by GitHub
commit 638ea5e141
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -159,7 +159,7 @@ class DisabledFundingSources {
return $disable_funding;
}
if ( ! is_checkout() || $this->dcc_configuration->use_acdc() ) {
if ( ! is_checkout() || $this->dcc_configuration->use_acdc() || ! $this->dcc_configuration->is_bcdc_enabled() ) {
// Non-checkout pages, or ACDC capability: Don't load card button.
$disable_funding[] = 'card';
}

View file

@ -330,7 +330,7 @@ class CardPaymentsConfiguration {
* @return bool
*/
public function is_bcdc_enabled() : bool {
if ( 'MX' === $this->store_country ) {
if ( 'MX' === $this->store_country || ! $this->use_acdc() ) {
$bcdc_setting = get_option( 'woocommerce_ppcp-card-button-gateway_settings' );
$enabled = $bcdc_setting['enabled'] ?? '';