Skip to content

Revert feature name to add_payment_method #60197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions plugins/woocommerce/changelog/60197-revert-feature-name
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: fix

Revert feature name to add_payment_method.
2 changes: 1 addition & 1 deletion plugins/woocommerce/includes/class-wc-form-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ public static function add_payment_method_action() {
if ( isset( $available_gateways[ $payment_method_id ] ) ) {
$gateway = $available_gateways[ $payment_method_id ];

if ( ! $gateway->supports( PaymentGatewayFeature::ADD_PAYMENT_METHODS ) && ! $gateway->supports( PaymentGatewayFeature::TOKENIZATION ) ) {
if ( ! $gateway->supports( PaymentGatewayFeature::ADD_PAYMENT_METHOD ) && ! $gateway->supports( PaymentGatewayFeature::TOKENIZATION ) ) {
wc_add_notice( __( 'Invalid payment gateway.', 'woocommerce' ), 'error' );
return;
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/woocommerce/includes/class-wc-payment-gateways.php
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ public function get_available_payment_gateways() {
if ( $gateway->is_available() ) {
if ( ! is_add_payment_method_page() ) {
$_available_gateways[ $gateway->id ] = $gateway;
} elseif ( $gateway->supports( PaymentGatewayFeature::ADD_PAYMENT_METHODS ) || $gateway->supports( PaymentGatewayFeature::TOKENIZATION ) ) {
} elseif ( $gateway->supports( PaymentGatewayFeature::ADD_PAYMENT_METHOD ) || $gateway->supports( PaymentGatewayFeature::TOKENIZATION ) ) {
$_available_gateways[ $gateway->id ] = $gateway;
}
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/woocommerce/includes/wc-account-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function wc_get_account_menu_items() {
if ( isset( $items['payment-methods'] ) ) {
$support_payment_methods = false;
foreach ( WC()->payment_gateways->get_available_payment_gateways() as $gateway ) {
if ( $gateway->supports( PaymentGatewayFeature::ADD_PAYMENT_METHODS ) || $gateway->supports( PaymentGatewayFeature::TOKENIZATION ) ) {
if ( $gateway->supports( PaymentGatewayFeature::ADD_PAYMENT_METHOD ) || $gateway->supports( PaymentGatewayFeature::TOKENIZATION ) ) {
$support_payment_methods = true;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/woocommerce/src/Enums/PaymentGatewayFeature.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ final class PaymentGatewayFeature {
*
* @var string
*/
public const ADD_PAYMENT_METHODS = 'add_payment_methods';
public const ADD_PAYMENT_METHOD = 'add_payment_method';

/**
* Payment gateway supports credit card form on saved method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function __construct() {
PaymentGatewayFeature::SUBSCRIPTION_PAYMENT_METHOD_CHANGE,
// Saved cards features.
PaymentGatewayFeature::TOKENIZATION,
PaymentGatewayFeature::ADD_PAYMENT_METHODS,
PaymentGatewayFeature::ADD_PAYMENT_METHOD,
);
}

Expand Down
Loading