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");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch,
CURLOPT_POSTFIELDS,"card_number=44443333222221111&card_expire=0505&amount=5.
00");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$cresult = curl_exec($ch);
curl_close ($ch);
The response I get is $cresult = "1", but, that's not what it should be. It
should instead be equal to the following:
HTTP/1.0 200 OK Approved
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: 162
auth_msg=APPROVED&ticket_code=XXXXXXXXXXXXXXX&avs_code=X
&auth_date=2003-07-14+21%3A00%3A37.0&status_code=T
&trans_id=109936885634&auth_code=999999&cvv2_code=M
Do my CURL statements look correct based on what the gateway needs to
receive?? I have PHP 4.3.2 and Apache 2.0 running on Red Hat ES 3.0.
Thanks!
Monty
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php