Merge pull request #662 from woocommerce/pcp-708-fix-free-trial-disable-funding

Fix disable-funding when free trial but dcc disabled
This commit is contained in:
Emili Castells 2022-06-14 11:51:58 +02:00 committed by GitHub
commit 2687365b5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -927,9 +927,9 @@ class SmartButton implements SmartButtonInterface {
}
if ( $this->is_free_trial_cart() ) {
$all_sources = $this->all_funding_sources;
$all_sources = array_keys( $this->all_funding_sources );
if ( $is_dcc_enabled ) {
$all_sources = array_keys( array_diff_key( $all_sources, array( 'card' => '' ) ) );
$all_sources = array_diff( $all_sources, array( 'card' ) );
}
$disable_funding = $all_sources;
}