[PHP] Re: credit card auth using curl function

2002-08-29 Thread Mike Mannakee

Absolutely.  Your best bet, leaving the most visible way of tracing the
steps on any authorization, would be to save the returned string to a file.
Open the file and pass the handle to CURL_SETOPT like

curl_setopt($ch, CURLOPT_FILE, $return_data_fp);

Then have your script parse the data and output to the user appropriately.

Alternately, you can set RETURNTRANSFER and put the string in a variable,
like

curl_setopt($ch, RETURNTRANSFER, 1);
$return_data = curl_exec($ch);

but then the variable is transient and you have no record of the
transaction.  By using the first option you can retrace the steps of any
transaction if you ever need to.

HTH, Mike


Phplist [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi, I am using the CURL command to post credit card info to a gateway .exe
 program on a secure server. The code below works fine to produce the comma
 delimitted credit card authorization information to the browser page
 (for example: declined,Invalid form data
 posted,8/29/2002,18:07,0,0 ), but I need to capture
the
 credit card gateway authorization string so that I can take action within
my
 PHP code, versus the user receiving the auth code returned on the browser
 page.

 Here is the code I am using:
 htmlbody

 ?php
 //
 // A very simple PHP example that sends a HTTP POST to a remote site
 //

 $ch = curl_init();

 curl_setopt($ch,
 CURLOPT_URL,http://secure.ibill.com/cgi-win/ccard/tpcard15.exe;);
 curl_setopt($ch, CURLOPT_POST, 1);
 curl_setopt($ch, CURLOPT_POSTFIELDS,
 reqtype=authorizeaccount=107036password=amount=12);

 curl_exec ($ch);
 curl_close ($ch);
 ?

 /body/html

 It produces:
 declined,Invalid form data
 posted,8/29/2002,18:07,0,0  at the browser... It is a
 valid decline on the credit card, which I am no concerned with, but I
don't
 have this return to the user, want to parse the string and produce my own
 php output based on accepted or declined status.

 Any ideas?

 Stan




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




FW: [PHP] Re: credit card auth using curl function

2002-08-29 Thread phplist

Thanks for the help. I made the change as follows, as I don't mind it
be transient data... but I still get the string outputted on the web page. I
can parse the string all I want, but the following code still prints out the
annoying string on the webpage. Any ideas where I am going wrong?  Stan

Here's the code I used based on suggestion:

htmlbody

?php
//
// A very simple PHP example that sends a HTTP POST to a remote site
//

$ch = curl_init();
curl_setopt($ch,
CURLOPT_URL,http://secure.ibill.com/cgi-win/ccard/tpcard15.exe;);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch,
CURLOPT_POSTFIELDS,reqtype=authorizeaccount=107036password=amount=12
);

curl_setopt($ch, RETURNTRANSFER, 1);
$return_data = curl_exec($ch);

curl_close ($ch); ?

 /body/html



--


-Original Message-
From: phplist [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 29, 2002 7:32 PM
To: [EMAIL PROTECTED]
Subject: FW: [PHP] Re: credit card auth using curl function




-Original Message-
From: Mike Mannakee [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 29, 2002 5:45 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: credit card auth using curl function


Absolutely.  Your best bet, leaving the most visible way of tracing the
steps on any authorization, would be to save the returned string to a file.
Open the file and pass the handle to CURL_SETOPT like

curl_setopt($ch, CURLOPT_FILE, $return_data_fp);

Then have your script parse the data and output to the user appropriately.

Alternately, you can set RETURNTRANSFER and put the string in a variable,
like

curl_setopt($ch, RETURNTRANSFER, 1);
$return_data = curl_exec($ch);

but then the variable is transient and you have no record of the
transaction.  By using the first option you can retrace the steps of any
transaction if you ever need to.

HTH, Mike


Phplist [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi, I am using the CURL command to post credit card info to a gateway .exe
 program on a secure server. The code below works fine to produce the comma
 delimitted credit card authorization information to the browser page
 (for example: declined,Invalid form data
 posted,8/29/2002,18:07,0,0 ), but I need to capture
the
 credit card gateway authorization string so that I can take action within
my
 PHP code, versus the user receiving the auth code returned on the browser
 page.

 Here is the code I am using:
 htmlbody

 ?php
 //
 // A very simple PHP example that sends a HTTP POST to a remote site
 //

 $ch = curl_init();

 curl_setopt($ch,
 CURLOPT_URL,http://secure.ibill.com/cgi-win/ccard/tpcard15.exe;);
 curl_setopt($ch, CURLOPT_POST, 1);
 curl_setopt($ch, CURLOPT_POSTFIELDS,
 reqtype=authorizeaccount=107036password=amount=12);

 curl_exec ($ch);
 curl_close ($ch);
 ?

 /body/html

 It produces:
 declined,Invalid form data
 posted,8/29/2002,18:07,0,0  at the browser... It is a
 valid decline on the credit card, which I am no concerned with, but I
don't
 have this return to the user, want to parse the string and produce my own
 php output based on accepted or declined status.

 Any ideas?

 Stan




--
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




Re: [PHP] Re: credit card auth using curl function

2002-08-29 Thread Mike Mannakee

Try

curl_setopt($ch, CURL_NOBODY, 1);

Mike


Phplist [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Thanks for the help. I made the change as follows, as I don't mind it
 be transient data... but I still get the string outputted on the web page.
I
 can parse the string all I want, but the following code still prints out
the
 annoying string on the webpage. Any ideas where I am going wrong?  Stan

 Here's the code I used based on suggestion:
 
 htmlbody

 ?php
 //
 // A very simple PHP example that sends a HTTP POST to a remote site
 //

 $ch = curl_init();
 curl_setopt($ch,
 CURLOPT_URL,http://secure.ibill.com/cgi-win/ccard/tpcard15.exe;);
 curl_setopt($ch, CURLOPT_POST, 1);
 curl_setopt($ch,

CURLOPT_POSTFIELDS,reqtype=authorizeaccount=107036password=amount=12
 );

 curl_setopt($ch, RETURNTRANSFER, 1);
 $return_data = curl_exec($ch);

 curl_close ($ch); ?

  /body/html



 --


 -Original Message-
 From: phplist [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, August 29, 2002 7:32 PM
 To: [EMAIL PROTECTED]
 Subject: FW: [PHP] Re: credit card auth using curl function




 -Original Message-
 From: Mike Mannakee [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, August 29, 2002 5:45 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Re: credit card auth using curl function


 Absolutely.  Your best bet, leaving the most visible way of tracing the
 steps on any authorization, would be to save the returned string to a
file.
 Open the file and pass the handle to CURL_SETOPT like

 curl_setopt($ch, CURLOPT_FILE, $return_data_fp);

 Then have your script parse the data and output to the user appropriately.

 Alternately, you can set RETURNTRANSFER and put the string in a variable,
 like

 curl_setopt($ch, RETURNTRANSFER, 1);
 $return_data = curl_exec($ch);

 but then the variable is transient and you have no record of the
 transaction.  By using the first option you can retrace the steps of any
 transaction if you ever need to.

 HTH, Mike


 Phplist [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hi, I am using the CURL command to post credit card info to a gateway
.exe
  program on a secure server. The code below works fine to produce the
comma
  delimitted credit card authorization information to the browser page
  (for example: declined,Invalid form data
  posted,8/29/2002,18:07,0,0 ), but I need to capture
 the
  credit card gateway authorization string so that I can take action
within
 my
  PHP code, versus the user receiving the auth code returned on the
browser
  page.
 
  Here is the code I am using:
  htmlbody
 
  ?php
  //
  // A very simple PHP example that sends a HTTP POST to a remote site
  //
 
  $ch = curl_init();
 
  curl_setopt($ch,
  CURLOPT_URL,http://secure.ibill.com/cgi-win/ccard/tpcard15.exe;);
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_POSTFIELDS,
  reqtype=authorizeaccount=107036password=amount=12);
 
  curl_exec ($ch);
  curl_close ($ch);
  ?
 
  /body/html
 
  It produces:
  declined,Invalid form data
  posted,8/29/2002,18:07,0,0  at the browser... It is
a
  valid decline on the credit card, which I am no concerned with, but I
 don't
  have this return to the user, want to parse the string and produce my
own
  php output based on accepted or declined status.
 
  Any ideas?
 
  Stan
 



 --
 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