Skip to content

Commit

Permalink
PPSL URL changes
Browse files Browse the repository at this point in the history
  • Loading branch information
csgarsarippsl committed Oct 16, 2024
1 parent 65598ae commit 55ced0e
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 73 deletions.
18 changes: 9 additions & 9 deletions Magento_V1.x/app/code/community/One97/Paytm/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -95,6 +96,7 @@ public function getPaytmResponseHtml($viewButton=false) {
break;

default:
$val= is_array($val)?json_encode($val):$val;
$response.=' <tr> <th>'.$k.'</th> <td>'.$val.'</td> </tr> ';
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down
76 changes: 31 additions & 45 deletions Magento_V2.3+/app/code/One97/Paytm/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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)){
Expand Down
8 changes: 4 additions & 4 deletions Magento_V2.3+/app/code/One97/Paytm/Model/Paytm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down Expand Up @@ -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";
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
} */
}


Expand Down
22 changes: 11 additions & 11 deletions Magento_v2.x/app/code/One97/Paytm/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 55ced0e

Please sign in to comment.