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:[EMAIL PROTECTED]]
Sent: Wed, August 28, 2002 11:14 PM
To: [EMAIL PROTECTED]
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


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

Reply via email to