Skip to content

DevPress/woo-update-subscription-token-renewal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

WooCommerce Update Subscription Token Renewal

A simple WordPress plugin that updates WooCommerce subscription payment method tokens when a renewal payment is made with a different payment method.

Description

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:

  1. A subscription renewal payment fails
  2. The customer manually pays for the renewal with a new/different card
  3. 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.

How It Works

The plugin hooks into the woocommerce_subscription_renewal_payment_complete action and:

  1. Checks if the payment is for a renewal order
  2. Compares the payment method token on the order with the one on the subscription
  3. If they're different, updates the subscription to use the new payment method
  4. Adds an order note to the subscription recording the change

Requirements

  • WordPress 6.2+
  • PHP 8.0+
  • WooCommerce 8.6.1+
  • WooCommerce Subscriptions

Installation

  1. Upload the plugin files to the /wp-content/plugins/woo-update-subscription-token-renewal directory
  2. Activate the plugin through the 'Plugins' screen in WordPress
  3. No configuration needed - the plugin works automatically

Changelog

1.0.0

  • Initial release

About

Updates subscription payment method token when a renewal payment is made with a different token.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages