Skip to content

Commit

Permalink
Allow the forceNetworkSavedCards payment method setting to be overr…
Browse files Browse the repository at this point in the history
…idden (#9460)

Co-authored-by: Timur Karimov <[email protected]>
  • Loading branch information
romarioraffington and timur27 authored Sep 24, 2024
1 parent 8c0d38a commit 7cd304e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Allow the network saved card payment method setting to be overridden by the `wcpay_force_network_saved_cards` filter
4 changes: 3 additions & 1 deletion includes/class-wc-payments-checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,9 @@ public function get_enabled_payment_method_config() {
'number' => '<button type="button" class="js-woopayments-copy-test-number" aria-label="' . esc_attr( __( 'Click to copy the test number to clipboard', 'woocommerce-payments' ) ) . '" title="' . esc_attr( __( 'Copy to clipboard', 'woocommerce-payments' ) ) . '"><i></i><span>',
]
);
$settings[ $payment_method_id ]['forceNetworkSavedCards'] = $gateway_for_payment_method->should_use_stripe_platform_on_checkout_page();

$should_enable_network_saved_cards = Payment_Method::CARD === $payment_method_id && WC_Payments::is_network_saved_cards_enabled();
$settings[ $payment_method_id ]['forceNetworkSavedCards'] = $should_enable_network_saved_cards || $gateway_for_payment_method->should_use_stripe_platform_on_checkout_page();
}

return $settings;
Expand Down

0 comments on commit 7cd304e

Please sign in to comment.