Plugin Directory

Changeset 3253883


Ignore:
Timestamp:
03/11/2025 09:21:50 AM (11 months ago)
Author:
cartasi
Message:

v 7.5.0

Location:
nexi-xpay-build
Files:
102 added
6 edited

Legend:

Unmodified
Added
Removed
  • nexi-xpay-build/trunk/README.md

    r3219516 r3253883  
    55Author: Nexi Payments SpA
    66Requires at least: 4.6
    7 Tested up to: 6.7.1
     7Tested up to: 6.7.2
    88WC Requires at least: 2.7.0
    9 WC Tested up to: 9.5.1
    10 Stable tag: 7.4.1
     9WC Tested up to: 9.7.1
     10Stable tag: 7.5.0
    1111License: GNU General Public License v3.0
    1212License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    281281= 7.4.1 =
    282282 * Fixed - Minor issues
     283
     284= 7.5.0 =
     285 * Added new payment method: Click to Pay
     286 * Added language compatibility: German, Czech, Romanian, Slovak, Hungarian, Polish
     287 * Fixed - Minor issues
  • nexi-xpay-build/trunk/assets/js/xpay-build.js

    r3017117 r3253883  
    1616        checkCanSavePaymentMethod();
    1717
    18         jQuery("input[name='wc-xpay_build-payment-token']").on("change", function () {
     18        jQuery(document).on("change", "input[name='wc-xpay_build-payment-token']", function () {
     19            checkCanSavePaymentMethod();
     20        });
     21
     22        jQuery(document).on("change", "ul.woocommerce-SavedPaymentMethods", function () {
    1923            checkCanSavePaymentMethod();
    2024        });
     
    3943
    4044        if (jQuery("#xpay_build_border_color_error").val()) {
    41             jQuery("#xpay-card").css(
    42                 "border",
    43                 "1px solid " + jQuery("#xpay_build_border_color_error").val()
    44             );
     45            jQuery("#xpay-card").css("border", "1px solid " + jQuery("#xpay_build_border_color_error").val());
    4546        }
    4647    } else {
     
    4950
    5051        if (jQuery("#xpay_build_border_color_default").val()) {
    51             jQuery("#xpay-card").css(
    52                 "border",
    53                 "1px solid " + jQuery("#xpay_build_border_color_default").val()
    54             );
     52            jQuery("#xpay-card").css("border", "1px solid " + jQuery("#xpay_build_border_color_default").val());
    5553        }
    5654    }
     
    8482
    8583        displayError.textContent = "[" + response.errore.codice + "] " + response.errore.messaggio;
     84
    8685        document.getElementById("place_order").disabled = false;
    8786
    88         htmlErr =
    89             '<div class="woocommerce-NoticeGroup woocommerce-NoticeGroup-checkout">\n<ul class="woocommerce-error" role="alert"><li>' +
    90             jQuery("#xpay_msg_err").val() +
    91             "</li></ul></div>";
     87        htmlErr = '<div class="woocommerce-NoticeGroup woocommerce-NoticeGroup-checkout">\n<ul class="woocommerce-error" role="alert"><li>' + jQuery("#xpay_msg_err").val() + "</li></ul></div>";
    9288
    9389        jQuery("form.checkout").prepend(htmlErr);
    94         jQuery("html,body").animate({ scrollTop: 0 }, "slow");
     90        jQuery("html,body").animate({scrollTop: 0}, "slow");
    9591        jQuery("body").trigger("update_checkout");
    9692    }
     
    10096    if (jQuery("#payment_method_xpay_build").is(":checked")) {
    10197        if (jQuery("#xpayNonce").val().length === 0) {
    102             if (
    103                 typeof jQuery('input[name="wc-xpay_build-payment-token"]:checked').val() ===
    104                     "undefined" ||
    105                 "new" === jQuery('input[name="wc-xpay_build-payment-token"]:checked').val()
    106             ) {
    107                 jQuery("#xpay_build_transactionId").val(
    108                     jQuery("#xpay_build_transactionId").attr("data-new-card-value")
    109                 );
    110 
    111                 jQuery("#xpay_build_num_contratto").val(
    112                     jQuery("#xpay_build_num_contratto").attr("data-new-card-value")
    113                 );
     98            if (typeof jQuery('input[name="wc-xpay_build-payment-token"]:checked').val() === "undefined" || "new" === jQuery('input[name="wc-xpay_build-payment-token"]:checked').val()) {
     99                jQuery("#xpay_build_transactionId").val(jQuery("#xpay_build_transactionId").attr("data-new-card-value"));
     100
     101                jQuery("#xpay_build_num_contratto").val(jQuery("#xpay_build_num_contratto").attr("data-new-card-value"));
    114102
    115103                XPay.createNonce("wc-xpay-cc-form", card["xpay-card"]);
    116104            } else {
    117                 selectedSavedCard = jQuery(
    118                     'input[name="wc-xpay_build-payment-token"]:checked'
    119                 ).val();
     105                selectedSavedCard = jQuery('input[name="wc-xpay_build-payment-token"]:checked').val();
     106
    120107                tokenObject = jQuery("div[data-wc-id='" + selectedSavedCard + "']");
    121108
     
    129116                XPay.createNonce("wc-xpay-cc-form", card[instanceId]);
    130117            }
     118
    131119            return false;
    132120        } else {
     
    137125
    138126function checkCanSavePaymentMethod() {
    139     if (
    140         jQuery("#wc-xpay_build-payment-token-new").length &&
    141         !jQuery("#wc-xpay_build-payment-token-new").is(":checked")
    142     ) {
     127    if (parseInt(jQuery('.payment_method_xpay_build ul.woocommerce-SavedPaymentMethods').data('count')) > 0 && jQuery("#wc-xpay_build-payment-token-new").length && !jQuery("#wc-xpay_build-payment-token-new").is(":checked")) {
    143128        jQuery("#save-card").removeAttr("checked");
    144129
     
    165150    });
    166151
    167     jQuery(document).on("change", 'input[name="wc-xpay_build-new-payment-method"]', function () {
     152    jQuery(document).on("change", '#save-card', function () {
    168153        var requestType = "PA";
    169154
    170         if (jQuery(this).is(":checked")) {
     155        if (jQuery("#save-card").is(":checked")) {
    171156            requestType = "PP";
    172157        }
     
    174159        XPay.updateConfig(card["xpay-card"], {
    175160            serviceType: "paga_oc3d",
    176             requestType: requestType,
     161            requestType: requestType
    177162        });
    178163    });
     
    180165    // if any error is returned from the payment process, forces form to refresh and reload the build form
    181166    jQuery(document.body).on("checkout_error", function () {
    182         if (
    183             jQuery("#payment_method_xpay_build").is(":checked") &&
    184             ("new" === jQuery('input[name="wc-xpay_build-payment-token"]:checked').val() ||
    185                 typeof jQuery('input[name="wc-xpay_build-payment-token"]:checked').val() ===
    186                     "undefined")
    187         ) {
     167        if (jQuery("#payment_method_xpay_build").is(":checked") && ("new" === jQuery('input[name="wc-xpay_build-payment-token"]:checked').val() || typeof jQuery('input[name="wc-xpay_build-payment-token"]:checked').val() === "undefined")) {
    188168            if (jQuery("#xpayNonce").val().length !== 0) {
    189169                jQuery("form.checkout").trigger("update");
     
    210190            baseConfig: {
    211191                apiKey: xpay_new_payment_info.apiKey,
    212                 enviroment: xpay_new_payment_info.enviroment,
     192                enviroment: xpay_new_payment_info.enviroment
    213193            },
    214194            paymentParams: {
     
    217197                url: "",
    218198                urlPost: "",
    219                 urlBack: "",
     199                urlBack: ""
    220200            },
    221201            customParams: {},
    222             language: xpay_new_payment_info.language,
     202            language: xpay_new_payment_info.language
    223203        };
    224204
     
    229209            cardHolderAcctInfo: {}
    230210        };
    231    
    232         if (xpay_new_payment_info.Buyer_email != '') {
     211
     212        if (xpay_new_payment_info.Buyer_email !== '') {
    233213            tds_param.buyer.email = xpay_new_payment_info.Buyer_email;
    234214        }
    235         if (xpay_new_payment_info.Buyer_homePhone != '') {
     215        if (xpay_new_payment_info.Buyer_homePhone !== '') {
    236216            tds_param.buyer.homePhone = xpay_new_payment_info.Buyer_homePhone;
    237217        }
    238         if (xpay_new_payment_info.Buyer_account != '') {
     218        if (xpay_new_payment_info.Buyer_account !== '') {
    239219            tds_param.buyer.account = xpay_new_payment_info.Buyer_account;
    240220        }
    241    
    242         if (xpay_new_payment_info.Dest_city != '') {
     221
     222        if (xpay_new_payment_info.Dest_city !== '') {
    243223            tds_param.destinationAddress.city = xpay_new_payment_info.Dest_city;
    244224        }
    245         if (xpay_new_payment_info.Dest_country != '') {
     225        if (xpay_new_payment_info.Dest_country !== '') {
    246226            tds_param.destinationAddress.countryCode = xpay_new_payment_info.Dest_country;
    247227        }
    248         if (xpay_new_payment_info.Dest_street != '') {
     228        if (xpay_new_payment_info.Dest_street !== '') {
    249229            tds_param.destinationAddress.street = xpay_new_payment_info.Dest_street;
    250230        }
    251         if (xpay_new_payment_info.Dest_street2 != '') {
     231        if (xpay_new_payment_info.Dest_street2 !== '') {
    252232            tds_param.destinationAddress.street2 = xpay_new_payment_info.Dest_street2;
    253233        }
    254         if (xpay_new_payment_info.Dest_cap != '') {
     234        if (xpay_new_payment_info.Dest_cap !== '') {
    255235            tds_param.destinationAddress.postalCode = xpay_new_payment_info.Dest_cap;
    256236        }
    257         if (xpay_new_payment_info.Dest_state != '') {
     237        if (xpay_new_payment_info.Dest_state !== '') {
    258238            tds_param.destinationAddress.stateCode = xpay_new_payment_info.Dest_state;
    259239        }
    260    
    261         if (xpay_new_payment_info.Bill_city != '') {
     240
     241        if (xpay_new_payment_info.Bill_city !== '') {
    262242            tds_param.billingAddress.city = xpay_new_payment_info.Bill_city;
    263243        }
    264         if (xpay_new_payment_info.Bill_country != '') {
     244        if (xpay_new_payment_info.Bill_country !== '') {
    265245            tds_param.billingAddress.countryCode = xpay_new_payment_info.Bill_country;
    266246        }
    267         if (xpay_new_payment_info.Bill_street != '') {
     247        if (xpay_new_payment_info.Bill_street !== '') {
    268248            tds_param.billingAddress.street = xpay_new_payment_info.Bill_street;
    269249        }
    270         if (xpay_new_payment_info.Bill_street2 != '') {
     250        if (xpay_new_payment_info.Bill_street2 !== '') {
    271251            tds_param.billingAddress.street2 = xpay_new_payment_info.Bill_street2;
    272252        }
    273         if (xpay_new_payment_info.Bill_cap != '') {
     253        if (xpay_new_payment_info.Bill_cap !== '') {
    274254            tds_param.billingAddress.postalCode = xpay_new_payment_info.Bill_cap;
    275255        }
    276         if (xpay_new_payment_info.Bill_state != '') {
     256        if (xpay_new_payment_info.Bill_state !== '') {
    277257            tds_param.billingAddress.stateCode = xpay_new_payment_info.Bill_state;
    278258        }
    279    
    280         if (xpay_new_payment_info.chAccDate != '') {
     259
     260        if (xpay_new_payment_info.chAccDate !== '') {
    281261            tds_param.cardHolderAcctInfo.chAccDate = xpay_new_payment_info.chAccDate;
    282262        }
    283         if (xpay_new_payment_info.chAccAgeIndicator != '') {
     263        if (xpay_new_payment_info.chAccAgeIndicator !== '') {
    284264            tds_param.cardHolderAcctInfo.chAccAgeIndicator = xpay_new_payment_info.chAccAgeIndicator;
    285265        }
    286         if (xpay_new_payment_info.nbPurchaseAccount != '') {
     266        if (xpay_new_payment_info.nbPurchaseAccount !== '') {
    287267            tds_param.cardHolderAcctInfo.nbPurchaseAccount = xpay_new_payment_info.nbPurchaseAccount;
    288268        }
    289         if (xpay_new_payment_info.destinationAddressUsageDate != '') {
     269        if (xpay_new_payment_info.destinationAddressUsageDate !== '') {
    290270            tds_param.cardHolderAcctInfo.destinationAddressUsageDate = xpay_new_payment_info.destinationAddressUsageDate;
    291271        }
    292         if (xpay_new_payment_info.destinationNameIndicator != '') {
     272        if (xpay_new_payment_info.destinationNameIndicator !== '') {
    293273            tds_param.cardHolderAcctInfo.destinationNameIndicator = xpay_new_payment_info.destinationNameIndicator;
    294274        }
    295    
     275
    296276        if (Object.keys(tds_param.buyer).length === 0) {
    297277            delete tds_param.buyer;
     
    307287        }
    308288
    309         var enabled3ds = document.getElementById("xpay_build_3ds").value;
    310    
    311         if (enabled3ds == '1') {
     289        var enabled3ds = parseInt(document.getElementById("xpay_build_3ds").value);
     290
     291        if (enabled3ds === 1) {
    312292            xpayConfig.informazioniSicurezza = tds_param;
    313293        }
     
    340320    } catch (error) {
    341321        console.error(error);
    342     }
    343 }
     322}
     323}
  • nexi-xpay-build/trunk/src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php

    r3185787 r3253883  
    4242            'PAGOLIGHT',
    4343            'PAYPAL_BNPL',
     44            'FASTCHECKOUT',
    4445        ),
    4546        'CZK' => array(
  • nexi-xpay-build/trunk/src/classes/Nexi/WC_Gateway_XPay_API.php

    r3185787 r3253883  
    6767        $this->init_settings();
    6868
    69         $this->nexi_xpay_alias = $this->settings["nexi_xpay_alias"];
    70         $this->nexi_xpay_mac = $this->settings["nexi_xpay_mac"];
    71 
    72         $this->nexi_xpay_accounting = $this->settings["nexi_xpay_accounting"];
    73 
    74         $this->nexi_xpay_oneclick_enabled = ($this->settings["nexi_xpay_oneclick_enabled"] == "yes");
    75 
    76         $this->nexi_xpay_recurring_enabled = ($this->settings["nexi_xpay_recurring_enabled"] == "yes");
    77         $this->nexi_xpay_recurring_alias = $this->settings["nexi_xpay_recurring_alias"];
    78         $this->nexi_xpay_recurring_mac = $this->settings["nexi_xpay_recurring_mac"];
     69        $this->nexi_xpay_alias = $this->settings["nexi_xpay_alias"] ?? '';
     70        $this->nexi_xpay_mac = $this->settings["nexi_xpay_mac"] ?? '';
     71
     72        $this->nexi_xpay_accounting = $this->settings["nexi_xpay_accounting"] ?? '';
     73
     74        $this->nexi_xpay_oneclick_enabled = (($this->settings["nexi_xpay_oneclick_enabled"] ?? '') == "yes");
     75
     76        $this->nexi_xpay_recurring_enabled = (($this->settings["nexi_xpay_recurring_enabled"] ?? '') == "yes");
     77        $this->nexi_xpay_recurring_alias = $this->settings["nexi_xpay_recurring_alias"] ?? '';
     78        $this->nexi_xpay_recurring_mac = $this->settings["nexi_xpay_recurring_mac"] ?? '';
    7979        $this->nexi_xpay_group = $this->settings["nexi_xpay_group"] ?? '';
    8080
    81         $this->nexi_xpay_3ds20_enabled = ($this->settings['nexi_xpay_3ds20_enabled'] == 'yes');
     81        $this->nexi_xpay_3ds20_enabled = (($this->settings['nexi_xpay_3ds20_enabled'] ?? '') == 'yes');
    8282    }
    8383
  • nexi-xpay-build/trunk/src/classes/Nexi/WC_Gateway_XPay_Generic_Method.php

    r3087872 r3253883  
    247247            case 'de_DE':
    248248                $language_id = 'GER';
     249
     250                $currentConfig = WC_Nexi_Helper::get_nexi_settings();
     251
     252                if (WC_Nexi_Helper::nexi_array_key_exists_and_equals($currentConfig, 'nexi_gateway', GATEWAY_NPG)) {
     253                    $language_id = 'DEU';
     254                }
    249255                break;
    250256
    251257            case 'ja':
    252258                $language_id = 'GER';
     259
     260                $currentConfig = WC_Nexi_Helper::get_nexi_settings();
     261
     262                if (WC_Nexi_Helper::nexi_array_key_exists_and_equals($currentConfig, 'nexi_gateway', GATEWAY_NPG)) {
     263                    $language_id = 'DEU';
     264                }
    253265                break;
    254266
  • nexi-xpay-build/trunk/woocommerce-gateway-nexi-xpay.php

    r3209323 r3253883  
    55 * Plugin URI:
    66 * Description: Payment plugin for payment cards and alternative methods. Powered by Nexi.
    7  * Version: 7.4.1
     7 * Version: 7.5.0
    88 * Author: Nexi SpA
    99 * Author URI: https://www.nexi.it
     
    2727{
    2828    if (in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins'))) || is_plugin_active_for_network('woocommerce/woocommerce.php')) {
    29         define("WC_GATEWAY_XPAY_VERSION", "7.4.1");
     29        define("WC_GATEWAY_XPAY_VERSION", "7.5.0");
    3030
    3131        define("GATEWAY_XPAY", "xpay");
Note: See TracChangeset for help on using the changeset viewer.