WooCommerce MercadoPago - Version 4.2.1

Version Description

Download this release

Release Info

Developer mercadopago
Plugin Icon 128x128 WooCommerce MercadoPago
Version 4.2.1
Comparing to
See all releases

Code changes from version 4.2.0 to 4.2.1

assets/js/basic_config_mercadopago.min.js CHANGED
@@ -1 +1 @@
1
- window.onload=function(){function e(e,o){return'<span class="mp-btn-collapsible" id="'+e+'" style="display:block">+</span> <span class="mp-btn-collapsible" id="'+o+'" style="display:none">-</span>'}document.querySelector(".wc-admin-breadcrumb").style.display="none",document.querySelector(".mp-header-logo").style.display="none",document.querySelector("#_wpnonce").parentElement.style.display="none",document.querySelectorAll("h2")[4].style.display="none";for(var o=document.querySelectorAll("p.description"),t=0;t<o.length;t++)o[t].style.width="420px";for(var c=document.querySelectorAll("th.titledesc"),n=0;n<c.length;n++)c[n].id="mp_field_text",null!=c[n].children[0].children[0]&&(c[n].children[0].children[0].style.position="relative",c[n].children[0].children[0].style.fontSize="22px");for(var l=document.querySelectorAll(".form-table"),d=0;d<l.length;d++)l[d].id="mp_table_"+d;document.querySelector(".hidden-field-mp-title").setAttribute("type","hidden"),document.querySelector(".hidden-field-mp-desc").setAttribute("type","hidden");var r=document.querySelectorAll("#mp_table_0");r[0].children[0].children[0].style.display="none",r[0].children[0].children[1].style.display="none";var a=document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_btn_save");if(null===document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_homolog_title")&&null===document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_credential_description_prod")||document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_credential_description_prod").nextElementSibling.append(a.cloneNode(!0)),null!==document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_homolog_title")||null!==document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_options_title")){document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_advanced_settings").nextElementSibling.append(a.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_options_subtitle").nextElementSibling.append(a.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_payments_description").nextElementSibling.append(a.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_payments_advanced_description").nextElementSibling.append(a.cloneNode(!0));var i=document.querySelector("#woocommerce_woo-mercado-pago-basic_checkout_advanced_settings"),m=i.nextElementSibling;m.style.display="none",i.style.cursor="pointer",i.innerHTML+=e("header_plus","header_less");var s=document.querySelector("#header_plus"),p=document.querySelector("#header_less");i.onclick=function(){"none"===m.style.display?(m.style.display="block",p.style.display="block",s.style.display="none"):(m.style.display="none",p.style.display="none",s.style.display="block")};var y=document.querySelector("#woocommerce_woo-mercado-pago-basic_checkout_payments_advanced_title"),u=document.querySelector("#woocommerce_woo-mercado-pago-basic_checkout_payments_advanced_description").nextElementSibling,_=document.querySelector("#woocommerce_woo-mercado-pago-basic_checkout_payments_advanced_description");u.style.display="none",_.style.display="none",y.style.cursor="pointer",y.innerHTML+=e("header_plus_2","header_less_2");var h=document.querySelector("#header_plus_2"),b=document.querySelector("#header_less_2");y.onclick=function(){"none"===u.style.display?(u.style.display="block",_.style.display="block",b.style.display="block",h.style.display="none"):(u.style.display="none",_.style.display="none",b.style.display="none",h.style.display="block")};var k=document.querySelector("#woocommerce_woo-mercado-pago-basic_checkout_payments_description").nextElementSibling.getAttribute("class"),g=document.querySelectorAll("."+k+" td.forminp label");for(t=0;t<g.length;t++)g[t].id="mp_input_payments_mt";for(var f="",w="",S=0,v=document.querySelectorAll(".online_payment_method"),q=0;q<v.length;q++)f=v[q].getAttribute("data-translate"),!0===v[q].checked&&(S+=1);S===v.length&&(w="checked");for(var E=0;E<v.length;E++)if(0===E){var x='<div class="all_checkbox"> <label for="checkmeon" id="mp_input_payments"> <input type="checkbox" name="checkmeon" id="checkmeon" '+w+' onclick="completeOnlineCheckbox()"> '+f+" </label> </div>";v[E].parentElement.insertAdjacentHTML("beforebegin",x);break}for(var A="",I="",B=0,M=document.querySelectorAll(".debit_payment_method"),C=0;C<M.length;C++)A=M[C].getAttribute("data-translate"),!0===M[C].checked&&(B+=1);B===M.length&&(I="checked");for(var L=0;L<M.length;L++)if(0===L){var H='<div class="all_checkbox"> <label for="checkmedeb" id="mp_input_payments"> <input type="checkbox" name="checkmedeb" id="checkmedeb" '+I+' onclick="completeDebitCheckbox()"> '+A+" </label> </div>";M[L].parentElement.insertAdjacentHTML("beforebegin",H);break}for(var N="",T="",O=0,j=document.querySelectorAll(".offline_payment_method"),D=0;D<j.length;D++)N=j[D].getAttribute(["data-translate"]),!0===j[D].checked&&(O+=1);O===j.length&&(T="checked");for(var P=0;P<j.length;P++)if(0===P){var z='<div class="all_checkbox"> <label for="checkmeoff" id="mp_input_payments" style="margin-bottom: 37px !important;"> <input type="checkbox" name="checkmeoff" id="checkmeoff" '+T+' onclick="completeOfflineCheckboxMP()"> '+N+" </label> </div>";j[P].parentElement.insertAdjacentHTML("beforebegin",z);break}}null!=document.querySelector(".homologScroll")&&document.querySelector(".homologScroll").addEventListener("click",function(){document.querySelector("#woocommerce_woo-mercado-pago-basic__mp_access_token_prod").scrollIntoView({block:"start",behavior:"smooth"})})},window.completeOnlineCheckbox=function(){for(var e=document.getElementById("checkmeon").checked,o=document.querySelectorAll(".online_payment_method"),t=0;t<o.length;t++)o[t].checked=!0===e},window.completeDebitCheckbox=function(){for(var e=document.getElementById("checkmedeb").checked,o=document.querySelectorAll(".debit_payment_method"),t=0;t<o.length;t++)o[t].checked=!0===e},window.completeOfflineCheckboxMP=function(){for(var e=document.getElementById("checkmeoff").checked,o=document.querySelectorAll(".offline_payment_method"),t=0;t<o.length;t++)o[t].checked=!0===e};
1
+ window.onload=function(){function e(e,o){return'<span class="mp-btn-collapsible" id="'+e+'" style="display:block">+</span> <span class="mp-btn-collapsible" id="'+o+'" style="display:none">-</span>'}document.querySelector(".wc-admin-breadcrumb").style.display="none",document.querySelector(".mp-header-logo").style.display="none",document.querySelector("#_wpnonce").parentElement.style.display="none",document.querySelectorAll("h2")[4].style.display="none";for(var o=document.querySelectorAll("p.description"),t=0;t<o.length;t++)o[t].style.width="420px";for(var c=document.querySelectorAll("th.titledesc"),n=0;n<c.length;n++)c[n].id="mp_field_text",null!=c[n].children[0].children[0]&&(c[n].children[0].children[0].style.position="relative",c[n].children[0].children[0].style.fontSize="22px");for(var l=document.querySelectorAll(".form-table"),d=0;d<l.length;d++)l[d].id="mp_table_"+d;document.querySelector(".hidden-field-mp-title").setAttribute("type","hidden"),document.querySelector(".hidden-field-mp-desc").setAttribute("type","hidden");var r=document.querySelectorAll("#mp_table_0");r[0].children[0].children[0].style.display="none",r[0].children[0].children[1].style.display="none";var a=document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_btn_save");if(null===document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_homolog_title")&&null===document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_credential_description_prod")||document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_credential_description_prod").nextElementSibling.append(a.cloneNode(!0)),null!==document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_homolog_title")||null!==document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_options_title")){document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_advanced_settings").nextElementSibling.append(a.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_options_subtitle").nextElementSibling.append(a.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_payments_description").nextElementSibling.append(a.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_payments_advanced_description").nextElementSibling.append(a.cloneNode(!0));var i=document.querySelector("#woocommerce_woo-mercado-pago-basic_checkout_advanced_settings"),m=i.nextElementSibling;m.style.display="none",i.style.cursor="pointer",i.innerHTML+=e("header_plus","header_less");var s=document.querySelector("#header_plus"),p=document.querySelector("#header_less");i.onclick=function(){"none"===m.style.display?(m.style.display="block",p.style.display="block",s.style.display="none"):(m.style.display="none",p.style.display="none",s.style.display="block")};var y=document.querySelector("#woocommerce_woo-mercado-pago-basic_checkout_payments_advanced_title"),u=document.querySelector("#woocommerce_woo-mercado-pago-basic_checkout_payments_advanced_description").nextElementSibling,_=document.querySelector("#woocommerce_woo-mercado-pago-basic_checkout_payments_advanced_description");u.style.display="none",_.style.display="none",y.style.cursor="pointer",y.innerHTML+=e("header_plus_2","header_less_2");var h=document.querySelector("#header_plus_2"),b=document.querySelector("#header_less_2");y.onclick=function(){"none"===u.style.display?(u.style.display="block",_.style.display="block",b.style.display="block",h.style.display="none"):(u.style.display="none",_.style.display="none",b.style.display="none",h.style.display="block")};for(var k=document.querySelector("#woocommerce_woo-mercado-pago-basic_checkout_payments_description").nextElementSibling.getAttribute("class"),g=document.querySelectorAll("."+k+" td.forminp label"),t=0;t<g.length;t++)g[t].id="mp_input_payments_mt";for(var f="",w="",S=0,v=document.querySelectorAll(".online_payment_method"),q=0;q<v.length;q++)f=v[q].getAttribute("data-translate"),!0===v[q].checked&&(S+=1);S===v.length&&(w="checked");for(var E=0;E<v.length;E++)if(0===E){var x='<div class="all_checkbox"> <label for="checkmeon" id="mp_input_payments"> <input type="checkbox" name="checkmeon" id="checkmeon" '+w+' onclick="completeOnlineCheckbox()"> '+f+" </label> </div>";v[E].parentElement.insertAdjacentHTML("beforebegin",x);break}for(var A="",I="",B=0,M=document.querySelectorAll(".debit_payment_method"),C=0;C<M.length;C++)A=M[C].getAttribute("data-translate"),!0===M[C].checked&&(B+=1);B===M.length&&(I="checked");for(var L=0;L<M.length;L++)if(0===L){var H='<div class="all_checkbox"> <label for="checkmedeb" id="mp_input_payments"> <input type="checkbox" name="checkmedeb" id="checkmedeb" '+I+' onclick="completeDebitCheckbox()"> '+A+" </label> </div>";M[L].parentElement.insertAdjacentHTML("beforebegin",H);break}for(var N="",T="",O=0,j=document.querySelectorAll(".offline_payment_method"),D=0;D<j.length;D++)N=j[D].getAttribute(["data-translate"]),!0===j[D].checked&&(O+=1);O===j.length&&(T="checked");for(var P=0;P<j.length;P++)if(0===P){var z='<div class="all_checkbox"> <label for="checkmeoff" id="mp_input_payments" style="margin-bottom: 37px !important;"> <input type="checkbox" name="checkmeoff" id="checkmeoff" '+T+' onclick="completeOfflineCheckboxMP()"> '+N+" </label> </div>";j[P].parentElement.insertAdjacentHTML("beforebegin",z);break}}null!=document.querySelector(".homologScroll")&&document.querySelector(".homologScroll").addEventListener("click",function(){document.querySelector("#woocommerce_woo-mercado-pago-basic__mp_access_token_prod").scrollIntoView({block:"start",behavior:"smooth"})})},window.completeOnlineCheckbox=function(){for(var e=document.getElementById("checkmeon").checked,o=document.querySelectorAll(".online_payment_method"),t=0;t<o.length;t++)o[t].checked=!0===e},window.completeDebitCheckbox=function(){for(var e=document.getElementById("checkmedeb").checked,o=document.querySelectorAll(".debit_payment_method"),t=0;t<o.length;t++)o[t].checked=!0===e},window.completeOfflineCheckboxMP=function(){for(var e=document.getElementById("checkmeoff").checked,o=document.querySelectorAll(".offline_payment_method"),t=0;t<o.length;t++)o[t].checked=!0===e};
assets/js/credit-card.min.js CHANGED
@@ -1 +1 @@
1
- !function(x){"use strict";x(function(){var t=!1,a={site_id:wc_mercadopago_params.site_id,public_key:wc_mercadopago_params.public_key},e=document.createElement("script");e.src="https://secure.mlstatic.com/sdk/javascript/v1/mercadopago.js",e.onload=function(){Mercadopago.setPublishableKey(a.public_key)};var n={discount_action_url:wc_mercadopago_params.discount_action_url,payer_email:wc_mercadopago_params.payer_email,activated:wc_mercadopago_params.coupon_mode,status:!1},c={},d={};function o(){0!==document.getElementById("mp-card-number").value&&(document.getElementById("mp-card-number").value="",p(),_(),f(),v(),b())}function r(){var e=document.querySelector("#mp-frame-payments");x("#button-show-payments").on("click",function(){e.style.display="inline-block"===e.style.display?"none":"inline-block"})}function u(){return document.getElementById("mp-card-number").value.replace(/[ .-]/g,"").slice(0,6)}function l(e){I(),document.getElementById("mp-card-holder-name").value="",document.getElementById("mp-card-expiration-date").value="",document.getElementById("mp-security-code").value="",v(),_(),f(),b();var o=u();o.length<6?p():"keyup"===e.type?6<=o.length&&Mercadopago.getPaymentMethod({bin:o},i):setTimeout(function(){6<=o.length&&Mercadopago.getPaymentMethod({bin:o},i)},100)}function m(){return(document.getElementById("mp-amount").value-document.getElementById("mp-discount").value)*document.getElementById("currency_ratio").value}function i(e,o){var t,n;200===e?(c=o[0],n=c.id,document.getElementById("paymentMethodId").value=n,t=c.secure_thumbnail,document.getElementById("mp-card-number").style.background="url("+t+") 98% 50% no-repeat #fff",function(e){d={issuer:!1,cardholder_name:!1,cardholder_identification_type:!1,cardholder_identification_number:!1};for(var o=0;o<e.length;o++)"issuer_id"===e[o]&&(d.issuer=!0),"cardholder_name"===e[o]&&(d.cardholder_name=!0),"cardholder_identification_type"===e[o]&&(d.cardholder_identification_type=!0),"cardholder_identification_number"===e[o]&&(d.cardholder_identification_number=!0)}(c.additional_info_needed),function(){d.cardholder_name?document.getElementById("mp-card-holder-div").style.display="block":document.getElementById("mp-card-holder-div").style.display="none";d.issuer?(document.getElementById("mp-issuer-div").style.display="block",document.getElementById("installments-div").classList.remove("mp-col-md-12"),document.getElementById("installments-div").classList.add("mp-col-md-8"),Mercadopago.getIssuers(c.id,S)):(v(),h());d.cardholder_identification_type?(document.getElementById("mp-doc-div").style.display="inline-block",document.getElementById("mp-doc-type-div").style.display="block",Mercadopago.getIdentificationTypes()):document.getElementById("mp-doc-type-div").style.display="none";d.cardholder_identification_number?(document.getElementById("mp-doc-div").style.display="inline-block",document.getElementById("mp-doc-number-div").style.display="block"):document.getElementById("mp-doc-number-div").style.display="none";d.cardholder_identification_type||d.cardholder_identification_number||(document.getElementById("mp-doc-div").style.display="none")}(),document.getElementById("mp-card-number").classList.remove("mp-form-control-error"),document.getElementById("mp-error-E301").style.display="none"):(p(),document.getElementById("mp-card-number").classList.add("mp-form-control-error"),document.getElementById("mp-error-E301").style.display="inline-block")}function p(){document.getElementById("mp-card-number").style.background="no-repeat #fff"}function s(e){var o="";if("MLA"!==a.site_id)return o;for(var t=0;t<e.length;t++)-1!==e[t].indexOf("CFT_")&&(o='data-tax="'+e[t]+'"');return o}function y(e,o){if(200===e){for(var t=document.getElementById("mp-installments"),n='<option value="-1">'+wc_mercadopago_params.choose+"...</option>",r=[],c=0;c<o.length;c++)"aggregator"===o[c].processing_mode&&(r=o[c].payer_costs);for(var d=0;d<r.length;d++)n+='<option value="'+r[d].installments+'" '+s(r[d].labels)+">"+(r[d].recommended_message||r[d].installments)+"</option>";t.innerHTML=n,"MLA"===a.site_id&&(f(),x("body").on("change","#mp-installments",g))}else _(),f()}function g(){var e=document.querySelector("#mp-installments"),o=e.options[e.selectedIndex].getAttribute("data-tax"),t="",n="";if(null!=o){var r=o.split("|");t=r[0].replace("_"," "),n=r[1].replace("_"," "),"CFT 0,00%"===t&&"TEA 0,00%"===n&&(n=t="")}document.querySelector("#mp-tax-cft-text").innerHTML=t,document.querySelector("#mp-tax-tea-text").innerHTML=n}function _(){document.getElementById("mp-installments").innerHTML=""}function f(){document.querySelector("#mp-tax-cft-text").innerHTML="",document.querySelector("#mp-tax-tea-text").innerHTML=""}function v(){document.getElementById("mp-issuer-div").style.display="none",document.getElementById("installments-div").classList.remove("mp-col-md-8"),document.getElementById("installments-div").classList.add("mp-dis-md-12"),document.getElementById("mp-issuer").innerHTML=""}function b(){document.getElementById("mp-doc-div").style.display="none",document.getElementById("mp-doc-type-div").style.display="none",document.getElementById("docType").innerHTML="",document.getElementById("docNumber").value=""}function h(){for(var e={},o=m(),t=!1,n=0;n<c.additional_info_needed.length;n++)"issuer_id"===c.additional_info_needed[n]&&(t=!0);if(t){var r=document.getElementById("mp-issuer").value;if(e={bin:u(),amount:o,issuer_id:r},"-1"===r)return}else e={bin:u(),amount:o};Mercadopago.getInstallments(e,y)}function S(e,o){if(200===e){var t=document.getElementById("mp-issuer"),n=document.createDocumentFragment();t.options.length=0;var r=new Option(wc_mercadopago_params.choose+"...","-1");n.appendChild(r);for(var c=0;c<o.length;c++){var d="default"===o[c].name?"Otro":o[c].name;n.appendChild(new Option(d,o[c].id))}t.appendChild(n),t.removeAttribute("disabled"),x("body").on("change","#mp-issuer",h)}else v()}function q(){return document.querySelector("#mercadopago-form")}function E(){I();var e=function(){for(var e=!1,o=q(),t=o.querySelectorAll("[data-checkout]"),n=["installments","securityCode","cardExpirationDate","cardNumber"],r=0;r<t.length;r++){var c=t[r];if(-1<n.indexOf(c.getAttribute("data-checkout"))&&("-1"===c.value||""===c.value)){var d=o.querySelectorAll('span[data-main="#'+c.id+'"]');0<d.length&&(d[0].style.display="inline-block"),c.classList.add("mp-form-control-error"),e=!0}}return e||e}(),o=function(){var e=!1;if(d.issuer){var o=document.getElementById("mp-issuer");"-1"!==o.value&&""!==o.value||(o.classList.add("mp-form-control-error"),e=!0)}if(d.cardholder_name){var t=document.getElementById("mp-card-holder-name");"-1"!==t.value&&""!==t.value||(t.classList.add("mp-form-control-error"),e=!0)}if(d.cardholder_identification_type){var n=document.getElementById("docType");"-1"!==n.value&&""!==n.value||(n.classList.add("mp-form-control-error"),e=!0)}if(d.cardholder_identification_number){var r=document.getElementById("docNumber");"-1"!==r.value&&""!==r.value||(r.classList.add("mp-form-control-error"),document.getElementById("mp-error-324").style.display="inline-block",e=!0)}return e||e}();return!e&&!o||(B(),void k())}function k(){void 0!==document.querySelectorAll(".mp-form-control-error")&&document.querySelectorAll(".mp-form-control-error")[0].focus()}function I(){for(var e=0;e<document.querySelectorAll("[data-checkout]").length;e++){var o=document.querySelectorAll("[data-checkout]")[e];o.classList.remove("mp-error-input"),o.classList.remove("mp-form-control-error")}for(var t=0;t<document.querySelectorAll(".mp-error").length;t++){document.querySelectorAll(".mp-error")[t].style.display="none"}}function B(){0<x("form#order_review").length&&x(".blockOverlay").css("display","none")}function C(e,o){(document.querySelector("#mp-box-loading").style.background="",200!==e&&201!==e)?(function(e){for(var o=q(),t=0;t<e.cause.length;t++){var n=e.cause[t],r=void 0;if(void 0!==(r="208"===n.code||"209"===n.code||"325"===n.code||"326"===n.code?o.querySelector("#mp-error-208"):o.querySelector("#mp-error-"+n.code))){var c=o.querySelector(r.getAttribute("data-main"));r.style.display="inline-block",c.classList.add("mp-form-control-error")}}}(o),B(),k()):(document.querySelector("#token").value=o.id,t=!0,x("form.checkout, form#order_review").submit())}function w(){o(),document.querySelector("#mpCouponApplyed").style.display="none",""===document.querySelector("#couponCode").value?(n.status=!1,document.querySelector("#mpCouponError").style.display="block",document.querySelector("#mpCouponError").innerHTML=wc_mercadopago_params.coupon_empty,document.querySelector("#couponCode").style.background=null,document.querySelector("#applyCoupon").value=wc_mercadopago_params.apply,document.querySelector("#mp-discount").value=0):n.status?(n.status=!1,document.querySelector("#mpCouponError").style.display="none",document.querySelector("#applyCoupon").style.background=null,document.querySelector("#applyCoupon").value=wc_mercadopago_params.apply,document.querySelector("#couponCode").value="",document.querySelector("#couponCode").style.background=null,document.querySelector("#mp-discount").value=0):(document.querySelector("#mpCouponError").style.display="none",document.querySelector("#couponCode").style.background="url("+wc_mercadopago_params.loading+") 98% 50% no-repeat #fff",document.querySelector("#couponCode").style.border="1px solid #cecece",document.querySelector("#applyCoupon").disabled=!0,function(){var e=n.discount_action_url,o="?";0<=e.indexOf("?")&&(o="&");e+=o+"site_id="+wc_mercadopago_params.site_id,e+="&coupon_id="+document.querySelector("#couponCode").value,e+="&amount="+document.querySelector("#mp-amount").value,e+="&payer="+n.payer_email,x.ajax({url:e,method:"GET",timeout:5e3,error:function(){n.status=!1,document.querySelector("#mpCouponApplyed").style.display="none",document.querySelector("#mpCouponError").style.display="none",document.querySelector("#applyCoupon").style.background=null,document.querySelector("#applyCoupon").value=wc_mercadopago_params.apply,document.querySelector("#couponCode").value="",document.querySelector("#couponCode").style.background=null,document.querySelector("#mp-discount").value=0},success:function(e){200===e.status?(n.status=!0,document.querySelector("#mpCouponApplyed").style.display="block",document.querySelector("#mp-discount").value=e.response.coupon_amount,document.querySelector("#mpCouponApplyed").innerHTML=wc_mercadopago_params.discount_info1+" <strong>"+L(e.response.currency_id)+" "+Math.round(100*e.response.coupon_amount)/100+"</strong> "+wc_mercadopago_params.discount_info2+" "+e.response.name+".<br>"+wc_mercadopago_params.discount_info3+" <strong>"+L(e.response.currency_id)+" "+Math.round(100*document.querySelector("#mp-amount").value)/100+"</strong><br>"+wc_mercadopago_params.discount_info4+" <strong>"+L(e.response.currency_id)+" "+Math.round(100*m())/100+"*</strong><br><i>"+wc_mercadopago_params.discount_info5+'</i><br><a href="https://api.mercadolibre.com/campaigns/'+e.response.id+'/terms_and_conditions?format_type=html" target="_blank">'+wc_mercadopago_params.discount_info6+"</a>",document.querySelector("#mpCouponError").style.display="none",document.querySelector("#couponCode").style.background=null,document.querySelector("#couponCode").style.background="url("+wc_mercadopago_params.check+") 94% 50% no-repeat #fff",document.querySelector("#couponCode").style.border="1px solid #cecece",document.querySelector("#applyCoupon").value=wc_mercadopago_params.remove,document.querySelector("#campaign_id").value=e.response.id,document.querySelector("#campaign").value=e.response.name):(n.status=!1,document.querySelector("#mpCouponApplyed").style.display="none",document.querySelector("#mpCouponError").style.display="block",document.querySelector("#mpCouponError").innerHTML=e.response.message,document.querySelector("#couponCode").style.background=null,document.querySelector("#couponCode").style.background="url("+wc_mercadopago_params.error+") 94% 50% no-repeat #fff",document.querySelector("#applyCoupon").value=wc_mercadopago_params.apply,document.querySelector("#mp-discount").value=0),document.querySelector("#applyCoupon").disabled=!1}})}())}function L(e){return"ARS"===e?"$":"BRL"===e?"R$":"COP"===e||"CLP"===e||"MXN"===e?"$":"VEF"===e?"Bs":"PEN"===e?"S/":"UYU"===e?"$U":"$"}function M(){return t?!(t=!1):!document.getElementById("payment_method_woo-mercado-pago-custom").checked||!!E()&&function(){I(),document.querySelector("#mp-box-loading").style.background="url("+wc_mercadopago_params.loading+") 0 50% no-repeat #fff";var e=q();return Mercadopago.createToken(e,C),!1}()}0<x("form#order_review").length&&("yes"===n.activated&&x("#applyCoupon").on("click",w),r()),x("body").on("updated_checkout",function(){"yes"===n.activated&&x("#applyCoupon").on("click",w),o(),r()}),x("body").on("keyup","#mp-card-number",l),x("body").on("change","#mp-card-number",l),x("form.checkout").on("checkout_place_order_woo-mercado-pago-custom",function(){return M()}),x("form#order_review").submit(function(){return M()}),window.onload=function(){document.querySelector("body").append(e)}})}(jQuery);
1
+ !function(M){"use strict";M(function(){var t=!1,a={site_id:wc_mercadopago_params.site_id,public_key:wc_mercadopago_params.public_key},e=document.createElement("script");e.src="https://secure.mlstatic.com/sdk/javascript/v1/mercadopago.js",e.onload=function(){Mercadopago.setPublishableKey(a.public_key)};var n={discount_action_url:wc_mercadopago_params.discount_action_url,payer_email:wc_mercadopago_params.payer_email,activated:wc_mercadopago_params.coupon_mode,status:!1},c={},l={};function o(){0!==document.getElementById("mp-card-number").value&&(document.getElementById("mp-card-number").value="",p(),g(),_(),f(),v())}function r(){var e=document.querySelector("#mp-frame-payments");M("#button-show-payments").on("click",function(){e.style.display="inline-block"===e.style.display?"none":"inline-block"})}function d(){return document.getElementById("mp-card-number").value.replace(/[ .-]/g,"").slice(0,6)}function u(e){k(),document.getElementById("mp-card-holder-name").value="",document.getElementById("mp-card-expiration-date").value="",document.getElementById("mp-security-code").value="",f(),g(),_(),v();var o=d();o.length<6?p():"keyup"===e.type?6<=o.length&&Mercadopago.getPaymentMethod({bin:o},i):setTimeout(function(){6<=o.length&&Mercadopago.getPaymentMethod({bin:o},i)},100)}function m(){return(document.getElementById("mp-amount").value-document.getElementById("mp-discount").value)*document.getElementById("currency_ratio").value}function i(e,o){var t,n;200===e?(c=o[0],n=c.id,document.getElementById("paymentMethodId").value=n,t=c.secure_thumbnail,document.getElementById("mp-card-number").style.background="url("+t+") 98% 50% no-repeat #fff",function(e){l={issuer:!1,cardholder_name:!1,cardholder_identification_type:!1,cardholder_identification_number:!1};for(var o=0;o<e.length;o++)"issuer_id"===e[o]&&(l.issuer=!0),"cardholder_name"===e[o]&&(l.cardholder_name=!0),"cardholder_identification_type"===e[o]&&(l.cardholder_identification_type=!0),"cardholder_identification_number"===e[o]&&(l.cardholder_identification_number=!0)}(c.additional_info_needed),function(){l.cardholder_name?document.getElementById("mp-card-holder-div").style.display="block":document.getElementById("mp-card-holder-div").style.display="none";l.issuer?(document.getElementById("mp-issuer-div").style.display="block",document.getElementById("installments-div").classList.remove("mp-col-md-12"),document.getElementById("installments-div").classList.add("mp-col-md-8"),Mercadopago.getIssuers(c.id,h)):(f(),b());l.cardholder_identification_type?(document.getElementById("mp-doc-div").style.display="inline-block",document.getElementById("mp-doc-type-div").style.display="block",Mercadopago.getIdentificationTypes()):document.getElementById("mp-doc-type-div").style.display="none";l.cardholder_identification_number?(document.getElementById("mp-doc-div").style.display="inline-block",document.getElementById("mp-doc-number-div").style.display="block"):document.getElementById("mp-doc-number-div").style.display="none";l.cardholder_identification_type||l.cardholder_identification_number||(document.getElementById("mp-doc-div").style.display="none")}(),document.getElementById("mp-card-number").classList.remove("mp-form-control-error"),document.getElementById("mp-error-E301").style.display="none"):(p(),document.getElementById("mp-card-number").classList.add("mp-form-control-error"),document.getElementById("mp-error-E301").style.display="inline-block")}function p(){document.getElementById("mp-card-number").style.background="no-repeat #fff"}function s(e,o){if(200===e){for(var t=document.getElementById("mp-installments"),n='<option value="-1">'+wc_mercadopago_params.choose+"...</option>",r=[],c=0;c<o.length;c++)"aggregator"===o[c].processing_mode&&(r=o[c].payer_costs);for(var d=0;d<r.length;d++)n+='<option value="'+r[d].installments+'" '+function(e){var o="";if("MLA"!==a.site_id)return o;for(var t=0;t<e.length;t++)-1!==e[t].indexOf("CFT_")&&(o='data-tax="'+e[t]+'"');return o}(r[d].labels)+">"+(r[d].recommended_message||r[d].installments)+"</option>";t.innerHTML=n,"MLA"===a.site_id&&(_(),M("body").on("change","#mp-installments",y))}else g(),_()}function y(){var e,o=document.querySelector("#mp-installments"),t=o.options[o.selectedIndex].getAttribute("data-tax"),n="",r="";null!=t&&(n=(e=t.split("|"))[0].replace("_"," "),r=e[1].replace("_"," "),"CFT 0,00%"===n&&"TEA 0,00%"===r&&(r=n="")),document.querySelector("#mp-tax-cft-text").innerHTML=n,document.querySelector("#mp-tax-tea-text").innerHTML=r}function g(){document.getElementById("mp-installments").innerHTML=""}function _(){document.querySelector("#mp-tax-cft-text").innerHTML="",document.querySelector("#mp-tax-tea-text").innerHTML=""}function f(){document.getElementById("mp-issuer-div").style.display="none",document.getElementById("installments-div").classList.remove("mp-col-md-8"),document.getElementById("installments-div").classList.add("mp-dis-md-12"),document.getElementById("mp-issuer").innerHTML=""}function v(){document.getElementById("mp-doc-div").style.display="none",document.getElementById("mp-doc-type-div").style.display="none",document.getElementById("docType").innerHTML="",document.getElementById("docNumber").value=""}function b(){for(var e={},o=m(),t=!1,n=0;n<c.additional_info_needed.length;n++)"issuer_id"===c.additional_info_needed[n]&&(t=!0);if(t){var r=document.getElementById("mp-issuer").value,e={bin:d(),amount:o,issuer_id:r};if("-1"===r)return}else e={bin:d(),amount:o};Mercadopago.getInstallments(e,s)}function h(e,o){if(200===e){var t=document.getElementById("mp-issuer"),n=document.createDocumentFragment();t.options.length=0;var r=new Option(wc_mercadopago_params.choose+"...","-1");n.appendChild(r);for(var c=0;c<o.length;c++){var d="default"===o[c].name?"Otro":o[c].name;n.appendChild(new Option(d,o[c].id))}t.appendChild(n),t.removeAttribute("disabled"),M("body").on("change","#mp-issuer",b)}else f()}function S(){return document.querySelector("#mercadopago-form")}function q(){k();var e,o,t,n,r,c=function(){for(var e=!1,o=S(),t=o.querySelectorAll("[data-checkout]"),n=["installments","securityCode","cardExpirationDate","cardNumber"],r=0;r<t.length;r++){var c,d=t[r];-1<n.indexOf(d.getAttribute("data-checkout"))&&("-1"!==d.value&&""!==d.value||(0<(c=o.querySelectorAll('span[data-main="#'+d.id+'"]')).length&&(c[0].style.display="inline-block"),d.classList.add("mp-form-control-error"),e=!0))}return e||e}(),d=(r=!1,l.issuer&&("-1"!==(e=document.getElementById("mp-issuer")).value&&""!==e.value||(e.classList.add("mp-form-control-error"),r=!0)),l.cardholder_name&&("-1"!==(o=document.getElementById("mp-card-holder-name")).value&&""!==o.value||(o.classList.add("mp-form-control-error"),r=!0)),l.cardholder_identification_type&&("-1"!==(t=document.getElementById("docType")).value&&""!==t.value||(t.classList.add("mp-form-control-error"),r=!0)),l.cardholder_identification_number&&("-1"!==(n=document.getElementById("docNumber")).value&&""!==n.value||(n.classList.add("mp-form-control-error"),document.getElementById("mp-error-324").style.display="inline-block",r=!0)),r||r);return!c&&!d||(I(),void E())}function E(){void 0!==document.querySelectorAll(".mp-form-control-error")&&document.querySelectorAll(".mp-form-control-error")[0].focus()}function k(){for(var e=0;e<document.querySelectorAll("[data-checkout]").length;e++){var o=document.querySelectorAll("[data-checkout]")[e];o.classList.remove("mp-error-input"),o.classList.remove("mp-form-control-error")}for(var t=0;t<document.querySelectorAll(".mp-error").length;t++){document.querySelectorAll(".mp-error")[t].style.display="none"}}function I(){0<M("form#order_review").length&&M(".blockOverlay").css("display","none")}function B(e,o){document.querySelector("#mp-box-loading").style.background="",200!==e&&201!==e?(function(e){for(var o=S(),t=0;t<e.cause.length;t++){var n,r=e.cause[t],c=void 0;void 0!==(c="208"===r.code||"209"===r.code||"325"===r.code||"326"===r.code?o.querySelector("#mp-error-208"):o.querySelector("#mp-error-"+r.code))&&(n=o.querySelector(c.getAttribute("data-main")),c.style.display="inline-block",n.classList.add("mp-form-control-error"))}}(o),I(),E()):(document.querySelector("#token").value=o.id,t=!0,M("form.checkout, form#order_review").submit())}function C(){o(),document.querySelector("#mpCouponApplyed").style.display="none",""===document.querySelector("#couponCode").value?(n.status=!1,document.querySelector("#mpCouponError").style.display="block",document.querySelector("#mpCouponError").innerHTML=wc_mercadopago_params.coupon_empty,document.querySelector("#couponCode").style.background=null,document.querySelector("#applyCoupon").value=wc_mercadopago_params.apply,document.querySelector("#mp-discount").value=0):n.status?(n.status=!1,document.querySelector("#mpCouponError").style.display="none",document.querySelector("#applyCoupon").style.background=null,document.querySelector("#applyCoupon").value=wc_mercadopago_params.apply,document.querySelector("#couponCode").value="",document.querySelector("#couponCode").style.background=null,document.querySelector("#mp-discount").value=0):(document.querySelector("#mpCouponError").style.display="none",document.querySelector("#couponCode").style.background="url("+wc_mercadopago_params.loading+") 98% 50% no-repeat #fff",document.querySelector("#couponCode").style.border="1px solid #cecece",document.querySelector("#applyCoupon").disabled=!0,function(){var e=n.discount_action_url,o="?";0<=e.indexOf("?")&&(o="&");e+=o+"site_id="+wc_mercadopago_params.site_id,e+="&coupon_id="+document.querySelector("#couponCode").value,e+="&amount="+document.querySelector("#mp-amount").value,e+="&payer="+n.payer_email,M.ajax({url:e,method:"GET",timeout:5e3,error:function(){n.status=!1,document.querySelector("#mpCouponApplyed").style.display="none",document.querySelector("#mpCouponError").style.display="none",document.querySelector("#applyCoupon").style.background=null,document.querySelector("#applyCoupon").value=wc_mercadopago_params.apply,document.querySelector("#couponCode").value="",document.querySelector("#couponCode").style.background=null,document.querySelector("#mp-discount").value=0},success:function(e){200===e.status?(n.status=!0,document.querySelector("#mpCouponApplyed").style.display="block",document.querySelector("#mp-discount").value=e.response.coupon_amount,document.querySelector("#mpCouponApplyed").innerHTML=wc_mercadopago_params.discount_info1+" <strong>"+w(e.response.currency_id)+" "+Math.round(100*e.response.coupon_amount)/100+"</strong> "+wc_mercadopago_params.discount_info2+" "+e.response.name+".<br>"+wc_mercadopago_params.discount_info3+" <strong>"+w(e.response.currency_id)+" "+Math.round(100*document.querySelector("#mp-amount").value)/100+"</strong><br>"+wc_mercadopago_params.discount_info4+" <strong>"+w(e.response.currency_id)+" "+Math.round(100*m())/100+"*</strong><br><i>"+wc_mercadopago_params.discount_info5+'</i><br><a href="https://api.mercadolibre.com/campaigns/'+e.response.id+'/terms_and_conditions?format_type=html" target="_blank">'+wc_mercadopago_params.discount_info6+"</a>",document.querySelector("#mpCouponError").style.display="none",document.querySelector("#couponCode").style.background=null,document.querySelector("#couponCode").style.background="url("+wc_mercadopago_params.check+") 94% 50% no-repeat #fff",document.querySelector("#couponCode").style.border="1px solid #cecece",document.querySelector("#applyCoupon").value=wc_mercadopago_params.remove,document.querySelector("#campaign_id").value=e.response.id,document.querySelector("#campaign").value=e.response.name):(n.status=!1,document.querySelector("#mpCouponApplyed").style.display="none",document.querySelector("#mpCouponError").style.display="block",document.querySelector("#mpCouponError").innerHTML=e.response.message,document.querySelector("#couponCode").style.background=null,document.querySelector("#couponCode").style.background="url("+wc_mercadopago_params.error+") 94% 50% no-repeat #fff",document.querySelector("#applyCoupon").value=wc_mercadopago_params.apply,document.querySelector("#mp-discount").value=0),document.querySelector("#applyCoupon").disabled=!1}})}())}function w(e){return"ARS"===e?"$":"BRL"===e?"R$":"COP"===e||"CLP"===e||"MXN"===e?"$":"VEF"===e?"Bs":"PEN"===e?"S/":"UYU"===e?"$U":"$"}function L(){return t?!(t=!1):!document.getElementById("payment_method_woo-mercado-pago-custom").checked||!!q()&&function(){k(),document.querySelector("#mp-box-loading").style.background="url("+wc_mercadopago_params.loading+") 0 50% no-repeat #fff";var e=S();return Mercadopago.createToken(e,B),!1}()}0<M("form#order_review").length&&("yes"===n.activated&&M("#applyCoupon").on("click",C),r()),M("body").on("updated_checkout",function(){"yes"===n.activated&&M("#applyCoupon").on("click",C),o(),r()}),M("body").on("keyup","#mp-card-number",u),M("body").on("change","#mp-card-number",u),M("form.checkout").on("checkout_place_order_woo-mercado-pago-custom",L),M("form#order_review").submit(L),window.onload=function(){document.querySelector("body").append(e)}})}(jQuery);
assets/js/custom_config_mercadopago.min.js CHANGED
@@ -1 +1 @@
1
- window.onload=function(){document.querySelector(".wc-admin-breadcrumb").style.display="none",document.querySelector(".mp-header-logo").style.display="none",document.querySelector("#_wpnonce").parentElement.style.display="none",document.querySelectorAll("h2")[4].style.display="none";for(var e=document.querySelectorAll("p.description"),o=0;o<e.length;o++)e[o].style.width="420px";for(var t=document.querySelectorAll("th.titledesc"),c=0;c<t.length;c++)t[c].id="mp_field_text",null!=t[c].children[0].children[0]&&(t[c].children[0].children[0].style.position="relative",t[c].children[0].children[0].style.fontSize="22px");for(var l=document.querySelectorAll(".form-table"),n=0;n<l.length;n++)l[n].id="mp_table_"+n;document.querySelector(".hidden-field-mp-title").setAttribute("type","hidden"),document.querySelector(".hidden-field-mp-desc").setAttribute("type","hidden");var d=document.querySelectorAll("#mp_table_0");d[0].children[0].children[0].style.display="none",d[0].children[0].children[1].style.display="none";var s=document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_btn_save");if(null===document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_homolog_title")&&null===document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_credential_description_prod")||document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_credential_description_prod").nextElementSibling.append(s.cloneNode(!0)),null!==document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_homolog_title")||null!==document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_custom_options_title")){document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_advanced_settings").nextElementSibling.append(s.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_custom_options_subtitle").nextElementSibling.append(s.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_payments_description").nextElementSibling.append(s.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_payments_advanced_description").nextElementSibling.append(s.cloneNode(!0));var m=document.querySelector("#woocommerce_woo-mercado-pago-custom_checkout_advanced_settings"),r=m.nextElementSibling;r.style.display="none",m.style.cursor="pointer",m.innerHTML+='<span class="mp-btn-collapsible" id="header_plus" style="display:block">+</span> <span class="mp-btn-collapsible" id="header_less" style="display:none">-</span>';var a=document.querySelector("#header_plus"),i=document.querySelector("#header_less");m.onclick=function(){"none"===r.style.display?(r.style.display="block",i.style.display="block",a.style.display="none"):(r.style.display="none",i.style.display="none",a.style.display="block")},document.querySelector("#woocommerce_woo-mercado-pago-custom_checkout_payments_advanced_description").nextElementSibling.style.display="none";var p=document.querySelector("#woocommerce_woo-mercado-pago-custom_checkout_custom_payments_advanced_title"),u=document.querySelector("#woocommerce_woo-mercado-pago-custom_checkout_payments_advanced_description").nextElementSibling,y=document.querySelector("#woocommerce_woo-mercado-pago-custom_checkout_payments_advanced_description");u.style.display="none",y.style.display="none",p.style.cursor="pointer",p.innerHTML+='<span class="mp-btn-collapsible" id="header_plus_2" style="display:block">+</span> <span class="mp-btn-collapsible" id="header_less_2" style="display:none">-</span>';var _=document.querySelector("#header_plus_2"),h=document.querySelector("#header_less_2");p.onclick=function(){"none"===u.style.display?(u.style.display="block",h.style.display="block",u.style.display="block",_.style.display="none"):(u.style.display="none",h.style.display="none",y.style.display="none",_.style.display="block")}}null!=document.querySelector(".homologScroll")&&document.querySelector(".homologScroll").addEventListener("click",function(){document.querySelector("#woocommerce_woo-mercado-pago-custom__mp_access_token_prod").scrollIntoView({block:"start",behavior:"smooth"})})};
1
+ window.onload=function(){document.querySelector(".wc-admin-breadcrumb").style.display="none",document.querySelector(".mp-header-logo").style.display="none",document.querySelector("#_wpnonce").parentElement.style.display="none",document.querySelectorAll("h2")[4].style.display="none";for(var e=document.querySelectorAll("p.description"),o=0;o<e.length;o++)e[o].style.width="420px";for(var t=document.querySelectorAll("th.titledesc"),c=0;c<t.length;c++)t[c].id="mp_field_text",null!=t[c].children[0].children[0]&&(t[c].children[0].children[0].style.position="relative",t[c].children[0].children[0].style.fontSize="22px");for(var l=document.querySelectorAll(".form-table"),n=0;n<l.length;n++)l[n].id="mp_table_"+n;document.querySelector(".hidden-field-mp-title").setAttribute("type","hidden"),document.querySelector(".hidden-field-mp-desc").setAttribute("type","hidden");var d=document.querySelectorAll("#mp_table_0");d[0].children[0].children[0].style.display="none",d[0].children[0].children[1].style.display="none";var s,m,r,a,i,p,u,y,_,h=document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_btn_save");null===document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_homolog_title")&&null===document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_credential_description_prod")||document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_credential_description_prod").nextElementSibling.append(h.cloneNode(!0)),null===document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_homolog_title")&&null===document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_custom_options_title")||(document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_advanced_settings").nextElementSibling.append(h.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_custom_options_subtitle").nextElementSibling.append(h.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_payments_description").nextElementSibling.append(h.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_payments_advanced_description").nextElementSibling.append(h.cloneNode(!0)),s=document.querySelector("#woocommerce_woo-mercado-pago-custom_checkout_advanced_settings"),(m=s.nextElementSibling).style.display="none",s.style.cursor="pointer",s.innerHTML+='<span class="mp-btn-collapsible" id="header_plus" style="display:block">+</span> <span class="mp-btn-collapsible" id="header_less" style="display:none">-</span>',r=document.querySelector("#header_plus"),a=document.querySelector("#header_less"),s.onclick=function(){"none"===m.style.display?(m.style.display="block",a.style.display="block",r.style.display="none"):(m.style.display="none",a.style.display="none",r.style.display="block")},document.querySelector("#woocommerce_woo-mercado-pago-custom_checkout_payments_advanced_description").nextElementSibling.style.display="none",i=document.querySelector("#woocommerce_woo-mercado-pago-custom_checkout_custom_payments_advanced_title"),p=document.querySelector("#woocommerce_woo-mercado-pago-custom_checkout_payments_advanced_description").nextElementSibling,u=document.querySelector("#woocommerce_woo-mercado-pago-custom_checkout_payments_advanced_description"),p.style.display="none",u.style.display="none",i.style.cursor="pointer",i.innerHTML+='<span class="mp-btn-collapsible" id="header_plus_2" style="display:block">+</span> <span class="mp-btn-collapsible" id="header_less_2" style="display:none">-</span>',y=document.querySelector("#header_plus_2"),_=document.querySelector("#header_less_2"),i.onclick=function(){"none"===p.style.display?(p.style.display="block",_.style.display="block",p.style.display="block",y.style.display="none"):(p.style.display="none",_.style.display="none",u.style.display="none",y.style.display="block")}),null!=document.querySelector(".homologScroll")&&document.querySelector(".homologScroll").addEventListener("click",function(){document.querySelector("#woocommerce_woo-mercado-pago-custom__mp_access_token_prod").scrollIntoView({block:"start",behavior:"smooth"})})};
assets/js/ticket.js CHANGED
@@ -354,7 +354,7 @@
354
  } else {
355
  docCI = 10 - x % 10;
356
  }
