DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

How To Integrate POLi Payment With PHP Using XML Web Services (REST)

09.16.2011
| 4142 views |
  • submit to reddit
        // description of your code here

// insert code here..
<InitiateTransactionRequest
xmlns="http://schemas.datacontract.org/2004/07/Centricom.POLi.Services.MerchantAPI.Contract
s" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<AuthenticationCode>xxxxxxxx</AuthenticationCode>
<Transaction
xmlns:dco="http://schemas.datacontract.org/2004/07/Centricom.POLi.Services.MerchantAPI.DCO"
>
<dco:CurrencyAmount>15.00</dco:CurrencyAmount>
<dco:CurrencyCode>AUD</dco:CurrencyCode>
<dco:MerchantCheckoutURL>http://mnhometeamleads.com/demo/test/xml/</dco:MerchantCheckoutURL>
<dco:MerchantCode>xxxxxxx</dco:MerchantCode>
<dco:MerchantData>MerchantDataAssociatedWithTransaction</dco:MerchantData>
<dco:MerchantDateTime>2008-08-18T14:01:02</dco:MerchantDateTime>
<dco:MerchantHomePageURL>http://mnhometeamleads.com/demo/test/xml/</dco:MerchantHomePageURL>
<dco:MerchantRef>MerchantReferenceAssociateWithTransaction</dco:MerchantRef>
<dco:NotificationURL>http://mnhometeamleads.com/demo/test/xml/notification</dco:NotificationURL>
<dco:SelectedFICode i:nil="true" />
<dco:SuccessfulURL>http://mnhometeamleads.com/demo/test/xml/successful</dco:SuccessfulURL>
<dco:Timeout>1000</dco:Timeout>
<dco:UnsuccessfulURL>http://mnhometeamleads.com/demo/test/xml/unsuccessful</dco:UnsuccessfulURL>
<dco:UserIPAddress>65.2.45.1</dco:UserIPAddress>
</Transaction>
</InitiateTransactionRequest>

		$url='https://merchantapi.apac.paywithpoli.com/MerchantAPIService.svc/Xml/transaction/initiate';   
        $curl = curl_init($url);
        curl_setopt($curl, CURLOPT_HEADER, 0);
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($curl, CURLOPT_FORBID_REUSE, 1);
        curl_setopt($curl, CURLOPT_FRESH_CONNECT, 1);
        curl_setopt($curl, CURLOPT_POST, 1);
        curl_setopt($curl, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml"));
        curl_setopt($curl, CURLOPT_POSTFIELDS, $xml);

        $response = curl_exec($curl);
		$response=str_replace('<a:','<',$response);$response=str_replace('</a:','</',$response);
		$result = simplexml_load_str
This is all i can made but did't work so need help..!!