You are here

function commerce_amex_menu in Commerce American Express Payment Gateway (Amex) 7

Implements hook_menu

File

./commerce_amex.module, line 26
Implements American Express payment gateway for use in Drupal Commerce.

Code

function commerce_amex_menu() {
  $items = array();

  // Define a path for the Amex gatewayReturnURL.
  $items['checkout/%commerce_order/amex/return/%'] = array(
    'page callback' => 'commerce_amex_hosted_return_handle',
    'page arguments' => array(
      1,
      4,
    ),
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
  );

  // Define a path to receive 3D Secure callback.
  $items['checkout/%commerce_order/amex/3d/%commerce_payment_transaction'] = array(
    'page callback' => 'commerce_amex_3d_secure_callback',
    'page arguments' => array(
      1,
      4,
    ),
    'access callback' => TRUE,
    'type' => MENU_CALLBACK,
  );

  // Add a menu item for capturing authorizations.
  $items['admin/commerce/orders/%commerce_order/payment/%commerce_payment_transaction/amex-capture'] = array(
    'title' => 'Capture',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'commerce_amex_capture_form',
      3,
      5,
    ),
    'access callback' => 'commerce_amex_capture_access',
    'access arguments' => array(
      3,
      5,
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'context' => MENU_CONTEXT_INLINE,
    'weight' => 2,
    'file' => 'includes/commerce_amex.admin.inc',
  );

  // Add a menu item for voiding authorizations.
  $items['admin/commerce/orders/%commerce_order/payment/%commerce_payment_transaction/amex-void'] = array(
    'title' => 'Void',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'commerce_amex_void_form',
      3,
      5,
    ),
    'access callback' => 'commerce_amex_void_access',
    'access arguments' => array(
      3,
      5,
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'context' => MENU_CONTEXT_INLINE,
    'weight' => 2,
    'file' => 'includes/commerce_amex.admin.inc',
  );

  // Add a menu item for refunding authorizations.
  $items['admin/commerce/orders/%commerce_order/payment/%commerce_payment_transaction/amex-refund'] = array(
    'title' => 'Refund',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'commerce_amex_refund_form',
      3,
      5,
    ),
    'access callback' => 'commerce_amex_refund_access',
    'access arguments' => array(
      3,
      5,
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'context' => MENU_CONTEXT_INLINE,
    'weight' => 2,
    'file' => 'includes/commerce_amex.admin.inc',
  );

  // Add a menu item for refunding authorizations.
  $items['admin/commerce/orders/%commerce_order/payment/%commerce_payment_transaction/amex-update'] = array(
    'title' => 'Update Status',
    'page callback' => 'commerce_amex_update_transaction',
    'page arguments' => array(
      3,
      5,
    ),
    'access callback' => 'commerce_amex_update_access',
    'access arguments' => array(
      3,
      5,
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'context' => MENU_CONTEXT_INLINE,
    'weight' => 2,
    'file' => 'includes/commerce_amex.admin.inc',
  );
  return $items;
}