Skip to content

Commit

Permalink
Txn token issue
Browse files Browse the repository at this point in the history
  • Loading branch information
abpaytm committed Jun 21, 2021
1 parent 7a8a630 commit fc872b8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
use Magento\Framework\App\CsrfAwareActionInterface;
use Magento\Framework\App\Request\InvalidRequestException;
use Magento\Framework\App\RequestInterface;
use Magento\Framework\Controller\ResultFactory;


class Redirect extends \One97\Paytm\Controller\Paytm implements CsrfAwareActionInterface{

Expand All @@ -28,7 +30,9 @@ public function execute() {
$order->addStatusToHistory($order->getStatus(), "Customer was redirected to paytm.");
$order->save();
$dataRaw=$this->_paytmModel->buildPaytmRequest($order);
echo json_encode(array('response'=>$dataRaw));
$resultJson = $this->resultFactory->create(ResultFactory::TYPE_JSON);
$resultJson->setData($dataRaw);
return $resultJson;
} else {
$this->_cancelPayment();
$this->restoreOrder();
Expand Down
6 changes: 3 additions & 3 deletions Magento_V2.3+/app/code/One97/Paytm/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Data extends AbstractHelper {
protected $session;

// PaytmConstants.php start
CONST TRANSACTION_URL_PRODUCTION = "https://securegw.paytm.in/order/process";
CONST TRANSACTION_URL_PRODUCTION = "https://securegw.paytm.in/order/process";
CONST TRANSACTION_STATUS_URL_PRODUCTION = "https://securegw.paytm.in/order/status";

CONST PRODUCTION_HOST = "https://securegw.paytm.in/";
Expand All @@ -33,8 +33,8 @@ class Data extends AbstractHelper {
CONST CONNECT_TIMEOUT = "10";
CONST TIMEOUT = "10";

CONST LAST_UPDATED = "20210512";
CONST PLUGIN_VERSION = "2.6.0";
CONST LAST_UPDATED = "20210621";
CONST PLUGIN_VERSION = "2.6.1";

CONST CUSTOM_CALLBACK_URL = "";
// PaytmConstants.php end
Expand Down
2 changes: 1 addition & 1 deletion Magento_V2.3+/app/code/One97/Paytm/Model/Paytm.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public function buildPaytmRequest($order) {
$datareturn['TXN_AMOUNT'] = $params['TXN_AMOUNT'];
$datareturn['MAGENTO_VERSION'] = $this->getMagentoVerionInPlugin();
$datareturn['PLUGIN_VERSION'] = $this->getpluginversion();
return $datareturn;
return array('response'=>$datareturn);
}

/* this function for checksum validation */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,9 @@ define(
*/
success: function (response) {


var response = JSON.parse(response);


if (response.response.txnToken) {
self.renderCheckout(response.response);

var respons = JSON.parse(JSON.stringify(response));
if (respons.response.txnToken) {
self.renderCheckout(respons.response);
}
},
});
Expand Down

0 comments on commit fc872b8

Please sign in to comment.