diff --git a/Magento_V1.x/app/code/community/One97/Paytm/Helper/Data.php b/Magento_V1.x/app/code/community/One97/Paytm/Helper/Data.php index 5154a1f..8f5d77a 100644 --- a/Magento_V1.x/app/code/community/One97/Paytm/Helper/Data.php +++ b/Magento_V1.x/app/code/community/One97/Paytm/Helper/Data.php @@ -3,14 +3,14 @@ class One97_paytm_Helper_Data extends Mage_Payment_Helper_Data { // PaytmConstants.php start - CONST TRANSACTION_URL_PRODUCTION = "https://securegw.paytm.in/order/process"; - CONST TRANSACTION_STATUS_URL_PRODUCTION = "https://securegw.paytm.in/order/status"; + CONST TRANSACTION_URL_PRODUCTION = "https://secure.paytmpayments.com/order/process"; + CONST TRANSACTION_STATUS_URL_PRODUCTION = "https://secure.paytmpayments.com/order/status"; - CONST TRANSACTION_URL_STAGING ="https://securegw-stage.paytm.in/order/process"; - CONST TRANSACTION_STATUS_URL_STAGING = "https://securegw-stage.paytm.in/order/status"; + CONST TRANSACTION_URL_STAGING ="https://securestage.paytmpayments.com/order/process"; + CONST TRANSACTION_STATUS_URL_STAGING = "https://securestage.paytmpayments.com/order/status"; - CONST STAGING_HOST = "https://securegw-stage.paytm.in/"; - CONST PRODUCTION_HOST = "https://securegw.paytm.in/"; + CONST STAGING_HOST = "https://securestage.paytmpayments.com/"; + CONST PRODUCTION_HOST = "https://secure.paytmpayments.com/"; CONST INITIATE_TRANSACTION_URL = "theia/api/v1/initiateTransaction"; CONST CHECKOUT_JS_URL = "merchantpgpui/checkoutjs/merchants/MID.js"; @@ -24,8 +24,8 @@ class One97_paytm_Helper_Data extends Mage_Payment_Helper_Data { CONST CONNECT_TIMEOUT = "10"; CONST TIMEOUT = "10"; - CONST LAST_UPDATED = "20200120"; - CONST PLUGIN_VERSION = "2.0"; + CONST LAST_UPDATED = "20241015"; + CONST PLUGIN_VERSION = "2.1"; CONST CUSTOM_CALLBACK_URL = ""; // PaytmConstants.php end @@ -145,7 +145,7 @@ static private function pkcs5Pad($text, $blocksize) { } static private function pkcs5Unpad($text) { - $pad = ord($text{strlen($text) - 1}); + $pad = ord($text[strlen($text) - 1]); if ($pad > strlen($text)) return false; return substr($text, 0, -1 * $pad); diff --git a/Magento_V2.3+/app/code/One97/Paytm/Block/Adminhtml/OrderEdit/Tab/View.php b/Magento_V2.3+/app/code/One97/Paytm/Block/Adminhtml/OrderEdit/Tab/View.php index df0cf59..e225fdf 100755 --- a/Magento_V2.3+/app/code/One97/Paytm/Block/Adminhtml/OrderEdit/Tab/View.php +++ b/Magento_V2.3+/app/code/One97/Paytm/Block/Adminhtml/OrderEdit/Tab/View.php @@ -82,6 +82,7 @@ public function getPaytmResponseHtml($viewButton=false) { if(!empty($result)){ $fetchStatusURL.='?fetchId='.$result[0]['id']; if(trim((string) $result[0]['paytm_response'])!=''){ + $result[0]['paytm_response'] = preg_replace('/"({.*?})"/', '$1', $result[0]['paytm_response']); $resArr=$this->jsonHelper->jsonDecode($result[0]['paytm_response']); $response=''; ksort($resArr); @@ -95,6 +96,7 @@ public function getPaytmResponseHtml($viewButton=false) { break; default: + $val= is_array($val)?json_encode($val):$val; $response.=' '.$k.' '.$val.' '; break; } diff --git a/Magento_V2.3+/app/code/One97/Paytm/Controller/Standard/Curlconfig.php b/Magento_V2.3+/app/code/One97/Paytm/Controller/Standard/Curlconfig.php index f0ab0b0..067cb5b 100755 --- a/Magento_V2.3+/app/code/One97/Paytm/Controller/Standard/Curlconfig.php +++ b/Magento_V2.3+/app/code/One97/Paytm/Controller/Standard/Curlconfig.php @@ -33,9 +33,9 @@ public function execute() { } else if(isset($reqData['setPaymentNotificationUrl'])){ if($reqData['environment'] == 0){ - $url = "https://boss-stage.paytm.in/"; + $url = "https://boss-stage.paytmpayments.com/"; }else{ - $url = "https://boss-ext.paytm.in/"; + $url = "https://boss-ext.paytmpayments.com/"; } $environment = $reqData['environment']; $mid = $reqData['mid']; diff --git a/Magento_V2.3+/app/code/One97/Paytm/Helper/Data.php b/Magento_V2.3+/app/code/One97/Paytm/Helper/Data.php index abdd797..eaed890 100755 --- a/Magento_V2.3+/app/code/One97/Paytm/Helper/Data.php +++ b/Magento_V2.3+/app/code/One97/Paytm/Helper/Data.php @@ -12,22 +12,22 @@ class Data extends AbstractHelper { private $stockItemRepository; // PaytmConstants.php start - CONST TRANSACTION_URL_PRODUCTION = "https://securegw.paytm.in/order/process"; - CONST TRANSACTION_STATUS_URL_PRODUCTION = "https://securegw.paytm.in/order/status"; + CONST TRANSACTION_URL_PRODUCTION = "https://secure.paytmpayments.com/order/process"; + CONST TRANSACTION_STATUS_URL_PRODUCTION = "https://secure.paytmpayments.com/order/status"; - CONST PRODUCTION_HOST = "https://securegw.paytm.in/"; - CONST STAGING_HOST = "https://securegw-stage.paytm.in/"; + CONST PRODUCTION_HOST = "https://secure.paytmpayments.com/"; + CONST STAGING_HOST = "https://securestage.paytmpayments.com/"; CONST PRODUCTION_PPBL_HOST = "https://securepg.paytm.in/"; CONST PPBL = false; - CONST TRANSACTION_URL_STAGING = "https://securegw-stage.paytm.in/order/process"; - CONST TRANSACTION_STATUS_URL_STAGING = "https://securegw-stage.paytm.in/order/status"; + CONST TRANSACTION_URL_STAGING = "https://securestage.paytmpayments.com/order/process"; + CONST TRANSACTION_STATUS_URL_STAGING = "https://securestage.paytmpayments.com/order/status"; - CONST TRANSACTION_TOKEN_URL_PRODUCTION = "https://securegw.paytm.in/theia/api/v1/initiateTransaction?mid="; + CONST TRANSACTION_TOKEN_URL_PRODUCTION = "https://secure.paytmpayments.com/theia/api/v1/initiateTransaction?mid="; - CONST TRANSACTION_TOKEN_URL_STAGING = "https://securegw-stage.paytm.in/theia/api/v1/initiateTransaction?mid="; + CONST TRANSACTION_TOKEN_URL_STAGING = "https://securestage.paytmpayments.com/theia/api/v1/initiateTransaction?mid="; CONST CHECKOUT_JS_URL = "merchantpgpui/checkoutjs/merchants/MID.js"; CONST SAVE_PAYTM_RESPONSE = true; @@ -39,8 +39,8 @@ class Data extends AbstractHelper { CONST CONNECT_TIMEOUT = "10"; CONST TIMEOUT = "10"; - CONST LAST_UPDATED = "20231107"; - CONST PLUGIN_VERSION = "2.6.9"; + CONST LAST_UPDATED = "20241015"; + CONST PLUGIN_VERSION = "2.7.0"; CONST CUSTOM_CALLBACK_URL = ""; // PaytmConstants.php end @@ -77,41 +77,27 @@ public function getUrl($route, $params = []) { // PaytmChecksum.php start private static $iv = "@@@@&&&&####$$$$"; - static public function encrypt($input, $key) { - $key = html_entity_decode($key); - - if(function_exists('openssl_encrypt')){ - $data = openssl_encrypt ( $input , "AES-128-CBC" , $key, 0, self::$iv ); - } else { - $size = mcrypt_get_block_size(MCRYPT_RIJNDAEL_128, 'cbc'); - $input = self::pkcs5Pad($input, $size); - $td = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', 'cbc', ''); - mcrypt_generic_init($td, $key, self::$iv); - $data = mcrypt_generic($td, $input); - mcrypt_generic_deinit($td); - mcrypt_module_close($td); - $data = base64_encode($data); - } - return $data; - } - - static public function decrypt($encrypted, $key) { - $key = html_entity_decode($key); - - if(function_exists('openssl_decrypt')){ - $data = openssl_decrypt ( $encrypted , "AES-128-CBC" , $key, 0, self::$iv ); - } else { - $encrypted = base64_decode($encrypted); - $td = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', 'cbc', ''); - mcrypt_generic_init($td, $key, self::$iv); - $data = mdecrypt_generic($td, $encrypted); - mcrypt_generic_deinit($td); - mcrypt_module_close($td); - $data = self::pkcs5Unpad($data); - $data = rtrim((string) $data); - } - return $data; - } + static public function encrypt($input, $key) { + $key = html_entity_decode($key); + + if (function_exists('openssl_encrypt')) { + $data = openssl_encrypt($input, "AES-128-CBC", $key, 0, self::$iv); + } else { + throw new Exception('OpenSSL extension is not available. Please install the OpenSSL extension.'); + } + return $data; + } + + static public function decrypt($encrypted, $key) { + $key = html_entity_decode($key); + + if(function_exists('openssl_decrypt')){ + $data = openssl_decrypt ( $encrypted , "AES-128-CBC" , $key, 0, self::$iv ); + } else { + throw new Exception('OpenSSL extension is not available. Please install the OpenSSL extension.'); + } + return $data; + } static public function generateSignature($params, $key) { if(!is_array($params) && !is_string($params)){ diff --git a/Magento_V2.3+/app/code/One97/Paytm/Model/Paytm.php b/Magento_V2.3+/app/code/One97/Paytm/Model/Paytm.php index 85bcb88..32e8897 100755 --- a/Magento_V2.3+/app/code/One97/Paytm/Model/Paytm.php +++ b/Magento_V2.3+/app/code/One97/Paytm/Model/Paytm.php @@ -135,10 +135,10 @@ public function buildPaytmRequest($order) { $params['PROMO_CAMP_ID']=$order->paytmPromoCode; } if($this->getConfigData("environment") ==1){ - $paytmDmain = 'https://securegw.paytm.in/'; + $paytmDmain = $this->helper::PRODUCTION_HOST; $url = $this->helper::TRANSACTION_TOKEN_URL_PRODUCTION.$params["MID"] . "&orderId=" . $params["ORDER_ID"]; }else{ - $paytmDmain = 'https://securegw-stage.paytm.in/'; + $paytmDmain = $this->helper::STAGING_HOST; $url = $this->helper::TRANSACTION_TOKEN_URL_STAGING.$params["MID"] . "&orderId=" . $params["ORDER_ID"]; } $checksum = $this->helper->generateSignature($params, $this->getConfigData("merchant_key")); @@ -292,9 +292,9 @@ public function getLastUpdate(){ /* this function for return Invert Logo Option */ public function getLogo() { if($this->getConfigData("invertlogo") == 1){ - return "https://staticpg.paytm.in/pg_plugins_logo/paytm_logo_invert.svg"; + return "https://staticpg.paytmpayments.com/pg_plugins_logo/paytm_logo_invert.svg"; } - return "https://staticpg.paytm.in/pg_plugins_logo/paytm_logo_paymodes.svg"; + return "https://staticpg.paytmpayments.com/pg_plugins_logo/paytm_logo_paymodes.svg"; } } diff --git a/Magento_V2.3+/app/code/One97/Paytm/view/frontend/web/js/view/payment/method-renderer/one97-paytm.js b/Magento_V2.3+/app/code/One97/Paytm/view/frontend/web/js/view/payment/method-renderer/one97-paytm.js index 80f6880..e8edb3b 100755 --- a/Magento_V2.3+/app/code/One97/Paytm/view/frontend/web/js/view/payment/method-renderer/one97-paytm.js +++ b/Magento_V2.3+/app/code/One97/Paytm/view/frontend/web/js/view/payment/method-renderer/one97-paytm.js @@ -54,10 +54,10 @@ define( if (event) { event.preventDefault(); //$("#paywithpaytm").addClass('paytmtoggle'); - if ($("#paywithpaytm").hasClass('paytmtoggle')) { + /* if ($("#paywithpaytm").hasClass('paytmtoggle')) { togglepoup = true; window.Paytm.CheckoutJS.invoke(); - } + } */ } diff --git a/Magento_v2.x/app/code/One97/Paytm/Helper/Data.php b/Magento_v2.x/app/code/One97/Paytm/Helper/Data.php index 75666d5..fc15dde 100755 --- a/Magento_v2.x/app/code/One97/Paytm/Helper/Data.php +++ b/Magento_v2.x/app/code/One97/Paytm/Helper/Data.php @@ -9,21 +9,21 @@ class Data extends AbstractHelper { protected $session; // PaytmConstants.php start - CONST TRANSACTION_STATUS_URL_PRODUCTION = "https://securegw.paytm.in/order/status"; - CONST TRANSACTION_STATUS_URL_STAGING = "https://securegw-stage.paytm.in/order/status"; + CONST TRANSACTION_STATUS_URL_PRODUCTION = "https://secure.paytmpayments.com/order/status"; + CONST TRANSACTION_STATUS_URL_STAGING = "https://securestage.paytmpayments.com/order/status"; - CONST PRODUCTION_HOST = "https://securegw.paytm.in/"; - CONST STAGING_HOST = "https://securegw-stage.paytm.in/"; + CONST PRODUCTION_HOST = "https://secure.paytmpayments.com/"; + CONST STAGING_HOST = "https://securestage.paytmpayments.com/"; CONST ORDER_PROCESS_URL = "order/process"; CONST ORDER_STATUS_URL = "order/status"; CONST INITIATE_TRANSACTION_URL = "theia/api/v1/initiateTransaction"; CONST CHECKOUT_JS_URL = "merchantpgpui/checkoutjs/merchants/MID.js"; - CONST TRANSACTION_URL_PRODUCTION = "https://securegw.paytm.in/order/process"; + CONST TRANSACTION_URL_PRODUCTION = "https://secure.paytmpayments.com/order/process"; - CONST TRANSACTION_URL_STAGING = "https://securegw-stage.paytm.in/order/process"; + CONST TRANSACTION_URL_STAGING = "https://securestage.paytmpayments.com/order/process"; CONST SAVE_PAYTM_RESPONSE = true; @@ -35,14 +35,14 @@ class Data extends AbstractHelper { CONST CONNECT_TIMEOUT = "10"; CONST TIMEOUT = "10"; - CONST LAST_UPDATED = "20200120"; - CONST PLUGIN_VERSION = "2.0"; + CONST LAST_UPDATED = "20241015"; + CONST PLUGIN_VERSION = "2.1"; CONST CUSTOM_CALLBACK_URL = ""; - CONST TRANSACTION_TOKEN_URL_PRODUCTION = "https://securegw.paytm.in/theia/api/v1/initiateTransaction?mid="; + CONST TRANSACTION_TOKEN_URL_PRODUCTION = "https://secure.paytmpayments.com/theia/api/v1/initiateTransaction?mid="; - CONST TRANSACTION_TOKEN_URL_STAGING = "https://securegw-stage.paytm.in/theia/api/v1/initiateTransaction?mid="; + CONST TRANSACTION_TOKEN_URL_STAGING = "https://securestage.paytmpayments.com/theia/api/v1/initiateTransaction?mid="; // PaytmConstants.php end @@ -200,7 +200,7 @@ static private function pkcs5Pad($text, $blocksize) { } static private function pkcs5Unpad($text) { - $pad = ord($text{strlen($text) - 1}); + $pad = ord($text[strlen($text) - 1]); if ($pad > strlen($text)) return false; return substr($text, 0, -1 * $pad);