Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Xml driving me nuts....


NGR

Recommended Posts

Hiya guys...

 

Okay, after losa of hassles. Can someone actually tell me how the string should look when you want to post it to another host??

 

So far im using curl - and this is what im doing!

 

$transdetail = "<?xml version=\"1.0\"?><Safe><Merchant><SafeKey>{XXXXXXXX-X8X2-4XXF-XXXX-XXXXXXXXXXXX}</SafeKey></Merchant><Transactions><IA_Auth><MerchantReference>Test_08:32:30 PM</MerchantReference><PaymentMethod>ican</PaymentMethod><Amount>92901</Amount></IA_Auth></Transactions>";

Above is the xml code being loaded into a variable.

 

Then i post the the host using curl :

curl_setopt ($ch, CURLOPT_URL, "http://secure.safeshop.co.za/s2s/SafePay.asp");

            curl_setopt ($ch, CURLOPT_POST, 1);

    curl_setopt ($ch, CURLOPT_POSTFIELDS, $transdetail);

    curl_setopt ($ch, CURLOPT_POSTFIELDSIZE, 0);

    curl_setopt ($ch, CURLOPT_TIMEOUT, 360);

    curl_setopt ($ch, CURLOPT_HEADER, 0);

    curl_setopt ($ch, CURLOPT_SSLVERSION, 3);

    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);

 

 

if i check the variable just before sending this is the full string that is being sent :

 

(Is the the right format that should be sending for XML???)

http://secure.safeshop.co.za/s2s/SafePay.asp?<?xml version="1.0"?><safe><Merchant><SafeKey>{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX}</SafeKey></Merchant><Transactions><IA_Auth><MerchantReference>Test_08:32:30 PM</MerchantReference><PaymentMethod>ican</PaymentMethod><Amount>92901</Amount></IA_Auth></Transactions></Safe>

 

Because nomatter what I do this is what is being returned :

 

<?xml version=\"1.0\" ?> <Safe> <LogRefNr>1185753</LogRefNr> <Error>XML Root Tag is incorrect should be <Safe> (10146)</Error> </Safe>

 

 

Thing is my first tag that is being sent IS "<Safe>" - anyone have any hints to why im not getting anywhere?!?

 

Thanks in advance guys!!

 

Nick

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...