Hi,
I now have a secure gateway, and I have installed the sql script from my supplier, and installed the payment module but.........
I think that my ZenCart is not yet configured to the payment API, I found the following cURL script from my eCommerce payment supplier, does any one know where I need to use this code?
PHP Code Example
Please note that this example uses the CURL libraries to enable the opening of an SSL port. Please feel free to edit and update this code as applicable.
<?
// these variables will be filled out by your program
$vars = array();
$vars[vendor_name] = "your_vendor_name";
$vars[vendor_password] = "directpass";
$vars[card_number] = "4444333322221111";
$vars[card_expiry] = "0808";
$vars[card_holder] = "John H Smith";
$vars[card_cvv] = "123";
$vars[payment_amount] = "1.11";
$vars[payment_reference] = "any_reference_you_need";
// call to directone interface function
$return_string = call_directone($vars);
// just print out what we got
print_r($return_string);
function call_directone($vars) {
// First you would normally do some checking to
// make sure the card number isn't invalid.
// Set up initial variables
$directone_url = "https://vault.safepay.com.au/cgi-bin/direct_test.pl";
// Prepare data for posting
$data = implode("&", $vars);
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_URL, $directone_url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$curlData = curl_exec ($ch);
curl_close ($ch);
return($curlData);
}
?>
Many thanks,
Goshawk:dontgetit