cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Sorry, I'm a newb, but I can't figure this out.

From: Stephen Heath <steve_at_anashtravel.com>
Date: Mon, 20 Jun 2005 17:02:37 -0400

I downloaded the 7.13 version of cURL although PHP tells me it's 7.11.2. I
am trying to access a secure site and am having two problems.

 

The first is that the "pictures" on the page are resolving to my website
address (www.anashtravel.com <http://www.anashtravel.com/> , where I am
launching the script from while testing - when I get it working I'll do it
command line mode) instead of the target address www3.moneris.com. I'm not
sure why, and figure it may be related to the next problem I am having.

 

I can get through the login, and send all the information to post a sale and
hit the process button, but the website rejects it saying API token
mismatch. I suspect I need to have some kind of redirector and some kind of
token-capture turned on, but I can't figure out what they are even called to
begin finding the information I need, so any help would be greatly
appreciated.

 

Script follows:

 

 

 

<?php

   $url="https://www3.moneris.com/mpg/terminal/purchase/index.php";

   $params =
"name=####&store_id=####&password=####&orderid=Test2&CreditCard=373387015331
002&DateExpires=0408&Amount=1.00&cust_id=TEST&ctype=1&auth=Process";

   $ch = curl_init();

   curl_setopt($ch, CURLOPT_POST,1);

   curl_setopt($ch, CURLOPT_POSTFIELDS,$params);

   curl_setopt($ch, CURLOPT_URL,$url);

   curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);

   curl_setopt($ch, CURLOPT_USERAGENT, $defined_vars['HTTP_USER_AGENT']);

   curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);

   curl_setopt($ch, CURLOPT_CAINFO, 'c:\curl\curl-ca-bundle.crt');

   $result=curl_exec ($ch);

   curl_close ($ch);

            echo ($result);

            exit;

 

?>
Received on 2005-06-20