Hi,
Please find the below Sample given by payment gateway provider, Can anyone give me a rough idea how to create a Module for Zen Cart. I am having little knowledge in PHP
PHP Code:
<?php
function getHash($details){
ksort($details);
$str = '';
foreach ($details as $k => $v) {
if ($k != 'hash' && isset($v)) $str .= "$v|";
}
$str .= "16c08268921b6485617b2f71c4e5ec"; // Your secret key goes here.
return md5($str);
}
function main(){
$request_url = "https://www.payzippy.com/payment/api/charging/v1"; //Charging Url
$details_array = array();
$details_array['merchant_id'] = "test_t152"; //Your MID issued by PayZippy.
$details_array['buyer_email_address'] = "[email protected]"; // Email Address
$details_array['merchant_transaction_id'] = "MT123ID12345"; //Your Transaction Id
$details_array['transaction_type'] = "SALE"; //This is the default Value.
$details_array['transaction_amount'] = "10000"; //Amount must be in paise. So, 1 Rupee= 100.
$details_array['payment_method'] = "CREDIT"; // CREDIT,DEBIT,EMI,NET
$details_array['bank_name'] = ""; //Bank Name required in case of EMI/NET.
$details_array['emi_months'] = "0"; // Emi Months in case of EMI.
$details_array['currency'] = "INR"; //INR is default.
$details_array['ui_mode'] = "REDIRECT"; //REDIRECT/IFRAME.
$details_array['hash_method'] = "MD5"; //MD5, SHA256
$details_array['merchant_key_id'] = "payment"; //This is the default value.
$details_array['timegmt']= round(microtime(true) * 1000);
$details_array['callback_url']="http://localhost";
$details_array['hash'] = getHash($details_array);
$request_url_to_be_hit = $request_url."?".http_build_query($details_array);
print_r($request_url_to_be_hit); //This url printed needs to be redirected or put in iframe
as the case may be.
}
main();
?>
Bookmarks