Plugin Directory

Changeset 2672583


Ignore:
Timestamp:
02/03/2022 11:48:32 PM (4 years ago)
Author:
rexak
Message:

rechecking escaped and sanitized data. moved admin setting js to new file

Location:
cardconnect-payment-module
Files:
43 added
3 edited

Legend:

Unmodified
Added
Removed
  • cardconnect-payment-module/trunk/cardconnect-payment-gateway.php

    r2672551 r2672583  
    44     * Plugin URI: https://wordpress.org/plugins/cardconnect-payment-module
    55     * Description: Accept credit card payments in your WooCommerce store.
    6      * Version: 3.4.10
     6     * Version: 3.4.11
    77     * Author: Fiserv <nicole.anderson@fiserv.com>
    88     * Author URI: https://cardconnect.com
     
    1313     * WC tested up to: 6.1.1
    1414     *
    15      * @version 3.4.10
     15     * @version 3.4.11
    1616     * @author  CardPointe/RexAK
    1717     */
     
    2525    }
    2626
    27     define('WC_CARDCONNECT_VER', '3.4.10');
     27    define('WC_CARDCONNECT_VER', '3.4.11');
    2828    define('WC_CARDCONNECT_PLUGIN_PATH', untrailingslashit(plugin_basename(__DIR__)));
    2929    define('WC_CARDCONNECT_ASSETS_URL', untrailingslashit(plugin_dir_url(__FILE__)) . '/assets/');
     
    3333    add_action('plugins_loaded', 'CardConnectPaymentGateway_init', 0);
    3434    add_action('wp_ajax_admin_banned_cards', 'admin_banned_cards', 10);
     35    add_action('admin_enqueue_scripts', 'cc_admin_page_scripts');
     36
     37    function cc_admin_page_scripts() {
     38        wp_enqueue_script('woo-settings', plugins_url('javascript/setting.js', __FILE__), array('jquery'), '3.4.11', true);
     39        wp_localize_script('woo-settings', 'ajax_var', array(
     40            'url'   => admin_url('admin-ajax.php'),
     41            'nonce' => wp_create_nonce('admin_banned_cards')
     42        ));
     43
     44    }
    3545
    3646    function admin_banned_cards() {
  • cardconnect-payment-module/trunk/classes/class-wc-gateway-cardconnect.php

    r2672502 r2672583  
    989989                </td>
    990990            </tr>
    991             <script>
    992                 (function ($) {
    993                     console.log('textarea');
    994                     $('td.custom_button a').on('click', function (evt) {
    995                         evt.preventDefault();
    996                         var selected = $('select#woocommerce_card_connect_cc_banned').val();
    997                         var data = {
    998                             'action': 'admin_banned_cards',
    999                             'card_to_remove': selected,
    1000                             '_ajax_nonce': "<?php echo wp_create_nonce('admin_banned_cards');?>",
    1001                         };
    1002                         $.ajax({
    1003                             url: ajaxurl,
    1004                             type: 'POST',
    1005                             data: data,
    1006                             dataType: 'json',
    1007                             success: function (response) {
    1008                                 if (response === 'refresh') {
    1009                                     $.each(selected, function (index, val) {
    1010                                         $("select#woocommerce_card_connect_cc_banned option[value='" + val + "']").remove();
    1011                                     });
    1012                                     setTimeout(function () {
    1013                                         $('button.button-primary.woocommerce-save-button').click();
    1014 
    1015                                     }, 500);
    1016                                 } else {
    1017                                     alert(response);
    1018                                 }
    1019                             }
    1020                         });
    1021                         console.log(selected);
    1022                     });
    1023                 })(jQuery);
    1024             </script>
     991
    1025992
    1026993            <?php
  • cardconnect-payment-module/trunk/readme.txt

    r2672551 r2672583  
    134134= 3.4.11 =
    135135* deleted: cruft example files
     136* change: moved inline JQ to separate file
    136137
    137138= 3.4.9 =
Note: See TracChangeset for help on using the changeset viewer.