You are here

function commerce_cardonfile_menu in Commerce Card on File 7

Same name and namespace in other branches
  1. 7.2 commerce_cardonfile.module \commerce_cardonfile_menu()

Implements hook_menu().

File

./commerce_cardonfile.module, line 13
Supports card on file functionality for credit card payment methods by associating card data reference IDs from payment gateways with user accounts.

Code

function commerce_cardonfile_menu() {
  $items = array();
  $items['admin/commerce/config/cardonfile'] = array(
    'title' => 'Card on file settings',
    'description' => 'Configure your card on file settings.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'commerce_cardonfile_settings_form',
    ),
    'access arguments' => array(
      'configure cardonfile',
    ),
    'file' => 'includes/commerce_cardonfile.admin.inc',
  );
  $items['user/%user/stored-payment-methods'] = array(
    'title' => 'Stored payment methods',
    'description' => 'Edit or delete your stored payment methods.',
    'page callback' => 'commerce_cardonfile_overview',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'commerce_cardonfile_user_access',
    'access arguments' => array(
      1,
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 20,
    'file' => 'includes/commerce_cardonfile.pages.inc',
  );
  $items['user/%user/stored-payment-methods/%commerce_cardonfile_data'] = array(
    'title' => 'Credit card',
    'page callback' => 'commerce_cardonfile_redirect_to_user',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'commerce_cardonfile_data_access',
    'access arguments' => array(
      3,
    ),
  );
  $items['user/%user/stored-payment-methods/%commerce_cardonfile_data/update'] = array(
    'title' => 'Update',
    'description' => 'Update a stored payment method.',
    'page callback' => 'commerce_cardonfile_update',
    'page arguments' => array(
      3,
    ),
    'access callback' => 'commerce_cardonfile_data_access',
    'access arguments' => array(
      3,
    ),
    'type' => MENU_LOCAL_TASK,
    'context' => MENU_CONTEXT_INLINE,
    'file' => 'includes/commerce_cardonfile.pages.inc',
  );
  $items['user/%user/stored-payment-methods/%commerce_cardonfile_data/delete'] = array(
    'title' => 'Delete',
    'description' => 'Delete a stored payment method.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'commerce_cardonfile_delete_form',
      3,
    ),
    'access callback' => 'commerce_cardonfile_data_access',
    'access arguments' => array(
      3,
    ),
    'type' => MENU_LOCAL_TASK,
    'context' => MENU_CONTEXT_INLINE,
    'weight' => 10,
    'file' => 'includes/commerce_cardonfile.pages.inc',
  );
  return $items;
}