• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1084
  • Last Modified:

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

0
m_ismadi
Asked:
m_ismadi
1 Solution
 
wassa_rCommented:
You have to capture the result, which is returned by curl_exec();

So $sResponse = curl_exec($ch);
echo $sResponse;

That'll work..
0
 
m_ismadiAuthor Commented:
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
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now