diff --git a/.gitignore b/.gitignore
index 36ad694d6..f8b22eae5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,4 @@
node_modules
-package-lock.json
.DS_Store
.vscode
.idea
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 216466138..78b5b30ae 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [4.5.0] - 2020-10-26
+
+### Added
+ - Compatibility with WooCommerce v4.6.x
+ - Improved security (added access token in the header for all calls to Mercado Livre and Mercado Pago endpoints)
+ - Add new endpoint to validate Access Token and Public key to substitute old process to validation
+ - Improved performance with CSS minification
+
+### Changed
+ - Fixed conflict with wc-api webhook and Mercado Pago webhook/IPN.
+ - Fixed alert in currency conversion
+ - Fixed tranlate in currency conversion
+ - Bug fixed when updating orders that have two or more payments associated.
+
## [4.4.0] - 2020-09-21
### Added
diff --git a/assets/css/admin_notice_mercadopago.min.css b/assets/css/admin_notice_mercadopago.min.css
new file mode 100644
index 000000000..087f5bfb8
--- /dev/null
+++ b/assets/css/admin_notice_mercadopago.min.css
@@ -0,0 +1 @@
+.mp-alert-frame{align-items:center;display:inline-flex;justify-content:center;justify-items:center}.mp-left-alert{padding-top:5px}.mp-left-alert img{max-width:150px}.mp-right-alert{padding-top:0}
\ No newline at end of file
diff --git a/assets/css/basic_checkout_mercadopago.min.css b/assets/css/basic_checkout_mercadopago.min.css
new file mode 100644
index 000000000..7f4cd4dc8
--- /dev/null
+++ b/assets/css/basic_checkout_mercadopago.min.css
@@ -0,0 +1 @@
+.mp-pt-20{padding-top:20px!important}.mp-pt-5{padding-top:5px!important}.mp-pt-15{padding-top:15px!important}.mp-pt-10{padding-top:10px!important}.mp-pt-0{padding-top:0!important}.mp-pt-30{padding-top:30px!important}.mp-pb-15{padding-bottom:15px!important}.mp-pb-20{padding-bottom:20px!important}.mp-pb-30{padding-bottom:30px!important}.mp-pl-10{padding-left:10px!important}.mp-pr-10{padding-right:10px!important}.mp-pr-15{padding-right:15px!important}.mp-mt-5{margin-top:5px!important}.mp-mt-03rem{margin-top:.3rem!important}.mp-mt-04rem{margin-top:.4rem!important}.mp-mt-05rem{margin-top:.5rem!important}.mp-mt-06rem{margin-top:.6rem!important}.mp-mb-0{margin-bottom:0!important}.mp-mb-20{margin-bottom:20px!important}.mp-mb-30{margin-bottom:30px!important}.mp-mt-20{margin-top:20px!important}.mp-display-inherit{display:inherit!important}.mp-pointer{cursor:pointer!important}.mp-text-center{text-align:center!important}.mp-text-justify{text-align:justify!important}.mp-min-hg{min-height:40px!important}.mp-row-checkout{width:100%;display:inline-block}.mp-col-md-12{width:100%;display:inline-block;padding-left:0;padding-right:0;text-align:left!important}.mp-col-md-9{flex:0 0 75%;width:75%;float:left}.mp-col-md-8{flex:0 0 66.666667%;width:66.666667%;float:left}.mp-col-md-6{width:50%;float:left;padding-left:0;padding-right:0;text-align:left!important}.mp-col-md-4{flex:0 0 33.333333%;width:33.333333%;float:left}.mp-col-md-3{flex:0 0 25%;width:25%;float:left}.mp-img-fluid{max-width:100%;height:auto}.mp-panel-checkout{background-color:#fff;padding:10px 15px 25px}.mp-title-checkout{padding:15px 0 0;font-family:sans-serif;font-size:1.2rem!important;font-weight:600!important;font-style:normal;font-stretch:normal;line-height:1.25!important;letter-spacing:normal;color:#04204c;margin:0!important}.mp-title-checkout::before{content:""!important;width:0!important;height:0!important;margin:0!important}.submp-title-checkout{font-size:14px!important;font-family:sans-serif!important;color:#7a7a7a;font-weight:400;padding:20px 0 0;margin:0 0 5px!important;text-transform:uppercase}.mp-subtitle-basic-checkout{font-size:14px!important;font-family:sans-serif!important;color:#7a7a7a;font-weight:400;padding:.625em 0 0;margin:0 0 5px!important;text-transform:uppercase}.mp-badge-checkout{font-size:15px!important;font-family:sans-serif!important;padding:5px 10px;margin-left:5px;display:inline-block;background-color:#2ec74b;color:#fff;text-transform:none;border-radius:2px}.mp-img-tarjetas{padding:8px!important;max-height:35px!important;width:auto!important;float:none!important;position:relative!important;right:0!important;border:inherit!important;display:inline-block!important}.mp-img-redirect{padding:8px!important;max-height:6.25em!important;width:auto!important;float:none!important;position:relative!important;right:0!important;border:inherit!important;display:inline-block!important}.mp-img-ticket{padding:0 8px!important;max-height:35px!important;width:auto!important;float:left!important;position:relative!important;right:0!important;border:inherit!important}.mp-redirect-frame{width:100%;text-align:center;background-color:#f5f5f5;padding:25px 20px 20px;display:inline-block}.mp-redirect-frame img{max-width:160px!important}.mp-redirect-frame p{padding-top:15px!important;margin-top:0!important;font-family:sans-serif!important;font-size:14px!important;font-weight:600!important;font-style:normal!important;font-stretch:normal!important;line-height:1.71!important;letter-spacing:normal!important;text-align:center!important;color:#333!important}.mp-panel-custom-checkout{background-color:#fff;padding:20px 15px 0}.mp-subtitle-custom-checkout{font-size:17px!important;font-family:sans-serif!important;color:#04204c;font-weight:600;padding:20px 0 0;margin:0 0 5px!important}.mp-subtitle-ticket-checkout{font-size:16px!important;font-family:sans-serif!important;color:#04204c;font-weight:600;padding:0 0 0;margin:0 0 5px!important}.mp-form-control{font-family:sans-serif!important;width:100%;height:40px!important;border-radius:5px!important;font-size:13px!important;padding:0 10px!important;background-color:#fff!important;border:1px solid #d1d1d1!important;margin-bottom:0!important}.mp-form-control-error{border:2px solid #f04449!important}.mp-form-control-check{margin:0 10px 0 0!important;font-family:sans-serif!important;border-radius:5px!important;font-size:13px!important;padding:0 10px!important;background-color:#fff!important;border:1px solid #d1d1d1!important;float:left}.mp-button{width:100%;height:40px;border-radius:5px!important;color:#fff!important;background-color:#3483fa!important;text-transform:none!important;font-size:15px!important;font-weight:400!important;font-style:normal;font-stretch:normal;line-height:1!important;letter-spacing:normal!important;text-align:center!important}.mp-button:hover{opacity:.8}.mp-error{font-family:sans-serif!important;font-size:12px!important;font-weight:400!important;font-style:normal;font-stretch:normal;line-height:1.29;letter-spacing:normal;color:#f04449!important;display:none}.mp-desc{font-family:sans-serif!important;font-size:12px!important;font-weight:400!important;font-style:normal;font-stretch:normal;line-height:1.29;letter-spacing:normal;color:rgba(0,0,0,.45)!important}.mp-label-form-check{font-family:sans-serif!important;font-size:14px!important;font-weight:400!important;font-style:normal;font-stretch:normal;line-height:1;letter-spacing:normal;color:rgba(0,0,0,.8)!important;vertical-align:baseline!important}.mp-label-form{font-family:sans-serif!important;font-size:13px!important;font-weight:400!important;font-style:normal;font-stretch:normal;line-height:1;letter-spacing:normal;color:rgba(0,0,0,.7)!important}.mp-label-form em{font-size:18px!important;color:#f04449!important;font-family:"Merriweather, Georgia";position:absolute;margin:-3px 0 0 3px}.mp-obrigatory{font-family:sans-serif!important;font-size:12px!important;font-weight:400!important;font-style:normal;font-stretch:normal;line-height:1.29;letter-spacing:normal;color:#f04449!important;padding-top:10px}.mp-obrigatory em{font-size:18px!important;color:#f04449!important;margin:-2px 5px 0 0;font-family:"Merriweather, Georgia";float:left}.mp-frame-links{display:inline-flex;padding-top:10px;text-align:left}.mp-checkout-link{font-family:sans-serif!important;font-size:14px;text-decoration:none!important;vertical-align:middle;box-shadow:none!important;cursor:pointer}.mp-frame-payments{display:none;background-color:#f5f5f5;margin-top:10px;padding:10px 10px 10px;width:100%}.submp-title-checkout-custom{font-size:13px!important;font-family:sans-serif!important;color:#7a7a7a;font-weight:400;padding:00px 0 0;margin:0 0 5px!important;text-transform:uppercase}.mp-tooltip{position:relative;display:inline-block;border-bottom:1px dotted #000}.mp-tooltip .mp-tooltiptext{visibility:hidden;background:#3483fa;color:#fff;padding:5px 0;position:absolute;width:250px;text-align:center;margin:-20px 0 0 100px;font-size:12px}.mp-tooltip .mp-tooltiptext:before{border:6px solid transparent;border-right-color:#3483fa;content:"";left:-12px;position:absolute;top:5px}.mp-tooltip:hover .mp-tooltiptext{visibility:visible}.mp-erro_febraban,.mp_error_docnumber{font-family:sans-serif!important;font-size:12px!important;font-weight:400!important;font-style:normal;font-stretch:normal;line-height:1.29;letter-spacing:normal;color:#f04449!important;margin-top:5px;display:none}.mp-subtitle-ticket-checkout{font-size:16px!important;font-family:sans-serif!important;color:#04204c;font-weight:600;margin:0 0 5px!important}.mp-ticket-name{font-weight:700;color:rgba(0,0,0,.8);padding-left:5px;font-size:13px}.mp-ticket-payments{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;padding:0 10px}#mp-box-input-tax-cft{margin-top:4px}#mp-tax-tea-text{color:#797979;font-size:12px;font-weight:400;font-style:normal;font-stretch:normal;line-height:1.29;letter-spacing:normal}#mp-tax-cft-text{font-size:27px;font-weight:400;font-style:normal;font-stretch:normal;line-height:1.25;letter-spacing:normal;color:#868686}#mp_socialname_label{display:none}#mp_cnpj_label{display:none}#mp-doc-div{display:none}#mp-doc-type-div{display:none}#mp-doc-number-div{display:none}#mp-issuer-div{display:none}#mp-card-holder-div{display:none}.mp-discount{border-style:solid;border-width:thin;border-color:#009ee3;padding:8px 8px 8px 8px;margin-top:20px;text-transform:uppercase;font-size:12px;color:#333;display:none;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;clear:both;float:left}
\ No newline at end of file
diff --git a/assets/css/config_mercadopago.min.css b/assets/css/config_mercadopago.min.css
new file mode 100644
index 000000000..cbe5fc7df
--- /dev/null
+++ b/assets/css/config_mercadopago.min.css
@@ -0,0 +1 @@
+.mp-px-20{padding-left:20px!important;padding-right:20px!important}.mp-pt-10{padding-top:10px!important}.mp-pb-10{padding-bottom:10px!important}.mp-pb-20{padding-bottom:20px!important}.mp-mt--10{margin-top:-10px!important}.mp-mt--15{margin-top:-15px!important}.mp-mt--12{margin-top:-12px!important}.mp-mt--5{margin-top:-5px!important}.mp-mt-5{margin-top:5px!important}.mp-mt-0{margin-top:0!important}.mp-mb-0{margin-bottom:0!important}.mp-mb-20{margin-bottom:20px!important}.mp-mb-18{margin-bottom:18px!important}.mp-mg-0{margin:0!important}.mp-fw-400{font-weight:400!important}.mp-text-center{text-align:center!important}.mp-row{width:100%;display:inline-block}.mp-col-md-12{width:100%;display:inline-block;text-align:justify!important}.mp-col-md-3{width:25%;float:left}.mp-col-md-2{width:20%;float:left}.mp-mouse_pointer{cursor:pointer!important}#mp_field_text{font-family:sans-serif!important;font-size:14px!important;font-weight:600!important;font-style:normal;font-stretch:normal;line-height:1.54;letter-spacing:normal;color:#555!important}#mp_input_payments{border:1px solid #ccc;padding:15px;width:365px;font-weight:700;margin-top:-8px!important;margin-bottom:37px!important}#mp_input_payments_mt{border:1px solid #ccc;padding:15px;width:365px;margin-top:-39px!important}.mp_text{font-family:sans-serif;font-size:14px!important;font-weight:400;font-style:normal;font-stretch:normal;line-height:1.25;letter-spacing:normal;color:rgba(0,0,0,.8)}.mp_subtitle{font-size:18px!important}.mp_subtitle_bd{border-top:1px solid #bbb;padding-top:20px;font-size:20px!important;margin-top:0!important;margin-bottom:20px!important}.mp_subtitle_bd_mb{border-top:1px solid #bbb;padding-top:20px;font-size:20px!important;margin-bottom:0!important}.mp_small_text{font-family:sans-serif;font-size:15px!important;font-weight:400;font-style:normal!important;font-stretch:normal;line-height:16px!important;letter-spacing:normal;color:#555}.mp_homolog_text{font-family:sans-serif;font-size:14px!important;font-weight:400;font-style:normal!important;font-stretch:normal;line-height:16px!important;letter-spacing:normal;color:#555;margin-top:0!important;margin-bottom:30px!important}.mp_title_bd{font-family:sans-serif;font-size:30px!important;font-weight:400;font-style:normal;font-stretch:normal;line-height:1.07;letter-spacing:normal;color:#303030;border-top:1px solid #bbb;padding-top:20px;margin-bottom:5px!important;margin-top:10px!important}.mp_title_checkout{font-family:sans-serif;font-size:30px!important;font-weight:400;font-style:normal;font-stretch:normal;line-height:1.07;letter-spacing:normal;color:#303030;margin-bottom:5px!important;margin-top:0!important}.mp_tienda_link{display:inline-block}.mp_tienda_link a{display:inline-block;margin-bottom:0;font-weight:400;text-align:center;vertical-align:middle;cursor:pointer;white-space:nowrap;line-height:1.42857;border-radius:2px!important;border:solid 1px #c2c2c2!important;padding:12px 50px!important;font-size:13px!important;background-color:#fafafa!important;text-decoration:none;color:#555;font-family:sans-serif}.mp_tienda_link:hover a{color:#fff!important;background-color:#00aff0!important;border-color:#008abd!important;-webkit-box-shadow:none!important;box-shadow:none}.mp_general_links{display:inline-block;margin-bottom:0;font-weight:400;text-align:center;vertical-align:middle;cursor:pointer;white-space:nowrap;line-height:1.42857;border-radius:2px!important;border:solid 1px #c2c2c2!important;padding:12px 50px!important;font-size:13px!important;background-color:#fafafa!important;text-decoration:none;color:#555;font-family:sans-serif}.mp_general_links:hover{color:#fff!important;background-color:#00aff0!important;border-color:#008abd!important;-webkit-box-shadow:none!important;box-shadow:none}.mp-btn-collapsible{float:right;font-size:25px;padding-right:5px}.mp-title-checkout-body{font-family:sans-serif!important;margin:0 0 13px!important;font-size:20px!important;font-weight:200!important;line-height:1.25;font-style:normal;font-stretch:normal;letter-spacing:normal;color:rgba(0,0,0,.8)}.mp-text-checkout-body{font-size:18px!important;font-weight:400!important;margin-top:10px!important;line-height:20px;font-style:normal;font-stretch:normal;letter-spacing:normal;color:rgba(0,0,0,.8)}.mp-text-steps{font-size:14px!important;font-weight:400!important;font-style:normal;font-stretch:normal;line-height:1.5;letter-spacing:normal;color:rgba(0,0,0,.8)}.mp-number-checkout-body{border-radius:100%;border:solid 1px #979797;display:block;width:35px;height:35px;margin:0 auto 8px!important;font-size:23px;font-weight:700}.mp-header-logo{align-items:center}.mp-left-header{min-width:120px}.mp-left-header img{max-width:150px}.mp-right-header{padding-top:20px}.mp-save-button{margin-bottom:15px!important}.mp-hidden-field{display:none}.mp_title_header{font-family:sans-serif;font-size:22px!important;font-weight:100;line-height:1.5;margin-bottom:5px!important;font-style:normal;font-stretch:normal;letter-spacing:normal}.mp_subtitle_header{font-family:sans-serif;font-size:28px!important;font-weight:600!important;line-height:35px;font-style:normal;font-stretch:normal;letter-spacing:normal}.mp_subtitle_mt{margin-top:0!important}
\ No newline at end of file
diff --git a/assets/js/basic_config_mercadopago.js b/assets/js/basic_config_mercadopago.js
index df1405214..4dbcb329e 100644
--- a/assets/js/basic_config_mercadopago.js
+++ b/assets/js/basic_config_mercadopago.js
@@ -10,7 +10,9 @@ 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';
+
+ var h2s = document.querySelectorAll('h2');
+ h2s[4] !== undefined ? h2s[4].style.display = 'none' : null;
var descriptionInput = document.querySelectorAll('p.description');
diff --git a/assets/js/basic_config_mercadopago.min.js b/assets/js/basic_config_mercadopago.min.js
index 6bdc95347..c13542da5 100644
--- a/assets/js/basic_config_mercadopago.min.js
+++ b/assets/js/basic_config_mercadopago.min.js
@@ -1 +1 @@
-window.onload=function(){function e(e,o){return'+ -'}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 '+f+" ";S[E].parentElement.insertAdjacentHTML("beforebegin",x);break}for(var A="",B="",I=0,M=document.querySelectorAll(".debit_payment_method"),C=0;C '+A+" ";M[L].parentElement.insertAdjacentHTML("beforebegin",H);break}for(var N="",T="",O=0,j=document.querySelectorAll(".offline_payment_method"),D=0;D '+N+" ";j[P].parentElement.insertAdjacentHTML("beforebegin",z);break}}var F=document.querySelectorAll(".mp-save-button");0!==F.length&&Array.from(F).forEach(function(e){e.addEventListener("click",function(){document.querySelector(".woocommerce-save-button").click()})})},window.completeOnlineCheckbox=function(){for(var e=document.getElementById("checkmeon").checked,o=document.querySelectorAll(".online_payment_method"),t=0;t+ -'}document.querySelector(".wc-admin-breadcrumb").style.display="none",document.querySelector(".mp-header-logo").style.display="none",document.querySelector("#_wpnonce").parentElement.style.display="none";var o=document.querySelectorAll("h2");void 0!==o[4]&&(o[4].style.display="none");for(var t=document.querySelectorAll("p.description"),c=0;c '+b+" ";f[v].parentElement.insertAdjacentHTML("beforebegin",S);break}for(var q="",E="",x=0,A=document.querySelectorAll(".debit_payment_method"),B=0;B '+q+" ";A[I].parentElement.insertAdjacentHTML("beforebegin",M);break}for(var C="",L="",H=0,N=document.querySelectorAll(".offline_payment_method"),T=0;T '+C+" ";N[O].parentElement.insertAdjacentHTML("beforebegin",j);break}}r=document.querySelectorAll(".mp-save-button");0!==r.length&&Array.from(r).forEach(function(e){e.addEventListener("click",function(){document.querySelector(".woocommerce-save-button").click()})})},window.completeOnlineCheckbox=function(){for(var e=document.getElementById("checkmeon").checked,o=document.querySelectorAll(".online_payment_method"),t=0;t'+wc_mercadopago_params.choose+"...",r=[],c=0;c"+(r[d].recommended_message||r[d].installments)+"";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"+w(e.response.currency_id)+" "+Math.round(100*e.response.coupon_amount)/100+" "+wc_mercadopago_params.discount_info2+" "+e.response.name+".
"+wc_mercadopago_params.discount_info3+" "+w(e.response.currency_id)+" "+Math.round(100*document.querySelector("#mp-amount").value)/100+"
"+wc_mercadopago_params.discount_info4+" "+w(e.response.currency_id)+" "+Math.round(100*m())/100+"*
"+wc_mercadopago_params.discount_info5+'
'+wc_mercadopago_params.discount_info6+"",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'+wc_mercadopago_params.choose+"...",n=[],r=0;r"+(n[c].recommended_message||n[c].installments)+"";e.innerHTML=t,"MLA"===d.site_id&&(_(),M("body").on("change","#mp-installments",y))}else g(),_()}function y(){var e=document.querySelector("#mp-installments"),o=e.options[e.selectedIndex].getAttribute("data-tax"),t="",e="";null!=o&&(t=(o=o.split("|"))[0].replace("_"," "),e=o[1].replace("_"," "),"CFT 0,00%"===t&&"TEA 0,00%"===e&&(e=t="")),document.querySelector("#mp-tax-cft-text").innerHTML=t,document.querySelector("#mp-tax-tea-text").innerHTML=e}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"+w(e.response.currency_id)+" "+Math.round(100*e.response.coupon_amount)/100+" "+wc_mercadopago_params.discount_info2+" "+e.response.name+".
"+wc_mercadopago_params.discount_info3+" "+w(e.response.currency_id)+" "+Math.round(100*document.querySelector("#mp-amount").value)/100+"
"+wc_mercadopago_params.discount_info4+" "+w(e.response.currency_id)+" "+Math.round(100*m())/100+"*
"+wc_mercadopago_params.discount_info5+'
'+wc_mercadopago_params.discount_info6+"",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