You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to integrate Paytm into the MVC (Codeigniter 3 Framework) pattern
Paytm Payment Gateway supports checksum generation and verification utility Which I want to use as per my requirement.
I have also completed the checksum validation utility and have set up the environment by creating a Paytm library on MVC pattern but I do not understand how to create the form as I want. how to implement on Paytm PG kit code as my requirement My form requirement is as follows:
I want to use the PG Kit code received from Paytm in my project as per my requirements. I want when the user adds an item to the cart and goes to the checkout button, the user is redirected to the shipping data(mobile, name, address, pin code, street, etc ) submission page. Where after completing of submitting the shipping data, as per Paytm credentials, the user will be redirected to the callback page where he will make the payment with the total amount. Once payment is completed, the user should be shown complete order details including shipping data and information obtained from the API response. How can this be done using 'session/rest'? Please provide me the code or logic for this so that I can understand it in depth in a better way
<?php
header("Pragma: no-cache");
header("Cache-Control: no-cache");
header("Expires: 0");
// following files need to be included
require_once("./lib/config_paytm.php");
require_once("./lib/encdec_paytm.php");
$checkSum = "";
$paramList = array();
$ORDER_ID = $_POST["ORDER_ID"];
$CUST_$_POST["CUST_ID"];
to $INDUSTRY_TYPE_ID = $_POST["INDUSTRY_TYPE_ID"];
$CHANNEL_ID = $_POST["CHANNEL_ID"];
$TXN_AMOUNT = $_POST["TXN_AMOUNT"];
// Create an array having all required parameters for creating checksum.
$paramList["MID"] = PAYTM_MERCHANT_MID;
$paramList["ORDER_ID"] = $ORDER_ID;
$paramList["CUST_ID"] = $CUST_ID;
$paramList["INDUSTRY_TYPE_ID"] = $INDUSTRY_TYPE_ID;
$paramList["CHANNEL_includingEL_ID;
$paramList["TXN_AMOUNT"] = $TXN_AMOUNT;
$paramList["WEBSITE"] = PAYTM_MERCHANT_WEBSITE;
/*
$paramList["CALLBACK_URL"] = "http://localhost/PaytmKit/pgResponse.php";
$paramList["MSISDN"] = $MSISDN; //Mobile number of customer
$paramList["EMAIL"] = $EMAIL; //Email ID of customer
$paramList["VERIFIED_BY"] = "EMAIL"; //
$paramList["IS_USER_VERIFIED"] = "YES"; //
*/
//Here checksum string will return by getChecksumFromArray() function.
$checkSum = getChecksumFromArray($paramList,PAYTM_MERCHANT_KEY);
?>
<html>
<head>
<title>Merchant Check Out Page</title>
</head>
<body>
<center><h1>Please do not refresh this page...</h1></center>
<form method="post" action="<?php echo PAYTM_TXN_URL ?>" name="f1">
<table border="1">
<tbody>
<?php
foreach($paramList as $name => $value) {
echo '<input type="hidden" name="' . $name .'" value="' . $value . '">';
}
?>
<input type="hidden" name="CHECKSUMHASH" value="<?php echo $checkSum ?>">
</tbody>
</table>
<script type="text/javascript">
document.f1.submit();
</script>
</form>
</body>
</html>
PaytmKit/pgResponse.php
<?php
header("Pragma: no-cache");
header("Cache-Control: no-cache");
header("Expires: 0");
// following files need to be included
require_once("./lib/config_paytm.php");
require_once("./lib/encdec_paytm.php");
$paytmChecksum = "";
$paramList = array();
$isValidChecksum = "FALSE";
$paramList = $_POST;
$paytmChecksum = isset($_POST["CHECKSUMHASH"]) ? $_POST["CHECKSUMHASH"] : ""; //Sent by Paytm pg
//Verify all parameters received from Paytm pg to your application. Like MID received from paytm pg is same as your application�s MID, TXN_AMOUNT and ORDER_ID are same as what was sent by you to Paytm PG for initiating transaction etc.
$isValidChecksum = verifychecksum_e($paramList, PAYTM_MERCHANT_KEY, $paytmChecksum); //will return TRUE or FALSE string.
if($isValidChecksum == "TRUE") {
echo "<b>Checksum matched and following are the transaction details:</b>" . "<br/>";
if ($_POST["STATUS"] == "TXN_SUCCESS") {
echo "<b>Transaction status is success</b>" . "<br/>";
//Process your transaction here as success transaction.
//Verify amount & order id received from Payment gateway with your application's order id and amount.
}
else {
echo "<b>Transaction status is failure</b>" . "<br/>";
}
if (isset($_POST) && count($_POST)>0 )
{
foreach($_POST as $paramName => $paramValue) {
echo "<br/>" . $paramName . " = " . $paramValue;
}
}
}
else {
echo "<b>Checksum mismatched.</b>";
//Process transaction as suspicious.
}
?>
API and WebhooksDiscussions related to GitHub's APIs or WebhooksQuestionAsk and answer questions about GitHub features and usage
1 participant
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
programming help
Body
I want to integrate Paytm into the MVC (Codeigniter 3 Framework) pattern
Paytm Payment Gateway supports checksum generation and verification utility Which I want to use as per my requirement.
I have also completed the checksum validation utility and have set up the environment by creating a Paytm library on MVC pattern but I do not understand how to create the form as I want. how to implement on Paytm PG kit code as my requirement
My form requirement is as follows:
I want to use the PG Kit code received from Paytm in my project as per my requirements. I want when the user adds an item to the cart and goes to the checkout button, the user is redirected to the shipping data(mobile, name, address, pin code, street, etc ) submission page. Where after completing of submitting the shipping data, as per Paytm credentials, the user will be redirected to the callback page where he will make the payment with the total amount. Once payment is completed, the user should be shown complete order details including shipping data and information obtained from the API response. How can this be done using 'session/rest'? Please provide me the code or logic for this so that I can understand it in depth in a better way
Paytm integration source code: https://github.com/paytm/Paytm_PHP_Sample
checksum implementation source code https://business.paytm.com/docs/checksum-implementation?ref=checksumdocument
PaytmKit/pgRedirect.php
PaytmKit/pgResponse.php
Beta Was this translation helpful? Give feedback.
All reactions