Re: CURL Help
| From: | Curt Zirzow | Date: | Tue, 20 Apr 2004 06:43:30 +0000 |
| Subject: | Re: CURL Help | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-183930@lists.php.net to get a copy of this message | ||
* Thus wrote Monty (monty3@hotmail.com):
> 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."