Link to home
Start Free TrialLog in
Avatar of m_ismadi
m_ismadi

asked on

Help with sending & receiving xml to Buckaroo payment gateway

Hi, I need some help with sending and receiving xml data to Buckroo payment gateway.
Basically I need to send over some transaction data to Buckaroo for them to process. After sending the xml data to their servers, I'm suppose to receive a response back immediately, which I did not get.

However I checked with them and confirmed that they received the transaction successfully. But I still did not get any response back. They tested it on their servers and said that everything was fine and they did get a response after sending. Te thing is their using asp to test it out and I'm out of luck in getting the test script that they used as I'm doing it in php.

The sample code is below. II'm suppose to receive a response back. The ResponseURL in the xml data is to receive back status of transaction after they run a batch job later on. So it has nothing to do with the immediate response that I'm suppose to get.

could someone help me. I'm at my wits end here.
$xml =
	'<?xml version="1.0"?>
	<PayMessage Channel="batch" VersionID="1.0">
	<Control Language="EN" Test="TRUE">
	<SenderSessionID>batchsession6</SenderSessionID>
	<Date>'.$date.'</Date>
	<Time>'.$time.'</Time>
	<MerchantID>'.$mkey.'</MerchantID>
	<BatchID>'.$batchid.'</BatchID>
	<Signature>'.$sig.'</Signature>
	<MessageID>BatchDeliveryRequest</MessageID>
	<ResponseURL>http://ww.mysite.com/xml_test/listener.php</ResponseURL>
	<Notify>me@gmail.com</Notify>
	</Control>
	<Content>
	<Transaction>
	<CustomerID>65</CustomerID>
	<Invoice>testbatchinv0006</Invoice>
	<Amount Currency="EUR">4800</Amount>
	<Description>Test monthly recurring payment</Description>
	</Transaction>
	</Content>
	</PayMessage >';
	$url ='https://payment.buckaroo.nl/batch/batch_delivery.asp';
	$port = 443;
 
	
	
	$ch = curl_init();
	
	$headers = array(
	"Content-Type: text/xml; charset=utf-8",
	);
	
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
	curl_setopt($ch, CURLOPT_HEADER, FALSE);
	curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
	curl_setopt($ch, CURLOPT_POST, TRUE);
	curl_setopt($ch, CURLOPT_TIMEOUT, 4);
	curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
	
	curl_exec($ch);
	curl_close($ch);

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of wassa_r
wassa_r
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of m_ismadi
m_ismadi

ASKER

Thanks wassa_r, the site is not helping at all. Next step is to read the xml and turn them into variables to store in db