Plugin Directory

Changeset 3087870


Ignore:
Timestamp:
05/16/2024 02:43:54 PM (20 months ago)
Author:
cartasi
Message:

v 7.3.2

Location:
cartasi-x-pay
Files:
122 added
21 edited

Legend:

Unmodified
Added
Removed
  • cartasi-x-pay/trunk/README.md

    r3029363 r3087870  
    55Author: Nexi Payments SpA
    66Requires at least: 4.4.0
    7 Tested up to: 6.4.2
     7Tested up to: 6.5.3
    88WC Requires at least: 2.7.0
    9 WC Tested up to: 8.5.2
    10 Stable tag: 7.3.1
     9WC Tested up to: 8.8.3
     10Stable tag: 7.3.2
    1111License: GNU General Public License v3.0
    1212License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    266266 * Changed - Management of bcmath PHP library
    267267 * Fixed - Minor issues
    268  
     268
    269269= 7.3.1 =
    270270 * Fixed - Subscription issue
     271
     272= 7.3.2 =
     273 * Added - Greek language
     274 * Added - Multicurrency with Apple Pay and Google Pay
     275 * Added - Installment payments for the Greek market
     276 * Fixed - Minor issues
  • cartasi-x-pay/trunk/assets/css/xpay.css

    r3029363 r3087870  
    2020#payment .payment_methods li[class*="payment_method_xpay"] label img:where([src*="google-pay"]) {
    2121    transform: scale(2);
     22}
     23
     24#payment .payment_methods li[class*="payment_method_xpay"] label img:where([src*="pagolight"]) {
     25    transform: scale(2.5);
    2226}
    2327
  • cartasi-x-pay/trunk/assets/js/xpay-admin.js

    r2975087 r3087870  
    1515        const GATEWAY_NPG = "npg";
    1616
    17         hideShowGatewayProperties(
    18             $(".gateway-input").length ? $(".gateway-input option:selected").val() : false
    19         );
    20 
    21         $(".gateway-input").on("change", function () {
    22             hideShowGatewayProperties($(this).val());
     17        hideShowGatewayProperties($(".gateway-input").length ? $(".gateway-input option:selected").val() : false);
     18
     19        $(".gateway-input, .installments-enabled").on("change", function () {
     20            hideShowGatewayProperties($(".gateway-input option:selected").val());
    2321        });
    2422
    2523        function hideShowGatewayProperties(flag) {
    26             if (flag == GATEWAY_NPG) {
     24            if (flag === GATEWAY_NPG) {
    2725                $(".xpay-only").each(function () {
    2826                    $($(this).parents("tr")[0]).hide();
     
    4240                    $(this).show();
    4341                });
    44             } else if (flag == false || flag == GATEWAY_XPAY) {
     42
     43                if ($('input[name$="nexi_xpay_installments_enabled"]').is(':checked')) {
     44                    $(".installments-only").each(function () {
     45                        $($(this).parents("tr")[0]).show();
     46                    });
     47                } else {
     48                    $(".installments-only").each(function () {
     49                        $($(this).parents("tr")[0]).hide();
     50                    });
     51                }
     52            } else if (flag === false || flag === GATEWAY_XPAY) {
    4553                $(".npg-only").each(function () {
     54                    $($(this).parents("tr")[0]).hide();
     55                });
     56
     57                $(".installments-only").each(function () {
    4658                    $($(this).parents("tr")[0]).hide();
    4759                });
     
    7284                "border-color",
    7385                "placeholder-color",
    74                 "color",
     86                "color"
    7587            ];
    7688
     
    8294                                styles[i],
    8395                                element.val()
    84                             );
     96                                );
    8597                        } else if (styles[i] === "placeholder-color") {
    8698                            $("#dynamicStyle").html(
    8799                                ".stylePreview .content-anteprima .Bricks input::placeholder { color: " +
    88                                     element.val() +
    89                                     "}"
    90                             );
     100                                element.val() +
     101                                "}"
     102                                );
    91103                        } else {
    92104                            $(".stylePreview .content-anteprima .Bricks input").css(
    93105                                styles[i],
    94106                                element.val()
    95                             );
     107                                );
    96108                        }
    97109                        break;
     
    117129                closeOnSelect: false,
    118130                scrollAfterSelect: true,
    119                 templateSelection: formatState,
     131                templateSelection: formatState
    120132            });
    121133        }
     
    153165                var domanda = confirm(
    154166                    jQuery("#xpay_account_form_question").val() +
    155                         " " +
    156                         amount +
    157                         " " +
    158                         jQuery("#xpay_account_form_currency_label").val() +
    159                         " ?"
    160                 );
     167                    " " +
     168                    amount +
     169                    " " +
     170                    jQuery("#xpay_account_form_currency_label").val() +
     171                    " ?"
     172                    );
    161173                if (domanda === true) {
    162174                    $("html, body").css("cursor", "wait");
     
    170182                        },
    171183                        data: {
    172                             amount: amount,
     184                            amount: amount
    173185                        },
    174186                        success: function (json) {
     
    184196                            alert(data.message);
    185197                            window.location.reload();
    186                         },
     198                        }
    187199                    });
    188200                }
     
    194206            }
    195207        });
     208
     209        function inputText(name, value) {
     210            return '<td><input type="text" name="' + name + '" value="' + value + '" /></td>';
     211        }
     212
     213        function addVariation(toAmount, nInstallments) {
     214            var randomId = 'row-variation-' + Math.floor(Math.random() * 10000000);
     215
     216            var row = '<tr id="' + randomId + '">';
     217
     218            row += inputText("to_amount", toAmount);
     219            row += inputText("n_installments", nInstallments);
     220            row += '<td><button class="button delete-ranges-variation" data-target="#' + randomId + '">' + $('#ranges-delete-label').val() + '</button></td>';
     221
     222            row += '</tr>';
     223
     224            $('#installments-ranges-variations-container table tbody').append(row);
     225        }
     226
     227        $(document).on('click', '#add-ranges-variation', function (event) {
     228            event.preventDefault();
     229
     230            addVariation("", "");
     231
     232            writeRangesVariation();
     233        });
     234
     235        $(document).on('click', '.delete-ranges-variation', function (event) {
     236            event.preventDefault();
     237
     238            $($(this).data('target')).remove();
     239
     240            writeRangesVariation();
     241        });
     242
     243        function writeRangesVariation() {
     244            if ($('#nexi_xpay_installments_ranges').length) {
     245                var variations = [];
     246
     247                $('#installments-ranges-variations-container table tbody tr').each(function () {
     248                    variations.push({
     249                        to_amount: $('#' + $(this).attr('id') + ' input[name="to_amount"]').val(),
     250                        n_installments: $('#' + $(this).attr('id') + ' input[name="n_installments"]').val()
     251                    });
     252                });
     253
     254                $('#nexi_xpay_installments_ranges').val(JSON.stringify(variations));
     255            }
     256        }
     257
     258        $(document).on('change', '#installments-ranges-variations-container input', function () {
     259            writeRangesVariation();
     260        });
     261
     262        if ($('#nexi_xpay_installments_ranges').length) {
     263            var rangesVariations = JSON.parse($('#nexi_xpay_installments_ranges').val());
     264
     265            for (var variation of rangesVariations) {
     266                addVariation(variation.to_amount, variation.n_installments);
     267            }
     268        }
    196269    });
    197270})(jQuery);
  • cartasi-x-pay/trunk/lang/woocommerce-gateway-nexi-xpay-it_IT.po

    r3017100 r3087870  
    77"gateway-nexi-xpay\n"
    88"POT-Creation-Date: 2021-11-16 09:07+0100\n"
    9 "PO-Revision-Date: 2023-12-12 10:38+0000\n"
     9"PO-Revision-Date: 2024-02-14 15:04+0000\n"
    1010"Last-Translator: \n"
    1111"Language-Team: Italiano\n"
     
    2121"X-Poedit-SearchPath-0: .\n"
    2222
    23 #: src/classes/Nexi/WC_Gateway_NPG_Cards.php:74
    24 #: src/classes/Nexi/WC_Gateway_XPay_APM.php:53
    25 #: src/classes/Nexi/WC_Gateway_NPG_APM.php:66
     23#: src/classes/Nexi/WC_Gateway_NPG_APM.php:66
     24#: src/classes/Nexi/WC_Gateway_NPG_Cards.php:79
     25#: src/classes/Nexi/WC_Gateway_XPay_APM.php:53
    2626msgid " configurations"
    2727msgstr " configurazioni"
     
    4141msgstr "%1$s che finisce con %2$s (scadenza %3$s/%4$s)"
    4242
    43 #: src/classes/Nexi/WC_Gateway_Admin.php:147
     43#: src/classes/Nexi/WC_Gateway_Admin.php:148
    4444msgid ""
    4545"(for example, shipping and / or invoicing address, payment details). Nexi "
     
    5151"raccolti separatamente ai fini della prevenzione delle frodi."
    5252
    53 #: src/classes/Nexi/WC_Gateway_Admin.php:145
    54 #: src/classes/Nexi/WC_Gateway_Admin.php:146
     53#: src/classes/Nexi/WC_Gateway_Admin.php:268
     54msgid ""
     55"1 to 99 installments, 1 for one shot payment. Before set up a configuration, "
     56"make sure to check with your payment provider what is the maximum number "
     57"accepted for your terminal."
     58msgstr ""
     59"Da 1 a 99 rate, 1 per pagamento in un'unica soluzione. Prima di impostare "
     60"una configurazione, assicurati di verificare con il tuo fornitore di servizi "
     61"di pagamento qual è il numero massimo accettato per il tuo terminale."
     62
     63#: src/classes/Nexi/WC_Gateway_Admin.php:146
     64#: src/classes/Nexi/WC_Gateway_Admin.php:147
    5565msgid "3D Secure 2 Service"
    5666msgstr "Servizio 3D Secure 2"
    5767
    58 #: src/classes/Nexi/WC_Gateway_Admin.php:137
     68#: src/classes/Nexi/WC_Gateway_Admin.php:138
    5969msgid ""
    6070"A POST notification by the Nexi servers is sent to the following address, "
     
    6474"Nexi, contenente le informazioni sull'esito del pagamento."
    6575
    66 #: templates/npg_payment_detail.php:159 templates/xpay_payment_detail.php:114
     76#: templates/xpay_payment_detail.php:114 templates/npg_payment_detail.php:166
    6777msgid "Account"
    6878msgstr "Contabilizza"
    6979
    70 #: src/classes/Nexi/WC_Gateway_Admin.php:206
     80#: src/classes/Nexi/WC_Gateway_Admin.php:207
    7181msgid "Accounting"
    7282msgstr "Contabilizzazione"
     
    7787msgstr "Contabilizzazione della transazione %s effettuata con successo"
    7888
    79 #: templates/npg_payment_detail.php:97 templates/xpay_payment_detail.php:62
     89#: templates/xpay_payment_detail.php:62 templates/npg_payment_detail.php:104
    8090msgid "Accounting operations"
    8191msgstr "Operazioni contabili"
    8292
    83 #: templates/npg_payment_detail.php:156
     93#: templates/npg_payment_detail.php:163
    8494msgid "Accounting successful"
    8595msgstr "Contabilizzazione avvenuta con successo"
     
    8999msgstr "Attiva il metodo di pagamento PagoDIL all'interno del negozio."
    90100
    91 #: src/classes/Nexi/WC_Gateway_Admin.php:175
     101#: src/classes/Nexi/WC_Gateway_Admin.php:279
     102msgid "Add amount and installments for each row. The installments limit is 99"
     103msgstr "Aggiungi importo e rate per ogni riga. Il limite delle rate è 99"
     104
     105#: src/classes/Nexi/WC_Gateway_Admin.php:455
     106msgid "Add rule"
     107msgstr "Aggiungi regola"
     108
     109#: src/classes/Nexi/WC_Gateway_Admin.php:176
    92110msgid "Alias"
    93111msgstr "Alias"
    94112
    95 #: src/classes/Nexi/WC_Gateway_Admin.php:164
     113#: src/classes/Nexi/WC_Gateway_Admin.php:165
    96114msgid "Alias and MAC Key"
    97115msgstr "Alias - Chiave MAC"
     
    101119msgstr "Tutte le categorie"
    102120
    103 #: templates/npg_payment_detail.php:109 templates/xpay_payment_detail.php:74
     121#: templates/xpay_payment_detail.php:74 templates/npg_payment_detail.php:116
    104122msgid "Amount"
    105123msgstr "Importo"
    106124
    107 #: templates/npg_payment_detail.php:83 templates/xpay_payment_detail.php:41
     125#: templates/xpay_payment_detail.php:41 templates/npg_payment_detail.php:90
    108126msgid "Amount: "
    109127msgstr "Importo: "
    110128
    111 #: src/classes/Nexi/WC_Gateway_XPay_APM.php:77
    112 #: src/classes/Nexi/WC_Pagodil_Widget.php:59
     129#: src/classes/Nexi/WC_Pagodil_Widget.php:59
     130#: src/classes/Nexi/WC_Gateway_XPay_APM.php:77
    113131#, php-format
    114132msgid "Amount: %s installments of %s€"
    115133msgstr "Importo: %s rate da %s€"
    116134
    117 #: src/classes/Nexi/WC_Gateway_Admin.php:190
     135#: src/classes/Nexi/WC_Gateway_Admin.php:191
    118136msgid "API Key"
    119137msgstr "API Key"
    120138
    121 #: src/classes/Nexi/WC_Gateway_Admin.php:165
     139#: src/classes/Nexi/WC_Gateway_Admin.php:166
    122140msgid "APIKey"
    123141msgstr "APIKey"
    124142
    125 #: src/classes/Nexi/WC_Gateway_NPG_Cards.php:70
    126 #: src/classes/Nexi/WC_Gateway_XPay_APM.php:49
    127 #: src/classes/Nexi/WC_Gateway_NPG_APM.php:62
     143#: src/classes/Nexi/WC_Gateway_NPG_APM.php:62
     144#: src/classes/Nexi/WC_Gateway_NPG_Cards.php:75
     145#: src/classes/Nexi/WC_Gateway_XPay_APM.php:49
    128146#| msgid "APMs do not have a custom configuration."
    129147msgid "APMs do not have a custom configuration. "
    130148msgstr "Gli APM non hanno una configurazione personalizzata."
    131149
    132 #: src/classes/Nexi/WC_Admin_Page.php:162
    133 msgid ""
    134 "Attention, bcmath PHP extension is not loaded, it is needed to list "
    135 "correctly order information and perform other operations."
    136 msgstr ""
    137 "Attenzione, l'estensione PHP bcmath non è attiva, è necessaria per elencare "
    138 "le informazioni sull'ordine ed eseguire altre operazioni."
    139 
    140 #: src/classes/Nexi/WC_Gateway_NPG_Cards.php:107
     150#: src/classes/Nexi/WC_Gateway_NPG_Cards.php:130
     151#: src/classes/Nexi/WC_Gateway_NPG_Cards_Build.php:48
    141152#: src/classes/Nexi/WC_Gateway_XPay_Cards_Build.php:174
    142 #: src/classes/Nexi/WC_Gateway_NPG_Cards_Build.php:48
    143 #: src/classes/Nexi/WC_Gateway_XPay_Generic_Method.php:75
     153#: src/classes/Nexi/WC_Gateway_XPay_Generic_Method.php:74
    144154msgid ""
    145155"Attention, the order for which you are making payment contains recurring "
     
    150160"sicuro da Nexi."
    151161
    152 #: src/classes/Nexi/WC_Gateway_Admin.php:300
     162#: src/classes/Nexi/WC_Gateway_Admin.php:341
    153163msgid "Border Color"
    154164msgstr "Colore bordo"
    155165
    156 #: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:351
     166#: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:348
    157167msgid "Buy now and pay a little by little with PagoDIL"
    158168msgstr "Acquista subito e paga un po' alla volta con PagoDIL"
    159169
    160 #: src/classes/Nexi/WC_Gateway_Admin.php:144
     170#: src/classes/Nexi/WC_Gateway_Admin.php:145
    161171msgid ""
    162172"By activating this option it is established that the terms and conditions "
     
    170180"aggiuntivi forniti dal"
    171181
    172 #: src/classes/Nexi/WC_Gateway_Admin.php:248
     182#: src/classes/Nexi/WC_Gateway_Admin.php:289
    173183msgid ""
    174184"By using this configurator you can change the look and feel of your module"
     
    180190msgstr "Impossibile connettersi."
    181191
    182 #: templates/npg_payment_detail.php:51 templates/xpay_payment_detail.php:17
     192#: templates/xpay_payment_detail.php:17 templates/npg_payment_detail.php:51
    183193msgid "Card detail"
    184194msgstr "Dettaglio carta"
     
    188198msgstr "Numero carta"
    189199
    190 #: templates/npg_payment_detail.php:57 templates/xpay_payment_detail.php:26
     200#: templates/xpay_payment_detail.php:26 templates/npg_payment_detail.php:57
    191201msgid "Card pan: "
    192202msgstr "Pan carta: "
    193203
    194 #: templates/npg_payment_detail.php:54 templates/xpay_payment_detail.php:20
     204#: templates/xpay_payment_detail.php:20 templates/npg_payment_detail.php:54
    195205msgid "Card: "
    196206msgstr "Carta: "
    197207
    198 #: templates/npg_payment_detail.php:36 templates/xpay_payment_detail.php:4
     208#: templates/xpay_payment_detail.php:4 templates/npg_payment_detail.php:36
    199209msgid "Cardholder"
    200210msgstr "Titolare carta"
     
    208218msgstr "Scegli il numero di rate"
    209219
    210 #: src/classes/Nexi/WC_Gateway_Admin.php:161
     220#: src/classes/Nexi/WC_Gateway_Admin.php:162
    211221msgid "Choose the type of credentials you have available for XPay"
    212222msgstr ""
     
    226236msgstr "Errore CURL: %s"
    227237
    228 #: src/classes/Nexi/WC_Gateway_NPG_API.php:321
     238#: src/classes/Nexi/WC_Gateway_NPG_API.php:330
    229239msgid "Customer not found."
    230240msgstr "Cliente non trovato."
    231241
    232 #: src/classes/Nexi/WC_Admin_Page.php:148
     242#: src/classes/Nexi/WC_Admin_Page.php:155
    233243msgid "Czech Kurun"
    234244msgstr "Corona Ceca"
    235245
    236 #: templates/npg_payment_detail.php:110 templates/xpay_payment_detail.php:72
     246#: templates/xpay_payment_detail.php:72 templates/npg_payment_detail.php:117
    237247msgid "Date"
    238248msgstr "Data"
    239249
    240 #: templates/npg_payment_detail.php:76 templates/xpay_payment_detail.php:38
     250#: templates/xpay_payment_detail.php:38 templates/npg_payment_detail.php:78
    241251msgid "Date: "
    242252msgstr "Data: "
    243253
    244 #: src/classes/Nexi/WC_Gateway_Admin.php:210
     254#: src/classes/Nexi/WC_Gateway_Admin.php:211
    245255msgid "Deferred"
    246256msgstr "Differita"
    247257
    248 #: templates/npg_payment_detail.php:155 templates/xpay_payment_detail.php:110
     258#: src/classes/Nexi/WC_Gateway_Admin.php:458
     259msgid "Delete"
     260msgstr "Elimina"
     261
     262#: templates/xpay_payment_detail.php:110 templates/npg_payment_detail.php:162
    249263msgid "Do you confirm to account"
    250264msgstr "Confermi di voler contabilizzare"
    251265
    252 #: src/classes/Nexi/WC_Pagodil_Widget.php:195
     266#: src/classes/Nexi/WC_Pagodil_Widget.php:202
    253267#, php-format
    254268#| msgid ""
     
    262276"il valore minimo di %s€ nel carrello"
    263277
    264 #: src/classes/Nexi/WC_Admin_Page.php:150
    265 #: src/classes/Nexi/WC_Admin_Page.php:151
     278#: src/classes/Nexi/WC_Admin_Page.php:157
     279#: src/classes/Nexi/WC_Admin_Page.php:158
    266280msgid "Dollars"
    267281msgstr "Dollari"
    268282
    269 #: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:251
     283#: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:248
    270284msgid "Easily pay with your Apple Pay wallet"
    271285msgstr "Paga facilmente con il tuo wallet Apple Pay"
    272286
    273 #: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:246
     287#: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:243
    274288msgid "Easily pay with your Google Pay wallet"
    275289msgstr "Paga facilmente con il tuo wallet Google Pay"
    276290
    277 #: src/classes/Nexi/WC_Gateway_Admin.php:216
     291#: src/classes/Nexi/WC_Gateway_Admin.php:217
    278292msgid "Enable 3D Secure 2 service"
    279293msgstr "Abilita il servizio 3D Secure 2"
    280294
    281 #: src/classes/Nexi/WC_Gateway_Admin.php:236
     295#: src/classes/Nexi/WC_Gateway_Admin.php:237
    282296#| msgid "Enable Nexi XPay for Multcurrency payments"
    283297msgid "Enable Nexi XPay for Multicurrency payments"
    284298msgstr "Abilita Nexi XPay ai pagamenti Multivaluta"
    285299
    286 #: src/classes/Nexi/WC_Gateway_Admin.php:225
     300#: src/classes/Nexi/WC_Gateway_Admin.php:226
    287301msgid "Enable Nexi XPay for OneClick payment"
    288302msgstr "Abilita Nexi XPay ai pagamenti OneClick"
    289303
    290 #: src/classes/Nexi/WC_Gateway_Admin.php:227
     304#: src/classes/Nexi/WC_Gateway_Admin.php:228
    291305msgid ""
    292306"Enable Nexi XPay for OneClick payment. Make sure that this option is also "
     
    296310"sia abilitata anche nella configurazione del tuo terminale."
    297311
    298 #: src/classes/Nexi/WC_Gateway_Admin.php:349
     312#: src/classes/Nexi/WC_Gateway_Admin.php:390
    299313msgid "Enable Nexi XPay for subscription's payment"
    300314msgstr "Abilita Nexi XPay ai pagamenti ricorrenti"
    301315
    302 #: src/classes/Nexi/WC_Gateway_Admin.php:153
    303 #: src/classes/Nexi/WC_Gateway_XPay_APM.php:63
    304 #: src/classes/Nexi/WC_Gateway_NPG_APM.php:76
     316#: src/classes/Nexi/WC_Gateway_NPG_APM.php:76
     317#: src/classes/Nexi/WC_Gateway_Admin.php:154
     318#: src/classes/Nexi/WC_Gateway_XPay_APM.php:63
    305319msgid "Enable Nexi XPay payment plugin."
    306320msgstr "Abilita il plugin di pagamento Nexi XPay."
    307321
    308 #: src/classes/Nexi/WC_Gateway_Admin.php:201
     322#: src/classes/Nexi/WC_Gateway_Admin.php:202
    309323msgid "Enable Nexi XPay plugin in testing mode."
    310324msgstr "Abilita il plugin Nexi XPay in modalità di test."
     
    323337"informazioni relative alla rateizzazione messa a disposizione sul prodotto."
    324338
    325 #: src/classes/Nexi/WC_Gateway_Admin.php:218
     339#: src/classes/Nexi/WC_Gateway_Admin.php:219
    326340msgid "Enable the sending of the fields for the 3D Secure 2 service"
    327341msgstr "Abilita l'invio dei campi aggiuntivi per il servizio 3D Secure 2"
    328342
    329 #: src/classes/Nexi/WC_Gateway_Admin.php:238
     343#: src/classes/Nexi/WC_Gateway_Admin.php:239
    330344#| msgid ""
    331345#| "Enable this option to make the payment methods available for different "
     
    344358"nella configurazione del tuo terminale."
    345359
    346 #: src/classes/Nexi/WC_Gateway_Admin.php:151
    347 #: src/classes/Nexi/WC_Gateway_XPay_APM.php:61
    348 #: src/classes/Nexi/WC_Gateway_NPG_APM.php:74
     360#: src/classes/Nexi/WC_Gateway_Admin.php:250
     361msgid ""
     362"Enable this option to use installment payments via XPay. This functionality "
     363"is only available to merchants with Greek VAT Number. Before enabling this "
     364"functionality, make sure it is available on your terminal with your payment "
     365"provider."
     366msgstr ""
     367"Abilita questa opzione per utilizzare i pagamenti rateali tramite XPay. "
     368"Questa funzionalità è disponibile solo per i commercianti con partita IVA "
     369"greca. Prima di abilitare questa funzionalità, assicurati che sia "
     370"disponibile sul tuo terminale presso il tuo fornitore di servizi di "
     371"pagamento."
     372
     373#: src/classes/Nexi/WC_Gateway_NPG_APM.php:74
     374#: src/classes/Nexi/WC_Gateway_Admin.php:152
     375#: src/classes/Nexi/WC_Gateway_XPay_APM.php:61
    349376msgid "Enable/Disable"
    350377msgstr "Abilita/Disabilita"
    351378
    352 #: src/classes/Nexi/WC_Gateway_Admin.php:234
     379#: src/classes/Nexi/WC_Gateway_Admin.php:246
     380#: src/classes/Nexi/WC_Gateway_Admin.php:248
     381msgid "Enable/Disable Installment Payments"
     382msgstr "Abilita/Disabilita pagamenti rateali"
     383
     384#: src/classes/Nexi/WC_Gateway_Admin.php:235
    353385#| msgid "Enable/Disable Multcurrency"
    354386msgid "Enable/Disable Multicurrency"
    355387msgstr "Abilita/Disabilita Multivaluta"
    356388
    357 #: src/classes/Nexi/WC_Gateway_Admin.php:223
     389#: src/classes/Nexi/WC_Gateway_Admin.php:224
    358390msgid "Enable/Disable OneClick"
    359391msgstr "Abilita/Disabilita OneClick"
    360392
    361 #: src/classes/Nexi/WC_Gateway_Admin.php:347
     393#: src/classes/Nexi/WC_Gateway_Admin.php:388
    362394msgid "Enable/Disable Recurring"
    363395msgstr "Abilita/Disabilita ricorrenze"
    364396
    365 #: src/classes/Nexi/WC_Gateway_Admin.php:199
     397#: src/classes/Nexi/WC_Gateway_Admin.php:200
    366398msgid "Enable/Disable TEST Mode"
    367399msgstr "Abilita/Disabilita modalità di TEST"
    368400
    369 #: src/classes/Nexi/WC_Gateway_Admin.php:309
     401#: src/classes/Nexi/WC_Gateway_Admin.php:350
    370402msgid "Error Border Color"
    371403msgstr "Colore bordo errore"
     
    388420msgstr "Errore durante il controllo delle credenziali."
    389421
    390 #: src/classes/Nexi/WC_Admin_Page.php:147
     422#: src/classes/Nexi/WC_Admin_Page.php:154
    391423msgid "Euros"
    392424msgstr "Euro"
     
    396428msgstr "Data scadenza: "
    397429
    398 #: src/classes/Nexi/WC_Gateway_Admin.php:258
     430#: src/classes/Nexi/WC_Gateway_Admin.php:299
    399431msgid "Font family"
    400432msgstr "Carattere"
    401433
    402 #: src/classes/Nexi/WC_Gateway_Admin.php:266
     434#: src/classes/Nexi/WC_Gateway_Admin.php:307
    403435msgid "Font size"
    404436msgstr "Dimensione Carattere"
    405437
    406 #: src/classes/Nexi/WC_Gateway_Admin.php:274
     438#: src/classes/Nexi/WC_Gateway_Admin.php:315
    407439msgid "Font style"
    408440msgstr "Stile Carattere"
    409441
    410 #: src/classes/Nexi/WC_Gateway_Admin.php:276
     442#: src/classes/Nexi/WC_Gateway_Admin.php:317
    411443msgid "Font style in the CC Form"
    412444msgstr "Lo stile del font nel form per le carte di credito"
    413445
    414 #: src/classes/Nexi/WC_Gateway_Admin.php:283
     446#: src/classes/Nexi/WC_Gateway_Admin.php:324
    415447msgid "Font variant"
    416448msgstr "Variante Carattere"
    417449
    418 #: src/classes/Nexi/WC_Gateway_Admin.php:285
     450#: src/classes/Nexi/WC_Gateway_Admin.php:326
    419451msgid "Font variant in the CC Form"
    420452msgstr "La viariante dello stile del font nel form per le carte di credito"
    421453
    422 #: src/classes/Nexi/WC_Gateway_Admin.php:136
     454#: src/classes/Nexi/WC_Gateway_Admin.php:137
    423455msgid ""
    424456"For a correct behavior of the module, check in the configuration section of "
     
    434466msgstr "Per categorie selezionate"
    435467
    436 #: src/classes/Nexi/WC_Gateway_Admin.php:192
     468#: src/classes/Nexi/WC_Gateway_Admin.php:193
    437469msgid ""
    438470"Generated from the Back Office XPay. Follow the directions in the developer "
     
    442474"sviluppatori per il procedimento di generazione corretto."
    443475
    444 #: src/classes/Nexi/WC_Gateway_Admin.php:177
    445 #: src/classes/Nexi/WC_Gateway_Admin.php:183
    446 #: src/classes/Nexi/WC_Gateway_Admin.php:356
    447 #: src/classes/Nexi/WC_Gateway_Admin.php:362
    448 #: src/classes/Nexi/WC_Gateway_Admin.php:368
     476#: src/classes/Nexi/WC_Gateway_Admin.php:178
     477#: src/classes/Nexi/WC_Gateway_Admin.php:184
     478#: src/classes/Nexi/WC_Gateway_Admin.php:397
     479#: src/classes/Nexi/WC_Gateway_Admin.php:403
     480#: src/classes/Nexi/WC_Gateway_Admin.php:409
    449481msgid "Given to Merchant by Nexi."
    450482msgstr "Fornito all'esercente da Nexi."
    451483
    452 #: src/classes/Nexi/WC_Gateway_Admin.php:366
     484#: src/classes/Nexi/WC_Gateway_Admin.php:407
    453485msgid "Group"
    454486msgstr "Gruppo"
     
    466498"verrà utilizzato dal plugin per il pagamento tramite PagoDIL."
    467499
    468 #: src/classes/Nexi/WC_Gateway_Admin.php:209
     500#: src/classes/Nexi/WC_Gateway_Admin.php:210
    469501msgid "Immediate"
    470502msgstr "Immediata"
     
    478510msgstr "Prodotti rateizzabili"
    479511
    480 #: src/classes/Nexi/WC_Gateway_NPG_Process_Completion.php:357
    481 #: src/classes/Nexi/WC_Gateway_XPay_Process_Completion.php:266
     512#: src/classes/Nexi/WC_Gateway_NPG_Cards.php:108
     513msgid "Installments"
     514msgstr "Numero di rate"
     515
     516#: templates/npg_payment_detail.php:85
     517msgid "Installments: "
     518msgstr "Numero di rate: "
     519
     520#: src/classes/Nexi/WC_Gateway_XPay_Process_Completion.php:266
     521#: src/classes/Nexi/WC_Gateway_NPG_Process_Completion.php:393
    482522msgid "Invalid amount."
    483523msgstr "Importo non valido."
    484524
    485 #: src/classes/Nexi/WC_Gateway_Admin.php:80
     525#: src/classes/Nexi/WC_Gateway_Admin.php:78
    486526msgid "Invalid API Key. Check and try again."
    487527msgstr "API Key non valida. Controlla e riprova."
    488528
    489 #: src/classes/Nexi/WC_Gateway_Admin.php:70
     529#: src/classes/Nexi/WC_Gateway_Admin.php:69
    490530msgid "Invalid credentials. Check and try again."
    491531msgstr "Credenziali non valide. Controlla e riprova."
     
    496536msgstr "Variante plugin non valida"
    497537
    498 #: src/classes/Nexi/WC_Gateway_NPG_Generic_Method.php:115
    499 #: src/classes/Nexi/WC_Gateway_XPay_Generic_Method.php:152
     538#: src/classes/Nexi/WC_Gateway_NPG_Generic_Method.php:121
     539#: src/classes/Nexi/WC_Gateway_XPay_Generic_Method.php:162
    500540msgid "Invalid refund amount."
    501541msgstr "Importo non valido."
     
    513553msgstr "Errore JSON"
    514554
    515 #: src/classes/Nexi/WC_Gateway_Admin.php:181
     555#: src/classes/Nexi/WC_Gateway_Admin.php:182
    516556msgid "Key MAC"
    517557msgstr "Chiave MAC"
    518558
    519 #: src/classes/Nexi/WC_Gateway_Admin.php:292
     559#: src/classes/Nexi/WC_Gateway_Admin.php:333
    520560msgid "Letter spacing"
    521561msgstr "Spaziatura"
     
    546586"tramite pagamenti rateali con PagoDIL. Questo valore corrisponde all'importo "
    547587"impostato nel back office XPay."
     588
     589#: src/classes/Nexi/WC_Gateway_Admin.php:446
     590msgid "Maximum installments"
     591msgstr "Numero massimo di rate"
     592
     593#: src/classes/Nexi/WC_Gateway_Admin.php:275
     594#: src/classes/Nexi/WC_Gateway_Admin.php:277
     595msgid "Maximum number of installments depending on the total order amount"
     596msgstr "Numero massimo di rate in base all'importo totale dell'ordine"
     597
     598#: src/classes/Nexi/WC_Gateway_Admin.php:263
     599#: src/classes/Nexi/WC_Gateway_Admin.php:266
     600msgid "Maximum number of installments regardless of the total order amount"
     601msgstr ""
     602"Numero massimo di rate indipendentemente dall'importo totale dell'ordine"
    548603
    549604#: src/classes/Nexi/WC_Pagodil_Configuration.php:98
     
    571626"impostato nel back office XPay."
    572627
    573 #: src/classes/Nexi/WC_Admin_Page.php:176
     628#: src/classes/Nexi/WC_Admin_Page.php:171
    574629msgid "Missing codTrans"
    575630msgstr "CodTrans mancante"
     
    579634msgstr "MM/YY"
    580635
    581 #: templates/npg_payment_detail.php:39 templates/xpay_payment_detail.php:7
     636#: templates/xpay_payment_detail.php:7 templates/npg_payment_detail.php:39
    582637msgid "Name: "
    583638msgstr "Nome: "
     
    587642msgstr "Nazionalità: "
    588643
    589 #: templates/npg_payment_detail.php:99 templates/xpay_payment_detail.php:64
     644#: templates/xpay_payment_detail.php:64 templates/npg_payment_detail.php:106
    590645msgid "New accounting operation"
    591646msgstr "Nuova operazione contabile"
    592647
    593 #: src/classes/Nexi/WC_Gateway_XPay_Cards_Build.php:118
    594 #: src/classes/Nexi/WC_Gateway_NPG_Cards_Build.php:39
     648#: src/classes/Nexi/WC_Gateway_NPG_Cards_Build.php:39
     649#: src/classes/Nexi/WC_Gateway_XPay_Cards_Build.php:118
    595650msgid "New payment methods can only be added during checkout"
    596651msgstr ""
     
    598653"dell'ordine."
    599654
    600 #: src/classes/Nexi/WC_Gateway_NPG_Cards.php:89
    601 #: src/classes/Nexi/WC_Gateway_XPay_Generic_Method.php:70
     655#: src/classes/Nexi/WC_Gateway_NPG_Cards.php:94
     656#: src/classes/Nexi/WC_Gateway_XPay_Generic_Method.php:69
    602657msgid "New payment methods can only be added during checkout."
    603658msgstr ""
     
    605660"dell'ordine."
    606661
    607 #: src/classes/Nexi/WC_Admin_Page.php:117
     662#: src/classes/Nexi/WC_Admin_Page.php:121
    608663msgid "Nexi payment details"
    609664msgstr "Dettagli pagamento Nexi"
     
    614669
    615670#. Name of the plugin
    616 #: src/classes/Nexi/WC_Gateway_Admin.php:23
    617 #: src/classes/Nexi/WC_Gateway_NPG_Cards.php:73
    618 #: src/classes/Nexi/WC_Gateway_XPay_APM.php:52
    619 #: src/classes/Nexi/WC_Gateway_NPG_APM.php:65
     671#: src/classes/Nexi/WC_Gateway_NPG_APM.php:65
     672#: src/classes/Nexi/WC_Gateway_NPG_Cards.php:78
     673#: src/classes/Nexi/WC_Gateway_Admin.php:22
     674#: src/classes/Nexi/WC_Gateway_XPay_APM.php:52
    620675msgid "Nexi XPay"
    621676msgstr "Nexi XPay"
     
    645700msgstr[1] "Nexi: Da Autorizzare (%s)"
    646701
    647 #: src/classes/Nexi/WC_Gateway_NPG_API.php:337
     702#: src/classes/Nexi/WC_Gateway_NPG_API.php:346
    648703msgid "NPG orderId not found for order: "
    649704msgstr "NPG orderId non trovato per l'ordine: "
     
    674729msgstr "Numero prodotti nel carrello (Opzionale)"
    675730
    676 #: templates/npg_payment_detail.php:86
     731#: src/classes/Nexi/WC_Gateway_NPG_Cards.php:111
     732msgid "One time solution"
     733msgstr "Unica soluzione"
     734
     735#: templates/npg_payment_detail.php:93
    677736msgid "Order ID: "
    678737msgstr "ID Ordine:"
    679738
    680 #: src/classes/Nexi/WC_Gateway_NPG_API.php:348
     739#: src/classes/Nexi/WC_Gateway_NPG_API.php:357
    681740msgid "Order not found."
    682741msgstr "Ordine non trovato."
     
    690749msgstr "Logo istituzionale PagoDIL"
    691750
    692 #: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:276
     751#: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:273
    693752msgid "Pay directly from your bank account with Giropay"
    694753msgstr "Paga in sicurezza direttamente dal tuo conto bancario con Giropay"
    695754
    696 #: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:281
     755#: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:278
    697756msgid "Pay directly from your bank account with iDEAL"
    698757msgstr "Paga in sicurezza direttamente dal tuo conto bancario con iDEAL"
    699758
    700 #: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:286
     759#: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:283
    701760msgid "Pay easily with Bancontact"
    702761msgstr "Paga facilmente con Bancontact"
    703762
    704 #: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:331
     763#: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:328
    705764msgid "Pay easily with your Amazon account"
    706765msgstr "Paga facilmente con il tuo account Amazon"
    707766
    708 #: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:326
     767#: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:323
    709768msgid "Pay easily with your Satispay account"
    710769msgstr "Paga facilmente con il tuo account Satispay"
    711770
    712 #: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:346
     771#: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:343
    713772msgid "Pay in 3 installments with Klarna interest-free"
    714773msgstr "Paga in 3 rate senza interessi tramite Klarna"
    715774
    716 #: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:341
     775#: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:338
    717776msgid "Pay in 3 or 4 installments by credit, debit or Postepay card with Oney"
    718777msgstr "Paga in 3 o 4 rate con carta di credito, debito o Postepay con Oney"
     
    722781msgstr "Paga a rate senza interessi"
    723782
    724 #: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:306
     783#: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:303
    725784msgid "Pay in one tap with your Skrill wallet"
    726785msgstr "Paga in un tap con il tuo wallet Skrill"
    727786
    728 #: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:266
     787#: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:263
    729788msgid "Pay quickly and easily with your AliPay wallet"
    730789msgstr "Paga in modo semplice e veloce con il tuo wallet AliPay"
    731790
    732 #: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:301
     791#: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:298
    733792msgid "Pay quickly and easily with your Skrill wallet"
    734793msgstr "Paga in modo semplice e veloce con il tuo wallet Skrill"
    735794
    736 #: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:271
     795#: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:268
    737796msgid "Pay quickly and easily with your WeChat Pay wallet"
    738797msgstr "Paga in modo semplice e veloce con il tuo wallet WeChat Pay"
    739798
    740 #: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:261
     799#: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:258
    741800msgid "Pay securely by bank transfer with MyBank"
    742801msgstr "Paga in sicurezza tramite bonifico bancario con MyBank"
    743802
    744 #: src/classes/Nexi/WC_Gateway_Admin.php:26
    745 #: src/classes/Nexi/WC_Gateway_NPG_Cards.php:29
    746 #: src/classes/Nexi/WC_Gateway_XPay_Cards_Build.php:46
     803#: src/classes/Nexi/WC_Gateway_NPG_Cards.php:28
    747804#: src/classes/Nexi/WC_Gateway_NPG_Cards_Build.php:29
    748 #: src/classes/Nexi/WC_Gateway_XPay_Cards.php:46
     805#: src/classes/Nexi/WC_Gateway_XPay_Cards.php:46
     806#: src/classes/Nexi/WC_Gateway_Admin.php:25
     807#: src/classes/Nexi/WC_Gateway_XPay_Cards_Build.php:46
    749808#| msgid "Pay securely by credit, debit and prepaid card through Nexi."
    750809msgid "Pay securely by credit, debit and prepaid card. Powered by Nexi."
     
    753812"Nexi."
    754813
    755 #: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:336
     814#: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:333
    756815msgid "Pay securely with your PayPal account"
    757816msgstr "Paga in sicurezza con il account PayPal"
    758817
    759 #: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:256
     818#: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:253
    760819msgid "Pay via BANCOMAT Pay just by entering your phone number"
    761820msgstr "Paga tramite BANCOMAT Pay inserendo solo il tuo numero di telefono"
     
    765824msgstr "Pagamento annullato: "
    766825
    767 #: src/classes/Nexi/WC_Gateway_NPG_Cards.php:25
    768 #: src/classes/Nexi/WC_Gateway_XPay_Cards_Build.php:25
     826#: src/classes/Nexi/WC_Gateway_NPG_Cards.php:24
    769827#: src/classes/Nexi/WC_Gateway_NPG_Cards_Build.php:25
    770 #: src/classes/Nexi/WC_Gateway_XPay_Cards.php:25
     828#: src/classes/Nexi/WC_Gateway_XPay_Cards.php:25
     829#: src/classes/Nexi/WC_Gateway_XPay_Cards_Build.php:25
    771830msgid "Payment cards"
    772831msgstr "Carte di pagamento"
     
    779838
    780839#: woocommerce-gateway-nexi-xpay.php:196
    781 #: src/classes/Nexi/WC_Gateway_NPG_Process_Completion.php:280
    782 #: src/classes/Nexi/WC_Gateway_NPG_Process_Completion.php:286
     840#: src/classes/Nexi/WC_Gateway_XPay_Process_Completion.php:154
     841#: src/classes/Nexi/WC_Gateway_XPay_Process_Completion.php:210
    783842#: src/classes/Nexi/WC_Gateway_XPay_Cards_Build.php:255
    784 #: src/classes/Nexi/WC_Gateway_XPay_Process_Completion.php:154
    785 #: src/classes/Nexi/WC_Gateway_XPay_Process_Completion.php:210
     843#: src/classes/Nexi/WC_Gateway_NPG_Process_Completion.php:316
     844#: src/classes/Nexi/WC_Gateway_NPG_Process_Completion.php:322
    786845msgid "Payment error"
    787846msgstr "Errore nel pagamento"
    788847
    789 #: src/classes/Nexi/WC_Gateway_NPG_Process_Completion.php:88
    790 #: src/classes/Nexi/WC_Gateway_XPay_Process_Completion.php:89
     848#: src/classes/Nexi/WC_Gateway_XPay_Process_Completion.php:89
     849#: src/classes/Nexi/WC_Gateway_NPG_Process_Completion.php:88
    791850msgid "Payment error, please try again"
    792851msgstr "Errore nel pagamento, riprova"
    793852
    794 #: src/classes/Nexi/WC_Gateway_NPG_Cards.php:26
    795 #: src/classes/Nexi/WC_Gateway_XPay_Cards_Build.php:26
     853#: src/classes/Nexi/WC_Gateway_NPG_Cards.php:25
    796854#: src/classes/Nexi/WC_Gateway_NPG_Cards_Build.php:26
    797 #: src/classes/Nexi/WC_Gateway_XPay_Cards.php:26
     855#: src/classes/Nexi/WC_Gateway_XPay_Cards.php:26
     856#: src/classes/Nexi/WC_Gateway_XPay_Cards_Build.php:26
    798857msgid "Payment gateway."
    799858msgstr "Gateway di pagamento."
    800859
    801 #: src/classes/Nexi/WC_Gateway_NPG_Process_Completion.php:337
    802 #: src/classes/Nexi/WC_Gateway_XPay_Process_Completion.php:245
     860#: src/classes/Nexi/WC_Gateway_XPay_Process_Completion.php:245
     861#: src/classes/Nexi/WC_Gateway_NPG_Process_Completion.php:373
    803862msgid "Payment has been cancelled."
    804863msgstr "Il pagamento è stato annullato."
    805864
    806865#. Description of the plugin
    807 #: src/classes/Nexi/WC_Gateway_Admin.php:24
     866#: src/classes/Nexi/WC_Gateway_Admin.php:23
    808867msgid ""
    809868"Payment plugin for payment cards and alternative methods. Powered by Nexi."
     
    811870"Plugin di pagamento per carte di pagamento e metodi alternativi tramite Nexi."
    812871
    813 #: src/classes/Nexi/WC_Gateway_Admin.php:318
     872#: src/classes/Nexi/WC_Gateway_Admin.php:359
    814873msgid "Placeholder Color"
    815874msgstr "Colore placeholder"
    816875
    817 #: src/classes/Nexi/WC_Gateway_Admin.php:203
     876#: src/classes/Nexi/WC_Gateway_Admin.php:204
    818877msgid "Please refer to Dev Portal to get access to the Sandbox"
    819878msgstr ""
     
    821880"alla Sandbox."
    822881
    823 #: src/classes/Nexi/WC_Gateway_Admin.php:203
     882#: src/classes/Nexi/WC_Gateway_Admin.php:204
    824883msgid "Please register at"
    825884msgstr "Si prega di registrarsi sul sito"
    826885
    827 #: src/classes/Nexi/WC_Gateway_NPG_Cards.php:72
    828 #: src/classes/Nexi/WC_Gateway_XPay_APM.php:51
    829 #: src/classes/Nexi/WC_Gateway_NPG_APM.php:64
     886#: src/classes/Nexi/WC_Gateway_NPG_APM.php:64
     887#: src/classes/Nexi/WC_Gateway_NPG_Cards.php:77
     888#: src/classes/Nexi/WC_Gateway_XPay_APM.php:51
    830889msgid "Please use "
    831890msgstr "Si prega di utilizzare "
    832891
    833 #: src/classes/Nexi/WC_Gateway_Admin.php:252
     892#: src/classes/Nexi/WC_Gateway_Admin.php:293
    834893msgid "Preview"
    835894msgstr "Anteprima"
    836895
    837 #: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:291
     896#: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:288
    838897msgid "Real time payment directly from your bank account with EPS"
    839898msgstr "Paga in tempo reale direttamente dal tuo conto bancario con EPS"
    840899
    841 #: src/classes/Nexi/WC_Gateway_Admin.php:354
     900#: src/classes/Nexi/WC_Gateway_Admin.php:395
    842901msgid "Recurring Alias"
    843902msgstr "Alias ricorrenze"
    844903
    845 #: src/classes/Nexi/WC_Gateway_Admin.php:360
     904#: src/classes/Nexi/WC_Gateway_Admin.php:401
    846905msgid "Recurring key MAC"
    847906msgstr "Chiave MAC ricorrenze"
    848907
    849 #: src/classes/Nexi/WC_Gateway_NPG_Cards.php:116
     908#: src/classes/Nexi/WC_Gateway_NPG_Cards.php:139
    850909#: src/classes/Nexi/WC_Gateway_XPay_Cards_Build.php:179
    851910msgid "Remember the payment option."
     
    856915msgstr "Risposta KO"
    857916
    858 #: templates/npg_payment_detail.php:108
     917#: templates/npg_payment_detail.php:115
    859918msgid "Result"
    860919msgstr "Esito"
    861920
    862 #: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:311
     921#: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:308
    863922msgid "Secure payment directly from your bank account with PayU"
    864923msgstr "Paga in sicurezza direttamente dal tuo conto bancario con PayU"
    865924
    866 #: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:296
     925#: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:293
    867926msgid "Secure payment directly from your bank account with Przelewy24"
    868927msgstr "Paga in sicurezza direttamente dal tuo conto bancario con Przelewy24"
    869928
    870 #: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:316
     929#: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:313
    871930msgid "Secure payment directly from your home banking with Blik"
    872931msgstr "Paga in sicurezza direttamente dal tuo home banking con Blik"
    873932
    874 #: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:321
     933#: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:318
    875934msgid "Secure payment directly from your home banking with Multibanco"
    876935msgstr "Paga in sicurezza direttamente dal tuo home banking con Multibanco"
    877936
    878 #: src/classes/Nexi/WC_Gateway_Admin.php:167
     937#: src/classes/Nexi/WC_Gateway_Admin.php:168
    879938msgid ""
    880939"Select \"Alias and MAC Key\" option if you received the credentials of the "
     
    886945"fase di attivazione del servizio"
    887946
    888 #: src/classes/Nexi/WC_Gateway_Admin.php:168
     947#: src/classes/Nexi/WC_Gateway_Admin.php:169
    889948msgid ""
    890949"Select \"APIKey\" option if you use the API Key as the credential of the "
     
    938997msgstr "Visualizza widget"
    939998
    940 #: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:241
     999#: src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php:238
    9411000msgid ""
    9421001"Simply pay by bank transfer directly from your home banking with PagoinConto"
     
    9491008msgstr "Stato: "
    9501009
    951 #: src/classes/Nexi/WC_Gateway_Admin.php:246
     1010#: src/classes/Nexi/WC_Gateway_Admin.php:287
    9521011msgid "Style configuration"
    9531012msgstr "Configurazione stile"
    9541013
    955 #: src/classes/Nexi/WC_Gateway_Admin.php:343
     1014#: src/classes/Nexi/WC_Gateway_Admin.php:384
    9561015msgid "Subscription configuration"
    9571016msgstr "Configurazione ricorrenze"
     
    9611020msgstr "Codice fiscale"
    9621021
    963 #: src/classes/Nexi/WC_Gateway_Admin.php:327
     1022#: src/classes/Nexi/WC_Gateway_Admin.php:368
    9641023msgid "Text Color"
    9651024msgstr "Colore testo"
    9661025
    967 #: src/classes/Nexi/WC_Gateway_Admin.php:329
     1026#: src/classes/Nexi/WC_Gateway_Admin.php:370
    9681027msgid "Text color in input field"
    9691028msgstr "Colore del testo nei campi input"
    9701029
    971 #: src/classes/Nexi/WC_Gateway_Admin.php:320
     1030#: src/classes/Nexi/WC_Gateway_Admin.php:361
    9721031msgid "Text color of placeholder"
    9731032msgstr "Il colore del testo del valore placeholder"
     
    9781037msgstr "Grazie per l'acquisto. Tuttavia, la transazione è stata rifiutata."
    9791038
    980 #: src/classes/Nexi/WC_Gateway_Admin.php:142
     1039#: src/classes/Nexi/WC_Gateway_Admin.php:143
    9811040msgid ""
    9821041"The 3D Secure 2 protocol adopted by the main international circuits (Visa, "
     
    9891048"l’esperienza di acquisto del titolare della carta."
    9901049
    991 #: src/classes/Nexi/WC_Gateway_Admin.php:212
     1050#: src/classes/Nexi/WC_Gateway_Admin.php:213
    9921051msgid ""
    9931052"The field identifies the collection method that the merchant wants to apply "
     
    10061065"terminale"
    10071066
    1008 #: src/classes/Nexi/WC_Gateway_Admin.php:260
     1067#: src/classes/Nexi/WC_Gateway_Admin.php:301
    10091068msgid "The font family in the CC Form"
    10101069msgstr "Il font family nel form per le carte di credito"
    10111070
    1012 #: src/classes/Nexi/WC_Gateway_Admin.php:139
     1071#: src/classes/Nexi/WC_Gateway_Admin.php:140
    10131072msgid ""
    10141073"The notification is essential for the functioning of the plugin, it is "
     
    10291088"nell'apposito form un nuovo indirizzo."
    10301089
    1031 #: src/classes/Nexi/WC_Gateway_Admin.php:268
     1090#: src/classes/Nexi/WC_Gateway_Admin.php:309
    10321091msgid "The size of the font in the CC Form in pixel"
    10331092msgstr "La gradezza del font nel form per le carte di credito"
    10341093
    1035 #: src/classes/Nexi/WC_Gateway_Admin.php:294
     1094#: src/classes/Nexi/WC_Gateway_Admin.php:335
    10361095msgid "The space between letters in pixel"
    10371096msgstr "Spaziatura in pixel"
     
    10531112msgstr[1] "Da Autorizzare (%s)"
    10541113
    1055 #: src/classes/Nexi/WC_Gateway_Admin.php:203
     1114#: src/classes/Nexi/WC_Gateway_Admin.php:204
    10561115msgid "to get the test credentials."
    10571116msgstr "per avere le tue credenziali di test."
     
    10611120msgstr "Codice transazione: "
    10621121
    1063 #: templates/npg_payment_detail.php:69 templates/xpay_payment_detail.php:35
     1122#: templates/xpay_payment_detail.php:35 templates/npg_payment_detail.php:70
    10641123msgid "Transaction detail"
    10651124msgstr "Dettaglio transazione"
    10661125
    1067 #: templates/npg_payment_detail.php:107 templates/xpay_payment_detail.php:73
     1126#: templates/xpay_payment_detail.php:73 templates/npg_payment_detail.php:114
    10681127msgid "Type of operation"
    10691128msgstr "Tipo di operazione"
     
    10751134"Impossibile contabilizzare l'ordine %s. L'ordine non ha un riferimento XPay."
    10761135
    1077 #: src/classes/Nexi/WC_Gateway_NPG_API.php:496
     1136#: src/classes/Nexi/WC_Gateway_NPG_API.php:505
    10781137msgid "Unable to complete account operation."
    10791138msgstr "Operazione di contabilizzazione fallita."
    10801139
    1081 #: src/classes/Nexi/WC_Gateway_NPG_API.php:430
     1140#: src/classes/Nexi/WC_Gateway_NPG_API.php:439
    10821141msgid "Unable to complete refund operation."
    10831142msgstr "Operazione di storno fallita."
    10841143
    1085 #: src/classes/Nexi/WC_Gateway_NPG_API.php:663
     1144#: src/classes/Nexi/WC_Gateway_NPG_API.php:672
    10861145msgid "Unable to finalize the payment."
    10871146msgstr "Errore durante la finalizzazione del pagamento."
    10881147
    1089 #: src/classes/Nexi/WC_Gateway_NPG_API.php:183
    1090 #: src/classes/Nexi/WC_Gateway_NPG_API.php:642
     1148#: src/classes/Nexi/WC_Gateway_NPG_API.php:192
     1149#: src/classes/Nexi/WC_Gateway_NPG_API.php:651
    10911150msgid "Unable to initialize the payment."
    10921151msgstr "Errore durante l'inizializzazione del pagamento."
    10931152
    1094 #: src/classes/Nexi/WC_Gateway_NPG_API.php:546
     1153#: src/classes/Nexi/WC_Gateway_NPG_API.php:555
    10951154msgid "Unable to perform the recurring payment."
    10961155msgstr "Non è stato possibile effettuare il pagamento ricorrente."
    10971156
    1098 #: src/classes/Nexi/WC_Gateway_NPG_API.php:304
    1099 #: src/classes/Nexi/WC_Gateway_NPG_API.php:325
     1157#: src/classes/Nexi/WC_Gateway_NPG_API.php:313
     1158#: src/classes/Nexi/WC_Gateway_NPG_API.php:334
    11001159msgid "Unable to retrive customer related info."
    11011160msgstr "Non è stato possibile recuperare le informazione legate al cliente."
    11021161
    1103 #: src/classes/Nexi/WC_Gateway_NPG_API.php:344
    1104 #: src/classes/Nexi/WC_Gateway_NPG_API.php:352
     1162#: src/classes/Nexi/WC_Gateway_NPG_API.php:353
     1163#: src/classes/Nexi/WC_Gateway_NPG_API.php:361
    11051164msgid "Unable to retrive order related info."
    11061165msgstr "Non è stato possibile recuperare le informazione legate all'ordine."
     1166
     1167#: src/classes/Nexi/WC_Gateway_Admin.php:445
     1168msgid "Up to an amount of"
     1169msgstr "Fino ad un importo di"
    11071170
    11081171#: woocommerce-gateway-nexi-xpay.php:301
     
    11151178"calcoli corretti."
    11161179
    1117 #: src/classes/Nexi/WC_Gateway_Admin.php:311
     1180#: src/classes/Nexi/WC_Gateway_Admin.php:352
    11181181msgid "When form has error"
    11191182msgstr "Quando il form ha errori"
    11201183
    1121 #: src/classes/Nexi/WC_Gateway_Admin.php:302
     1184#: src/classes/Nexi/WC_Gateway_Admin.php:343
    11221185msgid "When form is empty or correct"
    11231186msgstr "Quando il form è vuoto o corretto"
     
    11431206msgstr "Sessione XPay Build scaduta"
    11441207
    1145 #: src/classes/Nexi/WC_Admin_Page.php:126
     1208#: src/classes/Nexi/WC_Admin_Page.php:132
    11461209msgid "XPay payment details"
    11471210msgstr "Dettagli di pagamento XPay"
    11481211
    1149 #: src/classes/Nexi/WC_Admin_Page.php:149
     1212#: src/classes/Nexi/WC_Admin_Page.php:156
    11501213msgid "Zloty"
    11511214msgstr "Zloty"
  • cartasi-x-pay/trunk/src/classes/Nexi/WC_Admin_Page.php

    r3017100 r3087870  
    2020    {
    2121        $instance = new static();
    22         add_action('add_meta_boxes', array($instance, 'add_meta_box_details_payment_nexixpay'));
     22
     23        add_action('add_meta_boxes', array($instance, 'add_meta_box_details_payment_nexixpay'), 10, 2);
    2324
    2425        wp_enqueue_script('xpay-admin-checkout', plugins_url('assets/js/xpay-admin.js', WC_ECOMMERCE_GATEWAY_NEXI_MAIN_FILE), array('jquery'), WC_GATEWAY_XPAY_VERSION);
     
    103104    }
    104105
    105     public function add_meta_box_details_payment_nexixpay()
    106     {
    107         $order_id = get_post_field("ID");
     106    public function add_meta_box_details_payment_nexixpay($post_type, $post)
     107    {
     108        $order_id = $post->ID;
     109
    108110        $order = wc_get_order($order_id);
     111
    109112        if (!$order) {
    110113            return;
    111114        }
    112115
    113         $npOrderId = get_post_meta($order_id, "_npg_" . "orderId", true);
    114 
    115         if ($npOrderId != "") {
     116        $npgOrderId = get_post_meta($order_id, "_npg_" . "orderId", true);
     117
     118        if ($npgOrderId != "") {
    116119            if ($order->get_payment_method() === 'xpay' || substr($order->get_payment_method(), 0, 9) == 'xpay_npg_' || substr($order->get_payment_method(), 0, 10) == 'xpay_build') {
    117                 add_meta_box('xpay-subscription-box', __('Nexi payment details', 'woocommerce-gateway-nexi-xpay'), array($this, 'details_payment_npg'), 'shop_order', 'normal', 'high');
     120                foreach (array('woocommerce_page_wc-orders', 'shop_order') as $type) {
     121                    add_meta_box('xpay-subscription-box', __('Nexi payment details', 'woocommerce-gateway-nexi-xpay'), array($this, 'details_payment_npg'), $type, 'normal', 'high');
     122                }
    118123            }
    119124        } else {
     
    124129
    125130            if ($order->get_payment_method() === 'xpay' || substr($order->get_payment_method(), 0, 5) == 'xpay_') {
    126                 add_meta_box('xpay-subscription-box', __('XPay payment details', 'woocommerce-gateway-nexi-xpay'), array($this, 'details_payment_xpay'), 'shop_order', 'normal', 'high');
     131                foreach (array('woocommerce_page_wc-orders', 'shop_order') as $type) {
     132                    add_meta_box('xpay-subscription-box', __('XPay payment details', 'woocommerce-gateway-nexi-xpay'), array($this, 'details_payment_xpay'), $type, 'normal', 'high');
     133                }
    127134            }
    128135        }
     
    155162    }
    156163
    157     public function details_payment_xpay()
    158     {
    159         $order_id = get_post_field("ID");
     164    public function details_payment_xpay($post)
     165    {
     166        $order_id = $post->ID;
     167
    160168        $transactionCodTrans = WC_Nexi_Helper::get_xpay_post_meta($order_id, 'codTrans');
    161169
     
    246254    }
    247255
    248     public function details_payment_npg()
    249     {
    250         $order_id = get_post_field("ID");
     256    public function details_payment_npg($post)
     257    {
     258        $order_id = $post->ID;
    251259
    252260        try {
     
    276284
    277285            $accountUrl = get_rest_url(null, "woocommerce-gateway-nexi-xpay/process_account/npg/" . $order->get_id());
     286
     287            $installmentsNumber = get_post_meta($order_id, "_npg_" . "installmentsNumber", true);
    278288        } catch (\Exception $exc) {
    279289            Log::actionWarning(__FUNCTION__ . ': ' . $exc->getMessage());
     
    284294        include_once WC_Nexi_Helper::get_nexi_template_path('npg_payment_detail.php');
    285295    }
     296
    286297}
  • cartasi-x-pay/trunk/src/classes/Nexi/WC_Gateway_Admin.php

    r3017100 r3087870  
    11<?php
    2 
    32/**
    43 * Copyright (c) 2019 Nexi Payments S.p.A.
     
    6665    public static function my_error_notice_xpay()
    6766    {
    68 ?>
     67        ?>
    6968        <div class="error notice">
    7069            <p><?php echo __('Invalid credentials. Check and try again.', 'woocommerce-gateway-nexi-xpay'); ?></p>
    7170        </div>
    72     <?php
    73     }
    74 
     71        <?php
     72    }
    7573
    7674    public static function my_error_notice_npg()
    7775    {
    78     ?>
     76        ?>
    7977        <div class="error notice">
    8078            <p><?php echo __('Invalid API Key. Check and try again.', 'woocommerce-gateway-nexi-xpay'); ?></p>
    8179        </div>
    82     <?php
     80        <?php
    8381    }
    8482
     
    137135        parent::init_form_fields();
    138136
    139 
    140137        $descriptionEnable = __('For a correct behavior of the module, check in the configuration section of the Nexi back-office that the transaction cancellation in the event of a failed notification is set.', 'woocommerce-gateway-nexi-xpay') . '<br/><br/>'
    141138            . __('A POST notification by the Nexi servers is sent to the following address, containing information on the outcome of the payment.', 'woocommerce-gateway-nexi-xpay') . '<br/>'
     
    169166                    GATEWAY_NPG => __('APIKey', 'woocommerce-gateway-nexi-xpay')
    170167                ),
    171                 'description' => '- ' . __('Select "Alias and MAC Key" option if you received the credentials of the production environment in the Welcome Mail received from Nexi during the activation of the service', 'woocommerce-gateway-nexi-xpay')  . '<br />'
    172                     . '- ' . __('Select "APIKey" option if you use the API Key as the credential of the production environment generated from the Back Office XPay. Follow the directions in the developer portal for the correct generation process.', 'woocommerce-gateway-nexi-xpay'),
     168                'description' => '- ' . __('Select "Alias and MAC Key" option if you received the credentials of the production environment in the Welcome Mail received from Nexi during the activation of the service', 'woocommerce-gateway-nexi-xpay') . '<br />'
     169                . '- ' . __('Select "APIKey" option if you use the API Key as the credential of the production environment generated from the Back Office XPay. Follow the directions in the developer portal for the correct generation process.', 'woocommerce-gateway-nexi-xpay'),
    173170                'class' => 'gateway-input'
    174171            )
     
    242239                'description' => __('Enable this option to make the payment methods available for different currencies. To have the complete list of the supported currencies, please visit the developer Portal. Make sure that this option is also enabled on your terminal configuration.', 'woocommerce-gateway-nexi-xpay'),
    243240                'class' => 'npg-only',
     241            ),
     242        ));
     243
     244        $this->form_fields = array_merge($this->form_fields, array(
     245            'nexi_xpay_installments_enabled' => array(
     246                'title' => __('Enable/Disable Installment Payments', 'woocommerce-gateway-nexi-xpay'),
     247                'type' => 'checkbox',
     248                'label' => __('Enable/Disable Installment Payments', 'woocommerce-gateway-nexi-xpay'),
     249                'default' => 'no',
     250                'description' => __('Enable this option to use installment payments via XPay. This functionality is only available to merchants with Greek VAT Number. Before enabling this functionality, make sure it is available on your terminal with your payment provider.', 'woocommerce-gateway-nexi-xpay'),
     251                'class' => 'npg-only installments-enabled',
     252            ),
     253        ));
     254
     255        $maxInstallmentsOptions = array();
     256
     257        for ($i = 2; $i < 100; $i++) {
     258            $maxInstallmentsOptions[$i] = $i;
     259        }
     260
     261        $this->form_fields = array_merge($this->form_fields, array(
     262            'nexi_xpay_max_installments' => array(
     263                'title' => __('Maximum number of installments regardless of the total order amount', 'woocommerce-gateway-nexi-xpay'),
     264                'type' => 'select',
     265                'options' => $maxInstallmentsOptions,
     266                'label' => __('Maximum number of installments regardless of the total order amount', 'woocommerce-gateway-nexi-xpay'),
     267                'default' => 'no',
     268                'description' => __('1 to 99 installments, 1 for one shot payment. Before set up a configuration, make sure to check with your payment provider what is the maximum number accepted for your terminal.', 'woocommerce-gateway-nexi-xpay'),
     269                'class' => 'npg-only installments-only',
     270            ),
     271        ));
     272
     273        $this->form_fields = array_merge($this->form_fields, array(
     274            'nexi_xpay_installments_ranges' => array(
     275                'title' => __('Maximum number of installments depending on the total order amount', 'woocommerce-gateway-nexi-xpay'),
     276                'type' => 'field_group',
     277                'label' => __('Maximum number of installments depending on the total order amount', 'woocommerce-gateway-nexi-xpay'),
     278                'default' => '[]',
     279                'description' => __('Add amount and installments for each row. The installments limit is 99', 'woocommerce-gateway-nexi-xpay'),
     280                'class' => 'npg-only installments-only',
    244281            ),
    245282        ));
     
    375412            ));
    376413        }
     414    }
     415
     416    /**
     417     * Generate Field group HTML.
     418     *
     419     * @param mixed $key
     420     * @param mixed $data
     421     * @return string
     422     */
     423    public function generate_field_group_html($key, $data)
     424    {
     425        $field = $this->plugin_id . $this->id . '_' . $key;
     426
     427        $value = $this->get_option($key);
     428
     429        if ($value === false || $value === null || $value === "") {
     430            $value = $data['default'];
     431        }
     432
     433        ob_start();
     434        ?>
     435        <tr valign="top">
     436            <th scope="row" class="titledesc">
     437                <label for="<?php echo esc_attr($field); ?>"><?php echo wp_kses_post($data['title']); ?></label>
     438            </th>
     439            <td class="forminp <?php echo esc_attr($data['class']); ?>">
     440                <fieldset>
     441                    <div id="installments-ranges-variations-container">
     442                        <table>
     443                            <thead>
     444                                <tr>
     445                                    <th><?php echo __('Up to an amount of', 'woocommerce-gateway-nexi-xpay'); ?></th>
     446                                    <th><?php echo __('Maximum installments', 'woocommerce-gateway-nexi-xpay'); ?></th>
     447                                    <th></th>
     448                                </tr>
     449                            </thead>
     450                            <tbody></tbody>
     451                        </table>
     452                    </div>
     453
     454                    <div>
     455                        <button class="button" id="add-ranges-variation"><?php echo __('Add rule', 'woocommerce-gateway-nexi-xpay'); ?></button>
     456                    </div>
     457                   
     458                    <input type="hidden" id="ranges-delete-label" value="<?php echo __('Delete', 'woocommerce-gateway-nexi-xpay'); ?>" />
     459
     460                    <input type="hidden" id="<?php echo esc_attr($key); ?>" name="<?php echo esc_attr($field); ?>" value="<?php echo esc_attr($value); ?>" />
     461                </fieldset>
     462
     463                <style>
     464                    #installments-ranges-variations-container table thead th,
     465                    #installments-ranges-variations-container table tbody td {
     466                        padding: 5px 10px;
     467                        padding-left: 0;
     468                        width: 200px;
     469                    }
     470
     471                    #installments-ranges-variations-container table tbody td input {
     472                        width: 190px;
     473                    }
     474
     475                    #installments-ranges-variations-container {
     476                        margin-bottom: 20px;
     477                    }
     478                </style>
     479            </td>
     480        </tr>
     481        <?php
     482        return ob_get_clean();
    377483    }
    378484
     
    389495
    390496        ob_start();
    391     ?>
     497        ?>
    392498        <tr valign="top">
    393499            <th scope="row" class="titledesc">
     
    396502            <td class="forminp <?php echo esc_attr($data['class']); ?>">
    397503                <fieldset>
    398 
    399504                    <?php
    400505                    if ($this->id == "xpay") {
    401                     ?>
     506                        ?>
    402507
    403508                        <label for="<?php echo esc_attr($field); ?>"><?php echo wp_kses_post($data['label']); ?></label>
     
    405510                        <?php echo $this->get_description_html($data); ?>
    406511
    407                     <?php
    408 
     512                        <?php
    409513                    } else {
    410 
    411514                        $path = plugin_dir_path(WC_ECOMMERCE_GATEWAY_NEXI_MAIN_FILE);
    412515
     
    414517                    }
    415518                    ?>
    416 
    417519                </fieldset>
    418520            </td>
    419521        </tr>
    420     <?php
     522        <?php
    421523        return ob_get_clean();
    422524    }
     
    434536
    435537        ob_start();
    436     ?>
     538        ?>
    437539        <tr valign="top">
    438540            <th scope="row" class="titledesc">
     
    447549            </td>
    448550        </tr>
    449 <?php
     551        <?php
    450552        return ob_get_clean();
    451553    }
     
    471573        );
    472574    }
     575
    473576}
  • cartasi-x-pay/trunk/src/classes/Nexi/WC_Gateway_NPG_API.php

    r2975087 r3087870  
    114114    }
    115115
    116     public function new_payment_link($order, $recurringPayment, $cart, $selectedToken, $saveCard, $selectedC = 'CARDS')
     116    public function new_payment_link($order, $recurringPayment, $cart, $selectedToken, $saveCard, $selectedC, $installmentsNumber)
    117117    {
    118118        try {
     
    130130                    "description" => "WC Order " . $order->get_id(),
    131131                    "customField" => "Woocommerce " . WC_WOOCOMMERCE_GATEWAY_NEXI_XPAY_WOOCOMMERCE_VERSION . " - nexi" . WC_GATEWAY_NEXI_PLUGIN_VARIANT . " " . WC_GATEWAY_XPAY_VERSION,
    132                     "customerId" =>  $customerId
     132                    "customerId" => $customerId
    133133                ),
    134134                "paymentSession" => array(
     
    147147            );
    148148
     149            if ($installmentsNumber && $installmentsNumber >= 2) {
     150                $payload["order"]["plan"] = array(
     151                    "planType" => "ACQUIRER_AGREEMENT",
     152                    "installmentQty" => $installmentsNumber,
     153                );
     154
     155                update_post_meta($order->get_id(), "_npg_" . "installmentsNumber", $installmentsNumber);
     156            }
     157
    149158            if ($recurringPayment) {
    150159                if (!$this->nexi_xpay_recurring_enabled) {
     
    332341    {
    333342        try {
    334             $npgOrderId = get_post_meta($order_id,  "_npg_" . "orderId", true);
     343            $npgOrderId = get_post_meta($order_id, "_npg_" . "orderId", true);
    335344
    336345            if (!$npgOrderId) {
     
    509518                "currency" => $order->get_currency(),
    510519                "customField" => "WC Order " . $order->get_id(),
    511                 "customerId" =>  $customerId,
     520                "customerId" => $customerId,
    512521            ],
    513522            "contractId" => $contractId,
     
    515524        ];
    516525
    517         $params =  WC_NPG_3DS20_Data_Provider::calculate_params($order);
     526        $params = WC_NPG_3DS20_Data_Provider::calculate_params($order);
    518527
    519528        if (count($params) > 0) {
     
    537546                return $orderId;
    538547            } else if (in_array($operation['operationResult'], NPG_PAYMENT_FAILURE)) {
    539                 throw new \Exception('Payment failed - '  . json_encode($response));
     548                throw new \Exception('Payment failed - ' . json_encode($response));
    540549            } else {
    541550                throw new \Exception('Invalid operationResult - ' . json_encode($response));
     
    587596                    "description" => "WC Order ",
    588597                    "customField" => "Woocommerce " . WC_WOOCOMMERCE_GATEWAY_NEXI_XPAY_WOOCOMMERCE_VERSION . " - nexi" . WC_GATEWAY_NEXI_PLUGIN_VARIANT . " " . WC_GATEWAY_XPAY_VERSION,
    589                     "customerId" =>  $customerId,
     598                    "customerId" => $customerId,
    590599                ),
    591600                "paymentSession" => array(
     
    733742
    734743        Log::actionInfo(__FUNCTION__ . ' - Request : ' . json_encode([
    735             'method' => $method,
    736             'requestUrl' => $requestUrl,
    737             'httpHeader' => array_splice($httpHeader, 1),
    738             'payload' => $payload,
    739             'extraHeaders' => $extraHeaders
     744                'method' => $method,
     745                'requestUrl' => $requestUrl,
     746                'httpHeader' => array_splice($httpHeader, 1),
     747                'payload' => $payload,
     748                'extraHeaders' => $extraHeaders
    740749        ]));
    741750
     
    814823
    815824        while (strlen($id) < $length) {
    816             $id .= (int)((rand() * rand()) / rand());
     825            $id .= (int) ((rand() * rand()) / rand());
    817826        }
    818827
     
    824833        return substr(md5($prefix . $customerId . '-' . time()), 0, 18);
    825834    }
     835
    826836}
  • cartasi-x-pay/trunk/src/classes/Nexi/WC_Gateway_NPG_APM.php

    r3029363 r3087870  
    1616class WC_Gateway_NPG_APM extends WC_Gateway_NPG_Generic_Method
    1717{
     18
    1819    protected $selectedCard;
    1920
     
    3839
    3940        try {
    40             $recurringPayment = class_exists("\WC_Subscriptions_Cart") && \WC_Subscriptions_Cart::cart_contains_subscription();
     41            $recurringPayment = WC_Nexi_Helper::order_or_cart_contains_subscription($order);
    4142
    4243            update_post_meta($order_id, "_npg_" . "is_build", false);
    4344
    44             $redirectLink = WC_Gateway_NPG_API::getInstance()->new_payment_link($order, $recurringPayment, WC()->cart, false, false, $this->selectedCard);
     45            $redirectLink = WC_Gateway_NPG_API::getInstance()->new_payment_link($order, $recurringPayment, WC()->cart, false, false, $this->selectedCard, 0);
    4546
    4647            $result = 'success';
     
    7980        );
    8081    }
     82
    8183}
  • cartasi-x-pay/trunk/src/classes/Nexi/WC_Gateway_NPG_Cards.php

    r3017100 r3087870  
    11<?php
    2 
    32/**
    43 * Copyright (c) 2019 Nexi Payments S.p.A.
     
    2322        $this->supports = array_merge($this->supports, ['tokenization']);
    2423
    25         $this->method_title =  __('Payment cards', 'woocommerce-gateway-nexi-xpay');
    26         $this->method_description =  __('Payment gateway.', 'woocommerce-gateway-nexi-xpay');
     24        $this->method_title = __('Payment cards', 'woocommerce-gateway-nexi-xpay');
     25        $this->method_description = __('Payment gateway.', 'woocommerce-gateway-nexi-xpay');
    2726        $this->title = $this->method_title;
    2827
     
    3635
    3736        try {
    38             $recurringPayment = class_exists("\WC_Subscriptions_Cart") && \WC_Subscriptions_Cart::cart_contains_subscription();
     37            $recurringPayment = WC_Nexi_Helper::order_or_cart_contains_subscription($order);
    3938
    4039            $selectedToken = 'new';
     
    4948            }
    5049
    51             $redirectLink = WC_Gateway_NPG_API::getInstance()->new_payment_link($order, $recurringPayment, WC()->cart, $selectedToken, $saveCard);
     50            $installmentsNumber = 0;
     51
     52            if (isset($_REQUEST["nexi-xpay-installments-number"])) {
     53                $installmentsNumber = $_REQUEST["nexi-xpay-installments-number"];
     54            }
     55
     56            $redirectLink = WC_Gateway_NPG_API::getInstance()->new_payment_link($order, $recurringPayment, WC()->cart, $selectedToken, $saveCard, 'CARDS', $installmentsNumber);
    5257
    5358            $result = 'success';
     
    9398        $this->tokenization_script();
    9499
    95         echo $this->description . '<br>';
    96 
    97         $isRecurring = (class_exists("\WC_Subscriptions_Cart") && \WC_Subscriptions_Cart::cart_contains_subscription());
     100        echo $this->description . '<br />';
     101
     102        $installmentsInfo = $this->get_installments_info();
     103
     104        if ($installmentsInfo["installments_enabled"]) {
     105            ?>
     106            <fieldset>
     107                <label for="nexi-xpay-installments-number" style="display: block;">
     108                    <?php echo __('Installments', 'woocommerce-gateway-nexi-xpay'); ?>
     109                </label>
     110                <select id="nexi-xpay-installments-number" name="nexi-xpay-installments-number">
     111                    <option value=""><?php echo __('One time solution', 'woocommerce-gateway-nexi-xpay'); ?></option>
     112                    <?php foreach ($installmentsInfo['max_installments'] as $installmentsNumber) { ?>
     113                        <option value="<?php echo $installmentsNumber; ?>"><?php echo $installmentsNumber; ?></option>
     114                    <?php } ?>
     115                </select>
     116            </fieldset>
     117            <?php
     118        }
     119
     120        $isRecurring = WC_Nexi_Helper::cart_contains_subscription();
    98121
    99122        if (!$isRecurring) {
     
    102125
    103126        if ($isRecurring) {
    104 ?>
     127            ?>
    105128            <fieldset id="wc-<?php echo esc_attr($this->id) ?>-cc-form">
    106129                <?php
     
    108131                ?>
    109132            </fieldset>
    110         <?php
     133            <?php
    111134        } else if ($this->settings["nexi_xpay_oneclick_enabled"] == "yes") {
    112         ?>
     135            ?>
    113136            <fieldset id="wc-<?php echo esc_attr($this->id) ?>-cc-form">
    114137                <p class="form-row woocommerce-SavedPaymentMethods-saveNew">
     
    117140                </p>
    118141            </fieldset>
    119 <?php
     142            <?php
    120143        }
    121144    }
     
    131154        }
    132155    }
     156
     157    private function get_installments_info()
     158    {
     159        $installmentsEnabled = $this->settings["nexi_xpay_installments_enabled"] === "yes";
     160
     161        $maxInstallments = array();
     162
     163        if ($installmentsEnabled) {
     164            $tot = min($this->settings["nexi_xpay_max_installments"] ?? 99, $this->get_max_installments_number_by_cart());
     165
     166            for ($i = 2; $i <= $tot; $i++) {
     167                $maxInstallments[] = $i;
     168            }
     169        }
     170
     171        return array(
     172            'installments_enabled' => $installmentsEnabled && count($maxInstallments) > 0,
     173            'max_installments' => $maxInstallments,
     174        );
     175    }
     176
     177    private function get_max_installments_number_by_cart()
     178    {
     179        $nInstallments = null;
     180
     181        $ranges = json_decode($this->settings["nexi_xpay_installments_ranges"], true);
     182
     183        if (is_array($ranges) && count($ranges)) {
     184            $baseGrandTotal = floatval(WC()->cart->total);
     185
     186            $rangesValues = array_values($ranges);
     187
     188            $toAmount = array_column($rangesValues, 'to_amount');
     189
     190            array_multisort($toAmount, SORT_ASC, $rangesValues);
     191
     192            foreach ($rangesValues as $value) {
     193                if ($baseGrandTotal <= $value['to_amount']) {
     194                    $nInstallments = (int) $value['n_installments'];
     195                    break;
     196                }
     197            }
     198        }
     199
     200        return $nInstallments ?? 99;
     201    }
     202
    133203}
  • cartasi-x-pay/trunk/src/classes/Nexi/WC_Gateway_NPG_Cards_Build.php

    r3017100 r3087870  
    4141        }
    4242
    43         $isRecurring = (class_exists("\WC_Subscriptions_Cart") && \WC_Subscriptions_Cart::cart_contains_subscription());
     43        $isRecurring = WC_Nexi_Helper::cart_contains_subscription();
    4444
    4545        echo $this->description . "<br>";
     
    118118            $total = floatval(WC()->cart->total);
    119119
    120             $isRecurring = (class_exists("\WC_Subscriptions_Cart") && \WC_Subscriptions_Cart::cart_contains_subscription());
     120            $isRecurring = WC_Nexi_Helper::cart_contains_subscription();
    121121
    122122            $orderId = null;
     
    143143        wp_die();
    144144    }
     145
    145146}
  • cartasi-x-pay/trunk/src/classes/Nexi/WC_Gateway_NPG_Generic_Method.php

    r3017100 r3087870  
    2929    public function get_sorted_cards_images()
    3030    {
    31         $avaiable_methods_npg = json_decode(\WC_Admin_Settings::get_option('xpay_npg_available_methods'), true);
     31        $available_methods_npg = json_decode(\WC_Admin_Settings::get_option('xpay_npg_available_methods'), true);
    3232        $cards = [
    3333            'MC',
     
    4242        $image_list = array_fill(0, count($cards), null);
    4343
    44         foreach ($avaiable_methods_npg as $apm) {
    45             if ($apm['paymentMethodType'] != 'CARDS') {
    46                 continue;
     44        if (is_array($available_methods_npg)) {
     45            foreach ($available_methods_npg as $apm) {
     46                if ($apm['paymentMethodType'] != 'CARDS') {
     47                    continue;
     48                }
     49
     50                if (!in_array($apm['circuit'], $cards)) {
     51                    continue;
     52                }
     53
     54                array_splice($image_list, array_search($apm['circuit'], $cards), 1, [$apm['imageLink']]);
    4755            }
    48 
    49             if (!in_array($apm['circuit'], $cards)) {
    50                 continue;
    51             }
    52 
    53             array_splice($image_list, array_search($apm['circuit'], $cards), 1, [$apm['imageLink']]);
    5456        }
    5557
     
    130132        }
    131133    }
     134
    132135}
  • cartasi-x-pay/trunk/src/classes/Nexi/WC_Gateway_NPG_Lock_Handler.php

    r3017100 r3087870  
    1717{
    1818
    19     private static function set_order_validate_lock($order_id, $npg_order_id)
     19    private static function get_table_name()
    2020    {
    21         update_post_meta($order_id, '_npg_lock_' . $npg_order_id, 1);
     21        global $wpdb;
     22
     23        $table_name = $wpdb->prefix . 'nexi_' . WC_GATEWAY_NEXI_PLUGIN_VARIANT . '_order_lock';
     24
     25        return $table_name;
    2226    }
    2327
    24     private static function can_take_lock($order_id, $npg_order_id)
     28    private static function take_lock($order_id, $function)
    2529    {
    26         //not using get_post_meta because its value could be chached therefore not correct
    27 
    2830        global $wpdb;
    2931
    30         $result = $wpdb->get_results("  SELECT *
    31                                         FROM " . $wpdb->prefix . "postmeta
    32                                         WHERE post_id = " . $order_id . " AND meta_key = '_npg_lock_" . $npg_order_id . "'");
    33 
    34         $lock = is_array($result) && !empty($result);
    35 
    36         return !$lock;
     32        return $wpdb->insert(self::get_table_name(), array('id' => $order_id, 'caller' => $function), array('%d', '%s'));
    3733    }
    3834
    39     public static function chek_and_take_lock($order_id, $npg_order_id)
     35    public static function create_lock_table()
     36    {
     37        global $wpdb;
     38
     39        $table_name = self::get_table_name();
     40
     41        $charset_collate = $wpdb->get_charset_collate();
     42
     43        $sql = " CREATE TABLE $table_name (id bigint(20) UNSIGNED NOT NULL, caller VARCHAR(64) NOT NULL, PRIMARY KEY (id) ) $charset_collate; ";
     44
     45        require_once ABSPATH . 'wp-admin/includes/upgrade.php';
     46
     47        dbDelta($sql);
     48    }
     49
     50    public static function check_and_take_lock($order_id, $function)
    4051    {
    4152        $i = 0;
     
    4455            ++$i;
    4556
    46             if (static::can_take_lock($order_id, $npg_order_id)) {
    47                 static::set_order_validate_lock($order_id, $npg_order_id);
     57            if (static::take_lock($order_id, $function) !== false) {
    4858                return true;
    4959            }
     
    5767    }
    5868
    59     public static function release_lock($order_id, $npg_order_id)
     69    public static function release_lock($order_id)
    6070    {
    61         delete_post_meta($order_id, '_npg_lock_' . $npg_order_id);
     71        global $wpdb;
     72
     73        $wpdb->delete(self::get_table_name(), array('id' => $order_id), array('%d'));
    6274    }
     75
    6376}
  • cartasi-x-pay/trunk/src/classes/Nexi/WC_Gateway_NPG_Process_Completion.php

    r3017100 r3087870  
    8686            $error_message = get_post_meta($order_id, '_npg_' . 'last_error', true);
    8787
    88             wc_add_notice(__('Payment error, please try again', 'woocommerce-gateway-nexi-xpay') . ($error_message != "" ? " (" . htmlentities($error_message ??  "") . ")" : ""), 'error');
     88            wc_add_notice(__('Payment error, please try again', 'woocommerce-gateway-nexi-xpay') . ($error_message != "" ? " (" . htmlentities($error_message ?? "") . ")" : ""), 'error');
    8989
    9090            $payment_error = get_post_meta($order_id, '_npg_' . 'payment_error', true);
     
    105105    private static function check_if_build_and_get_wc_order_id($order_id)
    106106    {
    107         if ((bool)get_post_meta($order_id, "_npg_" . "is_build", true) && get_post_meta($order_id, "_npg_" . "wc_order_id", true)) {
     107        if ((bool) get_post_meta($order_id, "_npg_" . "is_build", true) && get_post_meta($order_id, "_npg_" . "wc_order_id", true)) {
    108108            return get_post_meta($order_id, "_npg_" . "wc_order_id", true);
    109109        }
     
    131131        }
    132132
    133         $npg_order_id = $params['operation']['orderId'];
    134 
    135         if (!WC_Gateway_NPG_Lock_Handler::chek_and_take_lock($order_id, $npg_order_id)) {
     133        if (!WC_Gateway_NPG_Lock_Handler::check_and_take_lock($order_id, __FUNCTION__)) {
    136134            Log::actionWarning(__FUNCTION__ . ': Couldn\'t get execution lock');
    137135
     
    146144            Log::actionWarning(__FUNCTION__ . ': Invalid securityToken for order: ' . $order_id . ' - Request: ' . json_encode($params));
    147145
    148             WC_Gateway_NPG_Lock_Handler::release_lock($order_id, $npg_order_id);
     146            WC_Gateway_NPG_Lock_Handler::release_lock($order_id);
    149147
    150148            return new \WP_REST_Response($payload, $status, []);
     
    169167        }
    170168
    171         WC_Gateway_NPG_Lock_Handler::release_lock($order_id, $npg_order_id);
     169        WC_Gateway_NPG_Lock_Handler::release_lock($order_id);
    172170
    173171        return new \WP_REST_Response($payload, $status, []);
     
    176174    public static function redirect($data)
    177175    {
     176        sleep(2);
     177
    178178        $params = $data->get_params();
    179179
     
    184184        $npg_order_id = get_post_meta($order_id, '_npg_' . 'orderId', true);
    185185
    186         if (!WC_Gateway_NPG_Lock_Handler::chek_and_take_lock($order_id, $npg_order_id)) {
     186        if (!WC_Gateway_NPG_Lock_Handler::check_and_take_lock($order_id, __FUNCTION__)) {
    187187            Log::actionWarning(__FUNCTION__ . ': Couldn\'t get execution lock');
    188188
     
    213213            $authorizationRecord = WC_Gateway_NPG_API::getInstance()->get_order_status($order_id);
    214214
    215             if ($c == 10) {
    216                 Log::actionWarning(__FUNCTION__ . ": reached max nummber of GET for order: " . $order_id);
     215            if ($c == 20) {
     216                Log::actionWarning(__FUNCTION__ . ": reached max number of GET for order: " . $order_id);
    217217                break;
    218218            }
     
    232232        $order = new \WC_Order($order_id);
    233233
    234         if ($order->needs_payment()) {
    235             WC_Gateway_NPG_Lock_Handler::release_lock($order_id, $npg_order_id);
     234        if ($order->needs_payment() || $order->get_status() == 'cancelled') {
     235            WC_Gateway_NPG_Lock_Handler::release_lock($order_id);
    236236
    237237            return new \WP_REST_Response(
     
    246246        }
    247247
    248         WC_Gateway_NPG_Lock_Handler::release_lock($order_id, $npg_order_id);
     248        WC_Gateway_NPG_Lock_Handler::release_lock($order_id);
    249249
    250250        return new \WP_REST_Response(
     
    267267            case NPG_OR_EXECUTED:
    268268                if (!in_array($order->get_status(), ['completed', 'processing'])) {
    269                     $completed = $order->payment_complete(get_post_meta($order_id,  "_npg_" . "orderId", true));
     269                    $completed = $order->payment_complete(get_post_meta($order_id, "_npg_" . "orderId", true));
    270270
    271271                    if ($completed) {
     272                        Log::actionInfo(__FUNCTION__ . ": order completed: " . $order_id);
     273
    272274                        WC_Save_Order_Meta::saveSuccessNpg(
    273275                            $order_id,
     
    298300            case NPG_OR_3DS_FAILED:
    299301            case NPG_OR_FAILED:
    300                 if ($order->get_status() != 'failed') {
     302                if (!in_array($order->get_status(), ['failed', 'cancelled'])) {
    301303                    $order->update_status('failed');
    302304                }
     
    304306                Log::actionWarning(__FUNCTION__ . ': payment error');
    305307
    306                 $error =  $operation['operationResult'];
     308                $error = $operation['operationResult'];
    307309
    308310                foreach ($operation['warnings'] as $warning) {
     
    399401        }
    400402    }
     403
    401404}
  • cartasi-x-pay/trunk/src/classes/Nexi/WC_Gateway_Nexi_Register_Available.php

    r3029363 r3087870  
    3939            'MY_BANK',
    4040            'PAGODIL',
     41            'KLARNA',
     42            'PAGOLIGHT',
     43            'PAYPAL_BNPL',
    4144        ),
    4245        'CZK' => array(
     
    4548        'PLN' => array(
    4649            'PAYU',
    47             'BLIK'
     50            'BLIK',
    4851        ),
    4952        'NZD' => array(
    50             'POLI'
     53            'POLI',
    5154        ),
    5255        'AUD' => array(
    53             'POLI'
    54         )
     56            'POLI',
     57        ),
     58        'GBP' => array(
     59            'KLARNA',
     60        ),
     61        'DKK' => array(
     62            'KLARNA',
     63        ),
    5564    );
    5665    private static $xpayMinAmounts = array(
     
    6170        'PAYU' => 300,
    6271        'BLIK' => 100,
    63         'POLI' => 100
     72        'POLI' => 100,
     73        'KLARNA' => 3500,
     74        'PAGOLIGHT' => 6000,
     75        'PAYPAL_BNPL' => 3000,
     76    );
     77    private static $xpayMaxAmounts = array(
     78        'KLARNA' => 150000,
     79        'PAGOLIGHT' => 500000,
     80        'PAYPAL_BNPL' => 200000,
    6481    );
    6582
     
    88105    private function evaluate_all()
    89106    {
    90         global $pagenow, $wp;
     107        global $pagenow;
    91108
    92109        $this->paymentGateways = array();
    93110
    94         if (is_admin() && $pagenow == 'admin.php') {
     111        if (is_admin() && $pagenow == 'admin.php' && $_GET['page'] == 'wc-settings' && $_GET['tab'] == 'checkout') {
    95112            $this->paymentGateways[] = new \Nexi\WC_Gateway_Admin();
    96113        } else {
     
    181198            }
    182199
     200            // Test for maximum amount. Each APM can have a maximum amount for payment processing
     201            if (WC_Nexi_Helper::nexi_array_key_exists(self::$xpayMaxAmounts, $am['selectedcard']) && isset(WC()->cart)) {
     202                $currentCartAmount = WC_Nexi_Helper::mul_bcmul(WC()->cart->total, 100, 0);
     203
     204                if ($currentCartAmount > self::$xpayMaxAmounts[$am['selectedcard']]) {
     205                    return;
     206                }
     207            }
     208
    183209            // Test for PagoDIL configuration. Cart must be payable in installable to pay with PagoDIL
    184210            if ($am['selectedcard'] == 'PAGODIL' && isset(WC()->cart)) {
     
    214240
    215241        // Test for minimum amount. Each APM can have a minimum amount for payment processing
    216         if (isset(WC()->cart)) {
    217             $currentCartAmount = \Nexi\WC_Gateway_NPG_Currency::calculate_amount_to_min_unit(WC()->cart->total, $this->currency);
    218 
    219             if ($apmInfo['min_amount'] !== null && $currentCartAmount < $apmInfo['min_amount']) {
    220                 return;
     242        if (isset($apmInfo['min_amount'])) {
     243            if (isset(WC()->cart)) {
     244                $currentCartAmount = \Nexi\WC_Gateway_NPG_Currency::calculate_amount_to_min_unit(WC()->cart->total, $this->currency);
     245
     246                if ($currentCartAmount < $apmInfo['min_amount']) {
     247                    return;
     248                }
     249            }
     250        }
     251
     252        // Test for maximum amount. Each APM can have a maximum amount for payment processing
     253        if (isset($apmInfo['max_amount'])) {
     254            if (isset(WC()->cart)) {
     255                $currentCartAmount = \Nexi\WC_Gateway_NPG_Currency::calculate_amount_to_min_unit(WC()->cart->total, $this->currency);
     256
     257                if ($currentCartAmount > $apmInfo['max_amount']) {
     258                    return;
     259                }
    221260            }
    222261        }
     
    238277                'description' => __('Simply pay by bank transfer directly from your home banking with PagoinConto', 'woocommerce-gateway-nexi-xpay'),
    239278                'min_amount' => null,
     279                'max_amount' => null,
    240280            ],
    241281            'GOOGLEPAY' => [
     
    243283                'description' => __('Easily pay with your Google Pay wallet', 'woocommerce-gateway-nexi-xpay'),
    244284                'min_amount' => null,
     285                'max_amount' => null,
    245286            ],
    246287            'APPLEPAY' => [
     
    248289                'description' => __('Easily pay with your Apple Pay wallet', 'woocommerce-gateway-nexi-xpay'),
    249290                'min_amount' => null,
     291                'max_amount' => null,
    250292            ],
    251293            'BANCOMATPAY' => [
     
    253295                'description' => __('Pay via BANCOMAT Pay just by entering your phone number', 'woocommerce-gateway-nexi-xpay'),
    254296                'min_amount' => null,
     297                'max_amount' => null,
    255298            ],
    256299            'MYBANK' => [
     
    258301                'description' => __('Pay securely by bank transfer with MyBank', 'woocommerce-gateway-nexi-xpay'),
    259302                'min_amount' => null,
     303                'max_amount' => null,
    260304            ],
    261305            'ALIPAY' => [
     
    263307                'description' => __('Pay quickly and easily with your AliPay wallet', 'woocommerce-gateway-nexi-xpay'),
    264308                'min_amount' => null,
     309                'max_amount' => null,
    265310            ],
    266311            'WECHATPAY' => [
     
    268313                'description' => __('Pay quickly and easily with your WeChat Pay wallet', 'woocommerce-gateway-nexi-xpay'),
    269314                'min_amount' => null,
     315                'max_amount' => null,
    270316            ],
    271317            'GIROPAY' => [
     
    273319                'description' => __('Pay directly from your bank account with Giropay', 'woocommerce-gateway-nexi-xpay'),
    274320                'min_amount' => 10,
     321                'max_amount' => null,
    275322            ],
    276323            'IDEAL' => [
     
    278325                'description' => __('Pay directly from your bank account with iDEAL', 'woocommerce-gateway-nexi-xpay'),
    279326                'min_amount' => 10,
     327                'max_amount' => null,
    280328            ],
    281329            'BANCONTACT' => [
     
    283331                'description' => __('Pay easily with Bancontact', 'woocommerce-gateway-nexi-xpay'),
    284332                'min_amount' => null,
     333                'max_amount' => null,
    285334            ],
    286335            'EPS' => [
     
    288337                'description' => __('Real time payment directly from your bank account with EPS', 'woocommerce-gateway-nexi-xpay'),
    289338                'min_amount' => 100,
     339                'max_amount' => null,
    290340            ],
    291341            'PRZELEWY24' => [
     
    293343                'description' => __('Secure payment directly from your bank account with Przelewy24', 'woocommerce-gateway-nexi-xpay'),
    294344                'min_amount' => null,
     345                'max_amount' => null,
    295346            ],
    296347            'SKRILL' => [
     
    298349                'description' => __('Pay quickly and easily with your Skrill wallet', 'woocommerce-gateway-nexi-xpay'),
    299350                'min_amount' => null,
     351                'max_amount' => null,
    300352            ],
    301353            'SKRILL1TAP' => [
     
    303355                'description' => __('Pay in one tap with your Skrill wallet', 'woocommerce-gateway-nexi-xpay'),
    304356                'min_amount' => null,
     357                'max_amount' => null,
    305358            ],
    306359            'PAYU' => [
     
    308361                'description' => __('Secure payment directly from your bank account with PayU', 'woocommerce-gateway-nexi-xpay'),
    309362                'min_amount' => 300,
     363                'max_amount' => null,
    310364            ],
    311365            'BLIK' => [
     
    313367                'description' => __('Secure payment directly from your home banking with Blik', 'woocommerce-gateway-nexi-xpay'),
    314368                'min_amount' => 100,
     369                'max_amount' => null,
    315370            ],
    316371            'MULTIBANCO' => [
     
    318373                'description' => __('Secure payment directly from your home banking with Multibanco', 'woocommerce-gateway-nexi-xpay'),
    319374                'min_amount' => null,
     375                'max_amount' => null,
    320376            ],
    321377            'SATISPAY' => [
     
    323379                'description' => __('Pay easily with your Satispay account', 'woocommerce-gateway-nexi-xpay'),
    324380                'min_amount' => null,
     381                'max_amount' => null,
    325382            ],
    326383            'AMAZONPAY' => [
     
    328385                'description' => __('Pay easily with your Amazon account', 'woocommerce-gateway-nexi-xpay'),
    329386                'min_amount' => null,
     387                'max_amount' => null,
    330388            ],
    331389            'PAYPAL' => [
     
    333391                'description' => __('Pay securely with your PayPal account', 'woocommerce-gateway-nexi-xpay'),
    334392                'min_amount' => null,
     393                'max_amount' => null,
    335394            ],
    336395            'ONEY' => [
     
    338397                'description' => __('Pay in 3 or 4 installments by credit, debit or Postepay card with Oney', 'woocommerce-gateway-nexi-xpay'),
    339398                'min_amount' => null,
     399                'max_amount' => null,
    340400            ],
    341401            'KLARNA' => [
    342402                'title' => 'Klarna',
    343403                'description' => __('Pay in 3 installments with Klarna interest-free', 'woocommerce-gateway-nexi-xpay'),
    344                 'min_amount' => null,
     404                'min_amount' => 3500,
     405                'max_amount' => 150000,
    345406            ],
    346407            'PAGODIL' => [
     
    348409                'description' => __('Buy now and pay a little by little with PagoDIL', 'woocommerce-gateway-nexi-xpay'),
    349410                'min_amount' => null,
     411                'max_amount' => null,
     412            ],
     413            'PAGOLIGHT' => [
     414                'title' => 'PagoLight',
     415                'description' => __('Pay in installments with PagoLight', 'woocommerce-gateway-nexi-xpay'),
     416                'min_amount' => 6000,
     417                'max_amount' => 300000,
     418            ],
     419            'PAYPAL_BNPL' => [
     420                'title' => 'PayPal BNPL',
     421                'description' => __('Pay in 3 installments with PayPal', 'woocommerce-gateway-nexi-xpay'),
     422                'min_amount' => 3000,
     423                'max_amount' => 200000,
    350424            ],
    351425        ];
     
    364438    private static function is_currency_valid_for_apm($currency, $apmCode)
    365439    {
    366         if (WC_Nexi_Helper::nexi_array_key_exists_and_equals(WC_Nexi_Helper::get_nexi_settings(), 'nexi_xpay_multicurrency_enabled', 'yes') && $apmCode == "CARDS") {
     440        $validApmCodes = array(
     441            "CARDS",
     442            "GOOGLEPAY",
     443            "APPLEPAY",
     444        );
     445
     446        if (WC_Nexi_Helper::nexi_array_key_exists_and_equals(WC_Nexi_Helper::get_nexi_settings(), 'nexi_xpay_multicurrency_enabled', 'yes') && in_array($apmCode, $validApmCodes)) {
    367447            return in_array($currency, \Nexi\WC_Gateway_NPG_Currency::get_npg_supported_currency_list());
    368448        }
  • cartasi-x-pay/trunk/src/classes/Nexi/WC_Gateway_XPay_Cards_Build.php

    r3017100 r3087870  
    11<?php
    2 
    32/**
    43 * Copyright (c) 2019 Nexi Payments S.p.A.
     
    4443        }
    4544
    46         $this->description =  $img_list . __("Pay securely by credit, debit and prepaid card. Powered by Nexi.", 'woocommerce-gateway-nexi-xpay');
     45        $this->description = $img_list . __("Pay securely by credit, debit and prepaid card. Powered by Nexi.", 'woocommerce-gateway-nexi-xpay');
    4746
    4847        if (\WC_Admin_Settings::get_option('xpay_logo_small') == "") {
     
    124123        echo $this->description . "<br>";
    125124
    126         $isRecurring = (class_exists("\WC_Subscriptions_Cart") && \WC_Subscriptions_Cart::cart_contains_subscription());
     125        $isRecurring = WC_Nexi_Helper::cart_contains_subscription();
    127126
    128127        $payment_payload = \Nexi\WC_Gateway_XPay_API::getInstance()->get_payment_build_payload(\WC_Payment_Gateway::get_order_total());
     
    131130            $this->saved_payment_methods();
    132131        }
    133 ?>
     132        ?>
    134133        <fieldset id="wc-<?php echo esc_attr($this->id) ?>-cc-form" class="wc-credit-card-form wc-payment-form">
    135134
     
    174173                echo __('Attention, the order for which you are making payment contains recurring payments, payment data will be stored securely by Nexi.', 'woocommerce-gateway-nexi-xpay');
    175174            } else if ($this->settings["nexi_xpay_oneclick_enabled"] == "yes") {
    176             ?>
     175                ?>
    177176                <p class="form-row woocommerce-SavedPaymentMethods-saveNew">
    178177                    <input id="save-card" name="save-card" type="checkbox" value="1" style="width:auto;" />
     
    184183
    185184        </fieldset>
    186 <?php
     185        <?php
    187186    }
    188187
     
    193192
    194193        try {
    195             $isRecurring = (class_exists("\WC_Subscriptions_Cart") && \WC_Subscriptions_Cart::cart_contains_subscription());
     194            $isRecurring = WC_Nexi_Helper::order_or_cart_contains_subscription($order);
    196195            $isNewCard = true;
    197196
     
    316315            ';
    317316    }
     317
    318318}
  • cartasi-x-pay/trunk/src/classes/Nexi/WC_Gateway_XPay_Generic_Method.php

    r3029363 r3087870  
    7171        }
    7272
    73         if (class_exists("\WC_Subscriptions_Cart") && \WC_Subscriptions_Cart::cart_contains_subscription()) {
     73        if (WC_Nexi_Helper::cart_contains_subscription()) {
    7474            echo __('Attention, the order for which you are making payment contains recurring payments, payment data will be stored securely by Nexi.', 'woocommerce-gateway-nexi-xpay');
    7575        } else {
     
    8282        $order = new \WC_Order($order_id);
    8383
    84         $recurringPaymentRequired = class_exists("\WC_Subscriptions_Cart") && \WC_Subscriptions_Cart::cart_contains_subscription();
     84        $recurringPaymentRequired = WC_Nexi_Helper::order_or_cart_contains_subscription($order);
    8585
    8686        $order_form = \Nexi\WC_Gateway_XPay_API::getInstance()->get_payment_form($order, $this->selectedCard, $recurringPaymentRequired);
  • cartasi-x-pay/trunk/src/classes/Nexi/WC_Gateway_XPay_Process_Completion.php

    r3029363 r3087870  
    146146                    );
    147147                } else {
    148                     if ($order->get_status() != 'failed') {
     148                    if (!in_array($order->get_status(), ['failed', 'cancelled'])) {
    149149                        $order->update_status('failed');
    150150                    }
     
    202202                }
    203203            } else {
    204                 if ($order->get_status() != 'failed') {
     204                if (!in_array($order->get_status(), ['failed', 'cancelled'])) {
    205205                    $order->update_status('failed');
    206206                }
     
    213213
    214214        Log::actionInfo(__FUNCTION__ . ": user redirect for order id " . $order_id . ' - ' . (array_key_exists('esito', $params) ? $params['esito'] : ''));
    215 
    216         if ($order->needs_payment()) {
     215       
     216        if ($order->needs_payment() || $order->get_status() == 'cancelled') {
    217217            return new \WP_REST_Response(
    218218                "redirecting failed...",
  • cartasi-x-pay/trunk/src/classes/Nexi/WC_Nexi_Helper.php

    r3017100 r3087870  
    1616class WC_Nexi_Helper
    1717{
     18
     19    public static function cart_contains_subscription()
     20    {
     21        return class_exists("\WC_Subscriptions_Cart") && \WC_Subscriptions_Cart::cart_contains_subscription();
     22    }
     23
     24    public static function order_or_cart_contains_subscription($order)
     25    {
     26        return (function_exists('wcs_order_contains_subscription') && wcs_order_contains_subscription($order)) || self::cart_contains_subscription();
     27    }
     28
    1829    /**
    1930     * checks if the requested information is available as per new configuration format and returns it
     
    4758        return "";
    4859    }
    49 
    5060
    5161    /**
     
    129139        return static::nexi_array_key_exists($array, $key) && in_array($value, $array[$key]);
    130140    }
     141
    131142}
  • cartasi-x-pay/trunk/templates/npg_payment_detail.php

    r2975087 r3087870  
    6565                ($firstOp !== null && array_key_exists('operationTime', $firstOp)) ||
    6666                (array_key_exists('orderStatus', $orderInfo) && array_key_exists('order', $orderInfo['orderStatus']) && count($orderInfo['orderStatus']['order']) > 0)
    67             ) { ?>
     67            ) {
     68                ?>
    6869                <div class="order_data_column">
    6970                    <h3><?php echo __("Transaction detail", 'woocommerce-gateway-nexi-xpay') ?></h3>
    7071                    <p>
    71                         <?php if ($firstOp !== null && $firstOp['operationTime'] != '') {
     72                        <?php
     73                        if ($firstOp !== null && $firstOp['operationTime'] != '') {
    7274                            $transactionDate = new \DateTime($firstOp['operationTime']);
    7375
    7476                            if ($transactionDate) {
     77                                ?>
     78                                <strong><?php echo __("Date: ", 'woocommerce-gateway-nexi-xpay') ?></strong> <?php echo htmlentities($transactionDate->format("d/m/Y H:i")) ?><br>
     79                                <?php
     80                            }
     81                        }
    7582                        ?>
    76                                 <strong><?php echo __("Date: ", 'woocommerce-gateway-nexi-xpay') ?></strong> <?php echo htmlentities($transactionDate->format("d/m/Y H:i")) ?><br>
    77                         <?php
    78                             }
    79                         } ?>
    80                         <?php
    81                         if (array_key_exists('orderStatus', $orderInfo) && array_key_exists('order', $orderInfo['orderStatus']) && count($orderInfo['orderStatus']['order']) > 0) { ?>
     83
     84                        <?php if (isset($installmentsNumber) && $installmentsNumber >= 2) { ?>
     85                            <strong><?php echo __("Installments: ", 'woocommerce-gateway-nexi-xpay') ?></strong> <?php echo $installmentsNumber; ?><br>
     86                        <?php } ?>
     87
     88                        <?php if (array_key_exists('orderStatus', $orderInfo) && array_key_exists('order', $orderInfo['orderStatus']) && count($orderInfo['orderStatus']['order']) > 0) { ?>
    8289                            <?php if ($orderInfo['orderStatus']['order']['amount']) { ?>
    8390                                <strong><?php echo __("Amount: ", 'woocommerce-gateway-nexi-xpay') ?></strong> <?php echo \Nexi\WC_Gateway_NPG_Currency::format_npg_amount($orderInfo['orderStatus']['order']['amount'], $orderInfo['orderStatus']['order']['currency']) . " " . $currencySign ?><br>
     
    93100
    94101        <?php if ($showOperations || $canAccount) {
    95         ?>
     102            ?>
    96103            <?php if ($showOperations) { ?>
    97104                <h3><?php echo __("Accounting operations", 'woocommerce-gateway-nexi-xpay') ?></h3>
  • cartasi-x-pay/trunk/woocommerce-gateway-nexi-xpay.php

    r3029363 r3087870  
    55 * Plugin URI:
    66 * Description: Payment plugin for payment cards and alternative methods. Powered by Nexi.
    7  * Version: 7.3.1
     7 * Version: 7.3.2
    88 * Author: Nexi SpA
    99 * Author URI: https://www.nexi.it
     
    1414 * License URI: http://www.gnu.org/licenses/gpl-3.0.html
    1515 */
    16 
    1716if (!defined('ABSPATH')) {
    1817    exit;
     
    2423
    2524if (in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins'))) || is_plugin_active_for_network('woocommerce/woocommerce.php')) {
    26     define("WC_GATEWAY_XPAY_VERSION", "7.3.1");
     25    define("WC_GATEWAY_XPAY_VERSION", "7.3.2");
    2726
    2827    define("GATEWAY_XPAY", "xpay");
     
    3534    define('WC_SETTINGS_KEY', 'woocommerce_' . WC_GATEWAY_NEXI_PLUGIN_VARIANT . '_settings');
    3635
    37     /*NPG constants**************************************************/
    3836    define('NPG_OR_AUTHORIZED', 'AUTHORIZED');
    3937    define('NPG_OR_EXECUTED', 'EXECUTED');
     
    7876
    7977    define('NPG_RT_MIT_SCHEDULED', 'MIT_SCHEDULED');
    80     /****************************************************************/
    8178
    8279    load_plugin_textdomain('woocommerce-gateway-nexi-xpay', false, dirname(plugin_basename(__FILE__)) . '/lang');
     
    136133    // custom hook called by the scheduled cron
    137134    add_action('wp_nexi_polling', 'wp_nexi_polling_executor');
     135
    138136    function wp_nexi_polling_executor()
    139137    {
     
    160158                case NPG_OR_AUTHORIZED:
    161159                case NPG_OR_EXECUTED:
    162                     $completed = $orderObj->payment_complete(get_post_meta($order->get_id(),  "_npg_" . "orderId", true));
     160                    $completed = $orderObj->payment_complete(get_post_meta($order->get_id(), "_npg_" . "orderId", true));
    163161
    164162                    if ($completed) {
     
    192190                    \Nexi\Log::actionWarning(__FUNCTION__ . ': payment error - operation: ' . json_encode($authorizationRecord));
    193191
    194                     $orderObj->update_status('failed');
     192                    if ($order->get_status() != 'cancelled') {
     193                        $orderObj->update_status('failed');
     194                    }
    195195
    196196                    $orderObj->add_order_note(__('Payment error', 'woocommerce-gateway-nexi-xpay'));
     
    205205
    206206    add_action('wp_nexi_update_npg_payment_methods', 'wp_nexi_update_npg_payment_methods_executor');
     207
    207208    function wp_nexi_update_npg_payment_methods_executor()
    208209    {
     
    233234    add_filter('cron_schedules', 'my_add_nexi_schedules_for_polling');
    234235
    235 
    236236    //chcks if the task is not already scheduled
    237237    if (!wp_next_scheduled('wp_nexi_polling') && WC_GATEWAY_NEXI_PLUGIN_VARIANT == 'xpay' && \Nexi\WC_Nexi_Helper::nexi_is_gateway_NPG()) {
     
    256256    register_activation_hook(__FILE__, 'xpay_plugin_activation');
    257257
    258 
    259258    function xpay_plugin_deactivation()
    260259    {
     
    273272
    274273    register_deactivation_hook(__FILE__, 'xpay_plugin_deactivation');
    275 
    276274
    277275    function xpay_plugin_action_links($links)
     
    286284    add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'xpay_plugin_action_links');
    287285
    288     add_action('init', '\Nexi\WC_Pending_Status::addNexiPendingPaymentOrderStatus');
     286    function nexi_xpay_plugin_init()
     287    {
     288        \Nexi\WC_Pending_Status::addNexiPendingPaymentOrderStatus();
     289
     290        \Nexi\WC_Nexi_Db::run_updates();
     291    }
     292
     293    add_action('init', 'nexi_xpay_plugin_init');
    289294
    290295    add_filter('wc_order_statuses', '\Nexi\WC_Pending_Status::wcOrderStatusesFilter');
Note: See TracChangeset for help on using the changeset viewer.