Quickpay API - xml
Hejsa!Jeg er ved at lave capture, status og cancel api til quickpay og følger deres dokumentation, hvori man skal sende nogle vars til deres /api og modtager så en xml tilbage.
Dog kan jeg ikke få parsed den xml...
<?
$url = "https://secure.quickpay.net/api";
$postdata = "protocol=7&msgtype=status&merchant=89898978&transaction=$transaction&md5check=$md5check";
$ch = curl_init(); // initialize curl handle
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
$result = curl_exec($ch);
$xml = new SimpleXMLElement($result);
echo $xml->qpstatmsg;
?>
Den returnere
Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /htdocs/admin/pages/quickpay_status.php:53 Stack trace: #0 /htdocs/admin/pages/quickpay_status.php(53): SimpleXMLElement->__construct('') #1 {main} thrown in /htdocs/admin/pages/quickpay_status.php on line 53