credit card auth using curl function
| From: | phplist | Date: | Thu, 29 Aug 2002 22:10:43 +0000 |
| Subject: | credit card auth using curl function | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-114561@lists.php.net to get a copy of this message | ||
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