src/Omnipay/Ecopayz/Message/FetchTransactionRequest.php
public function getData()
    {
        $this->validate(
            'merchantId',
            'merchantPassword'
        );

        $document = new \DOMDocument('1.0', 'utf-8');
        $document->formatOutput = false;

        $envelope = $document->appendChild(
            $document->createElementNS('http://schemas.xmlsoap.org/soap/envelope/', 'soapenv:Envelope')
        );

        $envelope->setAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
        $envelope->setAttribute('xmlns:xsd', 'http://www.w3.org/2001/XMLSchema');
        $envelope->setAttribute('xmlns:q0', 'http://www.ecocard.com/merchantAPI/');

        $body = $envelope->appendChild(
            $document->createElement('soapenv:Body')
        );

        if ($transactionReference = $this->getTransactionReference()) {

            $query = $body->appendChild(
                $document->createElement('q0:QueryBySVSTransactionID')
            );

            $request = $query->appendChild(
                $document->createElement('q0:QueryBySVSTransactionIDRequest')
            );

            $request->appendChild(
                $document->createElement('q0:MerchantID', $this->getMerchantId())
            );

            $request->appendChild(
                $document->createElement('q0:MerchantPassword', $this->getMerchantPassword())
            );

            $request->appendChild(
                $document->createElement('q0:SVSTxID', $transactionReference)
            );

        } elseif ($transactionId = $this->getTransactionId()) {

            $query = $body->appendChild(
                $document->createElement('q0:QueryByCustomerTransactionID')
            );

            $request = $query->appendChild(
                $document->createElement('q0:QueryByCustomerTransactionIDRequest')
            );

            $request->appendChild(
                $document->createElement('q0:MerchantID', $this->getMerchantId())
            );

            $request->appendChild(
                $document->createElement('q0:MerchantPassword', $this->getMerchantPassword())
            );

            $request->appendChild(
                $document->createElement('q0:TxID', $transactionId)
            );

        } else {

            throw new InvalidRequestException('The transactionId or transactionReference parameter is required');

        }

        return $document->saveXML();
    }
public function getData()
    {
        $this->validate(
            'merchantId',
            'merchantPassword'
        );

        $document = new \DOMDocument('1.0', 'utf-8');
        $document->formatOutput = false;

        $envelope = $document->appendChild(
            $document->createElementNS('http://schemas.xmlsoap.org/soap/envelope/', 'soapenv:Envelope')
        );

        $envelope->setAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
        $envelope->setAttribute('xmlns:xsd', 'http://www.w3.org/2001/XMLSchema');
        $envelope->setAttribute('xmlns:q0', 'http://www.ecocard.com/merchantAPI/');

        $body = $envelope->appendChild(
            $document->createElement('soapenv:Body')
        );

        if ($transactionReference = $this->getTransactionReference()) {

            $query = $body->appendChild(
                $document->createElement('q0:QueryBySVSTransactionID')
            );

            $request = $query->appendChild(
                $document->createElement('q0:QueryBySVSTransactionIDRequest')
            );

            $request->appendChild(
                $document->createElement('q0:MerchantID', $this->getMerchantId())
            );

            $request->appendChild(
                $document->createElement('q0:MerchantPassword', $this->getMerchantPassword())
            );

            $request->appendChild(
                $document->createElement('q0:SVSTxID', $transactionReference)
            );

        } elseif ($transactionId = $this->getTransactionId()) {

            $query = $body->appendChild(
                $document->createElement('q0:QueryByCustomerTransactionID')
            );

            $request = $query->appendChild(
                $document->createElement('q0:QueryByCustomerTransactionIDRequest')
            );

            $request->appendChild(
                $document->createElement('q0:MerchantID', $this->getMerchantId())
            );

            $request->appendChild(
                $document->createElement('q0:MerchantPassword', $this->getMerchantPassword())
            );

            $request->appendChild(
                $document->createElement('q0:TxID', $transactionId)
            );

        } else {

            throw new InvalidRequestException('The transactionId or transactionReference parameter is required');

        }

        return $document->saveXML();
    }
Get the data for this request.

@throws InvalidRequestException
@return string                  request data