A simple WordPress plugin that updates WooCommerce subscription payment method tokens when a renewal payment is made with a different payment method.
When a customer pays for a subscription renewal order with a different payment method than what's stored on the subscription, this plugin automatically updates the subscription to use the new payment method for future renewals.
This is particularly useful in scenarios where:
- A subscription renewal payment fails
- The customer manually pays for the renewal with a new/different card
- You want future renewals to use this new payment method
Without this plugin, WooCommerce Subscriptions would continue trying to charge the original payment method, even though the customer has demonstrated they want to use a different one.
The plugin hooks into the woocommerce_subscription_renewal_payment_complete action and:
- Checks if the payment is for a renewal order
- Compares the payment method token on the order with the one on the subscription
- If they're different, updates the subscription to use the new payment method
- Adds an order note to the subscription recording the change
- WordPress 6.2+
- PHP 8.0+
- WooCommerce 8.6.1+
- WooCommerce Subscriptions
- Upload the plugin files to the
/wp-content/plugins/woo-update-subscription-token-renewaldirectory - Activate the plugin through the 'Plugins' screen in WordPress
- No configuration needed - the plugin works automatically
- Initial release