357
- return (dig === docCI);
358
  }
359
 
360
  /**
354
  } else {
355
  docCI = 10 - x % 10;
356
  }
357
+ return (dig === docCI.toString());
358
  }
359
 
360
  /**
assets/js/ticket.min.js CHANGED
@@ -1 +1 @@
1
- !function(l){"use strict";l(function(){var e=!1,d="CPF",n={site_id:wc_mercadopago_ticket_params.site_id},o={discount_action_url:wc_mercadopago_ticket_params.discount_action_url,payer_email:wc_mercadopago_ticket_params.payer_email,activated:wc_mercadopago_ticket_params.coupon_mode,status:!1};function t(){return!document.getElementById("payment_method_woo-mercado-pago-ticket").checked||("MLB"===n.site_id?(function(){for(var e=document.querySelector("#mercadopago-form-ticket"),t=e.querySelectorAll("[data-checkout]"),o=e.querySelectorAll(".mp-erro_febraban"),r=0;r<t.length;r++){var c=t[r],n=e.querySelector(o[r].getAttribute("data-main"));"none"===c.parentNode.style.display||-1!==c.value&&""!==c.value?(o[r].style.display="none",n.classList.remove("mp-form-control-error")):(o[r].style.display="inline-block",n.classList.add("mp-form-control-error"))}for(var u=0;u<t.length;u++){var a=t[u];if("none"!==a.parentNode.style.display&&(-1===a.value||""===a.value))return void a.focus()}return 1}()&&r()?e=!0:c(),e):"MLU"===n.site_id?(r()?e=!0:c(),e):void 0)}function r(){var e,t,o=document.getElementById("mp_doc_number"),r=document.getElementById("mp_error_docnumber"),c=!1;return"MLB"===n.site_id&&(e=o.value,c=("CPF"!==d?function(e){if(""===(e=e.replace(/[^\d]+/g,"")))return!1;if(14!==e.length)return!1;if("00000000000000"===e||"11111111111111"===e||"22222222222222"===e||"33333333333333"===e||"44444444444444"===e||"55555555555555"===e||"66666666666666"===e||"77777777777777"===e||"88888888888888"===e||"99999999999999"===e)return!1;for(var t=e.length-2,o=e.substring(0,t),r=e.substring(t),c=0,n=t-7,u=t;1<=u;u--)c+=o.charAt(t-u)*n--,n<2&&(n=9);var a=c%11<2?0:11-c%11;if(a.toString()!==r[0])return!1;for(t+=1,o=e.substring(0,t),c=0,n=t-7,u=t;1<=u;u--)c+=o.charAt(t-u)*n--,n<2&&(n=9);return(a=c%11<2?0:11-c%11).toString()===r[1]}:function(e){var t,o;if(t=0,"00000000000"===(e=e.replace(/[.-\s]/g,"")))return!1;for(var r=1;r<=9;r++)t+=parseInt(e.substring(r-1,r),10)*(11-r);if(10!=(o=10*t%11)&&11!==o||(o=0),o!==parseInt(e.substring(9,10),10))return!1;t=0;for(var c=1;c<=10;c++)t+=parseInt(e.substring(c-1,c),10)*(12-c);return 10!=(o=10*t%11)&&11!==o||(o=0),o===parseInt(e.substring(10,11),10)})(e)),"MLU"===n.site_id&&(c=""!==(t=o.value)&&function(e){var t=0,o=0,r=e[e.length-1];if(e.length<=6)for(o=e.length;o<7;o++)e="0"+e;for(o=0;o<7;o++)t+=parseInt("2987634"[o],10)*parseInt(e[o],10)%10;return r===(t%10==0?0:10-t%10)}(t)),c?(r.style.display="none",o.classList.remove("mp-form-control-error"),c=!0):(r.style.display="block",o.classList.add("mp-form-control-error"),o.focus()),c}function c(){0<l("form#order_review").length&&l(".blockOverlay").css("display","none")}function u(){document.querySelector("#mpCouponApplyedTicket").style.display="none",""===document.querySelector("#couponCodeTicket").value?(o.status=!1,document.querySelector("#mpCouponErrorTicket").style.display="block",document.querySelector("#mpCouponErrorTicket").innerHTML=wc_mercadopago_ticket_params.coupon_empty,document.querySelector("#couponCodeTicket").style.background=null,document.querySelector("#applyCouponTicket").value=wc_mercadopago_ticket_params.apply,document.querySelector("#discountTicket").value=0):o.status?(o.status=!1,document.querySelector("#mpCouponErrorTicket").style.display="none",document.querySelector("#applyCouponTicket").style.background=null,document.querySelector("#applyCouponTicket").value=wc_mercadopago_ticket_params.apply,document.querySelector("#couponCodeTicket").value="",document.querySelector("#couponCodeTicket").style.background=null,document.querySelector("#discountTicket").value=0):(document.querySelector("#mpCouponErrorTicket").style.display="none",document.querySelector("#couponCodeTicket").style.background="url("+wc_mercadopago_ticket_params.loading+") 98% 50% no-repeat #fff",document.querySelector("#couponCodeTicket").style.border="1px solid #cecece",document.querySelector("#applyCouponTicket").disabled=!0,function(){var e=o.discount_action_url,t="?";0<=e.indexOf("?")&&(t="&");e+=t+"site_id="+wc_mercadopago_ticket_params.site_id,e+="&coupon_id="+document.querySelector("#couponCodeTicket").value,e+="&amount="+document.querySelector("#amountTicket").value,e+="&payer="+o.payer_email,l.ajax({url:e,method:"GET",timeout:5e3,error:function(){o.status=!1,document.querySelector("#mpCouponApplyedTicket").style.display="none",document.querySelector("#mpCouponErrorTicket").style.display="none",document.querySelector("#applyCouponTicket").style.background=null,document.querySelector("#applyCouponTicket").value=wc_mercadopago_ticket_params.apply,document.querySelector("#couponCodeTicket").value="",document.querySelector("#couponCodeTicket").style.background=null,document.querySelector("#discountTicket").value=0},success:function(e){200===e.status?(o.status=!0,document.querySelector("#mpCouponApplyedTicket").style.display="block",document.querySelector("#discountTicket").value=e.response.coupon_amount,document.querySelector("#mpCouponApplyedTicket").innerHTML=wc_mercadopago_ticket_params.discount_info1+" <strong>"+a(e.response.currency_id)+" "+Math.round(100*e.response.coupon_amount)/100+"</strong> "+wc_mercadopago_ticket_params.discount_info2+" "+e.response.name+".<br>"+wc_mercadopago_ticket_params.discount_info3+" <strong>"+a(e.response.currency_id)+" "+Math.round(100*document.querySelector("#amountTicket").value)/100+"</strong><br>"+wc_mercadopago_ticket_params.discount_info4+" <strong>"+a(e.response.currency_id)+" "+Math.round(100*(document.getElementById("amountTicket").value-document.getElementById("discountTicket").value))/100+"*</strong><br><i>"+wc_mercadopago_ticket_params.discount_info5+'</i><br><a href="https://api.mercadolibre.com/campaigns/'+e.response.id+'/terms_and_conditions?format_type=html" target="_blank">'+wc_mercadopago_ticket_params.discount_info6+"</a>",document.querySelector("#mpCouponErrorTicket").style.display="none",document.querySelector("#couponCodeTicket").style.background=null,document.querySelector("#couponCodeTicket").style.background="url("+wc_mercadopago_ticket_params.check+") 94% 50% no-repeat #fff",document.querySelector("#couponCodeTicket").style.border="1px solid #cecece",document.querySelector("#applyCouponTicket").value=wc_mercadopago_ticket_params.remove,document.querySelector("#campaign_idTicket").value=e.response.id,document.querySelector("#campaignTicket").value=e.response.name):(o.status=!1,document.querySelector("#mpCouponApplyedTicket").style.display="none",document.querySelector("#mpCouponErrorTicket").style.display="block",document.querySelector("#mpCouponErrorTicket").innerHTML=e.response.message,document.querySelector("#couponCodeTicket").style.background=null,document.querySelector("#couponCodeTicket").style.background="url("+wc_mercadopago_ticket_params.error+") 94% 50% no-repeat #fff",document.querySelector("#applyCouponTicket").value=wc_mercadopago_ticket_params.apply,document.querySelector("#discountTicket").value=0),document.querySelector("#applyCouponTicket").disabled=!1}})}())}function a(e){return"ARS"===e?"$":"BRL"===e?"R$":"COP"===e||"CLP"===e||"MXN"===e?"$":"VEF"===e?"Bs":"PEN"===e?"S/":"UYU"===e?"$U":"$"}0<l("form#order_review").length&&"yes"===o.activated&&l("#applyCouponTicket").on("click",u),l("body").on("updated_checkout",function(){"MLB"===n.site_id&&function(){var e=document.getElementById("mp_box_lastname"),t=document.getElementById("mp_box_firstname"),o=document.getElementById("mp_firstname_label"),r=document.getElementById("mp_socialname_label"),c=document.getElementById("mp_cpf_label"),n=document.getElementById("mp_cnpj_label"),u=document.getElementById("mp_doc_number"),a=document.querySelectorAll('input[type=radio][name="mercadopago_ticket[docType]"]');n.style.display="none",r.style.display="none";for(var l=function(){d="CPF"===this.value?(c.style.display="block",e.style.display="grid",o.style.display="block",n.style.display="none",r.style.display="none",t.classList.remove("mp-col-md-8"),t.classList.add("mp-col-md-4"),u.setAttribute("maxlength","14"),u.setAttribute("onkeyup","mpMaskInput(this, mpCpf)"),"CPF"):(c.style.display="none",e.style.display="none",o.style.display="none",n.style.display="block",r.style.display="block",t.classList.remove("mp-col-md-4"),t.classList.add("mp-col-md-8"),u.setAttribute("maxlength","18"),u.setAttribute("onkeyup","mpMaskInput(this, mpCnpj)"),"CNPJ")},i=0;i<a.length;i++)a[i].addEventListener("change",l)}(),"yes"===o.activated&&l("#applyCouponTicket").on("click",u)}),l("form.checkout").on("checkout_place_order_woo-mercado-pago-ticket",function(){return t()}),l("form#order_review").submit(function(){return t()})})}(jQuery);
1
+ !function(l){"use strict";l(function(){var e=!1,p="CPF",n={site_id:wc_mercadopago_ticket_params.site_id},o={discount_action_url:wc_mercadopago_ticket_params.discount_action_url,payer_email:wc_mercadopago_ticket_params.payer_email,activated:wc_mercadopago_ticket_params.coupon_mode,status:!1};function t(){return!document.getElementById("payment_method_woo-mercado-pago-ticket").checked||("MLB"===n.site_id?(function(){for(var e=document.querySelector("#mercadopago-form-ticket"),t=e.querySelectorAll("[data-checkout]"),o=e.querySelectorAll(".mp-erro_febraban"),r=0;r<t.length;r++){var c=t[r],n=e.querySelector(o[r].getAttribute("data-main"));"none"===c.parentNode.style.display||-1!==c.value&&""!==c.value?(o[r].style.display="none",n.classList.remove("mp-form-control-error")):(o[r].style.display="inline-block",n.classList.add("mp-form-control-error"))}for(var u=0;u<t.length;u++){var a=t[u];if("none"!==a.parentNode.style.display&&(-1===a.value||""===a.value))return a.focus(),!1}return!0}()&&r()?e=!0:c(),e):"MLU"===n.site_id?(r()?e=!0:c(),e):void 0)}function r(){var e,t,o=document.getElementById("mp_doc_number"),r=document.getElementById("mp_error_docnumber"),c=!1;return"MLB"===n.site_id&&(e=o.value,c=("CPF"!==p?function(e){if(""===(e=e.replace(/[^\d]+/g,"")))return!1;if(14!==e.length)return!1;if("00000000000000"===e||"11111111111111"===e||"22222222222222"===e||"33333333333333"===e||"44444444444444"===e||"55555555555555"===e||"66666666666666"===e||"77777777777777"===e||"88888888888888"===e||"99999999999999"===e)return!1;for(var t=e.length-2,o=e.substring(0,t),r=e.substring(t),c=0,n=t-7,u=t;1<=u;u--)c+=o.charAt(t-u)*n--,n<2&&(n=9);var a=c%11<2?0:11-c%11;if(a.toString()!==r[0])return!1;for(t+=1,o=e.substring(0,t),c=0,n=t-7,u=t;1<=u;u--)c+=o.charAt(t-u)*n--,n<2&&(n=9);return(a=c%11<2?0:11-c%11).toString()===r[1]}:function(e){var t,o;if(t=0,"00000000000"===(e=e.replace(/[.-\s]/g,"")))return!1;for(var r=1;r<=9;r++)t+=parseInt(e.substring(r-1,r),10)*(11-r);if(10!=(o=10*t%11)&&11!==o||(o=0),o!==parseInt(e.substring(9,10),10))return!1;t=0;for(var c=1;c<=10;c++)t+=parseInt(e.substring(c-1,c),10)*(12-c);return 10!=(o=10*t%11)&&11!==o||(o=0),o===parseInt(e.substring(10,11),10)})(e)),"MLU"===n.site_id&&(c=""!==(t=o.value)&&function(e){var t=0,o=0,r=e[e.length-1];if(e.length<=6)for(o=e.length;o<7;o++)e="0"+e;for(o=0;o<7;o++)t+=parseInt("2987634"[o],10)*parseInt(e[o],10)%10;return r===(t%10==0?0:10-t%10).toString()}(t)),c?(r.style.display="none",o.classList.remove("mp-form-control-error"),c=!0):(r.style.display="block",o.classList.add("mp-form-control-error"),o.focus()),c}function c(){0<l("form#order_review").length&&l(".blockOverlay").css("display","none")}function u(){document.querySelector("#mpCouponApplyedTicket").style.display="none",""===document.querySelector("#couponCodeTicket").value?(o.status=!1,document.querySelector("#mpCouponErrorTicket").style.display="block",document.querySelector("#mpCouponErrorTicket").innerHTML=wc_mercadopago_ticket_params.coupon_empty,document.querySelector("#couponCodeTicket").style.background=null,document.querySelector("#applyCouponTicket").value=wc_mercadopago_ticket_params.apply,document.querySelector("#discountTicket").value=0):o.status?(o.status=!1,document.querySelector("#mpCouponErrorTicket").style.display="none",document.querySelector("#applyCouponTicket").style.background=null,document.querySelector("#applyCouponTicket").value=wc_mercadopago_ticket_params.apply,document.querySelector("#couponCodeTicket").value="",document.querySelector("#couponCodeTicket").style.background=null,document.querySelector("#discountTicket").value=0):(document.querySelector("#mpCouponErrorTicket").style.display="none",document.querySelector("#couponCodeTicket").style.background="url("+wc_mercadopago_ticket_params.loading+") 98% 50% no-repeat #fff",document.querySelector("#couponCodeTicket").style.border="1px solid #cecece",document.querySelector("#applyCouponTicket").disabled=!0,function(){var e=o.discount_action_url,t="?";0<=e.indexOf("?")&&(t="&");e+=t+"site_id="+wc_mercadopago_ticket_params.site_id,e+="&coupon_id="+document.querySelector("#couponCodeTicket").value,e+="&amount="+document.querySelector("#amountTicket").value,e+="&payer="+o.payer_email,l.ajax({url:e,method:"GET",timeout:5e3,error:function(){o.status=!1,document.querySelector("#mpCouponApplyedTicket").style.display="none",document.querySelector("#mpCouponErrorTicket").style.display="none",document.querySelector("#applyCouponTicket").style.background=null,document.querySelector("#applyCouponTicket").value=wc_mercadopago_ticket_params.apply,document.querySelector("#couponCodeTicket").value="",document.querySelector("#couponCodeTicket").style.background=null,document.querySelector("#discountTicket").value=0},success:function(e){200===e.status?(o.status=!0,document.querySelector("#mpCouponApplyedTicket").style.display="block",document.querySelector("#discountTicket").value=e.response.coupon_amount,document.querySelector("#mpCouponApplyedTicket").innerHTML=wc_mercadopago_ticket_params.discount_info1+" <strong>"+a(e.response.currency_id)+" "+Math.round(100*e.response.coupon_amount)/100+"</strong> "+wc_mercadopago_ticket_params.discount_info2+" "+e.response.name+".<br>"+wc_mercadopago_ticket_params.discount_info3+" <strong>"+a(e.response.currency_id)+" "+Math.round(100*document.querySelector("#amountTicket").value)/100+"</strong><br>"+wc_mercadopago_ticket_params.discount_info4+" <strong>"+a(e.response.currency_id)+" "+Math.round(100*(document.getElementById("amountTicket").value-document.getElementById("discountTicket").value))/100+"*</strong><br><i>"+wc_mercadopago_ticket_params.discount_info5+'</i><br><a href="https://api.mercadolibre.com/campaigns/'+e.response.id+'/terms_and_conditions?format_type=html" target="_blank">'+wc_mercadopago_ticket_params.discount_info6+"</a>",document.querySelector("#mpCouponErrorTicket").style.display="none",document.querySelector("#couponCodeTicket").style.background=null,document.querySelector("#couponCodeTicket").style.background="url("+wc_mercadopago_ticket_params.check+") 94% 50% no-repeat #fff",document.querySelector("#couponCodeTicket").style.border="1px solid #cecece",document.querySelector("#applyCouponTicket").value=wc_mercadopago_ticket_params.remove,document.querySelector("#campaign_idTicket").value=e.response.id,document.querySelector("#campaignTicket").value=e.response.name):(o.status=!1,document.querySelector("#mpCouponApplyedTicket").style.display="none",document.querySelector("#mpCouponErrorTicket").style.display="block",document.querySelector("#mpCouponErrorTicket").innerHTML=e.response.message,document.querySelector("#couponCodeTicket").style.background=null,document.querySelector("#couponCodeTicket").style.background="url("+wc_mercadopago_ticket_params.error+") 94% 50% no-repeat #fff",document.querySelector("#applyCouponTicket").value=wc_mercadopago_ticket_params.apply,document.querySelector("#discountTicket").value=0),document.querySelector("#applyCouponTicket").disabled=!1}})}())}function a(e){return"ARS"===e?"$":"BRL"===e?"R$":"COP"===e||"CLP"===e||"MXN"===e?"$":"VEF"===e?"Bs":"PEN"===e?"S/":"UYU"===e?"$U":"$"}0<l("form#order_review").length&&"yes"===o.activated&&l("#applyCouponTicket").on("click",u),l("body").on("updated_checkout",function(){"MLB"===n.site_id&&function(){var e=document.getElementById("mp_box_lastname"),t=document.getElementById("mp_box_firstname"),o=document.getElementById("mp_firstname_label"),r=document.getElementById("mp_socialname_label"),c=document.getElementById("mp_cpf_label"),n=document.getElementById("mp_cnpj_label"),u=document.getElementById("mp_doc_number"),a=document.querySelectorAll('input[type=radio][name="mercadopago_ticket[docType]"]');n.style.display="none",r.style.display="none";for(var l=function(){p="CPF"===this.value?(c.style.display="block",e.style.display="grid",o.style.display="block",n.style.display="none",r.style.display="none",t.classList.remove("mp-col-md-8"),t.classList.add("mp-col-md-4"),u.setAttribute("maxlength","14"),u.setAttribute("onkeyup","mpMaskInput(this, mpCpf)"),"CPF"):(c.style.display="none",e.style.display="none",o.style.display="none",n.style.display="block",r.style.display="block",t.classList.remove("mp-col-md-4"),t.classList.add("mp-col-md-8"),u.setAttribute("maxlength","18"),u.setAttribute("onkeyup","mpMaskInput(this, mpCnpj)"),"CNPJ")},i=0;i<a.length;i++)a[i].addEventListener("change",l)}(),"yes"===o.activated&&l("#applyCouponTicket").on("click",u)}),l("form.checkout").on("checkout_place_order_woo-mercado-pago-ticket",t),l("form#order_review").submit(t)})}(jQuery);
i18n/languages/woocommerce-mercadopago-es_AR.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_AR.po CHANGED
@@ -2,15 +2,15 @@
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Mercado Pago payments for WooCommerce 4.2.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
- "PO-Revision-Date: 2020-05-08 14:41-0300\n"
13
- "X-Generator: Poedit 2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Mercado Pago payments for WooCommerce 4.2.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
+ "PO-Revision-Date: 2020-05-15 18:03-0300\n"
13
+ "X-Generator: Poedit 2.3.1\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
i18n/languages/woocommerce-mercadopago-es_CL.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_CL.po CHANGED
@@ -2,15 +2,15 @@
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Mercado Pago payments for WooCommerce 4.2.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
- "PO-Revision-Date: 2020-05-08 14:41-0300\n"
13
- "X-Generator: Poedit 2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Mercado Pago payments for WooCommerce 4.2.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
+ "PO-Revision-Date: 2020-05-15 18:03-0300\n"
13
+ "X-Generator: Poedit 2.3.1\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
i18n/languages/woocommerce-mercadopago-es_CO.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_CO.po CHANGED
@@ -2,15 +2,15 @@
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Mercado Pago payments for WooCommerce 4.2.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
- "PO-Revision-Date: 2020-05-08 14:41-0300\n"
13
- "X-Generator: Poedit 2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Mercado Pago payments for WooCommerce 4.2.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
+ "PO-Revision-Date: 2020-05-15 18:03-0300\n"
13
+ "X-Generator: Poedit 2.3.1\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
i18n/languages/woocommerce-mercadopago-es_ES.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_ES.po CHANGED
@@ -2,15 +2,15 @@
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Mercado Pago payments for WooCommerce 4.2.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
- "PO-Revision-Date: 2020-05-08 14:42-0300\n"
13
- "X-Generator: Poedit 2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Mercado Pago payments for WooCommerce 4.2.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
+ "PO-Revision-Date: 2020-05-15 18:03-0300\n"
13
+ "X-Generator: Poedit 2.3.1\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
i18n/languages/woocommerce-mercadopago-es_MX.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_MX.po CHANGED
@@ -2,15 +2,15 @@
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Mercado Pago payments for WooCommerce 4.2.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
- "PO-Revision-Date: 2020-05-08 14:42-0300\n"
13
- "X-Generator: Poedit 2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Mercado Pago payments for WooCommerce 4.2.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
+ "PO-Revision-Date: 2020-05-15 18:03-0300\n"
13
+ "X-Generator: Poedit 2.3.1\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
i18n/languages/woocommerce-mercadopago-es_PE.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_PE.po CHANGED
@@ -2,15 +2,15 @@
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Mercado Pago payments for WooCommerce 4.2.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
- "PO-Revision-Date: 2020-05-08 14:42-0300\n"
13
- "X-Generator: Poedit 2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Mercado Pago payments for WooCommerce 4.2.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
+ "PO-Revision-Date: 2020-05-15 18:03-0300\n"
13
+ "X-Generator: Poedit 2.3.1\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
i18n/languages/woocommerce-mercadopago-es_UY.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_UY.po CHANGED
@@ -2,15 +2,15 @@
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Mercado Pago payments for WooCommerce 4.2.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
- "PO-Revision-Date: 2020-05-08 14:43-0300\n"
13
- "X-Generator: Poedit 2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Mercado Pago payments for WooCommerce 4.2.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
+ "PO-Revision-Date: 2020-05-15 18:04-0300\n"
13
+ "X-Generator: Poedit 2.3.1\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
i18n/languages/woocommerce-mercadopago-es_VE.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_VE.po CHANGED
@@ -2,15 +2,15 @@
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Mercado Pago payments for WooCommerce 4.2.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
- "PO-Revision-Date: 2020-05-08 14:43-0300\n"
13
- "X-Generator: Poedit 2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Mercado Pago payments for WooCommerce 4.2.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
+ "PO-Revision-Date: 2020-05-15 18:04-0300\n"
13
+ "X-Generator: Poedit 2.3.1\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
i18n/languages/woocommerce-mercadopago-pt_BR.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-pt_BR.po CHANGED
@@ -2,15 +2,15 @@
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Mercado Pago payments for WooCommerce 4.2.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
- "PO-Revision-Date: 2020-05-08 14:43-0300\n"
13
- "X-Generator: Poedit 2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n > 1);\n"
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Mercado Pago payments for WooCommerce 4.2.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
+ "PO-Revision-Date: 2020-05-15 18:04-0300\n"
13
+ "X-Generator: Poedit 2.3.1\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n > 1);\n"
i18n/languages/woocommerce-mercadopago.pot CHANGED
@@ -3,7 +3,7 @@
3
  #, fuzzy
4
  msgid ""
5
  msgstr ""
6
- "Project-Id-Version: Mercado Pago payments for WooCommerce 4.2.0\n"
7
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
8
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
9
  "Language-Team: LANGUAGE <LL@li.org>\n"
3
  #, fuzzy
4
  msgid ""
5
  msgstr ""
6
+ "Project-Id-Version: Mercado Pago payments for WooCommerce 4.2.1\n"
7
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
8
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
9
  "Language-Team: LANGUAGE <LL@li.org>\n"
includes/module/config/WC_WooMercadoPago_Constants.php CHANGED
@@ -11,7 +11,7 @@ class WC_WooMercadoPago_Constants
11
  {
12
  const PRODUCT_ID = 'BC32CPFTRPP001U8NHRG';
13
  const PLATAFORM_ID = 'bo2hnr2ic4p001kbgpt0';
14
- const VERSION = '4.2.0';
15
  const MIN_PHP = 5.6;
16
  const API_MP_BASE_URL = 'https://api.mercadopago.com';
17
  }
11
  {
12
  const PRODUCT_ID = 'BC32CPFTRPP001U8NHRG';
13
  const PLATAFORM_ID = 'bo2hnr2ic4p001kbgpt0';
14
+ const VERSION = '4.2.1';
15
  const MIN_PHP = 5.6;
16
  const API_MP_BASE_URL = 'https://api.mercadopago.com';
17
  }
includes/module/preference/WC_WooMercadoPago_PreferenceAbstract.php CHANGED
@@ -59,10 +59,6 @@ abstract class WC_WooMercadoPago_PreferenceAbstract extends WC_Payment_Gateway
59
  $this->selected_shipping = $order->get_shipping_method();
60
  $this->ship_cost = $this->order->get_total_shipping() + $this->order->get_shipping_tax();
61
 
62
- if (!$this->test_user_v1 && !$this->sandbox) {
63
- $this->preference['sponsor_id'] = $this->get_sponsor_id();
64
- }
65
-
66
  if (sizeof($this->order->get_items()) > 0) {
67
  $this->items = $this->get_items_build_array();
68
  }
@@ -107,6 +103,11 @@ abstract class WC_WooMercadoPago_PreferenceAbstract extends WC_Payment_Gateway
107
  'notification_url' => $this->get_notification_url(),
108
  'statement_descriptor' => $this->payment->getOption('mp_statement_descriptor', 'Mercado Pago'),
109
  );
 
 
 
 
 
110
  return $preference;
111
  }
112
 
59
  $this->selected_shipping = $order->get_shipping_method();
60
  $this->ship_cost = $this->order->get_total_shipping() + $this->order->get_shipping_tax();
61
 
 
 
 
 
62
  if (sizeof($this->order->get_items()) > 0) {
63
  $this->items = $this->get_items_build_array();
64
  }
103
  'notification_url' => $this->get_notification_url(),
104
  'statement_descriptor' => $this->payment->getOption('mp_statement_descriptor', 'Mercado Pago'),
105
  );
106
+
107
+ if (!$this->test_user_v1 && !$this->sandbox) {
108
+ $preference['sponsor_id'] = $this->get_sponsor_id();
109
+ }
110
+
111
  return $preference;
112
  }
113
 
includes/payments/WC_WooMercadoPago_BasicGateway.php CHANGED
@@ -318,7 +318,7 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
318
  public function field_checkout_payments_advanced_title()
319
  {
320
  $checkout_payments_advanced_title = array(
321
- 'title' => __('advanced settings', 'woocommerce-mercadopago'),
322
  'type' => 'title',
323
  'class' => 'mp_subtitle_bd'
324
  );
318
  public function field_checkout_payments_advanced_title()
319
  {
320
  $checkout_payments_advanced_title = array(
321
+ 'title' => __('Advanced settings', 'woocommerce-mercadopago'),
322
  'type' => 'title',
323
  'class' => 'mp_subtitle_bd'
324
  );
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: ecommerce, mercadopago, woocommerce
4
  Requires at least: 4.9.10
5
  Tested up to: 5.4
6
  Requires PHP: 5.6
7
- Stable tag: 4.2.0
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -115,6 +115,10 @@ Set up both the plugin and the checkouts you want to activate on your payment av
115
  Check out our <a href="https://www.mercadopago.com.br/developers/pt/plugins_sdks/plugins/official/woo-commerce/">official documentation</a> for more information on the specific fields to configure.
116
 
117
  == Changelog ==
 
 
 
 
118
  = v4.2.0 (13/05/2020) =
119
  * Features
120
  - Added compatibility with WooCommerce version 4.1.0
@@ -125,7 +129,7 @@ Check out our <a href="https://www.mercadopago.com.br/developers/pt/plugins_sdks
125
  - Added assets versioning
126
  - Added minification of JS files
127
  - Added debug mode for JS in order to use files without minification
128
- - Added payment flow for WebPay in Colombia for Checkout Custom Offline
129
  - Updated documentation and regionalized links
130
 
131
  * Bug fixes
4
  Requires at least: 4.9.10
5
  Tested up to: 5.4
6
  Requires PHP: 5.6
7
+ Stable tag: 4.2.1
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
115
  Check out our <a href="https://www.mercadopago.com.br/developers/pt/plugins_sdks/plugins/official/woo-commerce/">official documentation</a> for more information on the specific fields to configure.
116
 
117
  == Changelog ==
118
+ = v4.2.1 (18/05/2020) =
119
+ * Bug fixes
120
+ - Corrected CI document input validation on Uruguay Custom Offline Checkout.
121
+
122
  = v4.2.0 (13/05/2020) =
123
  * Features
124
  - Added compatibility with WooCommerce version 4.1.0
129
  - Added assets versioning
130
  - Added minification of JS files
131
  - Added debug mode for JS in order to use files without minification
132
+ - Added payment flow for WebPay in Chile for Checkout Custom Offline
133
  - Updated documentation and regionalized links
134
 
135
  * Bug fixes
woocommerce-mercadopago.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Mercado Pago payments for WooCommerce
5
  * Plugin URI: https://github.com/mercadopago/cart-woocommerce
6
  * Description: Configure the payment options and accept payments with cards, ticket and money of Mercado Pago account.
7
- * Version: 4.2.0
8
  * Author: Mercado Pago
9
  * Author URI: https://developers.mercadopago.com/
10
  * Text Domain: woocommerce-mercadopago
4
  * Plugin Name: Mercado Pago payments for WooCommerce
5
  * Plugin URI: https://github.com/mercadopago/cart-woocommerce
6
  * Description: Configure the payment options and accept payments with cards, ticket and money of Mercado Pago account.
7
+ * Version: 4.2.1
8
  * Author: Mercado Pago
9
  * Author URI: https://developers.mercadopago.com/
10
  * Text Domain: woocommerce-mercadopago