NGR Posted September 16, 2004 Share Posted September 16, 2004 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.