At 11/21/2002 03:18 PM, Bret L Conard wrote:

Really appreciate the help Bret. But I've still got some problems:

(FYI - I am using authorize.net, so some of the response parameters may be
different for you)
Actually, I appreciate the fields demonstration because it made me realize I was missing two fields from the post, although Netledger is our accounting system, not the payment gateway, so I was able to dump the CC and eCHECK junk from the code since that's already been processed and written into the data file.

We're using PayflowPro, and I've set up their Silent Post to feed to a script on our site that generates an XML file in NetLedger's "Small Business XML" format based on the data returned by PayFlow, and only if the purchase is approved. It's that XML file that I need to post, along with two identifying fields. NetLedger is then supposed to take that uploaded XML file and turn it into a sales record in our accounting.

Does anyone know how to work a file into a cURL post?

I've already tested the XML file numerous times (NetLedger has a way to upload the XML files from your desktop), and I know it's formatted properly.

$ch = curl_init("https://secure.website.net/script_or_application";); // URL
Ok, I was setting the URL in a CURLOPT. From what I understand, that shouldn't make a difference, right?

//My responses are delimited with | (pipe)
$parts = explode("|", $resp); //creates array from reponse
Where are you setting this?


Ok, I've taken a shot at using your example and just removing the CC stuff. What I came up with, then, should work, right? Nope. Still no response. Here's my code:

$data = "mtype=XMLDOC&outfile=true";

$ch = curl_init("https://partners.netledger.com/SmbXml";);

curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$resp = curl_exec($ch);
curl_close ($ch);

$parts = explode("|", $resp);

echo "resp: ".$resp."<br />";
echo "parts: ".$parts."<br />";

foreach($parts as $key => $val) {
echo "<b>$key:</b> $val <br>\n";
}

Now, granted, I'm not using "|" as a delimiter. At least, I don't think I am. Still, $resp should echo if there's something in it, right? What I get out of that is:

resp:
parts: Array
0:

Parts is the only one that echoes as I expected it to.
--
S. Keller
UI Engineer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Email: [EMAIL PROTECTED]
Web: www.healthtvchannel.org


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to