src/BackendService.php
public function getOrderState($transaction_type)
    {
        switch ($transaction_type) {
            case Transaction::TYPE_PENDING_CREDIT:
            case Transaction::TYPE_PENDING_DEBIT:
                $state = self::TYPE_PENDING;
                break;
            case Transaction::TYPE_CAPTURE_AUTHORIZATION:
            case Transaction::TYPE_DEBIT:
            case Transaction::TYPE_PURCHASE:
            case Transaction::TYPE_DEPOSIT:
                $state = self::TYPE_PROCESSING;
                break;
            case Transaction::TYPE_VOID_AUTHORIZATION:
                $state = self::TYPE_CANCELLED;
                break;
            case Transaction::TYPE_REFUND_CAPTURE:
            case Transaction::TYPE_REFUND_DEBIT:
            case Transaction::TYPE_REFUND_PURCHASE:
            case Transaction::TYPE_CREDIT:
            case Transaction::TYPE_VOID_CAPTURE:
            case Transaction::TYPE_VOID_PURCHASE:
                $state = self::TYPE_REFUNDED;
                break;
            case Transaction::TYPE_AUTHORIZATION:
            default:
                $state = self::TYPE_AUTHORIZED;
                break;
        }

        return $state;
    }
public function getOrderState($transaction_type)
    {
        switch ($transaction_type) {
            case Transaction::TYPE_PENDING_CREDIT:
            case Transaction::TYPE_PENDING_DEBIT:
                $state = self::TYPE_PENDING;
                break;
            case Transaction::TYPE_CAPTURE_AUTHORIZATION:
            case Transaction::TYPE_DEBIT:
            case Transaction::TYPE_PURCHASE:
            case Transaction::TYPE_DEPOSIT:
                $state = self::TYPE_PROCESSING;
                break;
            case Transaction::TYPE_VOID_AUTHORIZATION:
                $state = self::TYPE_CANCELLED;
                break;
            case Transaction::TYPE_REFUND_CAPTURE:
            case Transaction::TYPE_REFUND_DEBIT:
            case Transaction::TYPE_REFUND_PURCHASE:
            case Transaction::TYPE_CREDIT:
            case Transaction::TYPE_VOID_CAPTURE:
            case Transaction::TYPE_VOID_PURCHASE:
                $state = self::TYPE_REFUNDED;
                break;
            case Transaction::TYPE_AUTHORIZATION:
            default:
                $state = self::TYPE_AUTHORIZED;
                break;
        }

        return $state;
    }
public function getOrderState ( $ transaction_type ) { switch ( $ transaction_type ) { case Transaction :: TYPE_PENDING_CREDIT : case Transaction :: TYPE_PENDING_DEBIT : $ state = self :: TYPE_PENDING ; break ; case Transaction :: TYPE_CAPTURE_AUTHORIZATION : case Transaction :: TYPE_DEBIT : case Transaction :: TYPE_PURCHASE : case Transaction :: TYPE_DEPOSIT : $ state = self :: TYPE_PROCESSING ; break ; case Transaction :: TYPE_VOID_AUTHORIZATION : $ state = self :: TYPE_CANCELLED ; break ; case Transaction :: TYPE_REFUND_CAPTURE : case Transaction :: TYPE_REFUND_DEBIT : case Transaction :: TYPE_REFUND_PURCHASE : case Transaction :: TYPE_CREDIT : case Transaction :: TYPE_VOID_CAPTURE : case Transaction :: TYPE_VOID_PURCHASE : $ state = self :: TYPE_REFUNDED ; break ; case Transaction :: TYPE_AUTHORIZATION : default : $ state = self :: TYPE_AUTHORIZED ; break ; } return $ state ; }
Return order state of the transaction

@param $transaction_type
@return string
Return order state of the transaction