🐛 Fix the “disable card funding” condition

This commit is contained in:
Philipp Stracker 2025-03-18 16:11:42 +01:00
parent b5c08e842e
commit ee5237adf5
No known key found for this signature in database

View file

@ -132,14 +132,14 @@ class DisabledFundingSources {
* @return array
*/
private function apply_context_rules( array $disable_funding ) : array {
if ( ! is_checkout() || ! $this->dcc_configuration->is_bcdc_enabled() ) {
// Non-checkout pages, or BCDC disabled: Don't load card payments.
if ( ! is_checkout() || $this->dcc_configuration->is_acdc_enabled() ) {
// Non-checkout pages, or ACDC enabled: Don't load card button.
$disable_funding[] = 'card';
return $disable_funding;
}
// A checkout page and BCDC is enabled: Load card payments.
// A checkout page without ACDC: Load card button.
return array_filter(
$disable_funding,
static fn( string $funding_source ) => $funding_source !== 'card'