You are here

function commerce_no_payment_status_convert in Commerce No Payment 7.2

Converts a Commerce Payment transaction status to a Payment status.

Parameters

string $transaction_status:

Return value

string

1 call to commerce_no_payment_status_convert()
commerce_no_payment_update_7201 in ./commerce_no_payment.install
Creates Payment payments for Commerce Payment payment transactions that use Commerce No Payment.

File

./commerce_no_payment.install, line 15
Installation and uninstallation functions.

Code

function commerce_no_payment_status_convert($transaction_status) {
  $map = array(
    COMMERCE_PAYMENT_STATUS_SUCCESS => PAYMENT_STATUS_SUCCESS,
    COMMERCE_PAYMENT_STATUS_FAILURE => PAYMENT_STATUS_FAILED,
    COMMERCE_PAYMENT_STATUS_PENDING => PAYMENT_STATUS_PENDING,
  );
  return isset($map[$transaction_status]) ? $map[$transaction_status] : PAYMENT_STATUS_UNKNOWN;
}