You wanna feed it an array - something like this:
$post_array = array(
"x_Login" => $config['authnetLogin']
,"x_Password" => $config['authnetPass']
,"x_Type" => $config['authnetXtype']
,"x_Method" => "CC"
,"x_Version" => "3.0"
,"x_ADC_Delim_Data" => "TRUE"
,"x_ADC_URL" => "FALSE"
,"x_Test_Request" => $config['authnetTest']
,"x_Amount" => $amount
,"x_Card_Num" => $credit_card_number
,"x_Exp_Date" => $credit_card_expiration_date
,"x_Email" => $customer_email
,"x_Phone" => $phone
,"x_First_Name" => $first_name
,"x_Last_Name" => $last_name
,"x_Company" => $company
,"x_Address" => $address
,"x_City" => $city
,"x_State" => $state
,"x_Zip" => $zip
,"x_country" => $country
,"x_Invoice_Num" => $invoicenum
,"x_Description" => $product_description
);
Then add it in with the other curl stuff...
curl_setopt($ch, CURLOPT_POSTFIELDS,$data);
-- jon
-------------------
jon roig
web developer
email: [EMAIL PROTECTED]
phone: 888.230.7557
-----Original Message-----
From: Curt Zirzow [mailto:[EMAIL PROTECTED]
Sent: Monday, April 19, 2004 11:44 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] CURL Help
* Thus wrote Monty ([EMAIL PROTECTED]):
> Hi, I'm trying to get a site working with our credit card merchant
> gateway's "direct mode" using CURL. But I'm not exactly sure if I'm
> doing it right. Here's what the gateway wants sent to it as a POST:
>
> POST /gw/sas/direct3.0 HTTP/1.0
> Host: secure.gateway.com:1401
> Content-Type: application/x-www-form-urlencoded
> Content-Length: 57
>
> card_number=44443333222221111&card_expire=0505&amount=5.00
>
> This is supposed to be sent to http://secure.gateway.com:1401, the
> 1401 representing a "port". Not sure if this requires anything special
> in CURL other than appending it to the URL after a colon the way it
> appears above.
>
> $ch = curl_init();
> curl_setopt($ch, CURLOPT_URL,"http://secure.gateway.com:1401");
You're missing the rest of the URL:
curl_setopt($ch,
CURLOPT_URL,"http://secure.gateway.com:1401/gw/direct3.0");
Do they require you to use a SSL connection?
use https:// instead, and has curl been compiled with-ssl, check
the output of phpinfo()
And set HTTP/1.0 protocol:
setopt($ch, CURLOPT_HTTP_VERSION, 1.0);
Curt
--
"I used to think I was indecisive, but now I'm not so sure."
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.657 / Virus Database: 422 - Release Date: 4/13/2004
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.657 / Virus Database: 422 - Release Date: 4/13/2004
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php