This issue is to remind myself to work on this feature.

In a recent patch I added the functionality to uc_recurring where if a recurring fee fails it reschedules itself to renew a set number of days later. At the moment this is hard coded to the first attempt happening 3 days later then the second attempt 5 days after that before canceling permanently.

Work still to be done:

  • This needs to be made a setting that anyone can change for a site or even by product.
  • Also need to provide the functionality for externally triggered recurring payments to notify uc_recurring that a recurring payment has been extended, e.g a public function they can call to extend an order
  • Integration/hooks to trigger other modules to do something on an extension, e.g. extend roles

Comments

univate’s picture

Title: Variable recurring extensions » Extensions api - effect how orders are handles when a renewals
univate’s picture

Title: Extensions api - effect how orders are handles when a renewals » Extensions api - effect how orders are handles when a renewal fails
univate’s picture

Title: Extensions api - effect how orders are handles when a renewal fails » Extensions api - handle renewal payments that fail
StatusFileSize
new1.51 KB

Attached are some basic api functions for handling extensions.

With a default install and this patch there is a hard coded extension of two reattempts on a failed renewal:
* The first failed payment extends for 3 days
* The second failed attempt extends for 5 days
* The third attempt will expire the recurring subscription.

What is still needed is a UI for allowing site admin's to change the default extension periods as well as the ability to override these for individual recurring fees. This will mean that you can define exactly what happens on any specific recurring fee failing and how many re-attempt should be made until giving up.

univate’s picture

Status: Active » Needs review
StatusFileSize
new26.59 KB
new9.86 KB

Attach is what I believe is a mostly complete attempt at a basic extension system.

The general idea of this feature is when a payment fails the recurring fee can be extended for some period (e.g. to allow person to update CC details or put funds on their card). Then uc_recurring will retry the renewal again after that period. The idea is you can configure what these intervals will be and how many times it should try until giving up and cancelling the subscription.

There are defaults extensions that will be used for all products, but the system has been built in a way that allows for extensions to be configured for each individual recurring fee as well. At the moment I haven't built the UI for being able to change these in each product but that can be done later.

There are also api function that other external gateways can used to tell uc_recurring that they are extending the subscription

function uc_recurring_extend_fee(&$fee, $extend_seconds);

Attached is an image of what the admin settings looks like to configure these extensions.

univate’s picture

StatusFileSize
new9.99 KB

realized that extensions should not be applied to orders where the recurring fee is handled by its own gateway

univate’s picture

Status: Needs review » Fixed

Ok cleaned up a couple of small things and committed this features.

amitaibu’s picture

Cool. What I think should be a nice feature request is instead if

+    '#description' => t('Enter comma (,) seperated list of days to reattempt...

Is to ask a value in PHP time (i.e. 1 day, 1 week, 1 week + 2 days)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.