Post by thomamvt » Sun Jan 01, 2012 1:06 pm

I want to integrate Transecute PG to my opencart 1.5.1.3, I got 3 php files from the payment gateway support site. I need some help in integration this to opencart, they say it can be done in an hour. What should i do... i have attached the three files..


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" ;
}

?>
File name- redirecturl.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 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

	}
?>

Attachments


Newbie

Posts

Joined
Sun Jan 01, 2012 12:59 pm

Post by d7a7z7e7d » Sun Jan 01, 2012 2:57 pm

You can try looking at some of the other payment extensions (like AuthorizeNet AIM) to see how they work. It will likely take longer than an hour to do it right, but it shouldn't be too difficult if you have some programming knowledge. Just search your opencart installation for any file called "authorizenet_aim.php" or "authorizenet_aim.tpl". There should be 5 or 6 files. Copy them and rename to "transecute.php" or "transecute.tpl" and begin making your changes. I do offer custom development for a fee if you are interested in having me do this for you. Just contact me below:

http://www.opencartworld.com/index.php? ... on/contact

Image
OpenCart Extensions, Technical Support & Custom Development | Have I helped you?


User avatar
Newbie

Posts

Joined
Fri Sep 17, 2010 5:51 am
Location - USA
Who is online

Users browsing this forum: No registered users and 11 guests