You are here

function payment_commerce_status_convert in Payment for Drupal Commerce 7

Same name and namespace in other branches
  1. 7.2 payment_commerce.module \payment_commerce_status_convert()

Convert a Payment payment status to a Commerce transaction status.

1 call to payment_commerce_status_convert()
payment_commerce_transaction_fill in ./payment_commerce.module
Fill a Commerce payment traction with Payment payment information.

File

./payment_commerce.module, line 284
Hook implementations and shared functions.

Code

function payment_commerce_status_convert($status) {
  if (in_array($status, array(
    PAYMENT_STATUS_NEW,
    PAYMENT_STATUS_PENDING,
  ))) {
    return COMMERCE_PAYMENT_STATUS_PENDING;
  }
  elseif (payment_status_is_or_has_ancestor($status, PAYMENT_STATUS_MONEY_TRANSFERRED)) {
    return COMMERCE_PAYMENT_STATUS_SUCCESS;
  }
  else {
    return COMMERCE_PAYMENT_STATUS_FAILURE;
  }
}