You are here

function hook_recurring_info in UC Recurring Payments and Subscriptions 7.2

Same name and namespace in other branches
  1. 6.2 uc_recurring.api.php \hook_recurring_info()

Define the recurring payment method/gateway function callbacks.

This hook enables payment modules to register that they support ubercart recurring fees and define the callbacks to trigger when a recurring operation is required using the specific payment method or gateway.

drupal.org/node/<nid> http:// drupal.org/node/<nid> .

Return value

An array of recurring fee handler items, each fee handler has a key corresponding to the unique payment method or gateway id. The item is an associative array that may contain the following key-value pairs:

  • "name": Required. The untranslated title of the menu item.
  • "payment method": Required. The type of payment method, this needs to correspond to another recurring fee handler (e.g. credit).
  • "fee handler": the unique id of the payment gateway or another handler that should handle the recurring fee.
  • "module": name of the module that implements this fee handler.
  • "process callback": The function to call when setting up the recurring fee.
  • "renew callbak": Function to call when renewing the recurring fee.
  • "cancel callback": Function to call when cancelling a recurring fee.
  • "own handler": set to TRUE if this recurring handler will be responsible for processing renewals and not uc_recurring. (Default: FALSE)
  • "saved profile": if set to TRUE then this payment method will be available to other charges.
  • "menu": Array of menu items that provide the user operations. uc_recurring does provide some common default operations for charge, edit and cancel which can be reused by setting these to either:

For a detailed usage example, see modules/uc_recurring.test_gateway.inc.

~~~~ We should put some developer docs online somewhere ~~~~ For comprehensive documentation on the ubercart recurring system, see

9 functions implement hook_recurring_info()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

uc_recurring_get_recurring_info in ./uc_recurring.module
Get the recurring handlers info.
uc_recurring_hosted_recurring_info in modules/uc_recurring_hosted/uc_recurring_hosted.module
Implements hook_recurring_info().
uc_recurring_mock_gateway_recurring_info in test/uc_recurring_mock_gateway.module
Implements hook_recurring_info().
uc_recurring_recurring_info in ./uc_recurring.module
Implements hook_recurring_info().
uc_recurring_test_gateway_recurring_info in includes/uc_recurring.test_gateway.inc
Implements hook_recurring_info().

... See full list

1 invocation of hook_recurring_info()
uc_recurring_get_recurring_info in ./uc_recurring.module
Get the recurring handlers info.

File

./uc_recurring.api.php, line 42

Code

function hook_recurring_info() {
  $items = array();
  $items['test_gateway'] = array(
    'name' => t('Test Gateway'),
    'payment method' => 'credit',
    'module' => 'uc_recurring',
    'fee handler' => 'test_gateway',
    'renew callback' => 'uc_recurring_test_gateway_renew',
    'process callback' => 'uc_recurring_test_gateway_process',
    'own handler' => FALSE,
    'saved profile' => FALSE,
    'menu' => array(
      'charge' => UC_RECURRING_MENU_DEFAULT,
      'edit' => array(
        'title' => 'Edit',
        'page arguments' => array(
          'uc_recurring_admin_edit_form',
        ),
        'access callback' => 'user_access',
        'access arguments' => array(
          'administer recurring fees',
        ),
        'file' => 'uc_recurring.admin.inc',
      ),
      'cancel' => array(
        'title' => 'Cancel',
        'page arguments' => array(
          'uc_recurring_user_cancel_form',
        ),
        'file' => 'uc_recurring.pages.inc',
      ),
    ),
  );
  return $items;
}