You are here

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

Determines access to the prior authorization capture form for Amex hosted credit card transactions.

Parameters

$order: The order the transaction is on.

$transaction: The payment transaction object to be captured.

Return value

TRUE or FALSE indicating capture access.

1 string reference to 'commerce_amex_update_access'
commerce_amex_menu in ./commerce_amex.module
Implements hook_menu

File

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

Code

function commerce_amex_update_access($order, $transaction) {

  // Return FALSE if the transaction isn't for Amex or isn't
  // awaiting capture.
  if ($transaction->payment_method != 'amex_hosted' || empty($transaction->remote_id) || $transaction->status != COMMERCE_PAYMENT_STATUS_AMEX_REVIEW) {
    return FALSE;
  }

  // Allow access if the user can update this transaction.
  return commerce_payment_transaction_access('update', $transaction);
}