Exemplo n.º 1
0
 public function ToXML()
 {
     $xmlRebill = new DomDocument('1.0');
     $nodeRoot = $xmlRebill->CreateElement('RebillUpload');
     $nodeRoot = $xmlRebill->appendChild($nodeRoot);
     $nodeNewRebill = $xmlRebill->createElement('NewRebill');
     $nodeNewRebill = $nodeRoot->appendChild($nodeNewRebill);
     $nodeCustomer = $xmlRebill->createElement('eWayCustomerID');
     $nodeCustomer = $nodeNewRebill->appendChild($nodeCustomer);
     $value = $xmlRebill->createTextNode($this->m_ewayCustomerID);
     $value = $nodeCustomer->appendChild($value);
     //Customer
     $nodeCustomer = $xmlRebill->createElement('Customer');
     $nodeCustomer = $nodeNewRebill->appendChild($nodeCustomer);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerRef');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerRef);
     $value = $nodeCustomerDetails->appendChild($value);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerTitle');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerTitle);
     $value = $nodeCustomerDetails->appendChild($value);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerFirstName');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerFirstName);
     $value = $nodeCustomerDetails->appendChild($value);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerLastName');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerLastName);
     $value = $nodeCustomerDetails->appendChild($value);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerCompany');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerCompany);
     $value = $nodeCustomerDetails->appendChild($value);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerJobDesc');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerJobDesc);
     $value = $nodeCustomerDetails->appendChild($value);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerEmail');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerEmail);
     $value = $nodeCustomerDetails->appendChild($value);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerAddress');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerAddress);
     $value = $nodeCustomerDetails->appendChild($value);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerSuburb');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerSuburb);
     $value = $nodeCustomerDetails->appendChild($value);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerState');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerState);
     $value = $nodeCustomerDetails->appendChild($value);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerPostCode');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerPostCode);
     $value = $nodeCustomerDetails->appendChild($value);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerCountry');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerCountry);
     $value = $nodeCustomerDetails->appendChild($value);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerPhone1');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerPhone1);
     $value = $nodeCustomerDetails->appendChild($value);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerPhone2');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerPhone2);
     $value = $nodeCustomerDetails->appendChild($value);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerFax');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerFax);
     $value = $nodeCustomerDetails->appendChild($value);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerURL');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerURL);
     $value = $nodeCustomerDetails->appendChild($value);
     $nodeCustomerDetails = $xmlRebill->createElement('CustomerComments');
     $nodeCustomerDetails = $nodeCustomer->appendChild($nodeCustomerDetails);
     $value = $xmlRebill->createTextNode($this->m_CustomerComments);
     $value = $nodeCustomerDetails->appendChild($value);
     //Rebill Events
     $nodeRebillEvent = $xmlRebill->createElement('RebillEvent');
     $nodeRebillEvent = $nodeNewRebill->appendChild($nodeRebillEvent);
     $nodeRebillDetails = $xmlRebill->createElement('RebillInvRef');
     $nodeRebillDetails = $nodeRebillEvent->appendChild($nodeRebillDetails);
     $value = $xmlRebill->createTextNode($this->m_RebillInvRef);
     $value = $nodeRebillDetails->AppendChild($value);
     $nodeRebillDetails = $xmlRebill->createElement('RebillInvDesc');
     $nodeRebillDetails = $nodeRebillEvent->appendChild($nodeRebillDetails);
     $value = $xmlRebill->createTextNode($this->m_RebillInvDesc);
     $value = $nodeRebillDetails->AppendChild($value);
     $nodeRebillDetails = $xmlRebill->createElement('RebillCCName');
     $nodeRebillDetails = $nodeRebillEvent->appendChild($nodeRebillDetails);
     $value = $xmlRebill->createTextNode($this->m_RebillCCName);
     $value = $nodeRebillDetails->AppendChild($value);
     $nodeRebillDetails = $xmlRebill->createElement('RebillCCNumber');
     $nodeRebillDetails = $nodeRebillEvent->appendChild($nodeRebillDetails);
     $value = $xmlRebill->createTextNode($this->m_RebillCCNumber);
     $value = $nodeRebillDetails->AppendChild($value);
     $nodeRebillDetails = $xmlRebill->createElement('RebillCCExpMonth');
     $nodeRebillDetails = $nodeRebillEvent->appendChild($nodeRebillDetails);
     $value = $xmlRebill->createTextNode($this->m_RebillCCExpMonth);
     $value = $nodeRebillDetails->AppendChild($value);
     $nodeRebillDetails = $xmlRebill->createElement('RebillCCExpYear');
     $nodeRebillDetails = $nodeRebillEvent->appendChild($nodeRebillDetails);
     $value = $xmlRebill->createTextNode($this->m_RebillCCExpYear);
     $value = $nodeRebillDetails->AppendChild($value);
     $nodeRebillDetails = $xmlRebill->createElement('RebillInitAmt');
     $nodeRebillDetails = $nodeRebillEvent->appendChild($nodeRebillDetails);
     $value = $xmlRebill->createTextNode($this->m_RebillInitAmt);
     $value = $nodeRebillDetails->AppendChild($value);
     $nodeRebillDetails = $xmlRebill->createElement('RebillInitDate');
     $nodeRebillDetails = $nodeRebillEvent->appendChild($nodeRebillDetails);
     $value = $xmlRebill->createTextNode($this->m_RebillInitDate);
     $value = $nodeRebillDetails->AppendChild($value);
     $nodeRebillDetails = $xmlRebill->createElement('RebillRecurAmt');
     $nodeRebillDetails = $nodeRebillEvent->appendChild($nodeRebillDetails);
     $value = $xmlRebill->createTextNode($this->m_RebillRecurAmt);
     $value = $nodeRebillDetails->AppendChild($value);
     $nodeRebillDetails = $xmlRebill->createElement('RebillStartDate');
     $nodeRebillDetails = $nodeRebillEvent->appendChild($nodeRebillDetails);
     $value = $xmlRebill->createTextNode($this->m_RebillStartDate);
     $value = $nodeRebillDetails->AppendChild($value);
     $nodeRebillDetails = $xmlRebill->createElement('RebillInterval');
     $nodeRebillDetails = $nodeRebillEvent->appendChild($nodeRebillDetails);
     $value = $xmlRebill->createTextNode($this->m_RebillInterval);
     $value = $nodeRebillDetails->AppendChild($value);
     $nodeRebillDetails = $xmlRebill->createElement('RebillIntervalType');
     $nodeRebillDetails = $nodeRebillEvent->appendChild($nodeRebillDetails);
     $value = $xmlRebill->createTextNode($this->m_RebillIntervalType);
     $value = $nodeRebillDetails->AppendChild($value);
     $nodeRebillDetails = $xmlRebill->createElement('RebillEndDate');
     $nodeRebillDetails = $nodeRebillEvent->appendChild($nodeRebillDetails);
     $value = $xmlRebill->createTextNode($this->m_RebillEndDate);
     $value = $nodeRebillDetails->AppendChild($value);
     $InnerXml = $xmlRebill->saveXML();
     return $InnerXml;
 }