file name -- checkout.php3
Code: Select all
<?php
/*COPYRIGHT NOTICE
Copyright @ Transecute (I) Pvt Ltd
All rights reserved. These materials are confidential and proprietary to Transecute and no part of these materials should be reverse engineered, reproduced, published in any form by any means, electronic or mechanical including photocopy or any information storage or retrieval system or should be disclosed to third parties without the express written authorization of Transecute.
This is the sample GET URL PHP script. It can be directly used for integration with Transecute if your application is developed in PHP. You need to simply change the variables to match your variables as well as insert routines for handling a successful or unsuccessful transaction.
*/
?>
<html>
<title>Creator Shop </title>
<?php
require("functions.php3");
$toid = "your Member ID" ; //put in your memberid you recvd after signing up in the quotes provided here
$totype = "transecute";
$amount = "100"; //your script should substitute the amount here in the quotes provided here
$description = "567"; //your script should substitute the order description here in the quotes provided here
$orderdescription = "order for X and Y items"; //your script should substitute detailed description of your order here ( This field is not mandatory )
$countrycode="IN";//your script should substitute the customer's country code
$currencysymbol="USD";//your script should substitute the currency symbol in which you want to display amount on transecute page
$customamount="1";//your script should substitute the amount in that customized currency
$city="Mumbai";//your script should substitute the customer's city
$state="Maharashtra";//your script should substitute the customer's state
$street="4 Bunglow";//your script should substitute the customer's street
$zip="400052";//your script should substitute the customer's zip
$telno="226370256";//your script should substitute the customer's actual telno
$telnocc="091";//your script should substitute the customer's contry code for tel no
$emailaddr="support@transecute.com";//your script should substitue the customer's email address
$redirecturl = "http://www.merchantshop.com/redirecturl.php3" ; // url of ur site
$key = "Your Key" ; //put in the 32 bit alphanumeric key in the quotes provided here
$checksum = getchecksum($toid,$totype,$amount,$description , $redirecturl,$key);
$testurl = "https://secure.transecute.com/transecuteicici/icicicredit/payprocesstest.php3"; //to be used while testing integration
//$liveurl = "https://secure.transecute.com/transecuteicici/icicicredit/payprocess.php3"; //to be used in live mode
?>
<form name="form" method="post" action=<?php echo $testurl; ?>>
<input type=hidden name=toid value="<?php echo $toid; ?>">
<input type=hidden name=totype value="<?php echo $totype; ?>">
<input type=hidden name=amount value="<?php echo $amount; ?>">
<input type=hidden name=description value="<?php echo $description; ?>">
<input type=hidden name=orderdescription value="<?php echo $orderdescription; ?>">
<input type=hidden name=redirecturl value="<?php echo $redirecturl; ?>">
<input type=hidden name=checksum value="<?php echo $checksum; ?>">
<input type="hidden" name="TMPL_<?php echo $countrycode; ?>" value="selected">
<input type="hidden" name="TMPL_AMOUNT" value="<?php echo $customamount; ?>">
<input type="hidden" name="TMPL_CURRENCY" value="<?php echo $currencysymbol; ?>">
<input type="hidden" name="TMPL_city" value="<?php echo $city; ?>">
<input type="hidden" name="TMPL_state" value="<?php echo $state; ?>">
<input type="hidden" name="TMPL_street" value="<?php echo $street; ?>">
<input type="hidden" name="TMPL_zip" value="<?php echo $zip; ?>">
<input type="hidden" name="TMPL_telno" value="<?php echo $telno; ?>">
<input type="hidden" name="TMPL_telnocc" value="<?php echo $telnocc; ?>">
<input type="hidden" name="TMPL_emailaddr" value="<?php echo $emailaddr; ?>">
<select name=fromtype>
<option value="icicicredit">Visa/MasterCard
</select>
<INPUT TYPE="submit" value="submit">
</form>
</body> </html>
File name = functions.php3
Code: Select all
<?php
function getchecksum($toid,$totype,$amount,$description , $redirecturl,$key)
{
$str = "$toid|$totype|$amount|$description|$redirecturl|$key";
$generatedChecksum = md5($str);
return $generatedChecksum;
}
function verifychecksum($description,$amount,$status,$checksum,$key)
{
$str = "$description|$amount|$status|$key";
$generatedCheckSum = md5($str);
// echo $str."<BR>";
// echo "Generated CheckSum: ".$generatedCheckSum."<BR>";
// echo "Received Checksum: ".$checksum."<BR>";
if($generatedCheckSum == $checksum)
return "true" ;
else
return "false" ;
}
?>
Code: Select all
<?php
/*COPYRIGHT NOTICE
Copyright @ Transecute (I) Pvt Ltd
All rights reserved. These materials are confidential and proprietary to Transecute and no part of these materials should be reverse engineered, reproduced, published in any form by any means, electronic or mechanical including photocopy or any information storage or retrieval system or should be disclosed to third parties without the express written authorization of Transecute.
This is the sample RedirectURL PHP script. It can be directly used for integration with Transecute if your application is developed in PHP. You need to simply change the variables to match your variables as well as insert routines for handling a successful or unsuccessful transaction.
*/
require("functions.php3");
$key = "Your Key" ; //put in the 32 bit alphanumeric key in the quotes provided here
$retval = verifychecksum ($desc,$amount,$status,$newchecksum,$key);
if($retval == "true" && $status == "Y")
{
echo "Thank you for shopping with us. Your credit card has been charged and your transaction is successful. We will be shipping your order to you soon.";
//Here you need to put in the routines for a successful
//transaction such as sending an email to customer,
//setting database status, informing logistics etc etc
}
else if($retval == "true" && $status == "N")
{
echo "Thank you for shopping with us. However it seems your credit card transaction failed.";
//Here you need to put in the routines for a failed
//transaction such as sending an email to customer
//setting database status etc etc
}
else if($retval == "true" && $status == "P")
{
echo "Your Transaction has been classified as a HIGH RISK Transaction by our Credit Card Processor.This requires you to Fax us an Authorisation for this transaction in order to complete the processing. This process is required by our Credit Card Processor to ensure that this transaction is being done by a genuine card-holder. The transaction will NOT be completed (and your card will NOT be charged) if you do not fax required documents. You can find Authorisation form at http://pay.transecute.com.";
//Here you need to put in, the routines for a HIGH RISK
//transaction such as sending an email to customer and explaining him a procedure,
//setting database status etc etc
}
else
{
echo "Security Error. Illegal access detected";
//Here you need to simply ignore this and dont need
//to perform any operation in this condition
}
?>