public static function fromId($transactionId, $orderId = null, $paymentMethodType = null)
    {
        try {
            $paymentMethodType = PaymentMethodType::validate($orderId);
        } catch (ArgumentException $ex) {
            /** */
        }

        if ($orderId === null && $paymentMethodType === null) {
            $paymentMethodType = PaymentMethodType::CREDIT;
        }

        $txn = new Transaction();
        $txn->transactionReference = new TransactionReference();
        $txn->transactionReference->transactionId = $transactionId;
        $txn->transactionReference->paymentMethodType = $paymentMethodType;
        $txn->transactionReference->orderId = $orderId;
        return $txn;
    }
public static function fromId($transactionId, $orderId = null, $paymentMethodType = null)
    {
        try {
            $paymentMethodType = PaymentMethodType::validate($orderId);
        } catch (ArgumentException $ex) {
            /** */
        }

        if ($orderId === null && $paymentMethodType === null) {
            $paymentMethodType = PaymentMethodType::CREDIT;
        }

        $txn = new Transaction();
        $txn->transactionReference = new TransactionReference();
        $txn->transactionReference->transactionId = $transactionId;
        $txn->transactionReference->paymentMethodType = $paymentMethodType;
        $txn->transactionReference->orderId = $orderId;
        return $txn;
    }
public static function fromId ( $ transactionId , $ orderId = null , $ paymentMethodType = null ) { try { $ paymentMethodType = PaymentMethodType :: validate ( $ orderId ) ; } catch ( ArgumentException $ ex ) { /** */ } if ( $ orderId === null && $ paymentMethodType === null ) { $ paymentMethodType = PaymentMethodType :: CREDIT ; } $ txn = new Transaction ( ) ; $ txn -> transactionReference = new TransactionReference ( ) ; $ txn -> transactionReference -> transactionId = $ transactionId ; $ txn -> transactionReference -> paymentMethodType = $ paymentMethodType ; $ txn -> transactionReference -> orderId = $ orderId ; return $ txn ; }
Creates a `Transaction` object from a stored transaction ID.

Used to expose management requests on the original transaction
at a later date/time. If `$orderId` is not necessary, `$paymentMethodType`
can be sent as the second argument.

@param string $transactionId The original transaction ID
@param string $orderId The original transaction's order ID (optional)
@param PaymentMethodType $paymentMethodType The original payment method type.
Defaults to `PaymentMethodType::CREDIT`.

@return Transaction
Creates a Transaction object from a stored transaction ID .