RE: [PHP] trying to post to credit card authorization gateway - ibill
| From: | Eric Bauer | Date: | Thu, 29 Aug 2002 03:25:08 +0000 |
| Subject: | RE: [PHP] trying to post to credit card authorization gateway - ibill | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-114454@lists.php.net to get a copy of this message | ||
I have done this with ASP and Authorize.net, so I'm not sure if it will work
for you, but all I did was in asp use a request.form("fieldname") which I
think would be like using $_POST['fieldname']; or
$HTTP_POST_VARS['fieldname'] (I'm still new to PHP).
Hope that helps
-----Original Message-----
From: Stan [mailto:stan.hines@verizon.net]
Sent: Wed, August 28, 2002 11:14 PM
To: php-general@lists.php.net
Subject: [PHP] trying to post to credit card authorization gateway -
ibill
The following was from a post over a year ago, where the author was trying
to post credit card info to an .exe gateway program to check authorization.
I am trying to get something similar to work. I can submit it and to the
gateway, but I never get the comma delimitted authorization string back from
the .exe gateway program. It may come back, but I am not sure how to get it
into my php program so that I can use it and take action. Here is the code I
am using... any suggestions? Stan
I get the following returned, but want to set up to get the actual credit
card authorization string
from the gateway. If I post with form fields it works fine, but with
fsockopen I never get the string. Does anyone know why I would not get the
credit card authorization string back, as I would with a manual post using
formfields?:
<html><body>
<?php
// Build the request string.
$request.='cardnum='.urlencode("0000111122223333");
$request.='&address1='.urlencode("99 xyz");
$request.='&zipcode='.urlencode("96004");
$request.='&amount='.urlencode("2.00");
// Build the header.
$header="POST /cgi-win/ccard/tpcard15.exe HTTPS/1.0\r\n";
$header.="Host: secure.ibill.com\n". "User-Agent: PostIt\r\n";
$header.="Content-type: application/x-www-form-urlencoded\r\n";
$header.="Content-length: ".strlen($request)."\r\n\r\n";
// Open the connection.
$fp = fsockopen('secure.ibill.com',443,&$err_num,&$err_msg);
$i=0; if ($fp) {
// Send everything.
fputs($fp,$header.$request);
// Get the response.
$response="I am in";
while (!feof($fp)) { $response.=fgets($fp,128);
$i++; } fclose($fp);
} else $response="Dead"; ?>
<html> <head> <title>Response from secure.ibill.com</title> </head>
<body bgcolor="#FFFFFF"> <p> <? echo "Response from aaa:
".$response; ?> <?
echo "<br>No. of loops: ".$i; ?> <? echo "<br>Error no:
".$err_num." Error
Message: ".$err_msg; ?> </p> </body> </html>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php