You are here

function commerce_purchase_order_validate_access in Commerce Purchase Order 7

User access callback for purchase order number validation

1 string reference to 'commerce_purchase_order_validate_access'
commerce_purchase_order_menu in ./commerce_purchase_order.module
Implements hook_menu().

File

./commerce_purchase_order.module, line 34
Provides an example payment method for Drupal Commerce for testing and development.

Code

function commerce_purchase_order_validate_access($order, $transaction) {
  if ($transaction->payment_method == 'commerce_purchase_order' && $transaction->status == COMMERCE_PAYMENT_STATUS_PENDING) {

    // Allow access if the user can update payments on this order.
    return commerce_payment_transaction_access('update', $transaction);
  }
  else {
    return FALSE;
  }
}