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,
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.
"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
> credit card gateway authorization string so that I can take action within
> PHP code, versus the user receiving the auth code returned on the browser
> Here is the code I am using:
> // A very simple PHP example that sends a HTTP POST to a remote site
> $ch = curl_init();
> curl_setopt($ch, CURLOPT_POST, 1);
> curl_setopt($ch, CURLOPT_POSTFIELDS,
> curl_exec ($ch);
> curl_close ($ch);
> 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
> 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?
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php