You are here

function commerce_payment_transaction_statuses in Commerce Core 7

Returns an array of transaction payment status objects for the defined payment statuses.

This function invokes hook_commerce_payment_transaction_status_info() so other payment modules can define statuses if necessary. However, it doesn't allow for altering so that existing payment methods cannot be unset. It still does perform an array merge in such a way that the properties for the three core statuses defined by this module may be overridden if the same keys are used in another module's implementation of the info hook.

7 calls to commerce_payment_transaction_statuses()
CommercePaymentTransactionEntityController::buildContent in modules/payment/includes/commerce_payment_transaction.controller.inc
Builds a structured array representing the entity's content.
commerce_payment_commerce_payment_transaction_insert in modules/payment/commerce_payment.module
Implements hook_commerce_payment_transaction_insert().
commerce_payment_handler_area_totals::render in modules/payment/includes/views/handlers/commerce_payment_handler_area_totals.inc
Render the area.
commerce_payment_handler_filter_payment_transaction_status::get_value_options in modules/payment/includes/views/handlers/commerce_payment_handler_filter_payment_transaction_status.inc
Child classes should be used to override this function and set the 'value options', unless 'options callback' is defined as a valid function or static public method to generate these values.
commerce_payment_order_balance in modules/payment/commerce_payment.module
Calculates the balance of an order by subtracting the total of all successful transactions from the total of all the line items on the order.

... See full list

File

modules/payment/commerce_payment.module, line 778
Defines the payment system and checkout integration.

Code

function commerce_payment_transaction_statuses() {
  $transaction_statuses =& drupal_static(__FUNCTION__);

  // If the statuses haven't been defined yet, do so now.
  if (!isset($transaction_statuses)) {
    $transaction_statuses = module_invoke_all('commerce_payment_transaction_status_info');
    $transaction_statuses += array(
      COMMERCE_PAYMENT_STATUS_PENDING => array(
        'status' => COMMERCE_PAYMENT_STATUS_PENDING,
        'title' => t('Pending'),
        'icon' => drupal_get_path('module', 'commerce_payment') . '/theme/icon-pending.png',
        'total' => FALSE,
      ),
      COMMERCE_PAYMENT_STATUS_SUCCESS => array(
        'status' => COMMERCE_PAYMENT_STATUS_SUCCESS,
        'title' => t('Success'),
        'icon' => drupal_get_path('module', 'commerce_payment') . '/theme/icon-success.png',
        'total' => TRUE,
      ),
      COMMERCE_PAYMENT_STATUS_FAILURE => array(
        'status' => COMMERCE_PAYMENT_STATUS_FAILURE,
        'title' => t('Failure'),
        'icon' => drupal_get_path('module', 'commerce_payment') . '/theme/icon-failure.png',
        'total' => FALSE,
      ),
    );
  }
  return $transaction_statuses;
}