Changeset 2944257
- Timestamp:
- 07/27/2023 02:31:14 PM (3 years ago)
- Location:
- paytm-donation/trunk
- Files:
-
- 9 added
- 1 deleted
- 4 edited
-
assets/220 (deleted)
-
assets/221 (added)
-
assets/221/css (added)
-
assets/221/css/admin (added)
-
assets/221/css/admin/paytm-donation-admin.css (added)
-
assets/221/css/paytm-donation.css (added)
-
assets/221/js (added)
-
assets/221/js/admin (added)
-
assets/221/js/admin/paytm-donation-admin.js (added)
-
assets/221/js/paytm-donation.js (added)
-
includes/PaytmConstantsDonation.php (modified) (2 diffs)
-
paytm-donation-user-field.php (modified) (2 diffs)
-
paytm-donation.php (modified) (6 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
paytm-donation/trunk/includes/PaytmConstantsDonation.php
r2939944 r2944257 15 15 CONST APPEND_TIMESTAMP = true; 16 16 CONST X_REQUEST_ID = "PLUGIN_WORDPRESS_"; 17 CONST PLUGIN_VERSION_FOLDER = "22 0";17 CONST PLUGIN_VERSION_FOLDER = "221"; 18 18 19 19 CONST MAX_RETRY_COUNT = 3; … … 21 21 CONST TIMEOUT = 10; 22 22 23 CONST LAST_UPDATED = "202307 18";24 CONST PLUGIN_VERSION = "2.2. 0";23 CONST LAST_UPDATED = "20230727"; 24 CONST PLUGIN_VERSION = "2.2.1"; 25 25 CONST PLUGIN_DOC_URL = "https://business.paytm.com/docs/wordpress/"; 26 26 -
paytm-donation/trunk/paytm-donation-user-field.php
r2939944 r2944257 128 128 129 129 <?php $post_paytmCustomField = get_queried_object_id(); 130 echo '<input type="button" value="Save Changes" class="button-primary" id="paytm-paytmCustomFieldSave" data-action="'.admin_url('admin-ajax.php').'?action=initiate_paytmCustomFieldSave" data-id="'.$post_paytmCustomField.'" />'; 130 131 //$nonce_field = wp_nonce_field(plugin_basename(__FILE__),'hide_form_field_for_admin_nonce'); 132 133 echo '<input type="button" value="Save Changes" class="button-primary" id="paytm-paytmCustomFieldSave" data-action="'.admin_url('admin-ajax.php').'?action=initiate_paytmCustomFieldSave&nonce='.wp_create_nonce( 'hide_form_field_for_admin_nonce' ).'" data-id="'.$post_paytmCustomField.'" />'; 131 134 ?> 132 135 </form> … … 223 226 var id = jQuery(this).data('id'); 224 227 jQuery.ajax({ 225 data: data,228 data:data, 226 229 method: "POST", 227 230 url: url, 228 231 dataType: 'JSON', 229 232 success: function(result) { 230 alert("Record Saved Successfully!"); 231 location.reload(); 233 if (result.success == true) { 234 alert("Record Saved Successfully!"); 235 location.reload(); 236 }else if(result.error == true){ 237 alert(result.message); 238 location.reload(); 239 } else { 240 alert('Something went wrong. Please try again!'); 241 location.reload(); 242 } 232 243 } 233 244 }); -
paytm-donation/trunk/paytm-donation.php
r2939944 r2944257 4 4 * Plugin URI: https://business.paytm.com/docs/wordpress/ 5 5 * Description: This plugin allow you to accept donation payments using Paytm. This plugin will add a simple form that user will fill, when he clicks on submit 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 all transaction details with payment status by going to "Paytm Payment Details" from menu in admin. 6 * Version: 2.2. 06 * Version: 2.2.1 7 7 * Author: Paytm 8 8 * Author URI: https://business.paytm.com/payment-gateway … … 529 529 } 530 530 endforeach; 531 // echo $dynamic_html; 532 531 532 $nonce_field = wp_nonce_field(plugin_basename(__FILE__),'hide_form_field_for_nonce'); 533 533 534 $current_url = esc_url("//".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); 534 535 //$html = PaytmHelperDonation::getCallbackMsgPaytm(); … … 569 570 <div class="paytm-pg-donar-info">' 570 571 .$dynamic_html. 572 $nonce_field. 571 573 '</div> 572 574 … … 585 587 $paytmParams = array(); 586 588 $txntoken = ''; 589 $token_val = $_POST['token']; 590 591 if (!isset($_POST['token']) || !wp_verify_nonce( $_POST['token'], plugin_basename(__FILE__))){ 592 // Actions to do should the nonce is invalid 593 $error = array( 594 "error"=>true, 595 "message" => "Sorry, your request did not verified" 596 ); 597 echo json_encode($error); 598 wp_die(); 599 600 } 587 601 588 602 /*added code for validate data*/ … … 598 612 } 599 613 } 614 615 600 616 /*End code for validate data*/ 601 617 … … 896 912 897 913 function initiate_paytmCustomFieldSave(){ 898 echo json_encode($_POST); 899 update_option('paytm_user_field', json_encode($_POST)); 900 wp_die(); 914 if (isset($_GET['nonce'])){ 915 if ( !wp_verify_nonce( $_GET['nonce'], 'hide_form_field_for_admin_nonce' ) ){ 916 $error = array( 917 "error" => true, 918 "message" => "Sorry, your request was not verified." 919 ); 920 echo json_encode( $error ); 921 wp_die(); 922 } 923 } 924 925 //echo json_encode($_POST);wp_die(); 926 update_option('paytm_user_field', json_encode($_POST)); 927 echo json_encode(array('success'=> true)); 928 wp_die(); 901 929 } 902 930 -
paytm-donation/trunk/readme.txt
r2939944 r2944257 4 4 Requires PHP: 7.4 5 5 Requires at least: 4.9 6 Tested up to: 6.2 7 Stable tag: 2.2. 06 Tested up to: 6.2.2 7 Stable tag: 2.2.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 29 29 == Changelog == 30 30 31 = 2.2.1 = 32 * Security Fixes 33 31 34 = 2.2.0 = 32 35 * Update in manage donation form setting
Note: See TracChangeset
for help on using the changeset viewer.