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:
> <html><body>
>
> <?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=authorize&account=107036&password=1111&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

Reply via email to