protected function getBaseXML()
    {
        foreach ($this->requiredFields as $field) {
            $this->validate($field);
        }

        $xml = new \SimpleXMLElement('<SecurePayMessage/>');

        $messageInfo = $xml->addChild('MessageInfo');
        $messageInfo->messageID = $this->getMessageId();
        $messageInfo->addChild('messageTimestamp', $this->generateTimestamp());
        $messageInfo->addChild('timeoutValue', 60);
        $messageInfo->addChild('apiVersion', 'xml-4.2');

        $merchantInfo = $xml->addChild('MerchantInfo');
        $merchantInfo->addChild('merchantID', $this->getMerchantId());
        $merchantInfo->addChild('password', $this->getTransactionPassword());

        $xml->addChild('RequestType', $this->requestType); // Not related to the transaction type

        return $xml;
    }
protected function getBaseXML()
    {
        foreach ($this->requiredFields as $field) {
            $this->validate($field);
        }

        $xml = new \SimpleXMLElement('<SecurePayMessage/>');

        $messageInfo = $xml->addChild('MessageInfo');
        $messageInfo->messageID = $this->getMessageId();
        $messageInfo->addChild('messageTimestamp', $this->generateTimestamp());
        $messageInfo->addChild('timeoutValue', 60);
        $messageInfo->addChild('apiVersion', 'xml-4.2');

        $merchantInfo = $xml->addChild('MerchantInfo');
        $merchantInfo->addChild('merchantID', $this->getMerchantId());
        $merchantInfo->addChild('password', $this->getTransactionPassword());

        $xml->addChild('RequestType', $this->requestType); // Not related to the transaction type

        return $xml;
    }
protected function getBaseXML ( ) { foreach ( $ this -> requiredFields as $ field ) { $ this -> validate ( $ field ) ; } $ xml = new \ SimpleXMLElement ( '<SecurePayMessage/>' ) ; $ messageInfo = $ xml -> addChild ( 'MessageInfo' ) ; $ messageInfo -> messageID = $ this -> getMessageId ( ) ; $ messageInfo -> addChild ( 'messageTimestamp' , $ this -> generateTimestamp ( ) ) ; $ messageInfo -> addChild ( 'timeoutValue' , 60 ) ; $ messageInfo -> addChild ( 'apiVersion' , 'xml-4.2' ) ; $ merchantInfo = $ xml -> addChild ( 'MerchantInfo' ) ; $ merchantInfo -> addChild ( 'merchantID' , $ this -> getMerchantId ( ) ) ; $ merchantInfo -> addChild ( 'password' , $ this -> getTransactionPassword ( ) ) ; $ xml -> addChild ( 'RequestType' , $ this -> requestType ) ; // Not related to the transaction type return $ xml ; }
XML Template of a SecurePayMessage.

As per section 5.1 of the documentation, these elements are common to
all requests.

@return \SimpleXMLElement SecurePayMessage template.
XML Template of a SecurePayMessage .