* Thus wrote Monty ([EMAIL PROTECTED]): > Hi, I'm trying to get a site working with our credit card merchant gateway's > "direct mode" using CURL. But I'm not exactly sure if I'm doing it right. > Here's what the gateway wants sent to it as a POST: > > POST /gw/sas/direct3.0 HTTP/1.0 > Host: secure.gateway.com:1401 > Content-Type: application/x-www-form-urlencoded > Content-Length: 57 > > card_number=44443333222221111&card_expire=0505&amount=5.00 > > This is supposed to be sent to http://secure.gateway.com:1401, the 1401 > representing a "port". Not sure if this requires anything special in CURL > other than appending it to the URL after a colon the way it appears above. > > $ch = curl_init(); > curl_setopt($ch, CURLOPT_URL,"http://secure.gateway.com:1401");
You're missing the rest of the URL: curl_setopt($ch, CURLOPT_URL,"http://secure.gateway.com:1401/gw/direct3.0"); Do they require you to use a SSL connection? use https:// instead, and has curl been compiled with-ssl, check the output of phpinfo() And set HTTP/1.0 protocol: setopt($ch, CURLOPT_HTTP_VERSION, 1.0); Curt -- "I used to think I was indecisive, but now I'm not so sure." -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php