Changeset 2938292
- Timestamp:
- 07/13/2023 02:38:51 PM (3 years ago)
- Location:
- paytm-payments/trunk
- Files:
-
- 12 added
- 1 deleted
- 5 edited
-
assets/279 (deleted)
-
assets/280 (added)
-
assets/280/css (added)
-
assets/280/css/admin (added)
-
assets/280/css/admin/paytm-payments.css (added)
-
assets/280/css/paytm-payments.css (added)
-
assets/280/images (added)
-
assets/280/images/paytm_logo_invert.svg (added)
-
assets/280/images/paytm_logo_paymodes.svg (added)
-
assets/280/js (added)
-
assets/280/js/admin (added)
-
assets/280/js/admin/paytm-payments.js (added)
-
assets/280/js/paytm-payments.js (added)
-
class.paytm.php (modified) (2 diffs)
-
includes/PaytmConstants.php (modified) (1 diff)
-
includes/PaytmHelper.php (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
-
woo-paytm.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
paytm-payments/trunk/class.paytm.php
r2904623 r2938292 20 20 if ($invertLogo == 1) { 21 21 $this->icon= esc_url("https://staticpg.paytm.in/pg_plugins_logo/paytm_logo_invert.svg"); 22 } else { 22 } 23 else { 23 24 $this->icon= esc_url("https://staticpg.paytm.in/pg_plugins_logo/paytm_logo_paymodes.svg"); 24 25 } … … 266 267 // Transaction URL is not working properly or not able to communicate with paytm 267 268 if (!empty(PaytmHelper::getPaytmURL(PaytmConstants::ORDER_STATUS_URL, $this->getSetting('environment')))) { 269 //wp_remote_get($url, array('sslverify' => FALSE)); 270 268 271 $response = (array)wp_remote_get(PaytmHelper::getPaytmURL(PaytmConstants::ORDER_STATUS_URL, $this->getSetting('environment'))); 269 272 if (!empty($response['errors'])) { -
paytm-payments/trunk/includes/PaytmConstants.php
r2904648 r2938292 24 24 CONST TIMEOUT= 10; 25 25 26 CONST LAST_UPDATED= "20230 426";27 CONST PLUGIN_VERSION= "2. 7.9";28 CONST PLUGIN_VERSION_FOLDER= "2 79";26 CONST LAST_UPDATED= "20230713"; 27 CONST PLUGIN_VERSION= "2.8.0"; 28 CONST PLUGIN_VERSION_FOLDER= "280"; 29 29 30 30 CONST CUSTOM_CALLBACK_URL= ""; -
paytm-payments/trunk/includes/PaytmHelper.php
r2904623 r2938292 64 64 $ch = curl_init(trim($transaction_status_url)); 65 65 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 66 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 67 66 68 $res = curl_exec($ch); 67 69 curl_close($ch); … … 106 108 'headers' => $headers, 107 109 'body' => json_encode($requestParamList, JSON_UNESCAPED_SLASHES), 108 'method' => $method 110 'method' => $method, 109 111 ); 110 112 -
paytm-payments/trunk/readme.txt
r2904623 r2938292 2 2 Contributors: integrationdevpaytm 3 3 Tags: Paytm, Paytm Payments, PayWithPaytm, Paytm WooCommerce, Paytm Plugin, Paytm Payment Gateway 4 Requires PHP: 5.64 Requires PHP: 7.4 5 5 Requires at least: 4.0.1 6 6 Tested up to: 6.2 7 Stable tag: 2. 7.97 Stable tag: 2.8.0 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 17 17 * Wordpress v3.9.2 or higher 18 18 * Woocommerce v2.4 or higher 19 * PHP v 5.6.0 or higher19 * PHP v7.4.0 or higher 20 20 * Php-curl 21 21 … … 100 100 == Changelog == 101 101 102 = 2.8.0 = 103 * Compatible and tested with WooCommerce version up to 7.8.2. 104 * Supports HPOS WooCommerce feature. 105 * Enhanced security with updates. 106 102 107 = 2.7.9 = 103 108 * Compatible and tested with Woocommerce version upto 7.5.1 104 * Optimize JS and CSS109 * Optimized JS and CSS 105 110 * Updated Security 106 111 -
paytm-payments/trunk/woo-paytm.php
r2904623 r2938292 4 4 * Plugin URI: https://github.com/Paytm/ 5 5 * Description: This plugin allow you to accept payments using Paytm. This plugin will add a Paytm Payment option on WooCommerce checkout page, when user choses Paytm as Payment Method, he will redirected to Paytm website to complete his transaction and on completion his payment, paytm will send that user back to your website along with transactions details. This plugin uses server-to-server verification to add additional security layer for validating transactions. Admin can also see payment status for orders by navigating to WooCommerce > Orders from menu in admin. 6 * Version: 2. 7.96 * Version: 2.8.0 7 7 * Author: Paytm 8 8 * Author URI: https://business.paytm.com/payment-gateway … … 10 10 * Requires at least: 4.0.1 11 11 * Tested up to: 6.2 12 * Requires PHP: 5.612 * Requires PHP: 7.4 13 13 * Text Domain: Paytm Payments 14 14 * WC requires at least: 2.0.0 15 * WC tested up to: 7. 5.115 * WC tested up to: 7.8.2 16 16 */ 17 17 … … 25 25 } 26 26 27 28 use Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController; 29 30 27 31 require_once __DIR__.'/includes/PaytmHelper.php'; 28 32 require_once __DIR__.'/includes/PaytmChecksum.php'; 29 33 34 35 add_action( 'before_woocommerce_init', function() { 36 if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { 37 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); 38 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'product_block_editor', __FILE__, true ); 39 } 40 } ); 41 30 42 add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'woocommerce_paytm_add_action_links'); 43 31 44 function woocommerce_paytm_add_action_links( $links ) 32 45 { … … 68 81 global $wpdb; 69 82 $table_name = $wpdb->prefix . 'paytm_order_data'; 70 $sql = "DROP TABLE IF EXISTS $table_name"; 71 $wpdb->query($sql); 83 $query = "SELECT * FROM $table_name"; 84 $results = $wpdb->get_results($query); 85 if(count($results) <= 0 ){ 86 $sql = "DROP TABLE IF EXISTS $table_name"; 87 $wpdb->query($sql); 88 } 72 89 delete_option('woocommerce_paytm_settings'); 73 90 } … … 88 105 add_action( 'wp_enqueue_scripts', 'paytmWoopayment_js_css' ); 89 106 90 91 107 if (PaytmConstants::SAVE_PAYTM_RESPONSE) { 108 92 109 // Add a paytm payments box only for shop_order post type (order edit pages) 93 110 add_action('add_meta_boxes', 'add_paytm_payment_block'); 111 112 //Function changes for woocommerce HPOS features 94 113 function add_paytm_payment_block() 95 114 { 115 96 116 global $wpdb; 97 117 $settings = get_option("woocommerce_paytm_settings"); 98 $post_id1 = sanitize_text_field( $_GET['post']);118 $post_id1 = sanitize_text_field(isset($_GET['post']) ? $_GET['post'] : ''); 99 119 $post_id = preg_replace('/[^a-zA-Z0-9]/', '', $post_id1); 120 121 122 if ($post_id == '' && get_option("woocommerce_custom_orders_table_enabled") == 'yes') { 123 $post_id = isset($_GET['id']) ? $_GET['id'] : ''; 124 } 125 100 126 if(! $post_id ) return; // Exit 101 127 $screen = wc_get_container()->get( CustomOrdersTableController::class )->custom_orders_table_usage_is_enabled() 128 ? wc_get_page_screen_id( 'shop-order' ) 129 : 'shop_order'; 102 130 $results = getPaytmOrderData($post_id); 131 103 132 // paytm enabled and order is exists with paym_order_data 104 133 if ($settings['enabled'] == 'yes' && !empty($results)) { 105 add_meta_box('_paytm_response_table', __('Paytm Payments'), '_paytm_response_table', 'shop_order', 'normal', 'default', array('results' => $results134 add_meta_box('_paytm_response_table', __('Paytm Payments'), '_paytm_response_table', $screen, 'normal', 'default', array('results' => $results 106 135 ) 107 136 ); … … 110 139 111 140 function _paytm_response_table($post = array(),$data = array()) 112 { 141 { 113 142 //Echoing HTML safely start 114 143 global $allowedposttags; … … 195 224 } 196 225 $table_html .= '</div>'; 226 echo $table_html;die; 197 227 198 228 echo wp_kses($table_html, $allowedposttags); 199 229 } 230 231 200 232 function getPaytmOrderData($order_id) 201 233 { … … 203 235 $sql = "SELECT * FROM `".$wpdb->prefix ."paytm_order_data` WHERE `order_id` = '".$order_id."' ORDER BY `id` DESC LIMIT 1"; 204 236 return $wpdb->get_row($sql, "ARRAY_A"); 237 } 238 239 function get_custom_order($order_id) { 240 global $wpdb; 241 $table_name = $wpdb->prefix . 'wc_orders'; 242 243 $order = $wpdb->get_row( 244 $wpdb->prepare( 245 "SELECT * FROM $table_name WHERE id = %d", 246 $order_id 247 ), 248 ARRAY_A 249 ); 250 251 if ($order) { 252 $order_data = maybe_unserialize($order['order_data']); 253 254 // Additional processing if needed 255 256 return $order_data; 257 } 258 259 return null; 205 260 } 206 261 … … 324 379 require_once(plugin_basename('class.paytm.php')); 325 380 381 326 382 add_filter('woocommerce_payment_gateways', 'woocommerce_add_paytm_gateway' ); 327 383 function woocommerce_add_paytm_gateway($methods)
Note: See TracChangeset
for help on using the changeset viewer.