WooCommerce MercadoPago - Version 4.5.0

Version Description

Download this release

Release Info

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

Code changes from version 4.4.0 to 4.5.0

Files changed (50) hide show
  1. assets/css/admin_notice_mercadopago.min.css +1 -0
  2. assets/css/basic_checkout_mercadopago.min.css +1 -0
  3. assets/css/config_mercadopago.min.css +1 -0
  4. assets/js/basic_config_mercadopago.js +3 -1
  5. assets/js/basic_config_mercadopago.min.js +1 -1
  6. assets/js/credit-card.min.js +1 -1
  7. assets/js/custom_config_mercadopago.js +3 -1
  8. assets/js/custom_config_mercadopago.min.js +1 -1
  9. assets/js/ticket.min.js +1 -1
  10. assets/js/ticket_config_mercadopago.js +3 -1
  11. assets/js/ticket_config_mercadopago.min.js +1 -1
  12. i18n/languages/woocommerce-mercadopago-es_AR.mo +0 -0
  13. i18n/languages/woocommerce-mercadopago-es_AR.po +6 -2
  14. i18n/languages/woocommerce-mercadopago-es_CL.mo +0 -0
  15. i18n/languages/woocommerce-mercadopago-es_CL.po +6 -2
  16. i18n/languages/woocommerce-mercadopago-es_CO.mo +0 -0
  17. i18n/languages/woocommerce-mercadopago-es_CO.po +6 -2
  18. i18n/languages/woocommerce-mercadopago-es_ES.mo +0 -0
  19. i18n/languages/woocommerce-mercadopago-es_ES.po +6 -2
  20. i18n/languages/woocommerce-mercadopago-es_MX.mo +0 -0
  21. i18n/languages/woocommerce-mercadopago-es_MX.po +6 -2
  22. i18n/languages/woocommerce-mercadopago-es_PE.mo +0 -0
  23. i18n/languages/woocommerce-mercadopago-es_PE.po +6 -2
  24. i18n/languages/woocommerce-mercadopago-es_UY.mo +0 -0
  25. i18n/languages/woocommerce-mercadopago-es_UY.po +6 -2
  26. i18n/languages/woocommerce-mercadopago-es_VE.mo +0 -0
  27. i18n/languages/woocommerce-mercadopago-es_VE.po +6 -2
  28. i18n/languages/woocommerce-mercadopago-pt_BR.mo +0 -0
  29. i18n/languages/woocommerce-mercadopago-pt_BR.po +7 -3
  30. i18n/languages/woocommerce-mercadopago.pot +197 -189
  31. includes/admin/notices/WC_WooMercadoPago_Notices.php +5 -3
  32. includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php +41 -25
  33. includes/module/WC_WooMercadoPago_Configs.php +31 -20
  34. includes/module/WC_WooMercadoPago_Credentials.php +37 -43
  35. includes/module/WC_WooMercadoPago_Module.php +7 -6
  36. includes/module/config/WC_WooMercadoPago_Constants.php +1 -1
  37. includes/module/preference/WC_WooMercadoPago_PreferenceAbstract.php +2 -2
  38. includes/module/preference/WC_WooMercadoPago_PreferenceBasic.php +0 -1
  39. includes/module/sdk/lib/MP.php +687 -735
  40. includes/module/sdk/lib/RestClient/AbstractRestClient.php +4 -70
  41. includes/notification/WC_WooMercadoPago_Notification_Abstract.php +112 -35
  42. includes/notification/WC_WooMercadoPago_Notification_IPN.php +24 -23
  43. includes/notification/WC_WooMercadoPago_Notification_Webhook.php +14 -15
  44. includes/payments/WC_WooMercadoPago_BasicGateway.php +6 -9
  45. includes/payments/WC_WooMercadoPago_CustomGateway.php +4 -2
  46. includes/payments/WC_WooMercadoPago_PaymentAbstract.php +7 -3
  47. includes/payments/WC_WooMercadoPago_TicketGateway.php +3 -1
  48. includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php +10 -51
  49. readme.txt +58 -41
  50. woocommerce-mercadopago.php +2 -2
assets/css/admin_notice_mercadopago.min.css ADDED
@@ -0,0 +1 @@
 
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}
assets/css/basic_checkout_mercadopago.min.css ADDED
@@ -0,0 +1 @@
 
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}
assets/css/config_mercadopago.min.css ADDED
@@ -0,0 +1 @@
 
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}
assets/js/basic_config_mercadopago.js CHANGED
@@ -10,7 +10,9 @@ window.onload = function () {
10
  document.querySelector('.wc-admin-breadcrumb').style.display = 'none';
11
  document.querySelector('.mp-header-logo').style.display = 'none';
12
  document.querySelector('#_wpnonce').parentElement.style.display = 'none';
13
- document.querySelectorAll('h2')[4].style.display = 'none';
 
 
14
 
15
 
16
  var descriptionInput = document.querySelectorAll('p.description');
10
  document.querySelector('.wc-admin-breadcrumb').style.display = 'none';
11
  document.querySelector('.mp-header-logo').style.display = 'none';
12
  document.querySelector('#_wpnonce').parentElement.style.display = 'none';
13
+
14
+ var h2s = document.querySelectorAll('h2');
15
+ h2s[4] !== undefined ? h2s[4].style.display = 'none' : null;
16
 
17
 
18
  var descriptionInput = document.querySelectorAll('p.description');
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 a=document.querySelectorAll("#mp_table_0");a[0].children[0].children[0].style.display="none",a[0].children[0].children[1].style.display="none";var r=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(r.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(r.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_options_title").nextElementSibling.append(r.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_payments_description").nextElementSibling.append(r.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_payments_advanced_description").nextElementSibling.append(r.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="",v=0,S=document.querySelectorAll(".online_payment_method"),q=0;q<S.length;q++)f=S[q].getAttribute("data-translate"),!0===S[q].checked&&(v+=1);v===S.length&&(w="checked");for(var E=0;E<S.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>";S[E].parentElement.insertAdjacentHTML("beforebegin",x);break}for(var A="",B="",I=0,M=document.querySelectorAll(".debit_payment_method"),C=0;C<M.length;C++)A=M[C].getAttribute("data-translate"),!0===M[C].checked&&(I+=1);I===M.length&&(B="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" '+B+' 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}}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<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";var o=document.querySelectorAll("h2");void 0!==o[4]&&(o[4].style.display="none");for(var t=document.querySelectorAll("p.description"),c=0;c<t.length;c++)t[c].style.width="420px";for(var n=document.querySelectorAll("th.titledesc"),l=0;l<n.length;l++)n[l].id="mp_field_text",null!=n[l].children[0].children[0]&&(n[l].children[0].children[0].style.position="relative",n[l].children[0].children[0].style.fontSize="22px");for(var d=document.querySelectorAll(".form-table"),a=0;a<d.length;a++)d[a].id="mp_table_"+a;document.querySelector(".hidden-field-mp-title").setAttribute("type","hidden"),document.querySelector(".hidden-field-mp-desc").setAttribute("type","hidden");o=document.querySelectorAll("#mp_table_0");o[0].children[0].children[0].style.display="none",o[0].children[0].children[1].style.display="none";o=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(o.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(o.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_options_title").nextElementSibling.append(o.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_payments_description").nextElementSibling.append(o.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_payments_advanced_description").nextElementSibling.append(o.cloneNode(!0));var r=document.querySelector("#woocommerce_woo-mercado-pago-basic_checkout_advanced_settings"),i=r.nextElementSibling;i.style.display="none",r.style.cursor="pointer",r.innerHTML+=e("header_plus","header_less");var m=document.querySelector("#header_plus"),s=document.querySelector("#header_less");r.onclick=function(){"none"===i.style.display?(i.style.display="block",s.style.display="block",m.style.display="none"):(i.style.display="none",s.style.display="none",m.style.display="block")};var r=document.querySelector("#woocommerce_woo-mercado-pago-basic_checkout_payments_advanced_title"),p=document.querySelector("#woocommerce_woo-mercado-pago-basic_checkout_payments_advanced_description").nextElementSibling,y=document.querySelector("#woocommerce_woo-mercado-pago-basic_checkout_payments_advanced_description");p.style.display="none",y.style.display="none",r.style.cursor="pointer",r.innerHTML+=e("header_plus_2","header_less_2");var u=document.querySelector("#header_plus_2"),_=document.querySelector("#header_less_2");r.onclick=function(){"none"===p.style.display?(p.style.display="block",y.style.display="block",_.style.display="block",u.style.display="none"):(p.style.display="none",y.style.display="none",_.style.display="none",u.style.display="block")};for(var r=document.querySelector("#woocommerce_woo-mercado-pago-basic_checkout_payments_description").nextElementSibling.getAttribute("class"),h=document.querySelectorAll("."+r+" td.forminp label"),c=0;c<h.length;c++)h[c].id="mp_input_payments_mt";for(var b="",k="",g=0,f=document.querySelectorAll(".online_payment_method"),w=0;w<f.length;w++)b=f[w].getAttribute("data-translate"),!0===f[w].checked&&(g+=1);g===f.length&&(k="checked");for(var v=0;v<f.length;v++)if(0===v){var S='<div class="all_checkbox"> <label for="checkmeon" id="mp_input_payments"> <input type="checkbox" name="checkmeon" id="checkmeon" '+k+' onclick="completeOnlineCheckbox()"> '+b+" </label> </div>";f[v].parentElement.insertAdjacentHTML("beforebegin",S);break}for(var q="",E="",x=0,A=document.querySelectorAll(".debit_payment_method"),B=0;B<A.length;B++)q=A[B].getAttribute("data-translate"),!0===A[B].checked&&(x+=1);x===A.length&&(E="checked");for(var I=0;I<A.length;I++)if(0===I){var M='<div class="all_checkbox"> <label for="checkmedeb" id="mp_input_payments"> <input type="checkbox" name="checkmedeb" id="checkmedeb" '+E+' onclick="completeDebitCheckbox()"> '+q+" </label> </div>";A[I].parentElement.insertAdjacentHTML("beforebegin",M);break}for(var C="",L="",H=0,N=document.querySelectorAll(".offline_payment_method"),T=0;T<N.length;T++)C=N[T].getAttribute(["data-translate"]),!0===N[T].checked&&(H+=1);H===N.length&&(L="checked");for(var O=0;O<N.length;O++)if(0===O){var j='<div class="all_checkbox"> <label for="checkmeoff" id="mp_input_payments" style="margin-bottom: 37px !important;"> <input type="checkbox" name="checkmeoff" id="checkmeoff" '+L+' onclick="completeOfflineCheckboxMP()"> '+C+" </label> </div>";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<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(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);
1
+ !function(M){"use strict";M(function(){var t=!1,d={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(d.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={},r={};function o(){0!==document.getElementById("mp-card-number").value&&(document.getElementById("mp-card-number").value="",p(),g(),_(),f(),v())}function a(){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 l(){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=l();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){200===e?(c=o[0],o=c.id,document.getElementById("paymentMethodId").value=o,o=c.secure_thumbnail,document.getElementById("mp-card-number").style.background="url("+o+") 98% 50% no-repeat #fff",function(e){r={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]&&(r.issuer=!0),"cardholder_name"===e[o]&&(r.cardholder_name=!0),"cardholder_identification_type"===e[o]&&(r.cardholder_identification_type=!0),"cardholder_identification_number"===e[o]&&(r.cardholder_identification_number=!0)}(c.additional_info_needed),function(){r.cardholder_name?document.getElementById("mp-card-holder-div").style.display="block":document.getElementById("mp-card-holder-div").style.display="none";r.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());r.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";r.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";r.cardholder_identification_type||r.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 e=document.getElementById("mp-installments"),t='<option value="-1">'+wc_mercadopago_params.choose+"...</option>",n=[],r=0;r<o.length;r++)"aggregator"===o[r].processing_mode&&(n=o[r].payer_costs);for(var c=0;c<n.length;c++)t+='<option value="'+n[c].installments+'" '+function(e){var o="";if("MLA"!==d.site_id)return o;for(var t=0;t<e.length;t++)-1!==e[t].indexOf("CFT_")&&(o='data-tax="'+e[t]+'"');return o}(n[c].labels)+">"+(n[c].recommended_message||n[c].installments)+"</option>";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<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:l(),amount:o,issuer_id:r};if("-1"===r)return}else e={bin:l(),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;e=new Option(wc_mercadopago_params.choose+"...","-1");n.appendChild(e);for(var r=0;r<o.length;r++){var c="default"===o[r].name?"Otro":o[r].name;n.appendChild(new Option(c,o[r].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=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}(),t=(t=!1,r.issuer&&("-1"!==(e=document.getElementById("mp-issuer")).value&&""!==e.value||(e.classList.add("mp-form-control-error"),t=!0)),r.cardholder_name&&("-1"!==(e=document.getElementById("mp-card-holder-name")).value&&""!==e.value||(e.classList.add("mp-form-control-error"),t=!0)),r.cardholder_identification_type&&("-1"!==(o=document.getElementById("docType")).value&&""!==o.value||(o.classList.add("mp-form-control-error"),t=!0)),r.cardholder_identification_number&&("-1"!==(o=document.getElementById("docNumber")).value&&""!==o.value||(o.classList.add("mp-form-control-error"),document.getElementById("mp-error-324").style.display="inline-block",t=!0)),t||t);return!n&&!t||(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=e.cause[t],r=void 0;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))&&(n=o.querySelector(r.getAttribute("data-main")),r.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),a()),M("body").on("updated_checkout",function(){"yes"===n.activated&&M("#applyCoupon").on("click",C),o(),a()}),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.js CHANGED
@@ -5,7 +5,9 @@ window.onload = function () {
5
  document.querySelector('.wc-admin-breadcrumb').style.display = 'none';
6
  document.querySelector('.mp-header-logo').style.display = 'none';
7
  document.querySelector('#_wpnonce').parentElement.style.display = 'none';
8
- document.querySelectorAll('h2')[4].style.display = 'none';
 
 
9
 
10
  var descriptionInput = document.querySelectorAll('p.description');
11
  for (var i = 0; i < descriptionInput.length; i++) {
5
  document.querySelector('.wc-admin-breadcrumb').style.display = 'none';
6
  document.querySelector('.mp-header-logo').style.display = 'none';
7
  document.querySelector('#_wpnonce').parentElement.style.display = 'none';
8
+
9
+ var h2s = document.querySelectorAll('h2');
10
+ h2s[4] !== undefined ? h2s[4].style.display = 'none' : null;
11
 
12
  var descriptionInput = document.querySelectorAll('p.description');
13
  for (var i = 0; i < descriptionInput.length; i++) {
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,m,a,r,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_title").nextElementSibling.append(h.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_payments_subtitle").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>',a=document.querySelector("#header_plus"),r=document.querySelector("#header_less"),s.onclick=function(){"none"===m.style.display?(m.style.display="block",r.style.display="block",a.style.display="none"):(m.style.display="none",r.style.display="none",a.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")});var g=document.querySelectorAll(".mp-save-button");0!==g.length&&Array.from(g).forEach(function(e){e.addEventListener("click",function(){document.querySelector(".woocommerce-save-button").click()})})};
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";var e=document.querySelectorAll("h2");void 0!==e[4]&&(e[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"),l=0;l<c.length;l++)c[l].id="mp_field_text",null!=c[l].children[0].children[0]&&(c[l].children[0].children[0].style.position="relative",c[l].children[0].children[0].style.fontSize="22px");for(var n=document.querySelectorAll(".form-table"),d=0;d<n.length;d++)n[d].id="mp_table_"+d;document.querySelector(".hidden-field-mp-title").setAttribute("type","hidden"),document.querySelector(".hidden-field-mp-desc").setAttribute("type","hidden");e=document.querySelectorAll("#mp_table_0");e[0].children[0].children[0].style.display="none",e[0].children[0].children[1].style.display="none";var s,m,a,r,i,p,u,e=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(e.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(e.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_custom_options_title").nextElementSibling.append(e.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_payments_subtitle").nextElementSibling.append(e.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_payments_advanced_description").nextElementSibling.append(e.cloneNode(!0)),y=document.querySelector("#woocommerce_woo-mercado-pago-custom_checkout_advanced_settings"),(s=y.nextElementSibling).style.display="none",y.style.cursor="pointer",y.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>',m=document.querySelector("#header_plus"),a=document.querySelector("#header_less"),y.onclick=function(){"none"===s.style.display?(s.style.display="block",a.style.display="block",m.style.display="none"):(s.style.display="none",a.style.display="none",m.style.display="block")},document.querySelector("#woocommerce_woo-mercado-pago-custom_checkout_payments_advanced_description").nextElementSibling.style.display="none",y=document.querySelector("#woocommerce_woo-mercado-pago-custom_checkout_custom_payments_advanced_title"),r=document.querySelector("#woocommerce_woo-mercado-pago-custom_checkout_payments_advanced_description").nextElementSibling,i=document.querySelector("#woocommerce_woo-mercado-pago-custom_checkout_payments_advanced_description"),r.style.display="none",i.style.display="none",y.style.cursor="pointer",y.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>',p=document.querySelector("#header_plus_2"),u=document.querySelector("#header_less_2"),y.onclick=function(){"none"===r.style.display?(r.style.display="block",u.style.display="block",r.style.display="block",p.style.display="none"):(r.style.display="none",u.style.display="none",i.style.display="none",p.style.display="block")});var y=document.querySelectorAll(".mp-save-button");0!==y.length&&Array.from(y).forEach(function(e){e.addEventListener("click",function(){document.querySelector(".woocommerce-save-button").click()})})};
assets/js/ticket.min.js CHANGED
@@ -1 +1 @@
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);10!=(o=10*t%11)&&11!==o||(o=0);if(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);10!=(o=10*t%11)&&11!==o||(o=0);return o===parseInt(e.substring(10,11),10)})(e)),"MLU"===n.site_id&&(c=""!==(t=o.value)&&function(e){var t=0,o=0,r=0,c=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;r=t%10==0?0:10-t%10;return c===r.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);
1
+ !function(l){"use strict";l(function(){var e=!1,p="CPF",c={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"===c.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:n(),e):"MLU"===c.site_id?(r()?e=!0:n(),e):void 0)}function r(){var e,t=document.getElementById("mp_doc_number"),o=document.getElementById("mp_error_docnumber"),r=!1;return"MLB"===c.site_id&&(e=t.value,r=("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);10!=(o=10*t%11)&&11!==o||(o=0);if(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);10!=(o=10*t%11)&&11!==o||(o=0);return o===parseInt(e.substring(10,11),10)})(e)),"MLU"===c.site_id&&(r=""!==(e=t.value)&&function(e){var t=0,o=0,r=0,c=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;r=t%10==0?0:10-t%10;return c===r.toString()}(e)),r?(o.style.display="none",t.classList.remove("mp-form-control-error"),r=!0):(o.style.display="block",t.classList.add("mp-form-control-error"),t.focus()),r}function n(){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"===c.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);
assets/js/ticket_config_mercadopago.js CHANGED
@@ -5,7 +5,9 @@ window.onload = function () {
5
  document.querySelector('.wc-admin-breadcrumb').style.display = 'none';
6
  document.querySelector('.mp-header-logo').style.display = 'none';
7
  document.querySelector('p.submit').style.display = 'none';
8
- document.querySelectorAll('h2')[4].style.display = 'none';
 
 
9
 
10
  var descriptionInput = document.querySelectorAll('p.description');
11
  for (var i = 0; i < descriptionInput.length; i++) {
5
  document.querySelector('.wc-admin-breadcrumb').style.display = 'none';
6
  document.querySelector('.mp-header-logo').style.display = 'none';
7
  document.querySelector('p.submit').style.display = 'none';
8
+
9
+ var h2s = document.querySelectorAll('h2');
10
+ h2s[4] !== undefined ? h2s[4].style.display = 'none' : null;
11
 
12
  var descriptionInput = document.querySelectorAll('p.description');
13
  for (var i = 0; i < descriptionInput.length; i++) {
assets/js/ticket_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("p.submit").style.display="none",document.querySelectorAll("h2")[4].style.display="none";for(var e=document.querySelectorAll("p.description"),t=0;t<e.length;t++)e[t].style.width="420px";for(var o=document.querySelectorAll("th.titledesc"),c=0;c<o.length;c++)o[c].id="mp_field_text",null!=o[c].children[0].children[0]&&(o[c].children[0].children[0].style.position="relative",o[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 i=document.getElementById("woocommerce_woo-mercado-pago-ticket_checkout_btn_save");if(null===document.getElementById("woocommerce_woo-mercado-pago-ticket_checkout_homolog_title")&&null===document.getElementById("woocommerce_woo-mercado-pago-ticket_checkout_credential_description_prod")||document.getElementById("woocommerce_woo-mercado-pago-ticket_checkout_credential_description_prod").nextElementSibling.append(i.cloneNode(!0)),null!==document.getElementById("woocommerce_woo-mercado-pago-ticket_checkout_homolog_title")||null!==document.getElementById("woocommerce_woo-mercado-pago-ticket_checkout_ticket_options_title")){document.getElementById("woocommerce_woo-mercado-pago-ticket_checkout_ticket_options_title").nextElementSibling.append(i.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-ticket_checkout_advanced_settings").nextElementSibling.append(i.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-ticket_checkout_ticket_payments_description").nextElementSibling.append(i.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-ticket_checkout_payments_advanced_description").nextElementSibling.append(i.cloneNode(!0));var r=document.querySelector("#woocommerce_woo-mercado-pago-ticket_checkout_advanced_settings"),a=r.nextElementSibling;a.style.display="none",r.style.cursor="pointer",r.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 m=document.querySelector("#header_plus"),s=document.querySelector("#header_less");r.onclick=function(){"none"===a.style.display?(a.style.display="block",s.style.display="block",m.style.display="none"):(a.style.display="none",s.style.display="none",m.style.display="block")};var p=document.querySelector("#woocommerce_woo-mercado-pago-ticket_checkout_ticket_payments_advanced_title"),y=document.querySelector("#woocommerce_woo-mercado-pago-ticket_checkout_payments_advanced_description").nextElementSibling,u=document.querySelector("#woocommerce_woo-mercado-pago-ticket_checkout_payments_advanced_description");y.style.display="none",u.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"===y.style.display?(y.style.display="block",u.style.display="block",h.style.display="block",_.style.display="none"):(y.style.display="none",u.style.display="none",h.style.display="none",_.style.display="block")};for(var k=document.querySelector("#woocommerce_woo-mercado-pago-ticket_checkout_ticket_payments_description").nextElementSibling.getAttribute("class"),g=document.querySelectorAll("."+k+" td.forminp label"),b=0;b<g.length;b++)g[b].id="mp_input_payments_mt";for(var f="",w="",S=0,v=document.querySelectorAll(".ticket_payment_method_select"),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="checkmeoff" id="mp_input_payments" style="margin-bottom: 37px !important;"> <input type="checkbox" name="checkmeoff" id="checkmeoff" '+w+' onclick="completeOfflineCheckbox()"> '+f+" </label> </div>";v[E].parentElement.insertAdjacentHTML("beforebegin",x);break}}var A=document.querySelectorAll(".mp-save-button");0!==A.length&&Array.from(A).forEach(function(e){e.addEventListener("click",function(){document.querySelector(".woocommerce-save-button").click()})})},window.completeOfflineCheckbox=function(){for(var e=document.getElementById("checkmeoff").checked,t=document.querySelectorAll(".ticket_payment_method_select"),o=0;o<t.length;o++)t[o].checked=!0===e};
1
+ window.onload=function(){document.querySelector(".wc-admin-breadcrumb").style.display="none",document.querySelector(".mp-header-logo").style.display="none",document.querySelector("p.submit").style.display="none";var e=document.querySelectorAll("h2");void 0!==e[4]&&(e[4].style.display="none");for(var t=document.querySelectorAll("p.description"),o=0;o<t.length;o++)t[o].style.width="420px";for(var c=document.querySelectorAll("th.titledesc"),l=0;l<c.length;l++)c[l].id="mp_field_text",null!=c[l].children[0].children[0]&&(c[l].children[0].children[0].style.position="relative",c[l].children[0].children[0].style.fontSize="22px");for(var n=document.querySelectorAll(".form-table"),d=0;d<n.length;d++)n[d].id="mp_table_"+d;document.querySelector(".hidden-field-mp-title").setAttribute("type","hidden"),document.querySelector(".hidden-field-mp-desc").setAttribute("type","hidden");e=document.querySelectorAll("#mp_table_0");e[0].children[0].children[0].style.display="none",e[0].children[0].children[1].style.display="none";e=document.getElementById("woocommerce_woo-mercado-pago-ticket_checkout_btn_save");if(null===document.getElementById("woocommerce_woo-mercado-pago-ticket_checkout_homolog_title")&&null===document.getElementById("woocommerce_woo-mercado-pago-ticket_checkout_credential_description_prod")||document.getElementById("woocommerce_woo-mercado-pago-ticket_checkout_credential_description_prod").nextElementSibling.append(e.cloneNode(!0)),null!==document.getElementById("woocommerce_woo-mercado-pago-ticket_checkout_homolog_title")||null!==document.getElementById("woocommerce_woo-mercado-pago-ticket_checkout_ticket_options_title")){document.getElementById("woocommerce_woo-mercado-pago-ticket_checkout_ticket_options_title").nextElementSibling.append(e.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-ticket_checkout_advanced_settings").nextElementSibling.append(e.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-ticket_checkout_ticket_payments_description").nextElementSibling.append(e.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-ticket_checkout_payments_advanced_description").nextElementSibling.append(e.cloneNode(!0));var i=document.querySelector("#woocommerce_woo-mercado-pago-ticket_checkout_advanced_settings"),r=i.nextElementSibling;r.style.display="none",i.style.cursor="pointer",i.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"),m=document.querySelector("#header_less");i.onclick=function(){"none"===r.style.display?(r.style.display="block",m.style.display="block",a.style.display="none"):(r.style.display="none",m.style.display="none",a.style.display="block")};var i=document.querySelector("#woocommerce_woo-mercado-pago-ticket_checkout_ticket_payments_advanced_title"),s=document.querySelector("#woocommerce_woo-mercado-pago-ticket_checkout_payments_advanced_description").nextElementSibling,p=document.querySelector("#woocommerce_woo-mercado-pago-ticket_checkout_payments_advanced_description");s.style.display="none",p.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>';var y=document.querySelector("#header_plus_2"),u=document.querySelector("#header_less_2");i.onclick=function(){"none"===s.style.display?(s.style.display="block",p.style.display="block",u.style.display="block",y.style.display="none"):(s.style.display="none",p.style.display="none",u.style.display="none",y.style.display="block")};for(var i=document.querySelector("#woocommerce_woo-mercado-pago-ticket_checkout_ticket_payments_description").nextElementSibling.getAttribute("class"),_=document.querySelectorAll("."+i+" td.forminp label"),h=0;h<_.length;h++)_[h].id="mp_input_payments_mt";for(var k="",g="",b=0,f=document.querySelectorAll(".ticket_payment_method_select"),w=0;w<f.length;w++)k=f[w].getAttribute("data-translate"),!0===f[w].checked&&(b+=1);b===f.length&&(g="checked");for(var S=0;S<f.length;S++)if(0===S){var v='<div class="all_checkbox"> <label for="checkmeoff" id="mp_input_payments" style="margin-bottom: 37px !important;"> <input type="checkbox" name="checkmeoff" id="checkmeoff" '+g+' onclick="completeOfflineCheckbox()"> '+k+" </label> </div>";f[S].parentElement.insertAdjacentHTML("beforebegin",v);break}}i=document.querySelectorAll(".mp-save-button");0!==i.length&&Array.from(i).forEach(function(e){e.addEventListener("click",function(){document.querySelector(".woocommerce-save-button").click()})})},window.completeOfflineCheckbox=function(){for(var e=document.getElementById("checkmeoff").checked,t=document.querySelectorAll(".ticket_payment_method_select"),o=0;o<t.length;o++)t[o].checked=!0===e};
i18n/languages/woocommerce-mercadopago-es_AR.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_AR.po CHANGED
@@ -2,14 +2,14 @@
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.4.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-09-18 09:54-0300\n"
13
  "X-Generator: Poedit 2.4.1\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
@@ -217,6 +217,10 @@ msgstr "El pago fue cancelado."
217
  msgid "The payment is in mediation or the purchase was unknown by the customer."
218
  msgstr "El pago esta en mediación o la compra fue desconocida por el cliente."
219
 
 
 
 
 
220
  #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:204
221
  msgid "Payment is pending review."
222
  msgstr "El pago está pendiente de revisió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.5.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-10-19 15:28-0300\n"
13
  "X-Generator: Poedit 2.4.1\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
217
  msgid "The payment is in mediation or the purchase was unknown by the customer."
218
  msgstr "El pago esta en mediación o la compra fue desconocida por el cliente."
219
 
220
+ #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:384
221
+ msgid "Mercado Pago: The payment %s was notified by Mercado Pago with status %s."
222
+ msgstr "Mercado Pago: El pago %s fue notificado por Mercado Pago con estado %s."
223
+
224
  #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:204
225
  msgid "Payment is pending review."
226
  msgstr "El pago está pendiente de revisión."
i18n/languages/woocommerce-mercadopago-es_CL.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_CL.po CHANGED
@@ -2,14 +2,14 @@
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.4.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-09-18 09:55-0300\n"
13
  "X-Generator: Poedit 2.4.1\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
@@ -217,6 +217,10 @@ msgstr "El pago fue cancelado."
217
  msgid "The payment is in mediation or the purchase was unknown by the customer."
218
  msgstr "El pago esta en mediación o la compra fue desconocida por el cliente."
219
 
 
 
 
 
220
  #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:204
221
  msgid "Payment is pending review."
222
  msgstr "El pago está pendiente de revisió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.5.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-10-19 15:28-0300\n"
13
  "X-Generator: Poedit 2.4.1\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
217
  msgid "The payment is in mediation or the purchase was unknown by the customer."
218
  msgstr "El pago esta en mediación o la compra fue desconocida por el cliente."
219
 
220
+ #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:384
221
+ msgid "Mercado Pago: The payment %s was notified by Mercado Pago with status %s."
222
+ msgstr "Mercado Pago: El pago %s fue notificado por Mercado Pago con estado %s."
223
+
224
  #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:204
225
  msgid "Payment is pending review."
226
  msgstr "El pago está pendiente de revisión."
i18n/languages/woocommerce-mercadopago-es_CO.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_CO.po CHANGED
@@ -2,14 +2,14 @@
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.4.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-09-18 09:55-0300\n"
13
  "X-Generator: Poedit 2.4.1\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
@@ -217,6 +217,10 @@ msgstr "El pago fue cancelado."
217
  msgid "The payment is in mediation or the purchase was unknown by the customer."
218
  msgstr "El pago esta en mediación o la compra fue desconocida por el cliente."
219
 
 
 
 
 
220
  #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:204
221
  msgid "Payment is pending review."
222
  msgstr "El pago está pendiente de revisió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.5.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-10-19 15:28-0300\n"
13
  "X-Generator: Poedit 2.4.1\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
217
  msgid "The payment is in mediation or the purchase was unknown by the customer."
218
  msgstr "El pago esta en mediación o la compra fue desconocida por el cliente."
219
 
220
+ #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:384
221
+ msgid "Mercado Pago: The payment %s was notified by Mercado Pago with status %s."
222
+ msgstr "Mercado Pago: El pago %s fue notificado por Mercado Pago con estado %s."
223
+
224
  #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:204
225
  msgid "Payment is pending review."
226
  msgstr "El pago está pendiente de revisión."
i18n/languages/woocommerce-mercadopago-es_ES.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_ES.po CHANGED
@@ -2,14 +2,14 @@
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.4.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-09-18 09:55-0300\n"
13
  "X-Generator: Poedit 2.4.1\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
@@ -217,6 +217,10 @@ msgstr "El pago fue cancelado."
217
  msgid "The payment is in mediation or the purchase was unknown by the customer."
218
  msgstr "El pago esta en mediación o la compra fue desconocida por el cliente."
219
 
 
 
 
 
220
  #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:204
221
  msgid "Payment is pending review."
222
  msgstr "El pago está pendiente de revisió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.5.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-10-19 15:28-0300\n"
13
  "X-Generator: Poedit 2.4.1\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
217
  msgid "The payment is in mediation or the purchase was unknown by the customer."
218
  msgstr "El pago esta en mediación o la compra fue desconocida por el cliente."
219
 
220
+ #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:384
221
+ msgid "Mercado Pago: The payment %s was notified by Mercado Pago with status %s."
222
+ msgstr "Mercado Pago: El pago %s fue notificado por Mercado Pago con estado %s."
223
+
224
  #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:204
225
  msgid "Payment is pending review."
226
  msgstr "El pago está pendiente de revisión."
i18n/languages/woocommerce-mercadopago-es_MX.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_MX.po CHANGED
@@ -2,14 +2,14 @@
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.4.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-09-18 09:55-0300\n"
13
  "X-Generator: Poedit 2.4.1\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
@@ -217,6 +217,10 @@ msgstr "El pago fue cancelado."
217
  msgid "The payment is in mediation or the purchase was unknown by the customer."
218
  msgstr "El pago esta en mediación o la compra fue desconocida por el cliente."
219
 
 
 
 
 
220
  #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:204
221
  msgid "Payment is pending review."
222
  msgstr "El pago está pendiente de revisió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.5.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-10-19 15:27-0300\n"
13
  "X-Generator: Poedit 2.4.1\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
217
  msgid "The payment is in mediation or the purchase was unknown by the customer."
218
  msgstr "El pago esta en mediación o la compra fue desconocida por el cliente."
219
 
220
+ #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:384
221
+ msgid "Mercado Pago: The payment %s was notified by Mercado Pago with status %s."
222
+ msgstr "Mercado Pago: El pago %s fue notificado por Mercado Pago con estado %s."
223
+
224
  #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:204
225
  msgid "Payment is pending review."
226
  msgstr "El pago está pendiente de revisión."
i18n/languages/woocommerce-mercadopago-es_PE.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_PE.po CHANGED
@@ -2,14 +2,14 @@
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.4.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-09-18 09:55-0300\n"
13
  "X-Generator: Poedit 2.4.1\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
@@ -217,6 +217,10 @@ msgstr "El pago fue cancelado."
217
  msgid "The payment is in mediation or the purchase was unknown by the customer."
218
  msgstr "El pago esta en mediación o la compra fue desconocida por el cliente."
219
 
 
 
 
 
220
  #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:204
221
  msgid "Payment is pending review."
222
  msgstr "El pago está pendiente de revisió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.5.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-10-19 15:27-0300\n"
13
  "X-Generator: Poedit 2.4.1\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
217
  msgid "The payment is in mediation or the purchase was unknown by the customer."
218
  msgstr "El pago esta en mediación o la compra fue desconocida por el cliente."
219
 
220
+ #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:384
221
+ msgid "Mercado Pago: The payment %s was notified by Mercado Pago with status %s."
222
+ msgstr "Mercado Pago: El pago %s fue notificado por Mercado Pago con estado %s."
223
+
224
  #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:204
225
  msgid "Payment is pending review."
226
  msgstr "El pago está pendiente de revisión."
i18n/languages/woocommerce-mercadopago-es_UY.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_UY.po CHANGED
@@ -2,14 +2,14 @@
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.4.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-09-18 09:56-0300\n"
13
  "X-Generator: Poedit 2.4.1\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
@@ -217,6 +217,10 @@ msgstr "El pago fue cancelado."
217
  msgid "The payment is in mediation or the purchase was unknown by the customer."
218
  msgstr "El pago esta en mediación o la compra fue desconocida por el cliente."
219
 
 
 
 
 
220
  #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:204
221
  msgid "Payment is pending review."
222
  msgstr "El pago está pendiente de revisió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.5.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-10-19 15:27-0300\n"
13
  "X-Generator: Poedit 2.4.1\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
217
  msgid "The payment is in mediation or the purchase was unknown by the customer."
218
  msgstr "El pago esta en mediación o la compra fue desconocida por el cliente."
219
 
220
+ #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:384
221
+ msgid "Mercado Pago: The payment %s was notified by Mercado Pago with status %s."
222
+ msgstr "Mercado Pago: El pago %s fue notificado por Mercado Pago con estado %s."
223
+
224
  #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:204
225
  msgid "Payment is pending review."
226
  msgstr "El pago está pendiente de revisión."
i18n/languages/woocommerce-mercadopago-es_VE.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_VE.po CHANGED
@@ -2,14 +2,14 @@
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.4.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-09-18 09:56-0300\n"
13
  "X-Generator: Poedit 2.4.1\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
@@ -217,6 +217,10 @@ msgstr "El pago fue cancelado."
217
  msgid "The payment is in mediation or the purchase was unknown by the customer."
218
  msgstr "El pago esta en mediación o la compra fue desconocida por el cliente."
219
 
 
 
 
 
220
  #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:204
221
  msgid "Payment is pending review."
222
  msgstr "El pago está pendiente de revisió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.5.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-10-19 15:27-0300\n"
13
  "X-Generator: Poedit 2.4.1\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
217
  msgid "The payment is in mediation or the purchase was unknown by the customer."
218
  msgstr "El pago esta en mediación o la compra fue desconocida por el cliente."
219
 
220
+ #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:384
221
+ msgid "Mercado Pago: The payment %s was notified by Mercado Pago with status %s."
222
+ msgstr "Mercado Pago: El pago %s fue notificado por Mercado Pago con estado %s."
223
+
224
  #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:204
225
  msgid "Payment is pending review."
226
  msgstr "El pago está pendiente de revisión."
i18n/languages/woocommerce-mercadopago-pt_BR.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-pt_BR.po CHANGED
@@ -2,14 +2,14 @@
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.4.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-09-18 09:56-0300\n"
13
  "X-Generator: Poedit 2.4.1\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
@@ -217,6 +217,10 @@ msgstr "O pagamento foi cancelado."
217
  msgid "The payment is in mediation or the purchase was unknown by the customer."
218
  msgstr "O pagamento está em mediação ou a compra não foi reconhecida pelo cliente."
219
 
 
 
 
 
220
  #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:204
221
  msgid "Payment is pending review."
222
  msgstr "O pagamento está em revisão."
@@ -1366,7 +1370,7 @@ msgstr "Agora convertemos sua moeda de %s para %s."
1366
 
1367
  #: includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php:386
1368
  msgid "We no longer convert your currency from %s to %s."
1369
- msgstr "Paramos de converter sua moreda de %s para %s."
1370
 
1371
  #: includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php:403
1372
  msgid "<b>Attention:</b> The currency settings you have in WooCommerce are not compatible with the currency you use in your Mercado Pago account. Please activate the currency conversion."
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.5.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-10-19 15:27-0300\n"
13
  "X-Generator: Poedit 2.4.1\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
217
  msgid "The payment is in mediation or the purchase was unknown by the customer."
218
  msgstr "O pagamento está em mediação ou a compra não foi reconhecida pelo cliente."
219
 
220
+ #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:384
221
+ msgid "Mercado Pago: The payment %s was notified by Mercado Pago with status %s."
222
+ msgstr "Mercado Pago: O pagamento %s foi notificado pelo Mercado Pago com status %s."
223
+
224
  #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:204
225
  msgid "Payment is pending review."
226
  msgstr "O pagamento está em revisão."
1370
 
1371
  #: includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php:386
1372
  msgid "We no longer convert your currency from %s to %s."
1373
+ msgstr "Paramos de converter sua moeda de %s para %s."
1374
 
1375
  #: includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php:403
1376
  msgid "<b>Attention:</b> The currency settings you have in WooCommerce are not compatible with the currency you use in your Mercado Pago account. Please activate the currency conversion."
i18n/languages/woocommerce-mercadopago.pot CHANGED
@@ -18,23 +18,35 @@ msgstr ""
18
  msgid "Activate this option so that the value of the currency set in WooCommerce is compatible with the value of the currency you use in Mercado Pago."
19
  msgstr ""
20
 
21
- #: includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php:311
22
  msgid "Convert Currency"
23
  msgstr ""
24
 
25
- #: includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php:378
 
 
 
 
 
 
 
 
26
  msgid "Now we convert your currency from %s to %s."
27
  msgstr ""
28
 
29
- #: includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php:394
30
  msgid "We no longer convert your currency from %s to %s."
31
  msgstr ""
32
 
33
- #: includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php:411
34
  msgid "<b>Attention:</b> The currency settings you have in WooCommerce are not compatible with the currency you use in your Mercado Pago account. Please activate the currency conversion."
35
  msgstr ""
36
 
37
- #: includes/module/WC_WooMercadoPago_Configs.php:112
 
 
 
 
38
  msgid "The store should have HTTPS in order to activate both Checkout Personalizado and Ticket Checkout."
39
  msgstr ""
40
 
@@ -54,127 +66,127 @@ msgstr ""
54
  msgid "Cancel order"
55
  msgstr ""
56
 
57
- #: includes/module/WC_WooMercadoPago_Module.php:239, includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:405
58
  msgid "Fill in your credentials to enable payment methods."
59
  msgstr ""
60
 
61
- #: includes/module/WC_WooMercadoPago_Module.php:248
62
  msgid "Set up"
63
  msgstr ""
64
 
65
- #: includes/module/WC_WooMercadoPago_Module.php:249
66
  msgid "Your opinion helps us get better"
67
  msgstr ""
68
 
69
- #: includes/module/WC_WooMercadoPago_Module.php:250
70
  msgid "Guides and Documentation"
71
  msgstr ""
72
 
73
- #: includes/module/WC_WooMercadoPago_Module.php:251
74
  msgid "Report Problem"
75
  msgstr ""
76
 
77
- #: includes/module/WC_WooMercadoPago_Module.php:323
78
  msgid "By Mercado Pago"
79
  msgstr ""
80
 
81
- #: includes/module/WC_WooMercadoPago_Module.php:348, includes/module/WC_WooMercadoPago_Module.php:369
82
  msgid "The <strong> Sponsor ID </strong> must be valid!"
83
  msgstr ""
84
 
85
- #: includes/module/WC_WooMercadoPago_Module.php:365
86
  msgid "The <strong>Sponsor ID</strong> must be from the same country as the seller!"
87
  msgstr ""
88
 
89
- #: includes/module/WC_WooMercadoPago_Module.php:396
90
  msgid "The payment method is not valid or not available."
91
  msgstr ""
92
 
93
- #: includes/module/WC_WooMercadoPago_Module.php:399
94
  msgid "The transaction amount cannot be processed by Mercado Pago."
95
  msgstr ""
96
 
97
- #: includes/module/WC_WooMercadoPago_Module.php:400
98
  msgid "Possible causes: Currency not supported; Amounts below the minimum or above the maximum allowed."
99
  msgstr ""
100
 
101
- #: includes/module/WC_WooMercadoPago_Module.php:403
102
  msgid "The users are not valid."
103
  msgstr ""
104
 
105
- #: includes/module/WC_WooMercadoPago_Module.php:404
106
  msgid "Possible causes: Buyer and seller have the same account in Mercado Pago; The transaction involving production and test users."
107
  msgstr ""
108
 
109
- #: includes/module/WC_WooMercadoPago_Module.php:407
110
  msgid "Unauthorized use of production credentials."
111
  msgstr ""
112
 
113
- #: includes/module/WC_WooMercadoPago_Module.php:408
114
  msgid "Possible causes: Use permission in use for the credential of the seller."
115
  msgstr ""
116
 
117
- #: includes/module/WC_WooMercadoPago_Module.php:526
118
  msgid "ERROR: It was not possible to convert the unsupported currency"
119
  msgstr ""
120
 
121
- #: includes/module/WC_WooMercadoPago_Module.php:528
122
  msgid "a"
123
  msgstr ""
124
 
125
- #: includes/module/WC_WooMercadoPago_Module.php:529, includes/module/WC_WooMercadoPago_Module.php:540
126
  msgid "Currency conversions should be done outside of this module."
127
  msgstr ""
128
 
129
- #: includes/module/WC_WooMercadoPago_Module.php:536
130
  msgid "ATTENTION: The currency"
131
  msgstr ""
132
 
133
- #: includes/module/WC_WooMercadoPago_Module.php:538
134
  msgid "defined in WooCommerce is different from that used by the credentials of your country.<br>The currency for transactions made with this payment method will be"
135
  msgstr ""
136
 
137
- #: includes/module/WC_WooMercadoPago_Module.php:547
138
  msgid "CONVERTED CURRENCY: Your store is converting currency of"
139
  msgstr ""
140
 
141
- #: includes/module/WC_WooMercadoPago_Module.php:549, templates/checkout/custom_checkout.php:135
142
  msgid "for"
143
  msgstr ""
144
 
145
- #: includes/module/WC_WooMercadoPago_Module.php:556, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:515
146
  msgid "Colombia"
147
  msgstr ""
148
 
149
- #: includes/module/WC_WooMercadoPago_Module.php:558, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:512
150
  msgid "Argentina"
151
  msgstr ""
152
 
153
- #: includes/module/WC_WooMercadoPago_Module.php:560, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:513
154
  msgid "Brazil"
155
  msgstr ""
156
 
157
- #: includes/module/WC_WooMercadoPago_Module.php:562, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:514
158
  msgid "Chile"
159
  msgstr ""
160
 
161
- #: includes/module/WC_WooMercadoPago_Module.php:564, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:516
162
  msgid "Mexico"
163
  msgstr ""
164
 
165
- #: includes/module/WC_WooMercadoPago_Module.php:566, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:518
166
  msgid "Uruguay"
167
  msgstr ""
168
 
169
- #: includes/module/WC_WooMercadoPago_Module.php:568
170
  msgid "Venezuela"
171
  msgstr ""
172
 
173
- #: includes/module/WC_WooMercadoPago_Module.php:570, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:517
174
  msgid "Peru"
175
  msgstr ""
176
 
177
- #: includes/module/WC_WooMercadoPago_Module.php:605
178
  msgid "Update the WooCommerce order to "
179
  msgstr ""
180
 
@@ -182,34 +194,38 @@ msgstr ""
182
  msgid "Payment approved."
183
  msgstr ""
184
 
185
- #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:187, includes/notification/WC_WooMercadoPago_Notification_Abstract.php:190
186
  msgid "Waiting for the ticket payment."
187
  msgstr ""
188
 
189
- #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:196
190
  msgid "The customer has not made the payment yet."
191
  msgstr ""
192
 
193
- #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:207
194
  msgid "Payment is pending review."
195
  msgstr ""
196
 
197
- #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:216
198
  msgid "Payment was declined. The customer can try again."
199
  msgstr ""
200
 
201
- #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:225
202
  msgid "Payment was returned to the customer."
203
  msgstr ""
204
 
205
- #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:234
206
  msgid "Payment was canceled."
207
  msgstr ""
208
 
209
- #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:244, includes/notification/WC_WooMercadoPago_Notification_Abstract.php:254
210
  msgid "The payment is in mediation or the purchase was unknown by the customer."
211
  msgstr ""
212
 
 
 
 
 
213
  #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:35
214
  msgid "No ID or TOPIC param in Request IPN"
215
  msgstr ""
@@ -226,11 +242,11 @@ msgstr ""
226
  msgid "Not found Payments into Merchant_Order"
227
  msgstr ""
228
 
229
- #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:147, includes/notification/WC_WooMercadoPago_Notification_IPN.php:122, includes/notification/WC_WooMercadoPago_Notification_Webhook.php:157, includes/notification/WC_WooMercadoPago_Notification_Webhook.php:139
230
  msgid "Buyer email"
231
  msgstr ""
232
 
233
- #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:150, includes/notification/WC_WooMercadoPago_Notification_IPN.php:125, includes/notification/WC_WooMercadoPago_Notification_Webhook.php:160, includes/notification/WC_WooMercadoPago_Notification_Webhook.php:142
234
  msgid "Payment method"
235
  msgstr ""
236
 
@@ -250,131 +266,123 @@ msgstr ""
250
  msgid "Pay with the payment method you prefer"
251
  msgstr ""
252
 
253
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:245
254
  msgid "Mercado Pago checkout %s"
255
  msgstr ""
256
 
257
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:248
258
  msgid "Accept all method of payment and take your charges to another level"
259
  msgstr ""
260
 
261
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:252
262
  msgid "Turn your online store into your customers preferred payment gateway. Choose if the final payment experience will be inside or outside your store."
263
  msgstr ""
264
 
265
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:269, includes/payments/WC_WooMercadoPago_TicketGateway.php:219
266
  msgid "Configure Mercado Pago for WooCommerce"
267
  msgstr ""
268
 
269
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:282
270
  msgid "Enable the experience of the Mercado Pago Checkout in your online store, select the means of payment available to your customers and<br> define the maximum fees in which they can pay you."
271
  msgstr ""
272
 
273
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:295
274
  msgid "Set payment preferences in your store"
275
  msgstr ""
276
 
277
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:308
278
  msgid "Advanced settings"
279
  msgstr ""
280
 
281
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:321
282
  msgid "Payment experience"
283
  msgstr ""
284
 
285
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:323
286
  msgid "Define what payment experience your customers will have, whether inside or outside your store."
287
  msgstr ""
288
 
289
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:326
290
  msgid "Redirect"
291
  msgstr ""
292
 
293
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:327
294
  msgid "Modal"
295
  msgstr ""
296
 
297
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:343
298
  msgid "Choose the URL that we will show your customers when they finish their purchase."
299
  msgstr ""
300
 
301
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:341, includes/payments/WC_WooMercadoPago_BasicGateway.php:361, includes/payments/WC_WooMercadoPago_BasicGateway.php:382
302
  msgid "This seems to be an invalid URL."
303
  msgstr ""
304
 
305
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:346
306
  msgid "Success URL"
307
  msgstr ""
308
 
309
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:363
310
  msgid "Choose the URL that we will show to your customers when we refuse their purchase. Make sure it includes a message appropriate to the situation and give them useful information so they can solve it."
311
  msgstr ""
312
 
313
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:366
314
  msgid "Payment URL rejected"
315
  msgstr ""
316
 
317
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:384
318
  msgid "Choose the URL that we will show to your customers when they have a payment pending approval."
319
  msgstr ""
320
 
321
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:387
322
  msgid "Payment URL pending"
323
  msgstr ""
324
 
325
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:467
326
  msgid "Select offline payments"
327
  msgstr ""
328
 
329
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:456
330
  msgid "Select debit cards"
331
  msgstr ""
332
 
333
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:445
334
  msgid "Select credit cards"
335
  msgstr ""
336
 
337
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:474, includes/payments/WC_WooMercadoPago_TicketGateway.php:326
338
  msgid "Payment methods"
339
  msgstr ""
340
 
341
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:475, includes/payments/WC_WooMercadoPago_TicketGateway.php:327
342
  msgid "Choose the available payment methods in your store."
343
  msgstr ""
344
 
345
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:478, includes/payments/WC_WooMercadoPago_TicketGateway.php:330
346
  msgid "Activate the available payment methods to your clients."
347
  msgstr ""
348
 
349
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:498
350
  msgid "Return to the store"
351
  msgstr ""
352
 
353
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:501
354
  msgid "Do you want your customer to automatically return to the store after payment?"
355
  msgstr ""
356
 
357
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:503, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:570, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:654, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:940, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1047, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1080, includes/payments/WC_WooMercadoPago_TicketGateway.php:277
358
- msgid "Yes"
359
- msgstr ""
360
-
361
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:504, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:569, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:653, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:939, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1046, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1081, includes/payments/WC_WooMercadoPago_TicketGateway.php:276
362
- msgid "No"
363
- msgstr ""
364
-
365
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:530
366
  msgid "installments"
367
  msgstr ""
368
 
369
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:534
370
  msgid "installment"
371
  msgstr ""
372
 
373
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:601, includes/payments/WC_WooMercadoPago_BasicGateway.php:601, includes/payments/WC_WooMercadoPago_BasicGateway.php:588, includes/payments/WC_WooMercadoPago_BasicGateway.php:588, includes/payments/WC_WooMercadoPago_CustomGateway.php:345, includes/payments/WC_WooMercadoPago_CustomGateway.php:345, includes/payments/WC_WooMercadoPago_CustomGateway.php:333, includes/payments/WC_WooMercadoPago_CustomGateway.php:333, includes/payments/WC_WooMercadoPago_TicketGateway.php:444, includes/payments/WC_WooMercadoPago_TicketGateway.php:444, includes/payments/WC_WooMercadoPago_TicketGateway.php:431, includes/payments/WC_WooMercadoPago_TicketGateway.php:431, includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:134, includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:132
374
  msgid "discount of"
375
  msgstr ""
376
 
377
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:606, includes/payments/WC_WooMercadoPago_BasicGateway.php:606, includes/payments/WC_WooMercadoPago_BasicGateway.php:593, includes/payments/WC_WooMercadoPago_BasicGateway.php:593, includes/payments/WC_WooMercadoPago_CustomGateway.php:350, includes/payments/WC_WooMercadoPago_CustomGateway.php:350, includes/payments/WC_WooMercadoPago_CustomGateway.php:338, includes/payments/WC_WooMercadoPago_CustomGateway.php:338, includes/payments/WC_WooMercadoPago_TicketGateway.php:449, includes/payments/WC_WooMercadoPago_TicketGateway.php:449, includes/payments/WC_WooMercadoPago_TicketGateway.php:436, includes/payments/WC_WooMercadoPago_TicketGateway.php:436, includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:136
378
  msgid "fee of"
379
  msgstr ""
380
 
@@ -478,367 +486,367 @@ msgstr ""
478
  msgid "This payment method cannot process your payment."
479
  msgstr ""
480
 
481
- #: includes/payments/WC_WooMercadoPago_CustomGateway.php:444
482
  msgid "A problem was occurred when processing your payment. Please, try again."
483
  msgstr ""
484
 
485
- #: includes/payments/WC_WooMercadoPago_CustomGateway.php:435
486
  msgid "A problem was occurred when processing your payment. Are you sure you have correctly filled all information in the checkout form?"
487
  msgstr ""
488
 
489
- #: includes/payments/WC_WooMercadoPago_CustomGateway.php:396
490
  msgid "See your order form"
491
  msgstr ""
492
 
493
- #: includes/payments/WC_WooMercadoPago_CustomGateway.php:408
494
  msgid "Your payment was declined. You can try again."
495
  msgstr ""
496
 
497
- #: includes/payments/WC_WooMercadoPago_CustomGateway.php:413, includes/payments/hooks/WC_WooMercadoPago_Hook_Basic.php:83
498
  msgid "Click to try again"
499
  msgstr ""
500
 
501
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:281
502
  msgid "%s, it only takes a few minutes"
503
  msgstr ""
504
 
505
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:281
506
  msgid "Approve your account"
507
  msgstr ""
508
 
509
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:358
510
  msgid "Title"
511
  msgstr ""
512
 
513
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:373
514
  msgid "Description"
515
  msgstr ""
516
 
517
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:408
518
  msgid "<b>Follow these steps to activate Mercado Pago in your store:</b>"
519
  msgstr ""
520
 
521
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:413
522
  msgid "<b>Upload your credentials</b> depending on the country in which you are registered."
523
  msgstr ""
524
 
525
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:420
526
  msgid "<b>Approve your account</b> to be able to charge."
527
  msgstr ""
528
 
529
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:427
530
  msgid "<b>Add the basic information of your business</b> in the plugin configuration."
531
  msgstr ""
532
 
533
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:434
534
  msgid "<b>Configure the payment preferences</b> for your customers."
535
  msgstr ""
536
 
537
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:441
538
  msgid "<b>Go to advanced settings</b> only when you want to change the presets."
539
  msgstr ""
540
 
541
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:460
542
  msgid "Credentials are the keys we provide you to integrate quickly <br>and securely. You must have a %s in Mercado Pago to obtain and collect them <br>on your website. You do not need to know how to design or program to do it"
543
  msgstr ""
544
 
545
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:461
546
  msgid "approved account"
547
  msgstr ""
548
 
549
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:478
550
  msgid "In which country does your Mercado Pago account operate?"
551
  msgstr ""
552
 
553
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:507
554
  msgid "Select your country"
555
  msgstr ""
556
 
557
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:509
558
  msgid "Select the country in which you operate with Mercado Pago"
559
  msgstr ""
560
 
561
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:542, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:546
562
  msgid "Save Changes"
563
  msgstr ""
564
 
565
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:564
566
  msgid "Activate checkout"
567
  msgstr ""
568
 
569
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:567
570
  msgid "Activate the Mercado Pago experience at the checkout of your store."
571
  msgstr ""
572
 
573
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:582
574
  msgid "Enter your credentials and choose how to operate"
575
  msgstr ""
576
 
577
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:595
578
  msgid "Test Mode"
579
  msgstr ""
580
 
581
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:608
582
  msgid "By default, we activate the Sandbox test environment for you to test before you start selling."
583
  msgstr ""
584
 
585
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:621
586
  msgid "Production Mode"
587
  msgstr ""
588
 
589
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:634
590
  msgid "When you see that everything is going well, deactivate Sandbox, turn on Production and make way for your online sales."
591
  msgstr ""
592
 
593
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:648
594
  msgid "Production"
595
  msgstr ""
596
 
597
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:650
598
  msgid "Choose “Yes” only when you’re ready to sell. Switch to “No” to activate Testing mode."
599
  msgstr ""
600
 
601
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:672
602
  msgid "Load credentials"
603
  msgstr ""
604
 
605
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:676
606
  msgid "Search my credentials"
607
  msgstr ""
608
 
609
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:695
610
  msgid "Test credentials"
611
  msgstr ""
612
 
613
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:707
614
  msgid "With these keys you can do the tests you want.."
615
  msgstr ""
616
 
617
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:720, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:777
618
  msgid "Public key"
619
  msgstr ""
620
 
621
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:736, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:794
622
  msgid "Access token"
623
  msgstr ""
624
 
625
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:752
626
  msgid "Production credentials"
627
  msgstr ""
628
 
629
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:764
630
  msgid "With these keys you can receive real payments from your customers."
631
  msgstr ""
632
 
633
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:811
634
  msgid "Approve your account, it will only take a few minutes"
635
  msgstr ""
636
 
637
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:824
638
  msgid "Complete this process to secure your customers data and comply with the regulations<br> and legal provisions of each country."
639
  msgstr ""
640
 
641
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:838, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1182
642
  msgid "%s"
643
  msgstr ""
644
 
645
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:839
646
  msgid "Homologate account in Mercado Pago"
647
  msgstr ""
648
 
649
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:853
650
  msgid "Store name"
651
  msgstr ""
652
 
653
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:855
654
  msgid "This name will appear on your customers invoice."
655
  msgstr ""
656
 
657
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:856
658
  msgid "Mercado Pago"
659
  msgstr ""
660
 
661
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:872
662
  msgid "Store Category"
663
  msgstr ""
664
 
665
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:874
666
  msgid "What category do your products belong to? Choose the one that best characterizes them (choose \"other\" if your product is too specific)."
667
  msgstr ""
668
 
669
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:875
670
  msgid "Categories"
671
  msgstr ""
672
 
673
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:887
674
  msgid "Store ID"
675
  msgstr ""
676
 
677
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:889
678
  msgid "Use a number or prefix to identify orders and payments from this store."
679
  msgstr ""
680
 
681
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:902
682
  msgid "Integrator ID"
683
  msgstr ""
684
 
685
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:905
686
  msgid "Do not forget to enter your integrator_id as a certified Mercado Pago Partner. If you don`t have it, you can %s"
687
  msgstr ""
688
 
689
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:906
690
  msgid "request it now."
691
  msgstr ""
692
 
693
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:920
694
  msgid "Advanced adjustment"
695
  msgstr ""
696
 
697
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:933
698
  msgid "Debug and Log mode"
699
  msgstr ""
700
 
701
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:936
702
  msgid "Record your store actions in our changes file to have more support information."
703
  msgstr ""
704
 
705
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:937
706
  msgid "We debug the information in our change file."
707
  msgstr ""
708
 
709
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:952
710
  msgid "Basic Configuration"
711
  msgstr ""
712
 
713
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:965
714
  msgid "Max of installments"
715
  msgstr ""
716
 
717
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:967
718
  msgid "What is the maximum quota with which a customer can buy?"
719
  msgstr ""
720
 
721
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:970
722
  msgid "1x installment"
723
  msgstr ""
724
 
725
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:971
726
  msgid "2x installments"
727
  msgstr ""
728
 
729
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:972
730
  msgid "3x installments"
731
  msgstr ""
732
 
733
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:973
734
  msgid "4x installments"
735
  msgstr ""
736
 
737
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:974
738
  msgid "5x installments"
739
  msgstr ""
740
 
741
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:975
742
  msgid "6x installments"
743
  msgstr ""
744
 
745
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:976
746
  msgid "10x installments"
747
  msgstr ""
748
 
749
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:977
750
  msgid "12x installments"
751
  msgstr ""
752
 
753
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:978
754
  msgid "15x installments"
755
  msgstr ""
756
 
757
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:979
758
  msgid "18x installments"
759
  msgstr ""
760
 
761
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:980
762
  msgid "24x installments"
763
  msgstr ""
764
 
765
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1009
766
  msgid "URL for IPN"
767
  msgstr ""
768
 
769
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1012
770
  msgid "Enter a URL to receive payment notifications. In %s you can check more information."
771
  msgstr ""
772
 
773
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1013
774
  msgid "our guides"
775
  msgstr ""
776
 
777
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1028
778
  msgid "Edit these advanced fields only when you want to modify the preset values."
779
  msgstr ""
780
 
781
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1041
782
  msgid "Discount coupons"
783
  msgstr ""
784
 
785
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1044
786
  msgid "Will you offer discount coupons to customers who buy with Mercado Pago?"
787
  msgstr ""
788
 
789
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1059
790
  msgid "It appears that your credentials are not properly configured.<br/>Please, go to %s and configure it."
791
  msgstr ""
792
 
793
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1060
794
  msgid "Market Payment Configuration"
795
  msgstr ""
796
 
797
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1074
798
  msgid "Binary mode"
799
  msgstr ""
800
 
801
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1077
802
  msgid "Accept and reject payments automatically. Do you want us to activate it?"
803
  msgstr ""
804
 
805
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1093
806
  msgid "Discounts per purchase with Mercado Pago"
807
  msgstr ""
808
 
809
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1095
810
  msgid "Choose a percentage value that you want to discount your customers for paying with Mercado Pago."
811
  msgstr ""
812
 
813
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1112
814
  msgid "Commission for purchase with Mercado Pago"
815
  msgstr ""
816
 
817
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1114
818
  msgid "Choose an additional percentage value that you want to charge as commission to your customers for paying with Mercado Pago."
819
  msgstr ""
820
 
821
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1139
822
  msgid "Everything set up? Go to your store in Sandbox mode"
823
  msgstr ""
824
 
825
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1137
826
  msgid "Everything ready for the takeoff of your sales?"
827
  msgstr ""
828
 
829
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1158
830
  msgid "Visit your store and simulate a payment to check that everything is fine."
831
  msgstr ""
832
 
833
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1156
834
  msgid "Visit your store as if you were one of your customers and check that everything is fine. If you already went to Production,<br> bring your customers and increase your sales with the best online shopping experience."
835
  msgstr ""
836
 
837
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1177
838
  msgid "I want to test my sales"
839
  msgstr ""
840
 
841
- #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1175
842
  msgid "Visit my store"
843
  msgstr ""
844
 
@@ -894,27 +902,27 @@ msgstr ""
894
  msgid "All payment methods"
895
  msgstr ""
896
 
897
- #: includes/payments/WC_WooMercadoPago_TicketGateway.php:466, includes/payments/WC_WooMercadoPago_TicketGateway.php:484
898
  msgid "There was a problem processing your payment. Are you sure you have correctly filled out all the information on the payment form?"
899
  msgstr ""
900
 
901
- #: includes/payments/WC_WooMercadoPago_TicketGateway.php:553
902
  msgid "A problem occurred when processing your payment. Please try again."
903
  msgstr ""
904
 
905
- #: includes/payments/WC_WooMercadoPago_TicketGateway.php:539
906
  msgid "A problem occurred when processing your payment. Are you sure you have correctly filled in all the information on the checkout form?"
907
  msgstr ""
908
 
909
- #: includes/payments/WC_WooMercadoPago_TicketGateway.php:516
910
  msgid "The customer has not paid yet."
911
  msgstr ""
912
 
913
- #: includes/payments/WC_WooMercadoPago_TicketGateway.php:521
914
  msgid "To print the ticket again click"
915
  msgstr ""
916
 
917
- #: includes/payments/WC_WooMercadoPago_TicketGateway.php:524
918
  msgid "here"
919
  msgstr ""
920
 
@@ -1133,19 +1141,19 @@ msgstr ""
1133
  msgid "Select the issuer with whom you want to process the payment"
1134
  msgstr ""
1135
 
1136
- #: includes/admin/notices/WC_WooMercadoPago_Notices.php:78, includes/admin/notices/WC_WooMercadoPago_Notices.php:133
1137
  msgid "Discard"
1138
  msgstr ""
1139
 
1140
- #: includes/admin/notices/WC_WooMercadoPago_Notices.php:109
1141
  msgid "See WooCommerce"
1142
  msgstr ""
1143
 
1144
- #: includes/admin/notices/WC_WooMercadoPago_Notices.php:107
1145
  msgid "Install WooCommerce"
1146
  msgstr ""
1147
 
1148
- #: includes/admin/notices/WC_WooMercadoPago_Notices.php:104
1149
  msgid "Activate WooCommerce"
1150
  msgstr ""
1151
 
@@ -1161,23 +1169,23 @@ msgstr ""
1161
  msgid "Discount for coupon %s"
1162
  msgstr ""
1163
 
1164
- #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:132
1165
  msgid " and fee of"
1166
  msgstr ""
1167
 
1168
- #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:365
1169
  msgid "<b>Public Key</b> production credential is invalid. Review the field to receive real payments."
1170
  msgstr ""
1171
 
1172
- #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:375
1173
  msgid "<b>Public Key</b> test credential is invalid. Review the field to perform tests in your store."
1174
  msgstr ""
1175
 
1176
- #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:385
1177
  msgid "<b>Access Token</b> production credential is invalid. Remember that it must be complete to receive real payments."
1178
  msgstr ""
1179
 
1180
- #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:395
1181
  msgid "<b>Access Token</b> test credential is invalid. Review the field to perform tests in your store."
1182
  msgstr ""
1183
 
18
  msgid "Activate this option so that the value of the currency set in WooCommerce is compatible with the value of the currency you use in Mercado Pago."
19
  msgstr ""
20
 
21
+ #: includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php:327
22
  msgid "Convert Currency"
23
  msgstr ""
24
 
25
+ #: includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php:332, includes/payments/WC_WooMercadoPago_BasicGateway.php:500, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:573, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:657, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:943, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1050, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1085, includes/payments/WC_WooMercadoPago_TicketGateway.php:276
26
+ msgid "No"
27
+ msgstr ""
28
+
29
+ #: includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php:333, includes/payments/WC_WooMercadoPago_BasicGateway.php:499, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:574, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:658, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:944, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1051, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1084, includes/payments/WC_WooMercadoPago_TicketGateway.php:277
30
+ msgid "Yes"
31
+ msgstr ""
32
+
33
+ #: includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php:395
34
  msgid "Now we convert your currency from %s to %s."
35
  msgstr ""
36
 
37
+ #: includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php:410
38
  msgid "We no longer convert your currency from %s to %s."
39
  msgstr ""
40
 
41
+ #: includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php:427
42
  msgid "<b>Attention:</b> The currency settings you have in WooCommerce are not compatible with the currency you use in your Mercado Pago account. Please activate the currency conversion."
43
  msgstr ""
44
 
45
+ #: includes/module/WC_WooMercadoPago_Configs.php:101
46
+ msgid "Update your credentials with the Access Token and Public Key, you need them to continue receiving payments!"
47
+ msgstr ""
48
+
49
+ #: includes/module/WC_WooMercadoPago_Configs.php:111
50
  msgid "The store should have HTTPS in order to activate both Checkout Personalizado and Ticket Checkout."
51
  msgstr ""
52
 
66
  msgid "Cancel order"
67
  msgstr ""
68
 
69
+ #: includes/module/WC_WooMercadoPago_Module.php:241, includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:364
70
  msgid "Fill in your credentials to enable payment methods."
71
  msgstr ""
72
 
73
+ #: includes/module/WC_WooMercadoPago_Module.php:250
74
  msgid "Set up"
75
  msgstr ""
76
 
77
+ #: includes/module/WC_WooMercadoPago_Module.php:251
78
  msgid "Your opinion helps us get better"
79
  msgstr ""
80
 
81
+ #: includes/module/WC_WooMercadoPago_Module.php:252
82
  msgid "Guides and Documentation"
83
  msgstr ""
84
 
85
+ #: includes/module/WC_WooMercadoPago_Module.php:253
86
  msgid "Report Problem"
87
  msgstr ""
88
 
89
+ #: includes/module/WC_WooMercadoPago_Module.php:324
90
  msgid "By Mercado Pago"
91
  msgstr ""
92
 
93
+ #: includes/module/WC_WooMercadoPago_Module.php:349, includes/module/WC_WooMercadoPago_Module.php:370
94
  msgid "The <strong> Sponsor ID </strong> must be valid!"
95
  msgstr ""
96
 
97
+ #: includes/module/WC_WooMercadoPago_Module.php:366
98
  msgid "The <strong>Sponsor ID</strong> must be from the same country as the seller!"
99
  msgstr ""
100
 
101
+ #: includes/module/WC_WooMercadoPago_Module.php:397
102
  msgid "The payment method is not valid or not available."
103
  msgstr ""
104
 
105
+ #: includes/module/WC_WooMercadoPago_Module.php:400
106
  msgid "The transaction amount cannot be processed by Mercado Pago."
107
  msgstr ""
108
 
109
+ #: includes/module/WC_WooMercadoPago_Module.php:401
110
  msgid "Possible causes: Currency not supported; Amounts below the minimum or above the maximum allowed."
111
  msgstr ""
112
 
113
+ #: includes/module/WC_WooMercadoPago_Module.php:404
114
  msgid "The users are not valid."
115
  msgstr ""
116
 
117
+ #: includes/module/WC_WooMercadoPago_Module.php:405
118
  msgid "Possible causes: Buyer and seller have the same account in Mercado Pago; The transaction involving production and test users."
119
  msgstr ""
120
 
121
+ #: includes/module/WC_WooMercadoPago_Module.php:408
122
  msgid "Unauthorized use of production credentials."
123
  msgstr ""
124
 
125
+ #: includes/module/WC_WooMercadoPago_Module.php:409
126
  msgid "Possible causes: Use permission in use for the credential of the seller."
127
  msgstr ""
128
 
129
+ #: includes/module/WC_WooMercadoPago_Module.php:527
130
  msgid "ERROR: It was not possible to convert the unsupported currency"
131
  msgstr ""
132
 
133
+ #: includes/module/WC_WooMercadoPago_Module.php:529
134
  msgid "a"
135
  msgstr ""
136
 
137
+ #: includes/module/WC_WooMercadoPago_Module.php:530, includes/module/WC_WooMercadoPago_Module.php:541
138
  msgid "Currency conversions should be done outside of this module."
139
  msgstr ""
140
 
141
+ #: includes/module/WC_WooMercadoPago_Module.php:537
142
  msgid "ATTENTION: The currency"
143
  msgstr ""
144
 
145
+ #: includes/module/WC_WooMercadoPago_Module.php:539
146
  msgid "defined in WooCommerce is different from that used by the credentials of your country.<br>The currency for transactions made with this payment method will be"
147
  msgstr ""
148
 
149
+ #: includes/module/WC_WooMercadoPago_Module.php:548
150
  msgid "CONVERTED CURRENCY: Your store is converting currency of"
151
  msgstr ""
152
 
153
+ #: includes/module/WC_WooMercadoPago_Module.php:550, templates/checkout/custom_checkout.php:135
154
  msgid "for"
155
  msgstr ""
156
 
157
+ #: includes/module/WC_WooMercadoPago_Module.php:557, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:516
158
  msgid "Colombia"
159
  msgstr ""
160
 
161
+ #: includes/module/WC_WooMercadoPago_Module.php:559, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:513
162
  msgid "Argentina"
163
  msgstr ""
164
 
165
+ #: includes/module/WC_WooMercadoPago_Module.php:561, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:514
166
  msgid "Brazil"
167
  msgstr ""
168
 
169
+ #: includes/module/WC_WooMercadoPago_Module.php:563, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:515
170
  msgid "Chile"
171
  msgstr ""
172
 
173
+ #: includes/module/WC_WooMercadoPago_Module.php:565, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:517
174
  msgid "Mexico"
175
  msgstr ""
176
 
177
+ #: includes/module/WC_WooMercadoPago_Module.php:567, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:519
178
  msgid "Uruguay"
179
  msgstr ""
180
 
181
+ #: includes/module/WC_WooMercadoPago_Module.php:569
182
  msgid "Venezuela"
183
  msgstr ""
184
 
185
+ #: includes/module/WC_WooMercadoPago_Module.php:571, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:518
186
  msgid "Peru"
187
  msgstr ""
188
 
189
+ #: includes/module/WC_WooMercadoPago_Module.php:606
190
  msgid "Update the WooCommerce order to "
191
  msgstr ""
192
 
194
  msgid "Payment approved."
195
  msgstr ""
196
 
197
+ #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:195, includes/notification/WC_WooMercadoPago_Notification_Abstract.php:198
198
  msgid "Waiting for the ticket payment."
199
  msgstr ""
200
 
201
+ #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:205
202
  msgid "The customer has not made the payment yet."
203
  msgstr ""
204
 
205
+ #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:224
206
  msgid "Payment is pending review."
207
  msgstr ""
208
 
209
+ #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:241
210
  msgid "Payment was declined. The customer can try again."
211
  msgstr ""
212
 
213
+ #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:257
214
  msgid "Payment was returned to the customer."
215
  msgstr ""
216
 
217
+ #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:270
218
  msgid "Payment was canceled."
219
  msgstr ""
220
 
221
+ #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:286, includes/notification/WC_WooMercadoPago_Notification_Abstract.php:298
222
  msgid "The payment is in mediation or the purchase was unknown by the customer."
223
  msgstr ""
224
 
225
+ #: includes/notification/WC_WooMercadoPago_Notification_Abstract.php:388
226
+ msgid "Mercado Pago: The payment %s was notified by Mercado Pago with status %s."
227
+ msgstr ""
228
+
229
  #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:35
230
  msgid "No ID or TOPIC param in Request IPN"
231
  msgstr ""
242
  msgid "Not found Payments into Merchant_Order"
243
  msgstr ""
244
 
245
+ #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:148, includes/notification/WC_WooMercadoPago_Notification_IPN.php:122, includes/notification/WC_WooMercadoPago_Notification_Webhook.php:156, includes/notification/WC_WooMercadoPago_Notification_Webhook.php:138
246
  msgid "Buyer email"
247
  msgstr ""
248
 
249
+ #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:151, includes/notification/WC_WooMercadoPago_Notification_IPN.php:125, includes/notification/WC_WooMercadoPago_Notification_Webhook.php:159, includes/notification/WC_WooMercadoPago_Notification_Webhook.php:141
250
  msgid "Payment method"
251
  msgstr ""
252
 
266
  msgid "Pay with the payment method you prefer"
267
  msgstr ""
268
 
269
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:241
270
  msgid "Mercado Pago checkout %s"
271
  msgstr ""
272
 
273
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:244
274
  msgid "Accept all method of payment and take your charges to another level"
275
  msgstr ""
276
 
277
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:248
278
  msgid "Turn your online store into your customers preferred payment gateway. Choose if the final payment experience will be inside or outside your store."
279
  msgstr ""
280
 
281
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:265, includes/payments/WC_WooMercadoPago_TicketGateway.php:219
282
  msgid "Configure Mercado Pago for WooCommerce"
283
  msgstr ""
284
 
285
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:278
286
  msgid "Enable the experience of the Mercado Pago Checkout in your online store, select the means of payment available to your customers and<br> define the maximum fees in which they can pay you."
287
  msgstr ""
288
 
289
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:291
290
  msgid "Set payment preferences in your store"
291
  msgstr ""
292
 
293
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:304
294
  msgid "Advanced settings"
295
  msgstr ""
296
 
297
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:317
298
  msgid "Payment experience"
299
  msgstr ""
300
 
301
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:319
302
  msgid "Define what payment experience your customers will have, whether inside or outside your store."
303
  msgstr ""
304
 
305
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:322
306
  msgid "Redirect"
307
  msgstr ""
308
 
309
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:323
310
  msgid "Modal"
311
  msgstr ""
312
 
313
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:339
314
  msgid "Choose the URL that we will show your customers when they finish their purchase."
315
  msgstr ""
316
 
317
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:337, includes/payments/WC_WooMercadoPago_BasicGateway.php:357, includes/payments/WC_WooMercadoPago_BasicGateway.php:378
318
  msgid "This seems to be an invalid URL."
319
  msgstr ""
320
 
321
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:342
322
  msgid "Success URL"
323
  msgstr ""
324
 
325
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:359
326
  msgid "Choose the URL that we will show to your customers when we refuse their purchase. Make sure it includes a message appropriate to the situation and give them useful information so they can solve it."
327
  msgstr ""
328
 
329
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:362
330
  msgid "Payment URL rejected"
331
  msgstr ""
332
 
333
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:380
334
  msgid "Choose the URL that we will show to your customers when they have a payment pending approval."
335
  msgstr ""
336
 
337
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:383
338
  msgid "Payment URL pending"
339
  msgstr ""
340
 
341
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:463
342
  msgid "Select offline payments"
343
  msgstr ""
344
 
345
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:452
346
  msgid "Select debit cards"
347
  msgstr ""
348
 
349
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:441
350
  msgid "Select credit cards"
351
  msgstr ""
352
 
353
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:470, includes/payments/WC_WooMercadoPago_TicketGateway.php:326
354
  msgid "Payment methods"
355
  msgstr ""
356
 
357
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:471, includes/payments/WC_WooMercadoPago_TicketGateway.php:327
358
  msgid "Choose the available payment methods in your store."
359
  msgstr ""
360
 
361
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:474, includes/payments/WC_WooMercadoPago_TicketGateway.php:330
362
  msgid "Activate the available payment methods to your clients."
363
  msgstr ""
364
 
365
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:494
366
  msgid "Return to the store"
367
  msgstr ""
368
 
369
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:497
370
  msgid "Do you want your customer to automatically return to the store after payment?"
371
  msgstr ""
372
 
373
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:526
 
 
 
 
 
 
 
 
374
  msgid "installments"
375
  msgstr ""
376
 
377
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:530
378
  msgid "installment"
379
  msgstr ""
380
 
381
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:598, includes/payments/WC_WooMercadoPago_BasicGateway.php:598, includes/payments/WC_WooMercadoPago_BasicGateway.php:585, includes/payments/WC_WooMercadoPago_BasicGateway.php:585, includes/payments/WC_WooMercadoPago_CustomGateway.php:347, includes/payments/WC_WooMercadoPago_CustomGateway.php:347, includes/payments/WC_WooMercadoPago_CustomGateway.php:335, includes/payments/WC_WooMercadoPago_CustomGateway.php:335, includes/payments/WC_WooMercadoPago_TicketGateway.php:446, includes/payments/WC_WooMercadoPago_TicketGateway.php:446, includes/payments/WC_WooMercadoPago_TicketGateway.php:433, includes/payments/WC_WooMercadoPago_TicketGateway.php:433, includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:100, includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:98
382
  msgid "discount of"
383
  msgstr ""
384
 
385
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:603, includes/payments/WC_WooMercadoPago_BasicGateway.php:603, includes/payments/WC_WooMercadoPago_BasicGateway.php:590, includes/payments/WC_WooMercadoPago_BasicGateway.php:590, includes/payments/WC_WooMercadoPago_CustomGateway.php:352, includes/payments/WC_WooMercadoPago_CustomGateway.php:352, includes/payments/WC_WooMercadoPago_CustomGateway.php:340, includes/payments/WC_WooMercadoPago_CustomGateway.php:340, includes/payments/WC_WooMercadoPago_TicketGateway.php:451, includes/payments/WC_WooMercadoPago_TicketGateway.php:451, includes/payments/WC_WooMercadoPago_TicketGateway.php:438, includes/payments/WC_WooMercadoPago_TicketGateway.php:438, includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:102
386
  msgid "fee of"
387
  msgstr ""
388
 
486
  msgid "This payment method cannot process your payment."
487
  msgstr ""
488
 
489
+ #: includes/payments/WC_WooMercadoPago_CustomGateway.php:446
490
  msgid "A problem was occurred when processing your payment. Please, try again."
491
  msgstr ""
492
 
493
+ #: includes/payments/WC_WooMercadoPago_CustomGateway.php:437
494
  msgid "A problem was occurred when processing your payment. Are you sure you have correctly filled all information in the checkout form?"
495
  msgstr ""
496
 
497
+ #: includes/payments/WC_WooMercadoPago_CustomGateway.php:398
498
  msgid "See your order form"
499
  msgstr ""
500
 
501
+ #: includes/payments/WC_WooMercadoPago_CustomGateway.php:410
502
  msgid "Your payment was declined. You can try again."
503
  msgstr ""
504
 
505
+ #: includes/payments/WC_WooMercadoPago_CustomGateway.php:415, includes/payments/hooks/WC_WooMercadoPago_Hook_Basic.php:83
506
  msgid "Click to try again"
507
  msgstr ""
508
 
509
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:282
510
  msgid "%s, it only takes a few minutes"
511
  msgstr ""
512
 
513
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:282
514
  msgid "Approve your account"
515
  msgstr ""
516
 
517
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:359
518
  msgid "Title"
519
  msgstr ""
520
 
521
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:374
522
  msgid "Description"
523
  msgstr ""
524
 
525
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:409
526
  msgid "<b>Follow these steps to activate Mercado Pago in your store:</b>"
527
  msgstr ""
528
 
529
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:414
530
  msgid "<b>Upload your credentials</b> depending on the country in which you are registered."
531
  msgstr ""
532
 
533
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:421
534
  msgid "<b>Approve your account</b> to be able to charge."
535
  msgstr ""
536
 
537
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:428
538
  msgid "<b>Add the basic information of your business</b> in the plugin configuration."
539
  msgstr ""
540
 
541
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:435
542
  msgid "<b>Configure the payment preferences</b> for your customers."
543
  msgstr ""
544
 
545
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
546
  msgid "<b>Go to advanced settings</b> only when you want to change the presets."
547
  msgstr ""
548
 
549
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:461
550
  msgid "Credentials are the keys we provide you to integrate quickly <br>and securely. You must have a %s in Mercado Pago to obtain and collect them <br>on your website. You do not need to know how to design or program to do it"
551
  msgstr ""
552
 
553
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:462
554
  msgid "approved account"
555
  msgstr ""
556
 
557
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:479
558
  msgid "In which country does your Mercado Pago account operate?"
559
  msgstr ""
560
 
561
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:508
562
  msgid "Select your country"
563
  msgstr ""
564
 
565
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:510
566
  msgid "Select the country in which you operate with Mercado Pago"
567
  msgstr ""
568
 
569
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:546, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:550
570
  msgid "Save Changes"
571
  msgstr ""
572
 
573
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:568
574
  msgid "Activate checkout"
575
  msgstr ""
576
 
577
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:571
578
  msgid "Activate the Mercado Pago experience at the checkout of your store."
579
  msgstr ""
580
 
581
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:586
582
  msgid "Enter your credentials and choose how to operate"
583
  msgstr ""
584
 
585
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:599
586
  msgid "Test Mode"
587
  msgstr ""
588
 
589
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:612
590
  msgid "By default, we activate the Sandbox test environment for you to test before you start selling."
591
  msgstr ""
592
 
593
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:625
594
  msgid "Production Mode"
595
  msgstr ""
596
 
597
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:638
598
  msgid "When you see that everything is going well, deactivate Sandbox, turn on Production and make way for your online sales."
599
  msgstr ""
600
 
601
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:652
602
  msgid "Production"
603
  msgstr ""
604
 
605
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:654
606
  msgid "Choose “Yes” only when you’re ready to sell. Switch to “No” to activate Testing mode."
607
  msgstr ""
608
 
609
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:676
610
  msgid "Load credentials"
611
  msgstr ""
612
 
613
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:680
614
  msgid "Search my credentials"
615
  msgstr ""
616
 
617
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:699
618
  msgid "Test credentials"
619
  msgstr ""
620
 
621
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:711
622
  msgid "With these keys you can do the tests you want.."
623
  msgstr ""
624
 
625
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:724, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:781
626
  msgid "Public key"
627
  msgstr ""
628
 
629
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:740, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:798
630
  msgid "Access token"
631
  msgstr ""
632
 
633
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:756
634
  msgid "Production credentials"
635
  msgstr ""
636
 
637
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:768
638
  msgid "With these keys you can receive real payments from your customers."
639
  msgstr ""
640
 
641
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:815
642
  msgid "Approve your account, it will only take a few minutes"
643
  msgstr ""
644
 
645
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:828
646
  msgid "Complete this process to secure your customers data and comply with the regulations<br> and legal provisions of each country."
647
  msgstr ""
648
 
649
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:842, includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1186
650
  msgid "%s"
651
  msgstr ""
652
 
653
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:843
654
  msgid "Homologate account in Mercado Pago"
655
  msgstr ""
656
 
657
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:857
658
  msgid "Store name"
659
  msgstr ""
660
 
661
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:859
662
  msgid "This name will appear on your customers invoice."
663
  msgstr ""
664
 
665
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:860
666
  msgid "Mercado Pago"
667
  msgstr ""
668
 
669
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:876
670
  msgid "Store Category"
671
  msgstr ""
672
 
673
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:878
674
  msgid "What category do your products belong to? Choose the one that best characterizes them (choose \"other\" if your product is too specific)."
675
  msgstr ""
676
 
677
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:879
678
  msgid "Categories"
679
  msgstr ""
680
 
681
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:891
682
  msgid "Store ID"
683
  msgstr ""
684
 
685
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:893
686
  msgid "Use a number or prefix to identify orders and payments from this store."
687
  msgstr ""
688
 
689
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:906
690
  msgid "Integrator ID"
691
  msgstr ""
692
 
693
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:909
694
  msgid "Do not forget to enter your integrator_id as a certified Mercado Pago Partner. If you don`t have it, you can %s"
695
  msgstr ""
696
 
697
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:910
698
  msgid "request it now."
699
  msgstr ""
700
 
701
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:924
702
  msgid "Advanced adjustment"
703
  msgstr ""
704
 
705
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:937
706
  msgid "Debug and Log mode"
707
  msgstr ""
708
 
709
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:940
710
  msgid "Record your store actions in our changes file to have more support information."
711
  msgstr ""
712
 
713
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:941
714
  msgid "We debug the information in our change file."
715
  msgstr ""
716
 
717
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:956
718
  msgid "Basic Configuration"
719
  msgstr ""
720
 
721
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:969
722
  msgid "Max of installments"
723
  msgstr ""
724
 
725
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:971
726
  msgid "What is the maximum quota with which a customer can buy?"
727
  msgstr ""
728
 
729
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:974
730
  msgid "1x installment"
731
  msgstr ""
732
 
733
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:975
734
  msgid "2x installments"
735
  msgstr ""
736
 
737
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:976
738
  msgid "3x installments"
739
  msgstr ""
740
 
741
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:977
742
  msgid "4x installments"
743
  msgstr ""
744
 
745
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:978
746
  msgid "5x installments"
747
  msgstr ""
748
 
749
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:979
750
  msgid "6x installments"
751
  msgstr ""
752
 
753
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:980
754
  msgid "10x installments"
755
  msgstr ""
756
 
757
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:981
758
  msgid "12x installments"
759
  msgstr ""
760
 
761
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:982
762
  msgid "15x installments"
763
  msgstr ""
764
 
765
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:983
766
  msgid "18x installments"
767
  msgstr ""
768
 
769
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:984
770
  msgid "24x installments"
771
  msgstr ""
772
 
773
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1013
774
  msgid "URL for IPN"
775
  msgstr ""
776
 
777
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1016
778
  msgid "Enter a URL to receive payment notifications. In %s you can check more information."
779
  msgstr ""
780
 
781
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1017
782
  msgid "our guides"
783
  msgstr ""
784
 
785
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1032
786
  msgid "Edit these advanced fields only when you want to modify the preset values."
787
  msgstr ""
788
 
789
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1045
790
  msgid "Discount coupons"
791
  msgstr ""
792
 
793
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1048
794
  msgid "Will you offer discount coupons to customers who buy with Mercado Pago?"
795
  msgstr ""
796
 
797
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1063
798
  msgid "It appears that your credentials are not properly configured.<br/>Please, go to %s and configure it."
799
  msgstr ""
800
 
801
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1064
802
  msgid "Market Payment Configuration"
803
  msgstr ""
804
 
805
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1078
806
  msgid "Binary mode"
807
  msgstr ""
808
 
809
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1081
810
  msgid "Accept and reject payments automatically. Do you want us to activate it?"
811
  msgstr ""
812
 
813
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1097
814
  msgid "Discounts per purchase with Mercado Pago"
815
  msgstr ""
816
 
817
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1099
818
  msgid "Choose a percentage value that you want to discount your customers for paying with Mercado Pago."
819
  msgstr ""
820
 
821
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1116
822
  msgid "Commission for purchase with Mercado Pago"
823
  msgstr ""
824
 
825
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1118
826
  msgid "Choose an additional percentage value that you want to charge as commission to your customers for paying with Mercado Pago."
827
  msgstr ""
828
 
829
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1143
830
  msgid "Everything set up? Go to your store in Sandbox mode"
831
  msgstr ""
832
 
833
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1141
834
  msgid "Everything ready for the takeoff of your sales?"
835
  msgstr ""
836
 
837
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1162
838
  msgid "Visit your store and simulate a payment to check that everything is fine."
839
  msgstr ""
840
 
841
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1160
842
  msgid "Visit your store as if you were one of your customers and check that everything is fine. If you already went to Production,<br> bring your customers and increase your sales with the best online shopping experience."
843
  msgstr ""
844
 
845
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1181
846
  msgid "I want to test my sales"
847
  msgstr ""
848
 
849
+ #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1179
850
  msgid "Visit my store"
851
  msgstr ""
852
 
902
  msgid "All payment methods"
903
  msgstr ""
904
 
905
+ #: includes/payments/WC_WooMercadoPago_TicketGateway.php:468, includes/payments/WC_WooMercadoPago_TicketGateway.php:486
906
  msgid "There was a problem processing your payment. Are you sure you have correctly filled out all the information on the payment form?"
907
  msgstr ""
908
 
909
+ #: includes/payments/WC_WooMercadoPago_TicketGateway.php:555
910
  msgid "A problem occurred when processing your payment. Please try again."
911
  msgstr ""
912
 
913
+ #: includes/payments/WC_WooMercadoPago_TicketGateway.php:541
914
  msgid "A problem occurred when processing your payment. Are you sure you have correctly filled in all the information on the checkout form?"
915
  msgstr ""
916
 
917
+ #: includes/payments/WC_WooMercadoPago_TicketGateway.php:518
918
  msgid "The customer has not paid yet."
919
  msgstr ""
920
 
921
+ #: includes/payments/WC_WooMercadoPago_TicketGateway.php:523
922
  msgid "To print the ticket again click"
923
  msgstr ""
924
 
925
+ #: includes/payments/WC_WooMercadoPago_TicketGateway.php:526
926
  msgid "here"
927
  msgstr ""
928
 
1141
  msgid "Select the issuer with whom you want to process the payment"
1142
  msgstr ""
1143
 
1144
+ #: includes/admin/notices/WC_WooMercadoPago_Notices.php:80, includes/admin/notices/WC_WooMercadoPago_Notices.php:135
1145
  msgid "Discard"
1146
  msgstr ""
1147
 
1148
+ #: includes/admin/notices/WC_WooMercadoPago_Notices.php:111
1149
  msgid "See WooCommerce"
1150
  msgstr ""
1151
 
1152
+ #: includes/admin/notices/WC_WooMercadoPago_Notices.php:109
1153
  msgid "Install WooCommerce"
1154
  msgstr ""
1155
 
1156
+ #: includes/admin/notices/WC_WooMercadoPago_Notices.php:106
1157
  msgid "Activate WooCommerce"
1158
  msgstr ""
1159
 
1169
  msgid "Discount for coupon %s"
1170
  msgstr ""
1171
 
1172
+ #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:98
1173
  msgid " and fee of"
1174
  msgstr ""
1175
 
1176
+ #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:324
1177
  msgid "<b>Public Key</b> production credential is invalid. Review the field to receive real payments."
1178
  msgstr ""
1179
 
1180
+ #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:334
1181
  msgid "<b>Public Key</b> test credential is invalid. Review the field to perform tests in your store."
1182
  msgstr ""
1183
 
1184
+ #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:344
1185
  msgid "<b>Access Token</b> production credential is invalid. Remember that it must be complete to receive real payments."
1186
  msgstr ""
1187
 
1188
+ #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:354
1189
  msgid "<b>Access Token</b> test credential is invalid. Review the field to perform tests in your store."
1190
  msgstr ""
1191
 
includes/admin/notices/WC_WooMercadoPago_Notices.php CHANGED
@@ -42,9 +42,11 @@ class WC_WooMercadoPago_Notices
42
  public function loadAdminNoticeCss()
43
  {
44
  if (is_admin()) {
 
 
45
  wp_enqueue_style(
46
  'woocommerce-mercadopago-admin-notice',
47
- plugins_url('../../assets/css/admin_notice_mercadopago.css', plugin_dir_path(__FILE__))
48
  );
49
  }
50
  }
@@ -66,7 +68,7 @@ class WC_WooMercadoPago_Notices
66
  }
67
 
68
  $notice = '<div id="message" class="notice ' . $type . ' is-dismissible ' . $inline . '">
69
- <div class="mp-alert-frame">
70
  <div class="mp-left-alert">
71
  <img src="' . plugins_url('../../assets/images/minilogo.png', plugin_dir_path(__FILE__)) . '">
72
  </div>
@@ -120,7 +122,7 @@ class WC_WooMercadoPago_Notices
120
  }
121
 
122
  $notice = '<div id="message" class="notice ' . $type . ' is-dismissible ' . $inline . '">
123
- <div class="mp-alert-frame">
124
  <div class="mp-left-alert">
125
  <img src="' . plugins_url('../../assets/images/minilogo.png', plugin_dir_path(__FILE__)) . '">
126
  </div>
42
  public function loadAdminNoticeCss()
43
  {
44
  if (is_admin()) {
45
+ $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
46
+
47
  wp_enqueue_style(
48
  'woocommerce-mercadopago-admin-notice',
49
+ plugins_url('../../assets/css/admin_notice_mercadopago' . $suffix . '.css', plugin_dir_path(__FILE__))
50
  );
51
  }
52
  }
68
  }
69
 
70
  $notice = '<div id="message" class="notice ' . $type . ' is-dismissible ' . $inline . '">
71
+ <div class="mp-alert-frame">
72
  <div class="mp-left-alert">
73
  <img src="' . plugins_url('../../assets/images/minilogo.png', plugin_dir_path(__FILE__)) . '">
74
  </div>
122
  }
123
 
124
  $notice = '<div id="message" class="notice ' . $type . ' is-dismissible ' . $inline . '">
125
+ <div class="mp-alert-frame">
126
  <div class="mp-left-alert">
127
  <img src="' . plugins_url('../../assets/images/minilogo.png', plugin_dir_path(__FILE__)) . '">
128
  </div>
includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
  }
6
 
7
  /**
@@ -88,10 +88,10 @@ class WC_WooMercadoPago_Helpers_CurrencyConverter
88
  return $this;
89
  }
90
 
91
- $this->setRatio($method->id, $this->loadRatio($localCurrency, $accountCurrency));
92
  } catch (Exception $e) {
93
- $this->setRatio($method->id);
94
- throw $e;
95
  }
96
  }
97
 
@@ -184,9 +184,10 @@ class WC_WooMercadoPago_Helpers_CurrencyConverter
184
  /**
185
  * @param $fromCurrency
186
  * @param $toCurrency
 
187
  * @return int
188
  */
189
- public function loadRatio($fromCurrency, $toCurrency)
190
  {
191
  $cacheKey = $fromCurrency . '--' . $toCurrency;
192
 
@@ -203,7 +204,12 @@ class WC_WooMercadoPago_Helpers_CurrencyConverter
203
 
204
  try {
205
  $result = MeliRestClient::get(
206
- array('uri' => sprintf('/currency_conversions/search?from=%s&to=%s', $fromCurrency, $toCurrency))
 
 
 
 
 
207
  );
208
 
209
  if ($result['status'] != 200) {
@@ -236,7 +242,7 @@ class WC_WooMercadoPago_Helpers_CurrencyConverter
236
  {
237
  try {
238
  $mp = new MP($accessToken);
239
- $result = $mp->get(sprintf('/users/me?access_token=%s', $accessToken));
240
  return isset($result['response'], $result['response']['site_id']) ? $result['response']['site_id'] : null;
241
  } catch (Exception $e) {
242
  return null;
@@ -265,11 +271,12 @@ class WC_WooMercadoPago_Helpers_CurrencyConverter
265
  /**
266
  * Check if currency is supported in mercado pago API
267
  * @param $currency
 
268
  * @return bool
269
  */
270
- private function isCurrencySupported($currency)
271
  {
272
- foreach ($this->getSupportedCurrencies() as $country) {
273
  if ($country['id'] == $currency) {
274
  return true;
275
  }
@@ -280,13 +287,22 @@ class WC_WooMercadoPago_Helpers_CurrencyConverter
280
 
281
  /**
282
  * Get supported currencies from mercado pago API
 
283
  * @return array|bool
284
  */
285
- public function getSupportedCurrencies()
286
  {
287
  if (is_null($this->supportedCurrencies)) {
288
  try {
289
- $result = MeliRestClient::get(['uri' => '/currencies']);
 
 
 
 
 
 
 
 
290
 
291
  if (!isset($result['response'])) {
292
  return false;
@@ -313,8 +329,8 @@ class WC_WooMercadoPago_Helpers_CurrencyConverter
313
  'default' => 'no',
314
  'description' => $this->msg_description,
315
  'options' => array(
316
- 'no' => $this->__('No'),
317
- 'yes' => $this->__('Yes'),
318
  ),
319
  );
320
  }
@@ -346,7 +362,9 @@ class WC_WooMercadoPago_Helpers_CurrencyConverter
346
  $show = isset($_SESSION[self::CONFIG_KEY]) ? $_SESSION[self::CONFIG_KEY] : array();
347
  $localCurrency = get_woocommerce_currency();
348
 
349
- if ($localCurrency == $this->getAccountCurrency($method)) {
 
 
350
  return;
351
  }
352
 
@@ -373,11 +391,10 @@ class WC_WooMercadoPago_Helpers_CurrencyConverter
373
  $localCurrency = get_woocommerce_currency();
374
  $currency = $this->getAccountCurrency($method);
375
 
376
- return '
377
- <div class="notice notice-success">
378
- <p>' . sprintf( __('Now we convert your currency from %s to %s.', 'woocommerce-mercadopago'), $localCurrency, $currency ) . '</p>
379
- </div>
380
- ';
381
  }
382
 
383
  /**
@@ -389,11 +406,10 @@ class WC_WooMercadoPago_Helpers_CurrencyConverter
389
  $localCurrency = get_woocommerce_currency();
390
  $currency = $this->getAccountCurrency($method);
391
 
392
- return '
393
- <div class="notice notice-error">
394
- <p>' . sprintf( __('We no longer convert your currency from %s to %s.', 'woocommerce-mercadopago'), $localCurrency, $currency) . '</p>
395
- </div>
396
- ';
397
  }
398
 
399
  /**
1
  <?php
2
 
3
+ if (!defined('ABSPATH')) {
4
+ exit;
5
  }
6
 
7
  /**
88
  return $this;
89
  }
90
 
91
+ $this->setRatio($method->id, $this->loadRatio($localCurrency, $accountCurrency, $method));
92
  } catch (Exception $e) {
93
+ $this->setRatio($method->id);
94
+ throw $e;
95
  }
96
  }
97
 
184
  /**
185
  * @param $fromCurrency
186
  * @param $toCurrency
187
+ * @param WC_WooMercadoPago_PaymentAbstract $method
188
  * @return int
189
  */
190
+ public function loadRatio($fromCurrency, $toCurrency, WC_WooMercadoPago_PaymentAbstract $method = null)
191
  {
192
  $cacheKey = $fromCurrency . '--' . $toCurrency;
193
 
204
 
205
  try {
206
  $result = MeliRestClient::get(
207
+ array(
208
+ 'uri' => sprintf('/currency_conversions/search?from=%s&to=%s', $fromCurrency, $toCurrency),
209
+ 'headers' => array(
210
+ 'Authorization' => 'Bearer ' . $this->getAccessToken($method)
211
+ )
212
+ )
213
  );
214
 
215
  if ($result['status'] != 200) {
242
  {
243
  try {
244
  $mp = new MP($accessToken);
245
+ $result = $mp->get('/users/me', array('Authorization' => 'Bearer ' . $accessToken));
246
  return isset($result['response'], $result['response']['site_id']) ? $result['response']['site_id'] : null;
247
  } catch (Exception $e) {
248
  return null;
271
  /**
272
  * Check if currency is supported in mercado pago API
273
  * @param $currency
274
+ * @param WC_WooMercadoPago_PaymentAbstract $method
275
  * @return bool
276
  */
277
+ private function isCurrencySupported($currency, WC_WooMercadoPago_PaymentAbstract $method)
278
  {
279
+ foreach ($this->getSupportedCurrencies($method) as $country) {
280
  if ($country['id'] == $currency) {
281
  return true;
282
  }
287
 
288
  /**
289
  * Get supported currencies from mercado pago API
290
+ * @param WC_WooMercadoPago_PaymentAbstract $method
291
  * @return array|bool
292
  */
293
+ public function getSupportedCurrencies(WC_WooMercadoPago_PaymentAbstract $method)
294
  {
295
  if (is_null($this->supportedCurrencies)) {
296
  try {
297
+
298
+ $request = array(
299
+ 'uri' => '/currencies',
300
+ 'headers' => array(
301
+ 'Authorization' => 'Bearer ' . $this->getAccessToken($method)
302
+ )
303
+ );
304
+
305
+ $result = MeliRestClient::get($request);
306
 
307
  if (!isset($result['response'])) {
308
  return false;
329
  'default' => 'no',
330
  'description' => $this->msg_description,
331
  'options' => array(
332
+ 'no' => __('No', 'woocommerce-mercadopago'),
333
+ 'yes' => __('Yes', 'woocommerce-mercadopago'),
334
  ),
335
  );
336
  }
362
  $show = isset($_SESSION[self::CONFIG_KEY]) ? $_SESSION[self::CONFIG_KEY] : array();
363
  $localCurrency = get_woocommerce_currency();
364
 
365
+ $accountCurrency = $this->getAccountCurrency($method);
366
+
367
+ if ($localCurrency == $accountCurrency || empty($accountCurrency) ) {
368
  return;
369
  }
370
 
391
  $localCurrency = get_woocommerce_currency();
392
  $currency = $this->getAccountCurrency($method);
393
 
394
+ $type = 'notice-error';
395
+ $message = sprintf(__('Now we convert your currency from %s to %s.', 'woocommerce-mercadopago'), $localCurrency, $currency);
396
+
397
+ return WC_WooMercadoPago_Notices::getAlertFrame($message, $type);
 
398
  }
399
 
400
  /**
406
  $localCurrency = get_woocommerce_currency();
407
  $currency = $this->getAccountCurrency($method);
408
 
409
+ $type = 'notice-error';
410
+ $message = sprintf(__('We no longer convert your currency from %s to %s.', 'woocommerce-mercadopago'), $localCurrency, $currency);
411
+
412
+ return WC_WooMercadoPago_Notices::getAlertFrame($message, $type);
 
413
  }
414
 
415
  /**
includes/module/WC_WooMercadoPago_Configs.php CHANGED
@@ -45,8 +45,7 @@ class WC_WooMercadoPago_Configs
45
  $this->updateToken();
46
  }
47
  }
48
-
49
- if (empty(get_option('_site_id_v1'))) {
50
  WC_WooMercadoPago_Credentials::validate_credentials_v1();
51
  }
52
 
@@ -99,7 +98,7 @@ class WC_WooMercadoPago_Configs
99
  public function noticeUpdateAccessToken()
100
  {
101
  $type = 'error';
102
- $message = __('Update your credentials with the Access Token and Public Key, you need them to continue receiving payments!', 'woocommerce-mercadopado');
103
  echo WC_WooMercadoPago_Notices::getAlertFrame($message, $type);
104
  }
105
 
@@ -118,20 +117,30 @@ class WC_WooMercadoPago_Configs
118
  */
119
  private function updateToken()
120
  {
121
- if (strpos(get_option('_mp_public_key'), 'TEST') === 0 && strpos(get_option('_mp_access_token'), 'TEST') === 0) {
122
- update_option('_mp_public_key_test', get_option('_mp_public_key'), true);
123
- update_option('_mp_access_token_test', get_option('_mp_access_token'), true);
124
- update_option('checkout_credential_prod', 'no', true);
125
- }
 
 
 
 
 
 
126
 
127
- if (strpos(get_option('_mp_public_key'), 'APP_USR') === 0 && strpos(get_option('_mp_access_token'), 'APP_USR') === 0) {
128
- update_option('_mp_public_key_prod', get_option('_mp_public_key'), true);
129
- update_option('_mp_access_token_prod', get_option('_mp_access_token'), true);
130
- if(!empty(get_option('_mp_public_key_prod', '')) && !empty(get_option('_mp_access_token_prod', ''))) {
131
- update_option('_mp_public_key', '');
132
- update_option('_mp_access_token', '');
 
 
 
 
 
133
  }
134
- update_option('checkout_credential_prod', 'yes', true);
135
  }
136
  }
137
 
@@ -243,18 +252,20 @@ class WC_WooMercadoPago_Configs
243
  */
244
  public function setPaymentGateway($methods = null)
245
  {
 
 
 
 
246
  global $wp;
247
  if (!empty($wp) && isset($wp->query_vars['wc-api'])) {
248
- $api_request = strtolower(wc_clean($wp->query_vars['wc-api']));
249
- if (!empty($api_request)) {
250
  $methods[] = $api_request;
251
  return $methods;
252
  }
253
  }
254
 
255
- $methods[] = 'WC_WooMercadoPago_BasicGateway';
256
- $methods[] = 'WC_WooMercadoPago_CustomGateway';
257
- $methods[] = 'WC_WooMercadoPago_TicketGateway';
258
  return $methods;
259
  }
260
  }
45
  $this->updateToken();
46
  }
47
  }
48
+ if (empty(get_option('_site_id_v1')) || empty(get_option('_collector_id_v1'))) {
 
49
  WC_WooMercadoPago_Credentials::validate_credentials_v1();
50
  }
51
 
98
  public function noticeUpdateAccessToken()
99
  {
100
  $type = 'error';
101
+ $message = __('Update your credentials with the Access Token and Public Key, you need them to continue receiving payments!', 'woocommerce-mercadopago');
102
  echo WC_WooMercadoPago_Notices::getAlertFrame($message, $type);
103
  }
104
 
117
  */
118
  private function updateToken()
119
  {
120
+ $mpInstance = WC_WooMercadoPago_Module::getMpInstanceSingleton();
121
+
122
+ if ($mpInstance) {
123
+ if (
124
+ WC_WooMercadoPago_Credentials::validateCredentialsTest($mpInstance, null, get_option('_mp_public_key')) == true
125
+ && WC_WooMercadoPago_Credentials::validateCredentialsTest($mpInstance, get_option('_mp_access_token')) == true
126
+ ) {
127
+ update_option('_mp_public_key_test', get_option('_mp_public_key'), true);
128
+ update_option('_mp_access_token_test', get_option('_mp_access_token'), true);
129
+ update_option('checkout_credential_prod', 'no', true);
130
+ }
131
 
132
+ if (
133
+ WC_WooMercadoPago_Credentials::validateCredentialsProd($mpInstance, null, get_option('_mp_public_key')) == true
134
+ && WC_WooMercadoPago_Credentials::validateCredentialsProd($mpInstance, get_option('_mp_access_token')) == true
135
+ ) {
136
+ update_option('_mp_public_key_prod', get_option('_mp_public_key'), true);
137
+ update_option('_mp_access_token_prod', get_option('_mp_access_token'), true);
138
+ if (!empty(get_option('_mp_public_key_prod', '')) && !empty(get_option('_mp_access_token_prod', ''))) {
139
+ update_option('_mp_public_key', '');
140
+ update_option('_mp_access_token', '');
141
+ }
142
+ update_option('checkout_credential_prod', 'yes', true);
143
  }
 
144
  }
145
  }
146
 
252
  */
253
  public function setPaymentGateway($methods = null)
254
  {
255
+ $mp_methods = array('WC_WooMercadoPago_BasicGateway',
256
+ 'WC_WooMercadoPago_CustomGateway',
257
+ 'WC_WooMercadoPago_TicketGateway');
258
+
259
  global $wp;
260
  if (!empty($wp) && isset($wp->query_vars['wc-api'])) {
261
+ $api_request = wc_clean($wp->query_vars['wc-api']);
262
+ if (!empty($api_request) && in_array($api_request, $mp_methods)) {
263
  $methods[] = $api_request;
264
  return $methods;
265
  }
266
  }
267
 
268
+ $methods = array_merge($mp_methods, $methods == null ? [] : $methods);
 
 
269
  return $methods;
270
  }
271
  }
includes/module/WC_WooMercadoPago_Credentials.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
  }
6
 
7
  /**
@@ -85,13 +85,6 @@ class WC_WooMercadoPago_Credentials
85
  return false;
86
  }
87
 
88
- if (strpos($this->publicKey, 'APP_USR') === false && strpos($this->publicKey, 'TEST') === false) {
89
- return false;
90
- }
91
- if (strpos($this->accessToken, 'APP_USR') === false && strpos($this->accessToken, 'TEST') === false) {
92
- return false;
93
- }
94
-
95
  return true;
96
  }
97
 
@@ -119,7 +112,7 @@ class WC_WooMercadoPago_Credentials
119
  if (empty($mp_v1)) {
120
  return false;
121
  }
122
- $get_request = $mp_v1->get('/users/me?access_token=' . $access_token);
123
  if ($get_request['status'] > 202) {
124
  $log = WC_WooMercadoPago_Log::init_mercado_pago_log('WC_WooMercadoPago_Credentials');
125
  $log->write_log('API valid_access_token error:', $get_request['response']['message']);
@@ -131,33 +124,8 @@ class WC_WooMercadoPago_Credentials
131
  update_option('_test_user_v1', in_array('test_user', $get_request['response']['tags']), true);
132
  }
133
 
134
- return true;
135
- }
136
-
137
- /**
138
- * @param $public_key
139
- * @return bool
140
- * @throws WC_WooMercadoPago_Exception
141
- */
142
- public static function public_key_is_valid($public_key)
143
- {
144
- $mp_v1 = WC_WooMercadoPago_Module::getMpInstanceSingleton();
145
- if (empty($mp_v1)) {
146
- return false;
147
- }
148
- $request = array(
149
- 'uri' => '/v1/card_tokens',
150
- 'data' => null,
151
- 'params' => array(
152
- 'public_key' => $public_key
153
- ),
154
- 'authenticate' => false
155
- );
156
- $get_request = $mp_v1->post($request);
157
- if ($get_request['status'] > 202) {
158
- $log = WC_WooMercadoPago_Log::init_mercado_pago_log('WC_WooMercadoPago_Credentials');
159
- $log->write_log('API public_key_is_valid error: ', $get_request['response']['message']);
160
- return false;
161
  }
162
 
163
  return true;
@@ -185,7 +153,8 @@ class WC_WooMercadoPago_Credentials
185
  return false;
186
  }
187
  $access_token = $mp_v1->get_access_token();
188
- $get_request = $mp_v1->get('/users/me?access_token=' . $access_token);
 
189
  if (isset($get_request['response']['site_id']) && (!empty($credentials->publicKey) || $basicIsEnabled == 'yes')) {
190
 
191
  update_option('_test_user_v1', in_array('test_user', $get_request['response']['tags']), true);
@@ -223,8 +192,8 @@ class WC_WooMercadoPago_Credentials
223
  */
224
  public static function getPaymentResponse($mpInstance, $accessToken)
225
  {
226
- $seller = explode('-', $accessToken);
227
- $payments = $mpInstance->get('/users/' . end($seller) . '/accepted_payment_methods?marketplace=NONE');
228
  if (isset($payments['response'])) {
229
  return $payments['response'];
230
  }
@@ -248,7 +217,7 @@ class WC_WooMercadoPago_Credentials
248
  }
249
 
250
  if (empty($paymentsResponse) || (isset($paymentsResponse['status']) && $paymentsResponse['status'] != 200 &&
251
- $paymentsResponse['status'] != 201)) {
252
  return;
253
  }
254
 
@@ -292,7 +261,7 @@ class WC_WooMercadoPago_Credentials
292
  }
293
 
294
  if (empty($paymentsResponse) || (isset($paymentsResponse['status']) && $paymentsResponse['status'] != 200 &&
295
- $paymentsResponse['status'] != 201)) {
296
  return;
297
  }
298
 
@@ -300,7 +269,8 @@ class WC_WooMercadoPago_Credentials
300
  $excluded = array('consumer_credits', 'paypal', 'pse');
301
 
302
  foreach ($paymentsResponse as $payment) {
303
- if (!in_array($payment['id'], $excluded) &&
 
304
  $payment['payment_type_id'] != 'account_money' &&
305
  $payment['payment_type_id'] != 'credit_card' &&
306
  $payment['payment_type_id'] != 'debit_card' &&
@@ -330,4 +300,28 @@ class WC_WooMercadoPago_Credentials
330
 
331
  return $basicIsEnabled;
332
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
333
  }
1
  <?php
2
 
3
+ if (!defined('ABSPATH')) {
4
+ exit;
5
  }
6
 
7
  /**
85
  return false;
86
  }
87
 
 
 
 
 
 
 
 
88
  return true;
89
  }
90
 
112
  if (empty($mp_v1)) {
113
  return false;
114
  }
115
+ $get_request = $mp_v1->get('/users/me', array('Authorization' => 'Bearer ' . $access_token), false);
116
  if ($get_request['status'] > 202) {
117
  $log = WC_WooMercadoPago_Log::init_mercado_pago_log('WC_WooMercadoPago_Credentials');
118
  $log->write_log('API valid_access_token error:', $get_request['response']['message']);
124
  update_option('_test_user_v1', in_array('test_user', $get_request['response']['tags']), true);
125
  }
126
 
127
+ if (isset($get_request['response']['id'])) {
128
+ update_option('_collector_id_v1', $get_request['response']['id'], true);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  }
130
 
131
  return true;
153
  return false;
154
  }
155
  $access_token = $mp_v1->get_access_token();
156
+ $get_request = $mp_v1->get('/users/me', array('Authorization' => 'Bearer ' . $access_token));
157
+
158
  if (isset($get_request['response']['site_id']) && (!empty($credentials->publicKey) || $basicIsEnabled == 'yes')) {
159
 
160
  update_option('_test_user_v1', in_array('test_user', $get_request['response']['tags']), true);
192
  */
193
  public static function getPaymentResponse($mpInstance, $accessToken)
194
  {
195
+ $seller = get_option('_collector_id_v1', '');
196
+ $payments = $mpInstance->get('/users/' . $seller . '/accepted_payment_methods?marketplace=NONE', array('Authorization' => 'Bearer ' . $accessToken));
197
  if (isset($payments['response'])) {
198
  return $payments['response'];
199
  }
217
  }
218
 
219
  if (empty($paymentsResponse) || (isset($paymentsResponse['status']) && $paymentsResponse['status'] != 200 &&
220
+ $paymentsResponse['status'] != 201)) {
221
  return;
222
  }
223
 
261
  }
262
 
263
  if (empty($paymentsResponse) || (isset($paymentsResponse['status']) && $paymentsResponse['status'] != 200 &&
264
+ $paymentsResponse['status'] != 201)) {
265
  return;
266
  }
267
 
269
  $excluded = array('consumer_credits', 'paypal', 'pse');
270
 
271
  foreach ($paymentsResponse as $payment) {
272
+ if (
273
+ !in_array($payment['id'], $excluded) &&
274
  $payment['payment_type_id'] != 'account_money' &&
275
  $payment['payment_type_id'] != 'credit_card' &&
276
  $payment['payment_type_id'] != 'debit_card' &&
300
 
301
  return $basicIsEnabled;
302
  }
303
+
304
+ /**
305
+ * @throws WC_WooMercadoPago_Exception
306
+ */
307
+ public static function validateCredentialsTest($mpInstance, $access_token = null, $public_key = null)
308
+ {
309
+ $isTeste = $mpInstance->getCredentialsWrapper($access_token, $public_key);
310
+ if (is_array($isTeste) && isset($isTeste['is_test']) && $isTeste['is_test'] == true) {
311
+ return true;
312
+ }
313
+ return false;
314
+ }
315
+
316
+ /**
317
+ * @throws WC_WooMercadoPago_Exception
318
+ */
319
+ public static function validateCredentialsProd($mpInstance, $access_token = null, $public_key = null)
320
+ {
321
+ $isTeste = $mpInstance->getCredentialsWrapper($access_token, $public_key);
322
+ if (is_array($isTeste) && isset($isTeste['is_test']) && $isTeste['is_test'] == false) {
323
+ return true;
324
+ }
325
+ return false;
326
+ }
327
  }
includes/module/WC_WooMercadoPago_Module.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
  }
6
 
7
  /**
@@ -206,9 +206,11 @@ class WC_WooMercadoPago_Module extends WC_WooMercadoPago_Configs
206
  public function loadAdminCss()
207
  {
208
  if (is_admin()) {
 
 
209
  wp_enqueue_style(
210
  'woocommerce-mercadopago-basic-config-styles',
211
- plugins_url('../assets/css/config_mercadopago.css', plugin_dir_path(__FILE__))
212
  );
213
  }
214
  }
@@ -300,7 +302,6 @@ class WC_WooMercadoPago_Module extends WC_WooMercadoPago_Configs
300
  if ($wc_country != '') {
301
 
302
  $sufix_country = strlen($wc_country) > 2 ? substr($wc_country, 0, 2) : $wc_country;
303
-
304
  }
305
 
306
  $sufix_country = strtoupper($sufix_country);
@@ -356,7 +357,7 @@ class WC_WooMercadoPago_Module extends WC_WooMercadoPago_Configs
356
 
357
  if ($varify_sponsor) {
358
  $mp_sponsor_id = WC_WooMercadoPago_Module::getMpInstanceSingleton();
359
- $get_sponor_id = $mp_sponsor_id->get('/users/' . $sponsor_id, $access_token, false);
360
  if (!is_wp_error($get_sponor_id) && ($get_sponor_id['status'] == 200 || $get_sponor_id['status'] == 201)) {
361
  if ($get_sponor_id['response']['site_id'] == $site_id) {
362
  update_option('_mp_sponsor_id', $sponsor_id, true);
@@ -576,7 +577,7 @@ class WC_WooMercadoPago_Module extends WC_WooMercadoPago_Configs
576
  public static function build_log_path_string($gateway_id, $gateway_name)
577
  {
578
  return '<a href="' . esc_url(admin_url('admin.php?page=wc-status&tab=logs&log_file=' .
579
- esc_attr($gateway_id) . '-' . sanitize_file_name(wp_hash($gateway_id)) . '.log')) . '">' .
580
  $gateway_name . '</a>';
581
  }
582
 
1
  <?php
2
 
3
+ if (!defined('ABSPATH')) {
4
+ exit;
5
  }
6
 
7
  /**
206
  public function loadAdminCss()
207
  {
208
  if (is_admin()) {
209
+ $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
210
+
211
  wp_enqueue_style(
212
  'woocommerce-mercadopago-basic-config-styles',
213
+ plugins_url('../assets/css/config_mercadopago' . $suffix . '.css', plugin_dir_path(__FILE__))
214
  );
215
  }
216
  }
302
  if ($wc_country != '') {
303
 
304
  $sufix_country = strlen($wc_country) > 2 ? substr($wc_country, 0, 2) : $wc_country;
 
305
  }
306
 
307
  $sufix_country = strtoupper($sufix_country);
357
 
358
  if ($varify_sponsor) {
359
  $mp_sponsor_id = WC_WooMercadoPago_Module::getMpInstanceSingleton();
360
+ $get_sponor_id = $mp_sponsor_id->get('/users/' . $sponsor_id, array('Authorization' => 'Bearer ' . $access_token), false);
361
  if (!is_wp_error($get_sponor_id) && ($get_sponor_id['status'] == 200 || $get_sponor_id['status'] == 201)) {
362
  if ($get_sponor_id['response']['site_id'] == $site_id) {
363
  update_option('_mp_sponsor_id', $sponsor_id, true);
577
  public static function build_log_path_string($gateway_id, $gateway_name)
578
  {
579
  return '<a href="' . esc_url(admin_url('admin.php?page=wc-status&tab=logs&log_file=' .
580
+ esc_attr($gateway_id) . '-' . sanitize_file_name(wp_hash($gateway_id)) . '.log')) . '">' .
581
  $gateway_name . '</a>';
582
  }
583
 
includes/module/config/WC_WooMercadoPago_Constants.php CHANGED
@@ -12,7 +12,7 @@ class WC_WooMercadoPago_Constants
12
  const PRODUCT_ID_DESKTOP = 'BT7OF5FEOO6G01NJK3QG';
13
  const PRODUCT_ID_MOBILE = 'BT7OFH09QS3001K5A0H0';
14
  const PLATAFORM_ID = 'bo2hnr2ic4p001kbgpt0';
15
- const VERSION = '4.4.0';
16
  const MIN_PHP = 5.6;
17
  const API_MP_BASE_URL = 'https://api.mercadopago.com';
18
  }
12
  const PRODUCT_ID_DESKTOP = 'BT7OF5FEOO6G01NJK3QG';
13
  const PRODUCT_ID_MOBILE = 'BT7OFH09QS3001K5A0H0';
14
  const PLATAFORM_ID = 'bo2hnr2ic4p001kbgpt0';
15
+ const VERSION = '4.5.0';
16
  const MIN_PHP = 5.6;
17
  const API_MP_BASE_URL = 'https://api.mercadopago.com';
18
  }
includes/module/preference/WC_WooMercadoPago_PreferenceAbstract.php CHANGED
@@ -413,7 +413,7 @@ abstract class WC_WooMercadoPago_PreferenceAbstract extends WC_Payment_Gateway
413
 
414
  $analytics = new WC_WooMercadoPago_PreferenceAnalytics();
415
 
416
- $seller = explode('-', $accessToken);
417
  $w = WC_WooMercadoPago_Module::woocommerce_instance();
418
  $internal_metadata = array(
419
  "platform" => WC_WooMercadoPago_Constants::PLATAFORM_ID,
@@ -421,7 +421,7 @@ abstract class WC_WooMercadoPago_PreferenceAbstract extends WC_Payment_Gateway
421
  "module_version" => WC_WooMercadoPago_Constants::VERSION,
422
  "site_id" => get_option('_site_id_v1'),
423
  "sponsor_id" => $this->get_sponsor_id(),
424
- "collector" => end($seller),
425
  "test_mode" => $test_mode,
426
  "details" => "",
427
  "basic_settings" => json_encode($analytics->getBasicSettings(), true),
413
 
414
  $analytics = new WC_WooMercadoPago_PreferenceAnalytics();
415
 
416
+ $seller = get_option('_collector_id_v1', '');
417
  $w = WC_WooMercadoPago_Module::woocommerce_instance();
418
  $internal_metadata = array(
419
  "platform" => WC_WooMercadoPago_Constants::PLATAFORM_ID,
421
  "module_version" => WC_WooMercadoPago_Constants::VERSION,
422
  "site_id" => get_option('_site_id_v1'),
423
  "sponsor_id" => $this->get_sponsor_id(),
424
+ "collector" => $seller,
425
  "test_mode" => $test_mode,
426
  "details" => "",
427
  "basic_settings" => json_encode($analytics->getBasicSettings(), true),
includes/module/preference/WC_WooMercadoPago_PreferenceBasic.php CHANGED
@@ -109,7 +109,6 @@ class WC_WooMercadoPago_PreferenceBasic extends WC_WooMercadoPago_PreferenceAbst
109
  }
110
  $payment_methods = array(
111
  'installments' => (int)$installments,
112
- 'default_installments' => 1,
113
  'excluded_payment_methods' => $excluded_payment_methods
114
  );
115
  return $payment_methods;
109
  }
110
  $payment_methods = array(
111
  'installments' => (int)$installments,
 
112
  'excluded_payment_methods' => $excluded_payment_methods
113
  );
114
  return $payment_methods;
includes/module/sdk/lib/MP.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
  }
6
 
7
  $GLOBALS['LIB_LOCATION'] = dirname(__FILE__);
@@ -11,749 +11,701 @@ $GLOBALS['LIB_LOCATION'] = dirname(__FILE__);
11
  */
12
  class MP
13
  {
14
- private $client_id;
15
- private $client_secret;
16
- private $ll_access_token;
17
- private $sandbox = FALSE;
18
- private $accessTokenByClient;
19
- private $paymentClass;
20
-
21
- /**
22
- * MP constructor.
23
- * @throws WC_WooMercadoPago_Exception
24
- */
25
- public function __construct()
26
- {
27
- $includes_path = dirname(__FILE__);
28
- require_once($includes_path . '/RestClient/AbstractRestClient.php');
29
- require_once($includes_path . '/RestClient/MeliRestClient.php');
30
- require_once($includes_path . '/RestClient/MpRestClient.php');
31
-
32
- $i = func_num_args();
33
- if ($i > 2 || $i < 1) {
34
- throw new WC_WooMercadoPago_Exception('Invalid arguments. Use CLIENT_ID and CLIENT SECRET, or ACCESS_TOKEN');
35
- }
36
-
37
- if ($i == 1) {
38
- $this->ll_access_token = func_get_arg(0);
39
- }
40
-
41
- if ($i == 2) {
42
- $this->client_id = func_get_arg(0);
43
- $this->client_secret = func_get_arg(1);
44
- }
45
- }
46
-
47
- /**
48
- * @param $email
49
- */
50
- public function set_email($email)
51
- {
52
- MPRestClient::set_email($email);
53
- MeliRestClient::set_email($email);
54
- }
55
-
56
- /**
57
- * @param $country_code
58
- */
59
- public function set_locale($country_code)
60
- {
61
- MPRestClient::set_locale($country_code);
62
- MeliRestClient::set_locale($country_code);
63
- }
64
-
65
- /**
66
- * @param null $enable
67
- * @return bool
68
- */
69
- public function sandbox_mode($enable = NULL)
70
- {
71
- if (!is_null($enable)) {
72
- $this->sandbox = $enable === TRUE;
73
- }
74
- return $this->sandbox;
75
- }
76
-
77
- /**
78
- * @return mixed|null
79
- * @throws WC_WooMercadoPago_Exception
80
- */
81
- public function get_access_token()
82
- {
83
-
84
- if (isset($this->ll_access_token) && !is_null($this->ll_access_token)) {
85
- return $this->ll_access_token;
86
- }
87
-
88
- if (!empty($this->accessTokenByClient)) {
89
- return $this->accessTokenByClient;
90
- }
91
-
92
- $app_client_values = array(
93
- 'client_id' => $this->client_id,
94
- 'client_secret' => $this->client_secret,
95
- 'grant_type' => 'client_credentials'
96
- );
97
-
98
- $access_data = MPRestClient::post(
99
- array(
100
- 'uri' => '/oauth/token',
101
- 'data' => $app_client_values,
102
- 'headers' => array(
103
- 'content-type' => 'application/x-www-form-urlencoded'
104
- )
105
- ),
106
- WC_WooMercadoPago_Constants::VERSION
107
- );
108
-
109
- if ($access_data['status'] != 200) {
110
- return null;
111
- }
112
-
113
- $response = $access_data['response'];
114
- $this->accessTokenByClient = $response['access_token'];
115
-
116
- return $this->accessTokenByClient;
117
- }
118
-
119
- /**
120
- * @param $id
121
- * @return array|null
122
- * @throws WC_WooMercadoPago_Exception
123
- */
124
- public function search_paymentV1($id)
125
- {
126
-
127
- $request = array(
128
- 'uri' => '/v1/payments/' . $id,
129
- 'params' => array('access_token' => $this->get_access_token())
130
- );
131
-
132
- $payment = MPRestClient::get($request, WC_WooMercadoPago_Constants::VERSION);
133
- return $payment;
134
- }
135
-
136
- //=== CUSTOMER CARDS FUNCTIONS ===
137
-
138
- /**
139
- * @param $payer_email
140
- * @return array|mixed|null
141
- * @throws WC_WooMercadoPago_Exception
142
- */
143
- public function get_or_create_customer($payer_email)
144
- {
145
-
146
- $customer = $this->search_customer($payer_email);
147
-
148
- if ($customer['status'] == 200 && $customer['response']['paging']['total'] > 0) {
149
- $customer = $customer['response']['results'][0];
150
- } else {
151
- $resp = $this->create_customer($payer_email);
152
- $customer = $resp['response'];
153
- }
154
-
155
- return $customer;
156
-
157
- }
158
-
159
- /**
160
- * @param $email
161
- * @return array|null
162
- * @throws WC_WooMercadoPago_Exception
163
- */
164
- public function create_customer($email)
165
- {
166
-
167
- $request = array(
168
- 'uri' => '/v1/customers',
169
- 'params' => array(
170
- 'access_token' => $this->get_access_token()
171
- ),
172
- 'data' => array(
173
- 'email' => $email
174
- )
175
- );
176
-
177
- $customer = MPRestClient::post($request);
178
- return $customer;
179
-
180
- }
181
-
182
- /**
183
- * @param $email
184
- * @return array|null
185
- * @throws WC_WooMercadoPago_Exception
186
- */
187
- public function search_customer($email)
188
- {
189
-
190
- $request = array(
191
- 'uri' => '/v1/customers/search',
192
- 'params' => array(
193
- 'access_token' => $this->get_access_token(),
194
- 'email' => $email
195
- )
196
- );
197
-
198
- $customer = MPRestClient::get($request);
199
- return $customer;
200
-
201
- }
202
-
203
- /**
204
- * @param $customer_id
205
- * @param $token
206
- * @param null $payment_method_id
207
- * @param null $issuer_id
208
- * @return array|null
209
- * @throws WC_WooMercadoPago_Exception
210
- */
211
- public function create_card_in_customer($customer_id, $token, $payment_method_id = null,
212
- $issuer_id = null)
213
- {
214
-
215
- $request = array(
216
- 'uri' => '/v1/customers/' . $customer_id . '/cards',
217
- 'params' => array(
218
- 'access_token' => $this->get_access_token()
219
- ),
220
- 'data' => array(
221
- 'token' => $token,
222
- 'issuer_id' => $issuer_id,
223
- 'payment_method_id' => $payment_method_id
224
- )
225
- );
226
-
227
- $card = MPRestClient::post($request);
228
- return $card;
229
-
230
- }
231
-
232
- /**
233
- * @param $customer_id
234
- * @param $token
235
- * @return array|null
236
- * @throws WC_WooMercadoPago_Exception
237
- */
238
- public function get_all_customer_cards($customer_id, $token)
239
- {
240
-
241
- $request = array(
242
- 'uri' => '/v1/customers/' . $customer_id . '/cards',
243
- 'params' => array(
244
- 'access_token' => $this->get_access_token()
245
- )
246
- );
247
-
248
- $cards = MPRestClient::get($request);
249
- return $cards;
250
-
251
- }
252
-
253
- //=== COUPOM AND DISCOUNTS FUNCTIONS ===
254
- /**
255
- * @param $transaction_amount
256
- * @param $payer_email
257
- * @param $coupon_code
258
- * @return array|null
259
- * @throws WC_WooMercadoPago_Exception
260
- */
261
- public function check_discount_campaigns($transaction_amount, $payer_email, $coupon_code)
262
- {
263
- $request = array(
264
- 'uri' => '/discount_campaigns',
265
- 'params' => array(
266
- 'access_token' => $this->get_access_token(),
267
- 'transaction_amount' => $transaction_amount,
268
- 'payer_email' => $payer_email,
269
- 'coupon_code' => $coupon_code
270
- )
271
- );
272
- $discount_info = MPRestClient::get($request);
273
- return $discount_info;
274
- }
275
-
276
- //=== CHECKOUT AUXILIARY FUNCTIONS ===
277
-
278
- /**
279
- * @param $id
280
- * @return array|null
281
- * @throws WC_WooMercadoPago_Exception
282
- */
283
- public function get_authorized_payment($id)
284
- {
285
-
286
- $request = array(
287
- 'uri' => '/authorized_payments/{$id}',
288
- 'params' => array(
289
- 'access_token' => $this->get_access_token()
290
- )
291
- );
292
-
293
- $authorized_payment_info = MPRestClient::get($request);
294
- return $authorized_payment_info;
295
-
296
- }
297
-
298
- /**
299
- * @param $preference
300
- * @return array|null
301
- * @throws WC_WooMercadoPago_Exception
302
- */
303
- public function create_preference($preference)
304
- {
305
-
306
- $request = array(
307
- 'uri' => '/checkout/preferences',
308
- 'params' => array(
309
- 'access_token' => $this->get_access_token()
310
- ),
311
- 'headers' => array(
312
- 'user-agent' => 'platform:desktop,type:woocommerce,so:' . WC_WooMercadoPago_Constants::VERSION
313
- ),
314
- 'data' => $preference
315
- );
316
-
317
- $preference_result = MPRestClient::post($request);
318
- return $preference_result;
319
-
320
- }
321
-
322
- /**
323
- * @param $id
324
- * @param $preference
325
- * @return array|null
326
- * @throws WC_WooMercadoPago_Exception
327
- */
328
- public function update_preference($id, $preference)
329
- {
330
-
331
- $request = array(
332
- 'uri' => '/checkout/preferences/{$id}',
333
- 'params' => array(
334
- 'access_token' => $this->get_access_token()
335
- ),
336
- 'data' => $preference
337
- );
338
-
339
- $preference_result = MPRestClient::put($request);
340
- return $preference_result;
341
-
342
- }
343
-
344
- /**
345
- * @param $id
346
- * @return array|null
347
- * @throws WC_WooMercadoPago_Exception
348
- */
349
- public function get_preference($id)
350
- {
351
-
352
- $request = array(
353
- 'uri' => '/checkout/preferences/{$id}',
354
- 'params' => array(
355
- 'access_token' => $this->get_access_token()
356
- )
357
- );
358
-
359
- $preference_result = MPRestClient::get($request);
360
- return $preference_result;
361
-
362
- }
363
-
364
- /**
365
- * @param $preference
366
- * @return array|null
367
- * @throws WC_WooMercadoPago_Exception
368
- */
369
- public function create_payment($preference)
370
- {
371
-
372
- $request = array(
373
- 'uri' => '/v1/payments',
374
- 'params' => array(
375
- 'access_token' => $this->get_access_token()
376
- ),
377
- 'headers' => array(
378
- 'X-Tracking-Id' => 'platform:v1-whitelabel,type:woocommerce,so:' . WC_WooMercadoPago_Constants::VERSION
379
- ),
380
- 'data' => $preference
381
- );
382
-
383
- $payment = MPRestClient::post($request, WC_WooMercadoPago_Constants::VERSION);
384
- return $payment;
385
- }
386
-
387
- /**
388
- * @param $preapproval_payment
389
- * @return array|null
390
- * @throws WC_WooMercadoPago_Exception
391
- */
392
- public function create_preapproval_payment($preapproval_payment)
393
- {
394
-
395
- $request = array(
396
- 'uri' => '/preapproval',
397
- 'params' => array(
398
- 'access_token' => $this->get_access_token()
399
- ),
400
- 'data' => $preapproval_payment
401
- );
402
-
403
- $preapproval_payment_result = MPRestClient::post($request);
404
- return $preapproval_payment_result;
405
-
406
- }
407
-
408
- /**
409
- * @param $id
410
- * @return array|null
411
- * @throws WC_WooMercadoPago_Exception
412
- */
413
- public function get_preapproval_payment($id)
414
- {
415
-
416
- $request = array(
417
- 'uri' => '/preapproval/' . $id,
418
- 'params' => array(
419
- 'access_token' => $this->get_access_token()
420
- )
421
- );
422
-
423
- $preapproval_payment_result = MPRestClient::get($request);
424
- return $preapproval_payment_result;
425
-
426
- }
427
-
428
- /**
429
- * @param $id
430
- * @param $preapproval_payment
431
- * @return array|null
432
- * @throws WC_WooMercadoPago_Exception
433
- */
434
- public function update_preapproval_payment($id, $preapproval_payment)
435
- {
436
-
437
- $request = array(
438
- 'uri' => '/preapproval/' . $id,
439
- 'params' => array(
440
- 'access_token' => $this->get_access_token()
441
- ),
442
- 'data' => $preapproval_payment
443
- );
444
-
445
- $preapproval_payment_result = MPRestClient::put($request);
446
- return $preapproval_payment_result;
447
-
448
- }
449
-
450
- /**
451
- * @param $id
452
- * @return array|null
453
- * @throws WC_WooMercadoPago_Exception
454
- */
455
- public function cancel_preapproval_payment($id)
456
- {
457
-
458
- $request = array(
459
- 'uri' => '/preapproval/' . $id,
460
- 'params' => array(
461
- 'access_token' => $this->get_access_token()
462
- ),
463
- 'data' => array(
464
- 'status' => 'cancelled'
465
- )
466
- );
467
-
468
- $response = MPRestClient::put($request);
469
- return $response;
470
-
471
- }
472
-
473
- //=== REFUND AND CANCELING FLOW FUNCTIONS ===
474
-
475
- /**
476
- * @param $id
477
- * @return array|null
478
- * @throws WC_WooMercadoPago_Exception
479
- */
480
- public function refund_payment($id)
481
- {
482
-
483
- $request = array(
484
- 'uri' => '/v1/payments/' . $id . '/refunds',
485
- 'params' => array(
486
- 'access_token' => $this->get_access_token()
487
- )
488
- );
489
-
490
- $response = MPRestClient::post($request);
491
- return $response;
492
-
493
- }
494
-
495
- /**
496
- * @param $id
497
- * @param $amount
498
- * @param $reason
499
- * @param $external_reference
500
- * @return array|null
501
- * @throws WC_WooMercadoPago_Exception
502
- */
503
- public function partial_refund_payment($id, $amount, $reason, $external_reference)
504
- {
505
-
506
- $request = array(
507
- 'uri' => '/v1/payments/' . $id . '/refunds?access_token=' . $this->get_access_token(),
508
- 'data' => array(
509
- 'amount' => $amount,
510
- 'metadata' => array(
511
- 'metadata' => $reason,
512
- 'external_reference' => $external_reference
513
- )
514
- )
515
- );
516
-
517
- $response = MPRestClient::post($request);
518
- return $response;
519
-
520
- }
521
-
522
- /**
523
- * @param $id
524
- * @return array|null
525
- * @throws WC_WooMercadoPago_Exception
526
- */
527
- public function cancel_payment($id)
528
- {
529
-
530
- $request = array(
531
- 'uri' => '/v1/payments/' . $id,
532
- 'params' => array(
533
- 'access_token' => $this->get_access_token()
534
- ),
535
- 'data' => '{"status":"cancelled"}'
536
- );
537
-
538
- $response = MPRestClient::put($request);
539
- return $response;
540
-
541
- }
542
-
543
- /**
544
- * @return array|null
545
- * @throws WC_WooMercadoPago_Exception
546
- */
547
- public function get_payment_methods()
548
- {
549
- $request = array(
550
- 'uri' => '/v1/payment_methods',
551
- 'params' => array(
552
- 'access_token' => $this->get_access_token()
553
- )
554
- );
555
-
556
- $response = MPRestClient::get($request);
557
- asort($result);
558
- return $response;
559
- }
560
-
561
- //=== GENERIC RESOURCE CALL METHODS ===
562
-
563
- /**
564
- * @param $request
565
- * @param null $params
566
- * @param bool $authenticate
567
- * @return array|null
568
- * @throws WC_WooMercadoPago_Exception
569
- */
570
- public function get($request, $params = null, $authenticate = true)
571
- {
572
-
573
- if (is_string($request)) {
574
- $request = array(
575
- 'uri' => $request,
576
- 'params' => $params,
577
- 'authenticate' => $authenticate
578
- );
579
- }
580
-
581
- $request['params'] = isset($request['params']) && is_array($request['params']) ?
582
- $request['params'] :
583
- array();
584
-
585
- if (!isset($request['authenticate']) || $request['authenticate'] !== false) {
586
- $request['params']['access_token'] = $this->get_access_token();
587
- }
588
-
589
- $result = MPRestClient::get($request);
590
- return $result;
591
-
592
- }
593
-
594
- /**
595
- * @param $request
596
- * @param null $data
597
- * @param null $params
598
- * @return array|null
599
- * @throws WC_WooMercadoPago_Exception
600
- */
601
- public function post($request, $data = null, $params = null)
602
- {
603
-
604
- if (is_string($request)) {
605
- $request = array(
606
- 'uri' => $request,
607
- 'data' => $data,
608
- 'params' => $params
609
- );
610
- }
611
-
612
- $request['params'] = isset($request['params']) && is_array($request['params']) ?
613
- $request["params"] :
614
- array();
615
-
616
- if (!isset ($request['authenticate']) || $request['authenticate'] !== false) {
617
- $request['params']['access_token'] = $this->get_access_token();
618
- }
619
-
620
- $result = MPRestClient::post($request);
621
- return $result;
622
-
623
- }
624
-
625
- /**
626
- * @param $request
627
- * @param null $data
628
- * @param null $params
629
- * @return array|null
630
- * @throws WC_WooMercadoPago_Exception
631
- */
632
- public function put($request, $data = null, $params = null)
633
- {
634
-
635
- if (is_string($request)) {
636
- $request = array(
637
- 'uri' => $request,
638
- 'data' => $data,
639
- 'params' => $params
640
- );
641
- }
642
-
643
- $request['params'] = isset($request['params']) && is_array($request['params']) ?
644
- $request['params'] :
645
- array();
646
-
647
- if (!isset ($request['authenticate']) || $request['authenticate'] !== false) {
648
- $request['params']['access_token'] = $this->get_access_token();
649
- }
650
-
651
- $result = MPRestClient::put($request);
652
- return $result;
653
-
654
- }
655
-
656
- /**
657
- * @param $request
658
- * @param null $params
659
- * @return array|null
660
- * @throws WC_WooMercadoPago_Exception
661
- */
662
- public function delete($request, $params = null)
663
- {
664
-
665
- if (is_string($request)) {
666
- $request = array(
667
- 'uri' => $request,
668
- 'params' => $params
669
- );
670
- }
671
-
672
- $request['params'] = isset($request['params']) && is_array($request['params']) ?
673
- $request['params'] :
674
- array();
675
-
676
- if (!isset($request['authenticate']) || $request['authenticate'] !== false) {
677
- $request['params']['access_token'] = $this->get_access_token();
678
- }
679
-
680
- $result = MPRestClient::delete($request);
681
- return $result;
682
-
683
- }
684
-
685
- //=== MODULE ANALYTICS FUNCTIONS ===
686
-
687
- /**
688
- * @param $module_info
689
  * @return array|null
690
  * @throws WC_WooMercadoPago_Exception
691
  */
692
- public function analytics_save_settings($module_info)
693
  {
694
- try {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
695
  $request = array(
696
- 'uri' => '/modules/tracking/settings?access_token=' . $this->get_access_token(),
697
- 'data' => $module_info,
 
698
  );
 
699
 
700
- $result = MPRestClient::post($request);
701
- } catch (Exception $e) {
702
- $result = null;
 
 
703
  }
704
 
 
705
  return $result;
706
  }
707
 
708
- /**
709
- * @param null $payment
710
- */
711
- public function setPaymentClass($payment = null)
712
- {
713
- if (!empty($payment)) {
714
- $this->paymentClass = get_class($payment);
715
- }
716
- }
717
-
718
- /**
719
- * @return mixed
720
- */
721
- public function getPaymentClass()
722
- {
723
- return $this->paymentClass;
724
- }
725
-
726
- /**
727
- * @param $accessToken
728
- * @return int
729
- * @throws WC_WooMercadoPago_Exception
730
- */
731
- public function homologValidate($accessToken)
732
- {
733
- $session = 'homolog_validate_' . $accessToken;
734
- if (isset($_SESSION[$session])) {
735
- return $_SESSION[$session];
736
- }
737
-
738
- $seller = explode('-', $accessToken);
739
- $response = MeliRestClient::get(
740
- array('uri' => '/applications/' . $seller[1]), WC_WooMercadoPago_Constants::VERSION
741
- );
742
-
743
- //in case of failures
744
- if ($response['status'] > 202) {
745
- $log = WC_WooMercadoPago_Log::init_mercado_pago_log('WC_WooMercadoPago_Module');
746
- $log->write_log('API application_search_owner_id error:', $response['response']['message']);
747
- $_SESSION[$session] = 0;
748
- return 0;
749
- }
750
- //response treatment
751
- $result = $response['response'];
752
- if (in_array('payments', $result['scopes'])) {
753
- $_SESSION[$session] = 1;
754
- return 1;
755
- }
756
- $_SESSION[$session] = 0;
757
- return 0;
758
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
759
  }
1
  <?php
2
 
3
+ if (!defined('ABSPATH')) {
4
+ exit;
5
  }
6
 
7
  $GLOBALS['LIB_LOCATION'] = dirname(__FILE__);
11
  */
12
  class MP
13
  {
14
+ private $client_id;
15
+ private $client_secret;
16
+ private $ll_access_token;
17
+ private $sandbox = FALSE;
18
+ private $accessTokenByClient;
19
+ private $paymentClass;
20
+
21
+ /**
22
+ * MP constructor.
23
+ * @throws WC_WooMercadoPago_Exception
24
+ */
25
+ public function __construct()
26
+ {
27
+ $includes_path = dirname(__FILE__);
28
+ require_once($includes_path . '/RestClient/AbstractRestClient.php');
29
+ require_once($includes_path . '/RestClient/MeliRestClient.php');
30
+ require_once($includes_path . '/RestClient/MpRestClient.php');
31
+
32
+ $i = func_num_args();
33
+ if ($i > 2 || $i < 1) {
34
+ throw new WC_WooMercadoPago_Exception('Invalid arguments. Use CLIENT_ID and CLIENT SECRET, or ACCESS_TOKEN');
35
+ }
36
+
37
+ if ($i == 1) {
38
+ $this->ll_access_token = func_get_arg(0);
39
+ }
40
+
41
+ if ($i == 2) {
42
+ $this->client_id = func_get_arg(0);
43
+ $this->client_secret = func_get_arg(1);
44
+ }
45
+ }
46
+
47
+ /**
48
+ * @param $email
49
+ */
50
+ public function set_email($email)
51
+ {
52
+ MPRestClient::set_email($email);
53
+ MeliRestClient::set_email($email);
54
+ }
55
+
56
+ /**
57
+ * @param $country_code
58
+ */
59
+ public function set_locale($country_code)
60
+ {
61
+ MPRestClient::set_locale($country_code);
62
+ MeliRestClient::set_locale($country_code);
63
+ }
64
+
65
+ /**
66
+ * @param null $enable
67
+ * @return bool
68
+ */
69
+ public function sandbox_mode($enable = NULL)
70
+ {
71
+ if (!is_null($enable)) {
72
+ $this->sandbox = $enable === TRUE;
73
+ }
74
+ return $this->sandbox;
75
+ }
76
+
77
+ /**
78
+ * @return mixed|null
79
+ * @throws WC_WooMercadoPago_Exception
80
+ */
81
+ public function get_access_token()
82
+ {
83
+
84
+ if (isset($this->ll_access_token) && !is_null($this->ll_access_token)) {
85
+ return $this->ll_access_token;
86
+ }
87
+
88
+ if (!empty($this->accessTokenByClient)) {
89
+ return $this->accessTokenByClient;
90
+ }
91
+
92
+ $app_client_values = array(
93
+ 'client_id' => $this->client_id,
94
+ 'client_secret' => $this->client_secret,
95
+ 'grant_type' => 'client_credentials'
96
+ );
97
+
98
+ $access_data = MPRestClient::post(
99
+ array(
100
+ 'uri' => '/oauth/token',
101
+ 'data' => $app_client_values,
102
+ 'headers' => array(
103
+ 'content-type' => 'application/x-www-form-urlencoded'
104
+ )
105
+ ),
106
+ WC_WooMercadoPago_Constants::VERSION
107
+ );
108
+
109
+ if ($access_data['status'] != 200) {
110
+ return null;
111
+ }
112
+
113
+ $response = $access_data['response'];
114
+ $this->accessTokenByClient = $response['access_token'];
115
+
116
+ return $this->accessTokenByClient;
117
+ }
118
+
119
+ /**
120
+ * @param $id
121
+ * @return array|null
122
+ * @throws WC_WooMercadoPago_Exception
123
+ */
124
+ public function search_paymentV1($id)
125
+ {
126
+
127
+ $request = array(
128
+ 'uri' => '/v1/payments/' . $id,
129
+ 'params' => array('access_token' => $this->get_access_token())
130
+ );
131
+
132
+ $payment = MPRestClient::get($request, WC_WooMercadoPago_Constants::VERSION);
133
+ return $payment;
134
+ }
135
+
136
+ //=== CUSTOMER CARDS FUNCTIONS ===
137
+
138
+ /**
139
+ * @param $payer_email
140
+ * @return array|mixed|null
141
+ * @throws WC_WooMercadoPago_Exception
142
+ */
143
+ public function get_or_create_customer($payer_email)
144
+ {
145
+
146
+ $customer = $this->search_customer($payer_email);
147
+
148
+ if ($customer['status'] == 200 && $customer['response']['paging']['total'] > 0) {
149
+ $customer = $customer['response']['results'][0];
150
+ } else {
151
+ $resp = $this->create_customer($payer_email);
152
+ $customer = $resp['response'];
153
+ }
154
+
155
+ return $customer;
156
+ }
157
+
158
+ /**
159
+ * @param $email
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  * @return array|null
161
  * @throws WC_WooMercadoPago_Exception
162
  */
163
+ public function create_customer($email)
164
  {
165
+
166
+ $request = array(
167
+ 'headers' => array(
168
+ 'Authorization' => 'Bearer ' . $this->get_access_token()
169
+ ),
170
+ 'uri' => '/v1/customers',
171
+ 'data' => array(
172
+ 'email' => $email
173
+ )
174
+ );
175
+
176
+ $customer = MPRestClient::post($request);
177
+ return $customer;
178
+ }
179
+
180
+ /**
181
+ * @param $email
182
+ * @return array|null
183
+ * @throws WC_WooMercadoPago_Exception
184
+ */
185
+ public function search_customer($email)
186
+ {
187
+
188
+ $request = array(
189
+ 'headers' => array(
190
+ 'Authorization' => 'Bearer ' . $this->get_access_token()
191
+ ),
192
+ 'uri' => '/v1/customers/search',
193
+ 'params' => array(
194
+ 'email' => $email
195
+ )
196
+ );
197
+
198
+ $customer = MPRestClient::get($request);
199
+ return $customer;
200
+ }
201
+
202
+ /**
203
+ * @param $customer_id
204
+ * @param $token
205
+ * @param null $payment_method_id
206
+ * @param null $issuer_id
207
+ * @return array|null
208
+ * @throws WC_WooMercadoPago_Exception
209
+ */
210
+ public function create_card_in_customer(
211
+ $customer_id,
212
+ $token,
213
+ $payment_method_id = null,
214
+ $issuer_id = null
215
+ ) {
216
+
217
+ $request = array(
218
+ 'headers' => array(
219
+ 'Authorization' => 'Bearer ' . $this->get_access_token()
220
+ ),
221
+ 'uri' => '/v1/customers/' . $customer_id . '/cards',
222
+ 'data' => array(
223
+ 'token' => $token,
224
+ 'issuer_id' => $issuer_id,
225
+ 'payment_method_id' => $payment_method_id
226
+ )
227
+ );
228
+
229
+ $card = MPRestClient::post($request);
230
+ return $card;
231
+ }
232
+
233
+ /**
234
+ * @param $customer_id
235
+ * @param $token
236
+ * @return array|null
237
+ * @throws WC_WooMercadoPago_Exception
238
+ */
239
+ public function get_all_customer_cards($customer_id, $token)
240
+ {
241
+
242
+ $request = array(
243
+ 'headers' => array(
244
+ 'Authorization' => 'Bearer ' . $this->get_access_token()
245
+ ),
246
+ 'uri' => '/v1/customers/' . $customer_id . '/cards',
247
+ );
248
+
249
+ $cards = MPRestClient::get($request);
250
+ return $cards;
251
+ }
252
+
253
+ //=== COUPOM AND DISCOUNTS FUNCTIONS ===
254
+ /**
255
+ * @param $transaction_amount
256
+ * @param $payer_email
257
+ * @param $coupon_code
258
+ * @return array|null
259
+ * @throws WC_WooMercadoPago_Exception
260
+ */
261
+ public function check_discount_campaigns($transaction_amount, $payer_email, $coupon_code)
262
+ {
263
+ $request = array(
264
+ 'headers' => array(
265
+ 'Authorization' => 'Bearer ' . $this->get_access_token()
266
+ ),
267
+ 'uri' => '/discount_campaigns',
268
+ 'params' => array(
269
+ 'transaction_amount' => $transaction_amount,
270
+ 'payer_email' => $payer_email,
271
+ 'coupon_code' => $coupon_code
272
+ )
273
+ );
274
+ $discount_info = MPRestClient::get($request);
275
+ return $discount_info;
276
+ }
277
+
278
+ //=== CHECKOUT AUXILIARY FUNCTIONS ===
279
+
280
+ /**
281
+ * @param $id
282
+ * @return array|null
283
+ * @throws WC_WooMercadoPago_Exception
284
+ */
285
+ public function get_authorized_payment($id)
286
+ {
287
+
288
+ $request = array(
289
+ 'headers' => array(
290
+ 'Authorization' => 'Bearer ' . $this->get_access_token()
291
+ ),
292
+ 'uri' => '/authorized_payments/{$id}',
293
+ );
294
+
295
+ $authorized_payment_info = MPRestClient::get($request);
296
+ return $authorized_payment_info;
297
+ }
298
+
299
+ /**
300
+ * @param $preference
301
+ * @return array|null
302
+ * @throws WC_WooMercadoPago_Exception
303
+ */
304
+ public function create_preference($preference)
305
+ {
306
+
307
+ $request = array(
308
+ 'uri' => '/checkout/preferences',
309
+ 'headers' => array(
310
+ 'user-agent' => 'platform:desktop,type:woocommerce,so:' . WC_WooMercadoPago_Constants::VERSION,
311
+ 'Authorization' => 'Bearer ' . $this->get_access_token()
312
+ ),
313
+ 'data' => $preference
314
+ );
315
+
316
+ $preference_result = MPRestClient::post($request);
317
+ return $preference_result;
318
+ }
319
+
320
+ /**
321
+ * @param $id
322
+ * @param $preference
323
+ * @return array|null
324
+ * @throws WC_WooMercadoPago_Exception
325
+ */
326
+ public function update_preference($id, $preference)
327
+ {
328
+
329
+ $request = array(
330
+ 'headers' => array(
331
+ 'Authorization' => 'Bearer ' . $this->get_access_token()
332
+ ),
333
+ 'uri' => '/checkout/preferences/{$id}',
334
+ 'data' => $preference
335
+ );
336
+
337
+ $preference_result = MPRestClient::put($request);
338
+ return $preference_result;
339
+ }
340
+
341
+ /**
342
+ * @param $id
343
+ * @return array|null
344
+ * @throws WC_WooMercadoPago_Exception
345
+ */
346
+ public function get_preference($id)
347
+ {
348
+
349
+ $request = array(
350
+ 'headers' => array(
351
+ 'Authorization' => 'Bearer ' . $this->get_access_token()
352
+ ),
353
+ 'uri' => '/checkout/preferences/{$id}',
354
+ );
355
+
356
+ $preference_result = MPRestClient::get($request);
357
+ return $preference_result;
358
+ }
359
+
360
+ /**
361
+ * @param $preference
362
+ * @return array|null
363
+ * @throws WC_WooMercadoPago_Exception
364
+ */
365
+ public function create_payment($preference)
366
+ {
367
+
368
+ $request = array(
369
+ 'uri' => '/v1/payments',
370
+ 'headers' => array(
371
+ 'X-Tracking-Id' => 'platform:v1-whitelabel,type:woocommerce,so:' . WC_WooMercadoPago_Constants::VERSION,
372
+ 'Authorization' => 'Bearer ' . $this->get_access_token()
373
+ ),
374
+ 'data' => $preference
375
+ );
376
+
377
+ $payment = MPRestClient::post($request, WC_WooMercadoPago_Constants::VERSION);
378
+ return $payment;
379
+ }
380
+
381
+ /**
382
+ * @param $preapproval_payment
383
+ * @return array|null
384
+ * @throws WC_WooMercadoPago_Exception
385
+ */
386
+ public function create_preapproval_payment($preapproval_payment)
387
+ {
388
+
389
+ $request = array(
390
+ 'headers' => array(
391
+ 'Authorization' => 'Bearer ' . $this->get_access_token()
392
+ ),
393
+ 'uri' => '/preapproval',
394
+ 'data' => $preapproval_payment
395
+ );
396
+
397
+ $preapproval_payment_result = MPRestClient::post($request);
398
+ return $preapproval_payment_result;
399
+ }
400
+
401
+ /**
402
+ * @param $id
403
+ * @return array|null
404
+ * @throws WC_WooMercadoPago_Exception
405
+ */
406
+ public function get_preapproval_payment($id)
407
+ {
408
+
409
+ $request = array(
410
+ 'headers' => array(
411
+ 'Authorization' => 'Bearer ' . $this->get_access_token()
412
+ ),
413
+ 'uri' => '/preapproval/' . $id
414
+ );
415
+
416
+ $preapproval_payment_result = MPRestClient::get($request);
417
+ return $preapproval_payment_result;
418
+ }
419
+
420
+ /**
421
+ * @param $id
422
+ * @param $preapproval_payment
423
+ * @return array|null
424
+ * @throws WC_WooMercadoPago_Exception
425
+ */
426
+ public function update_preapproval_payment($id, $preapproval_payment)
427
+ {
428
+
429
+ $request = array(
430
+ 'headers' => array(
431
+ 'Authorization' => 'Bearer ' . $this->get_access_token()
432
+ ),
433
+ 'uri' => '/preapproval/' . $id,
434
+ 'data' => $preapproval_payment
435
+ );
436
+
437
+ $preapproval_payment_result = MPRestClient::put($request);
438
+ return $preapproval_payment_result;
439
+ }
440
+
441
+ /**
442
+ * @param $id
443
+ * @return array|null
444
+ * @throws WC_WooMercadoPago_Exception
445
+ */
446
+ public function cancel_preapproval_payment($id)
447
+ {
448
+
449
+ $request = array(
450
+ 'headers' => array(
451
+ 'Authorization' => 'Bearer ' . $this->get_access_token()
452
+ ),
453
+ 'uri' => '/preapproval/' . $id,
454
+ 'data' => array(
455
+ 'status' => 'cancelled'
456
+ )
457
+ );
458
+
459
+ $response = MPRestClient::put($request);
460
+ return $response;
461
+ }
462
+
463
+ //=== REFUND AND CANCELING FLOW FUNCTIONS ===
464
+
465
+ /**
466
+ * @param $id
467
+ * @return array|null
468
+ * @throws WC_WooMercadoPago_Exception
469
+ */
470
+ public function refund_payment($id)
471
+ {
472
+
473
+ $request = array(
474
+ 'headers' => array(
475
+ 'Authorization' => 'Bearer ' . $this->get_access_token()
476
+ ),
477
+ 'uri' => '/v1/payments/' . $id . '/refunds'
478
+ );
479
+
480
+ $response = MPRestClient::post($request);
481
+ return $response;
482
+ }
483
+
484
+ /**
485
+ * @param $id
486
+ * @param $amount
487
+ * @param $reason
488
+ * @param $external_reference
489
+ * @return array|null
490
+ * @throws WC_WooMercadoPago_Exception
491
+ */
492
+ public function partial_refund_payment($id, $amount, $reason, $external_reference)
493
+ {
494
+
495
+ $request = array(
496
+ 'headers' => array(
497
+ 'Authorization' => 'Bearer ' . $this->get_access_token()
498
+ ),
499
+ 'uri' => '/v1/payments/' . $id . '/refunds',
500
+ 'data' => array(
501
+ 'amount' => $amount,
502
+ 'metadata' => array(
503
+ 'metadata' => $reason,
504
+ 'external_reference' => $external_reference
505
+ )
506
+ )
507
+ );
508
+
509
+ $response = MPRestClient::post($request);
510
+ return $response;
511
+ }
512
+
513
+ /**
514
+ * @param $id
515
+ * @return array|null
516
+ * @throws WC_WooMercadoPago_Exception
517
+ */
518
+ public function cancel_payment($id)
519
+ {
520
+
521
+ $request = array(
522
+ 'headers' => array(
523
+ 'Authorization' => 'Bearer ' . $this->get_access_token()
524
+ ),
525
+ 'uri' => '/v1/payments/' . $id,
526
+ 'data' => '{"status":"cancelled"}'
527
+ );
528
+
529
+ $response = MPRestClient::put($request);
530
+ return $response;
531
+ }
532
+
533
+ /**
534
+ * @return array|null
535
+ * @throws WC_WooMercadoPago_Exception
536
+ */
537
+ public function get_payment_methods()
538
+ {
539
+ $request = array(
540
+ 'headers' => array(
541
+ 'Authorization' => 'Bearer ' . $this->get_access_token()
542
+ ),
543
+ 'uri' => '/v1/payment_methods',
544
+ );
545
+
546
+ $response = MPRestClient::get($request);
547
+ asort($result);
548
+ return $response;
549
+ }
550
+
551
+ /**
552
+ * Validate if the seller is homologated
553
+ * @param $access_token
554
+ * @param $public_key
555
+ * @return array|null
556
+ * @throws WC_WooMercadoPago_Exception
557
+ */
558
+ public function getCredentialsWrapper($access_token = null, $public_key = null)
559
+ {
560
+ $request = array(
561
+ 'uri' => '/plugins-credentials-wrapper/credentials',
562
+ );
563
+
564
+ if (!empty($access_token) && empty($public_key)) {
565
+ $request['headers'] = array('Authorization' => 'Bearer ' . $access_token);
566
+ }
567
+
568
+ if (empty($access_token) && !empty($public_key)) {
569
+ $request['params'] = array('public_key' => $public_key);
570
+ }
571
+
572
+ $response = MPRestClient::get($request);
573
+
574
+ if ($response['status'] > 202) {
575
+ $log = WC_WooMercadoPago_Log::init_mercado_pago_log('getCredentialsWrapper');
576
+ $log->write_log('API GET Credentials Wrapper error:', $response['response']['message']);
577
+ return false;
578
+ }
579
+
580
+ return $response['response'];
581
+ }
582
+
583
+ //=== GENERIC RESOURCE CALL METHODS ===
584
+
585
+ /**
586
+ * @param $request
587
+ * @param null $params
588
+ * @param bool $authenticate
589
+ * @return array|null
590
+ * @throws WC_WooMercadoPago_Exception
591
+ */
592
+ public function get($request, $headers = [], $authenticate = true)
593
+ {
594
+
595
+ if (is_string($request)) {
596
  $request = array(
597
+ 'headers' => $headers,
598
+ 'uri' => $request,
599
+ 'authenticate' => $authenticate
600
  );
601
+ }
602
 
603
+ if (!isset($request['authenticate']) || $request['authenticate'] !== false) {
604
+ $access_token = $this->get_access_token();
605
+ if (!empty($access_token)) {
606
+ $request['headers'] = array('Authorization'=> 'Bearer ' . $access_token);
607
+ }
608
  }
609
 
610
+ $result = MPRestClient::get($request);
611
  return $result;
612
  }
613
 
614
+ /**
615
+ * @param $request
616
+ * @param null $data
617
+ * @param null $params
618
+ * @return array|null
619
+ * @throws WC_WooMercadoPago_Exception
620
+ */
621
+ public function post($request, $data = null, $params = null)
622
+ {
623
+
624
+ if (is_string($request)) {
625
+ $request = array(
626
+ 'headers' => array('Authorization' => 'Bearer ' . $this->get_access_token()),
627
+ 'uri' => $request,
628
+ 'data' => $data,
629
+ 'params' => $params
630
+ );
631
+ }
632
+
633
+ $request['params'] = isset($request['params']) && is_array($request['params']) ?
634
+ $request["params"] :
635
+ array();
636
+
637
+ $result = MPRestClient::post($request);
638
+ return $result;
639
+ }
640
+
641
+ /**
642
+ * @param $request
643
+ * @param null $data
644
+ * @param null $params
645
+ * @return array|null
646
+ * @throws WC_WooMercadoPago_Exception
647
+ */
648
+ public function put($request, $data = null, $params = null)
649
+ {
650
+
651
+ if (is_string($request)) {
652
+ $request = array(
653
+ 'headers' => array('Authorization' => 'Bearer ' . $this->get_access_token()),
654
+ 'uri' => $request,
655
+ 'data' => $data,
656
+ 'params' => $params
657
+ );
658
+ }
659
+
660
+ $request['params'] = isset($request['params']) && is_array($request['params']) ?
661
+ $request['params'] :
662
+ array();
663
+
664
+ $result = MPRestClient::put($request);
665
+ return $result;
666
+ }
667
+
668
+ /**
669
+ * @param $request
670
+ * @param null $params
671
+ * @return array|null
672
+ * @throws WC_WooMercadoPago_Exception
673
+ */
674
+ public function delete($request, $params = null)
675
+ {
676
+
677
+ if (is_string($request)) {
678
+ $request = array(
679
+ 'headers' => array('Authorization' => 'Bearer ' . $this->get_access_token()),
680
+ 'uri' => $request,
681
+ 'params' => $params
682
+ );
683
+ }
684
+
685
+ $request['params'] = isset($request['params']) && is_array($request['params']) ?
686
+ $request['params'] :
687
+ array();
688
+
689
+ $result = MPRestClient::delete($request);
690
+ return $result;
691
+ }
692
+
693
+ /**
694
+ * @param null $payment
695
+ */
696
+ public function setPaymentClass($payment = null)
697
+ {
698
+ if (!empty($payment)) {
699
+ $this->paymentClass = get_class($payment);
700
+ }
701
+ }
702
+
703
+ /**
704
+ * @return mixed
705
+ */
706
+ public function getPaymentClass()
707
+ {
708
+ return $this->paymentClass;
709
+ }
710
+
711
  }
includes/module/sdk/lib/RestClient/AbstractRestClient.php CHANGED
@@ -8,8 +8,8 @@
8
  * License - https://www.gnu.org/licenses/gpl.html GPL version 2 or higher
9
  */
10
 
11
- if ( ! defined( 'ABSPATH' ) ) {
12
- exit;
13
  }
14
  /**
15
  * Class AbstractRestClient
@@ -55,7 +55,7 @@ class AbstractRestClient
55
  }
56
 
57
  $headers = array('accept: application/json');
58
- if ($request['method'] == 'POST' ) {
59
  $headers[] = 'x-product-id:' . (WC_WooMercadoPago_Module::is_mobile() ? WC_WooMercadoPago_Constants::PRODUCT_ID_MOBILE : WC_WooMercadoPago_Constants::PRODUCT_ID_DESKTOP);
60
  $headers[] = 'x-platform-id:' . WC_WooMercadoPago_Constants::PLATAFORM_ID;
61
  $headers[] = 'x-integrator-id:' . get_option('_mp_integrator_id', null);
@@ -67,8 +67,6 @@ class AbstractRestClient
67
 
68
  if (isset($request['headers']) && is_array($request['headers'])) {
69
  foreach ($request['headers'] as $h => $v) {
70
- $h = strtolower($h);
71
- $v = strtolower($v);
72
  if ($h == 'content-type') {
73
  $default_content_type = false;
74
  $json_content = $v == 'application/json';
@@ -131,7 +129,7 @@ class AbstractRestClient
131
  $response = null;
132
  $api_result = curl_exec($connect);
133
  if (curl_errno($connect)) {
134
- throw new WC_WooMercadoPago_Exception (curl_error($connect));
135
  }
136
  $api_http_code = curl_getinfo($connect, CURLINFO_HTTP_CODE);
137
 
@@ -139,74 +137,10 @@ class AbstractRestClient
139
  $response = array('status' => $api_http_code, 'response' => json_decode($api_result, true));
140
  }
141
 
142
- if ($response != null && $response['status'] >= 400 && self::$check_loop == 0) {
143
- try {
144
- self::$check_loop = 1;
145
- $message = null;
146
- $payloads = null;
147
- $endpoint = null;
148
- $errors = array();
149
- if (isset($response['response'])) {
150
- if (isset($response['response']['message'])) {
151
- $message = $response['response']['message'];
152
- }
153
- if (isset($response['response']['cause'])) {
154
- $message .= json_encode($response['response']['cause']);
155
- }
156
- }
157
- if ($request != null) {
158
- if (isset($request['data'])) {
159
- if ($request['data'] != null) {
160
- $payloads = json_encode($request['data']);
161
- }
162
- }
163
- if (isset($request['uri'])) {
164
- if ($request['uri'] != null) {
165
- $endpoint = $request['uri'];
166
- }
167
- }
168
- }
169
- $errors[] = array(
170
- 'endpoint' => $endpoint,
171
- 'message' => $message,
172
- 'payloads' => $payloads
173
- );
174
- self::sendErrorLog($response['status'], $errors, WC_WooMercadoPago_Constants::VERSION);
175
- } catch (Exception $e) {
176
- throw new WC_WooMercadoPago_Exception('Error to call API LOGS' . $e);
177
- }
178
- }
179
-
180
- self::$check_loop = 0;
181
  curl_close($connect);
182
  return $response;
183
  }
184
 
185
- /**
186
- * @param $code
187
- * @param $errors
188
- * @return array|null
189
- * @throws WC_WooMercadoPago_Exception
190
- */
191
- public static function sendErrorLog($code, $errors)
192
- {
193
- $data = array(
194
- 'code' => $code,
195
- 'module' => WC_WooMercadoPago_Constants::PLATAFORM_ID,
196
- 'module_version' => WC_WooMercadoPago_Constants::VERSION,
197
- 'url_store' => $_SERVER['HTTP_HOST'],
198
- 'errors' => $errors,
199
- 'email_admin' => self::$email_admin,
200
- 'country_initial' => self::$site_locale
201
- );
202
- $request = array(
203
- 'uri' => '/modules/log',
204
- 'data' => $data
205
- );
206
- $result_response = MeLiRestClient::post($request);
207
- return $result_response;
208
- }
209
-
210
  /**
211
  * @param $params
212
  * @return string
8
  * License - https://www.gnu.org/licenses/gpl.html GPL version 2 or higher
9
  */
10
 
11
+ if (!defined('ABSPATH')) {
12
+ exit;
13
  }
14
  /**
15
  * Class AbstractRestClient
55
  }
56
 
57
  $headers = array('accept: application/json');
58
+ if ($request['method'] == 'POST') {
59
  $headers[] = 'x-product-id:' . (WC_WooMercadoPago_Module::is_mobile() ? WC_WooMercadoPago_Constants::PRODUCT_ID_MOBILE : WC_WooMercadoPago_Constants::PRODUCT_ID_DESKTOP);
60
  $headers[] = 'x-platform-id:' . WC_WooMercadoPago_Constants::PLATAFORM_ID;
61
  $headers[] = 'x-integrator-id:' . get_option('_mp_integrator_id', null);
67
 
68
  if (isset($request['headers']) && is_array($request['headers'])) {
69
  foreach ($request['headers'] as $h => $v) {
 
 
70
  if ($h == 'content-type') {
71
  $default_content_type = false;
72
  $json_content = $v == 'application/json';
129
  $response = null;
130
  $api_result = curl_exec($connect);
131
  if (curl_errno($connect)) {
132
+ throw new WC_WooMercadoPago_Exception(curl_error($connect));
133
  }
134
  $api_http_code = curl_getinfo($connect, CURLINFO_HTTP_CODE);
135
 
137
  $response = array('status' => $api_http_code, 'response' => json_decode($api_result, true));
138
  }
139
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
  curl_close($connect);
141
  return $response;
142
  }
143
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
144
  /**
145
  * @param $params
146
  * @return string
includes/notification/WC_WooMercadoPago_Notification_Abstract.php CHANGED
@@ -107,19 +107,19 @@ abstract class WC_WooMercadoPago_Notification_Abstract
107
  $this->mp_rule_approved($data, $order, $used_gateway);
108
  break;
109
  case 'pending':
110
- $this->mp_rule_pending($order, $used_gateway);
111
  break;
112
  case 'in_process':
113
- $this->mp_rule_in_process($order);
114
  break;
115
  case 'rejected':
116
- $this->mp_rule_rejected($order);
117
  break;
118
  case 'refunded':
119
  $this->mp_rule_refunded($order);
120
  break;
121
  case 'cancelled':
122
- $this->mp_rule_cancelled($order);
123
  break;
124
  case 'in_mediation':
125
  $this->mp_rule_in_mediation($order);
@@ -140,7 +140,14 @@ abstract class WC_WooMercadoPago_Notification_Abstract
140
  public function mp_rule_approved($data, $order, $used_gateway)
141
  {
142
  $order->add_order_note('Mercado Pago: ' . __('Payment approved.', 'woocommerce-mercadopago'));
143
- $payment_completed_status = apply_filters('woocommerce_payment_complete_order_status', $order->needs_processing() ? 'processing' : 'completed', $order->get_id(), $order);
 
 
 
 
 
 
 
144
  if (method_exists($order, 'get_status') && $order->get_status() !== 'completed') {
145
  switch ($used_gateway) {
146
  case 'WC_WooMercadoPago_CustomGateway':
@@ -171,49 +178,72 @@ abstract class WC_WooMercadoPago_Notification_Abstract
171
  * @param $order
172
  * @param $usedGateway
173
  */
174
- public function mp_rule_pending($order, $used_gateway)
175
  {
176
- $order->update_status(self::get_wc_status_for_mp_status('pending'));
177
- switch ($used_gateway) {
178
- case 'WC_WooMercadoPago_TicketGateway':
179
- $notes = $order->get_customer_order_notes();
180
- $has_note = false;
181
- if (sizeof($notes) > 1) {
182
- $has_note = true;
 
 
 
 
 
 
 
 
 
 
 
 
183
  break;
184
- }
185
- if (!$has_note) {
186
- $order->add_order_note(
187
- 'Mercado Pago: ' . __('Waiting for the ticket payment.', 'woocommerce-mercadopago')
188
- );
189
  $order->add_order_note(
190
- 'Mercado Pago: ' . __('Waiting for the ticket payment.', 'woocommerce-mercadopago'),
191
- 1, false
192
  );
193
- }
194
- break;
195
- default:
196
- $order->add_order_note('Mercado Pago: ' . __('The customer has not made the payment yet.', 'woocommerce-mercadopago'));
197
- break;
198
  }
 
199
  return;
200
  }
201
 
202
  /**
203
  * @param $order
204
  */
205
- public function mp_rule_in_process($order)
206
  {
207
- $order->update_status(self::get_wc_status_for_mp_status('inprocess'), 'Mercado Pago: ' . __('Payment is pending review.', 'woocommerce-mercadopago'));
 
 
 
 
 
 
 
 
208
  return;
209
  }
210
 
211
  /**
212
  * @param $order
213
  */
214
- public function mp_rule_rejected($order)
215
  {
216
- $order->update_status(self::get_wc_status_for_mp_status('rejected'), 'Mercado Pago: ' . __('Payment was declined. The customer can try again.', 'woocommerce-mercadopago'));
 
 
 
 
 
 
 
 
217
  return;
218
  }
219
 
@@ -222,16 +252,27 @@ abstract class WC_WooMercadoPago_Notification_Abstract
222
  */
223
  public function mp_rule_refunded($order)
224
  {
225
- $order->update_status(self::get_wc_status_for_mp_status('refunded'), 'Mercado Pago: ' . __('Payment was returned to the customer.', 'woocommerce-mercadopago'));
 
 
 
226
  return;
227
  }
228
 
229
  /**
230
  * @param $order
231
  */
232
- public function mp_rule_cancelled($order)
233
  {
234
- $order->update_status(self::get_wc_status_for_mp_status('cancelled'), 'Mercado Pago: ' . __('Payment was canceled.', 'woocommerce-mercadopago'));
 
 
 
 
 
 
 
 
235
  return;
236
  }
237
 
@@ -241,7 +282,9 @@ abstract class WC_WooMercadoPago_Notification_Abstract
241
  public function mp_rule_in_mediation($order)
242
  {
243
  $order->update_status(self::get_wc_status_for_mp_status('inmediation'));
244
- $order->add_order_note('Mercado Pago: ' . __('The payment is in mediation or the purchase was unknown by the customer.', 'woocommerce-mercadopago'));
 
 
245
  return;
246
  }
247
 
@@ -251,7 +294,10 @@ abstract class WC_WooMercadoPago_Notification_Abstract
251
  public function mp_rule_charged_back($order)
252
  {
253
  $order->update_status(self::get_wc_status_for_mp_status('chargedback'));
254
- $order->add_order_note('Mercado Pago: ' . __('The payment is in mediation or the purchase was unknown by the customer.', 'woocommerce-mercadopago'));
 
 
 
255
  return;
256
  }
257
 
@@ -314,6 +360,38 @@ abstract class WC_WooMercadoPago_Notification_Abstract
314
  }
315
  }
316
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
317
  /**
318
  * @param $code
319
  * @param $code_message
@@ -324,5 +402,4 @@ abstract class WC_WooMercadoPago_Notification_Abstract
324
  status_header($code, $code_message);
325
  die($body);
326
  }
327
-
328
  }
107
  $this->mp_rule_approved($data, $order, $used_gateway);
108
  break;
109
  case 'pending':
110
+ $this->mp_rule_pending($data, $order, $used_gateway);
111
  break;
112
  case 'in_process':
113
+ $this->mp_rule_in_process($data, $order);
114
  break;
115
  case 'rejected':
116
+ $this->mp_rule_rejected($data, $order);
117
  break;
118
  case 'refunded':
119
  $this->mp_rule_refunded($order);
120
  break;
121
  case 'cancelled':
122
+ $this->mp_rule_cancelled($data, $order);
123
  break;
124
  case 'in_mediation':
125
  $this->mp_rule_in_mediation($order);
140
  public function mp_rule_approved($data, $order, $used_gateway)
141
  {
142
  $order->add_order_note('Mercado Pago: ' . __('Payment approved.', 'woocommerce-mercadopago'));
143
+
144
+ $payment_completed_status = apply_filters(
145
+ 'woocommerce_payment_complete_order_status',
146
+ $order->needs_processing() ? 'processing' : 'completed',
147
+ $order->get_id(),
148
+ $order
149
+ );
150
+
151
  if (method_exists($order, 'get_status') && $order->get_status() !== 'completed') {
152
  switch ($used_gateway) {
153
  case 'WC_WooMercadoPago_CustomGateway':
178
  * @param $order
179
  * @param $usedGateway
180
  */
181
+ public function mp_rule_pending($data, $order, $used_gateway)
182
  {
183
+ if ($this->canUpdateOrderStatus($order)) {
184
+ $order->update_status(self::get_wc_status_for_mp_status('pending'));
185
+ switch ($used_gateway) {
186
+ case 'WC_WooMercadoPago_TicketGateway':
187
+ $notes = $order->get_customer_order_notes();
188
+ $has_note = false;
189
+ if (sizeof($notes) > 1) {
190
+ $has_note = true;
191
+ break;
192
+ }
193
+ if (!$has_note) {
194
+ $order->add_order_note(
195
+ 'Mercado Pago: ' . __('Waiting for the ticket payment.', 'woocommerce-mercadopago')
196
+ );
197
+ $order->add_order_note(
198
+ 'Mercado Pago: ' . __('Waiting for the ticket payment.', 'woocommerce-mercadopago'),
199
+ 1, false
200
+ );
201
+ }
202
  break;
203
+ default:
 
 
 
 
204
  $order->add_order_note(
205
+ 'Mercado Pago: ' . __('The customer has not made the payment yet.', 'woocommerce-mercadopago')
 
206
  );
207
+ break;
208
+ }
209
+ } else {
210
+ $this->validateOrderNoteType($data, $order, 'pending');
 
211
  }
212
+
213
  return;
214
  }
215
 
216
  /**
217
  * @param $order
218
  */
219
+ public function mp_rule_in_process($data, $order)
220
  {
221
+ if ($this->canUpdateOrderStatus($order)) {
222
+ $order->update_status(
223
+ self::get_wc_status_for_mp_status('inprocess'),
224
+ 'Mercado Pago: ' . __('Payment is pending review.', 'woocommerce-mercadopago')
225
+ );
226
+ } else {
227
+ $this->validateOrderNoteType($data, $order, 'in_process');
228
+ }
229
+
230
  return;
231
  }
232
 
233
  /**
234
  * @param $order
235
  */
236
+ public function mp_rule_rejected($data, $order)
237
  {
238
+ if ($this->canUpdateOrderStatus($order)) {
239
+ $order->update_status(
240
+ self::get_wc_status_for_mp_status('rejected'),
241
+ 'Mercado Pago: ' . __('Payment was declined. The customer can try again.', 'woocommerce-mercadopago')
242
+ );
243
+ } else {
244
+ $this->validateOrderNoteType($data, $order, 'rejected');
245
+ }
246
+
247
  return;
248
  }
249
 
252
  */
253
  public function mp_rule_refunded($order)
254
  {
255
+ $order->update_status(
256
+ self::get_wc_status_for_mp_status('refunded'),
257
+ 'Mercado Pago: ' . __('Payment was returned to the customer.', 'woocommerce-mercadopago')
258
+ );
259
  return;
260
  }
261
 
262
  /**
263
  * @param $order
264
  */
265
+ public function mp_rule_cancelled($data, $order)
266
  {
267
+ if ($this->canUpdateOrderStatus($order)) {
268
+ $order->update_status(
269
+ self::get_wc_status_for_mp_status('cancelled'),
270
+ 'Mercado Pago: ' . __('Payment was canceled.', 'woocommerce-mercadopago')
271
+ );
272
+ } else {
273
+ $this->validateOrderNoteType($data, $order, 'cancelled');
274
+ }
275
+
276
  return;
277
  }
278
 
282
  public function mp_rule_in_mediation($order)
283
  {
284
  $order->update_status(self::get_wc_status_for_mp_status('inmediation'));
285
+ $order->add_order_note(
286
+ 'Mercado Pago: ' . __('The payment is in mediation or the purchase was unknown by the customer.', 'woocommerce-mercadopago')
287
+ );
288
  return;
289
  }
290
 
294
  public function mp_rule_charged_back($order)
295
  {
296
  $order->update_status(self::get_wc_status_for_mp_status('chargedback'));
297
+ $order->add_order_note(
298
+ 'Mercado Pago: ' . __('The payment is in mediation or the purchase was unknown by the customer.',
299
+ 'woocommerce-mercadopago')
300
+ );
301
  return;
302
  }
303
 
360
  }
361
  }
362
 
363
+ protected function canUpdateOrderStatus($order) {
364
+ return method_exists($order, 'get_status') && $order->get_status() !== 'completed' && $order->get_status() !== 'processing';
365
+ }
366
+
367
+ /**
368
+ * @param $data
369
+ * @param $order
370
+ * @param $status
371
+ * @return void
372
+ */
373
+ protected function validateOrderNoteType($data, $order, $status)
374
+ {
375
+ $paymentId = $data['id'];
376
+
377
+ if(isset($data['ipn_type']) && $data['ipn_type'] === 'merchant_order') {
378
+ $payments = [];
379
+ foreach($data['payments'] as $payment) {
380
+ $payments[] = $payment['id'];
381
+ }
382
+
383
+ $paymentId = implode(',', $payments);
384
+ }
385
+
386
+ $order->add_order_note(
387
+ sprintf(
388
+ __('Mercado Pago: The payment %s was notified by Mercado Pago with status %s.', 'woocommerce-mercadopago'),
389
+ $paymentId,
390
+ $status
391
+ )
392
+ );
393
+ }
394
+
395
  /**
396
  * @param $code
397
  * @param $code_message
402
  status_header($code, $code_message);
403
  die($body);
404
  }
 
405
  }
includes/notification/WC_WooMercadoPago_Notification_IPN.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
  }
6
 
7
  /**
@@ -40,9 +40,9 @@ class WC_WooMercadoPago_Notification_IPN extends WC_WooMercadoPago_Notification_
40
  $this->setResponse(422, null, __('Type of topic IPN invalid, need to be merchant_order', 'woocommerce-mercadopago'));
41
  }
42
 
43
- $access_token = array('access_token' => $this->mp->get_access_token());
44
  if ($data['topic'] == 'merchant_order') {
45
- $ipn_info = $this->mp->get('/merchant_orders/' . $data['id'], $access_token, false);
46
 
47
  if (is_wp_error($ipn_info) || ($ipn_info['status'] != 200 && $ipn_info['status'] != 201)) {
48
  $this->log->write_log(__FUNCTION__, ' IPN merchant_order not found ' . json_encode($ipn_info, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
@@ -66,18 +66,18 @@ class WC_WooMercadoPago_Notification_IPN extends WC_WooMercadoPago_Notification_
66
  * @return bool|void|WC_Order|WC_Order_Refund
67
  * @throws WC_Data_Exception
68
  */
69
- public function successful_request($data)
70
- {
71
- try {
72
- $order = parent::successful_request($data);
73
- $processed_status = $this->process_status_mp_business($data, $order);
74
- $this->log->write_log(__FUNCTION__, 'Changing order status to: ' . parent::get_wc_status_for_mp_status(str_replace('_', '', $processed_status)));
75
- $this->proccessStatus($processed_status, $data, $order);
76
- } catch (Exception $e) {
77
- $this->setResponse(422,null, $e->getMessage());
78
- $this->log->write_log(__FUNCTION__, $e->getMessage());
79
- }
80
- }
81
 
82
  /**
83
  * @param $data
@@ -128,11 +128,12 @@ class WC_WooMercadoPago_Notification_IPN extends WC_WooMercadoPago_Notification_
128
  $payment_ids = array();
129
  foreach ($data['payments'] as $payment) {
130
  $payment_ids[] = $payment['id'];
131
- $order->update_meta_data('Mercado Pago - Payment ' . $payment['id'],
 
132
  '[Date ' . date('Y-m-d H:i:s', strtotime($payment['date_created'])) .
133
- ']/[Amount ' . $payment['transaction_amount'] .
134
- ']/[Paid ' . $payment['total_paid_amount'] .
135
- ']/[Refund ' . $payment['amount_refunded'] . ']'
136
  );
137
  }
138
  if (sizeof($payment_ids) > 0) {
@@ -157,9 +158,9 @@ class WC_WooMercadoPago_Notification_IPN extends WC_WooMercadoPago_Notification_
157
  $order->id,
158
  'Mercado Pago - Payment ' . $payment['id'],
159
  '[Date ' . date('Y-m-d H:i:s', strtotime($payment['date_created'])) .
160
- ']/[Amount ' . $payment['transaction_amount'] .
161
- ']/[Paid ' . $payment['total_paid_amount'] .
162
- ']/[Refund ' . $payment['amount_refunded'] . ']'
163
  );
164
  }
165
  if (sizeof($payment_ids) > 0) {
1
  <?php
2
 
3
+ if (!defined('ABSPATH')) {
4
+ exit;
5
  }
6
 
7
  /**
40
  $this->setResponse(422, null, __('Type of topic IPN invalid, need to be merchant_order', 'woocommerce-mercadopago'));
41
  }
42
 
43
+ $access_token = $this->mp->get_access_token();
44
  if ($data['topic'] == 'merchant_order') {
45
+ $ipn_info = $this->mp->get('/merchant_orders/' . $data['id'], array('Authorization' => 'Bearer ' . $access_token), false);
46
 
47
  if (is_wp_error($ipn_info) || ($ipn_info['status'] != 200 && $ipn_info['status'] != 201)) {
48
  $this->log->write_log(__FUNCTION__, ' IPN merchant_order not found ' . json_encode($ipn_info, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
66
  * @return bool|void|WC_Order|WC_Order_Refund
67
  * @throws WC_Data_Exception
68
  */
69
+ public function successful_request($data)
70
+ {
71
+ try {
72
+ $order = parent::successful_request($data);
73
+ $processed_status = $this->process_status_mp_business($data, $order);
74
+ $this->log->write_log(__FUNCTION__, 'Changing order status to: ' . parent::get_wc_status_for_mp_status(str_replace('_', '', $processed_status)));
75
+ $this->proccessStatus($processed_status, $data, $order);
76
+ } catch (Exception $e) {
77
+ $this->setResponse(422, null, $e->getMessage());
78
+ $this->log->write_log(__FUNCTION__, $e->getMessage());
79
+ }
80
+ }
81
 
82
  /**
83
  * @param $data
128
  $payment_ids = array();
129
  foreach ($data['payments'] as $payment) {
130
  $payment_ids[] = $payment['id'];
131
+ $order->update_meta_data(
132
+ 'Mercado Pago - Payment ' . $payment['id'],
133
  '[Date ' . date('Y-m-d H:i:s', strtotime($payment['date_created'])) .
134
+ ']/[Amount ' . $payment['transaction_amount'] .
135
+ ']/[Paid ' . $payment['total_paid_amount'] .
136
+ ']/[Refund ' . $payment['amount_refunded'] . ']'
137
  );
138
  }
139
  if (sizeof($payment_ids) > 0) {
158
  $order->id,
159
  'Mercado Pago - Payment ' . $payment['id'],
160
  '[Date ' . date('Y-m-d H:i:s', strtotime($payment['date_created'])) .
161
+ ']/[Amount ' . $payment['transaction_amount'] .
162
+ ']/[Paid ' . $payment['total_paid_amount'] .
163
+ ']/[Refund ' . $payment['amount_refunded'] . ']'
164
  );
165
  }
166
  if (sizeof($payment_ids) > 0) {
includes/notification/WC_WooMercadoPago_Notification_Webhook.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
  }
6
 
7
  /**
@@ -52,23 +52,23 @@ class WC_WooMercadoPago_Notification_Webhook extends WC_WooMercadoPago_Notificat
52
  if (!isset($data['id']) || !isset($data['topic'])) {
53
  $this->log->write_log(__FUNCTION__, 'Mercado Pago Request failure: ' .
54
  json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
55
- $this->setResponse(422,null, "Mercado Pago Request failure");
56
  }
57
  } else {
58
  if ($data['type'] == 'payment') {
59
- $access_token = array('access_token' => $this->mp->get_access_token());
60
- $payment_info = $this->mp->get('/v1/payments/' . $data['data_id'], $access_token, false);
61
  if (!is_wp_error($payment_info) && ($payment_info['status'] == 200 || $payment_info['status'] == 201)) {
62
  if ($payment_info['response']) {
63
  do_action('valid_mercadopago_ipn_request', $payment_info['response']);
64
- $this->setResponse(200,"OK", "Webhook Notification Successfull");
65
  }
66
  } else {
67
  $this->log->write_log(__FUNCTION__, 'error when processing received data: ' . json_encode($payment_info, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
68
  }
69
  }
70
  }
71
- $this->setResponse(422,null, "Mercado Pago Invalid Requisition");
72
  }
73
 
74
  /**
@@ -85,7 +85,6 @@ class WC_WooMercadoPago_Notification_Webhook extends WC_WooMercadoPago_Notificat
85
  } catch (Exception $e) {
86
  $this->log->write_log(__FUNCTION__, $e->getMessage());
87
  }
88
-
89
  }
90
 
91
  /**
@@ -109,7 +108,7 @@ class WC_WooMercadoPago_Notification_Webhook extends WC_WooMercadoPago_Notificat
109
  return;
110
  }
111
  if (isset($checkout_info['issuer_id']) && !empty($checkout_info['issuer_id'])) {
112
- $issuer_id = (integer)($checkout_info['issuer_id']);
113
  }
114
  if (isset($checkout_info['payment_method_id']) && !empty($checkout_info['payment_method_id'])) {
115
  $payment_method_id = $checkout_info['payment_method_id'];
@@ -144,9 +143,9 @@ class WC_WooMercadoPago_Notification_Webhook extends WC_WooMercadoPago_Notificat
144
  $order->update_meta_data(
145
  'Mercado Pago - Payment ' . $data['id'],
146
  '[Date ' . date('Y-m-d H:i:s', strtotime($data['date_created'])) .
147
- ']/[Amount ' . $data['transaction_amount'] .
148
- ']/[Paid ' . $total_paid .
149
- ']/[Refund ' . $total_refund . ']'
150
  );
151
  $order->update_meta_data('_Mercado_Pago_Payment_IDs', $data['id']);
152
  $order->save();
@@ -163,9 +162,9 @@ class WC_WooMercadoPago_Notification_Webhook extends WC_WooMercadoPago_Notificat
163
  $order->id,
164
  'Mercado Pago - Payment ' . $data['id'],
165
  '[Date ' . date('Y-m-d H:i:s', strtotime($data['date_created'])) .
166
- ']/[Amount ' . $data['transaction_amount'] .
167
- ']/[Paid ' . $total_paid .
168
- ']/[Refund ' . $total_refund . ']'
169
  );
170
  update_post_meta($order->id, '_Mercado_Pago_Payment_IDs', $data['id']);
171
  }
1
  <?php
2
 
3
+ if (!defined('ABSPATH')) {
4
+ exit;
5
  }
6
 
7
  /**
52
  if (!isset($data['id']) || !isset($data['topic'])) {
53
  $this->log->write_log(__FUNCTION__, 'Mercado Pago Request failure: ' .
54
  json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
55
+ $this->setResponse(422, null, "Mercado Pago Request failure");
56
  }
57
  } else {
58
  if ($data['type'] == 'payment') {
59
+ $access_token = $this->mp->get_access_token();
60
+ $payment_info = $this->mp->get('/v1/payments/' . $data['data_id'], array('Authorization' => 'Bearer ' . $access_token), false);
61
  if (!is_wp_error($payment_info) && ($payment_info['status'] == 200 || $payment_info['status'] == 201)) {
62
  if ($payment_info['response']) {
63
  do_action('valid_mercadopago_ipn_request', $payment_info['response']);
64
+ $this->setResponse(200, "OK", "Webhook Notification Successfull");
65
  }
66
  } else {
67
  $this->log->write_log(__FUNCTION__, 'error when processing received data: ' . json_encode($payment_info, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
68
  }
69
  }
70
  }
71
+ $this->setResponse(422, null, "Mercado Pago Invalid Requisition");
72
  }
73
 
74
  /**
85
  } catch (Exception $e) {
86
  $this->log->write_log(__FUNCTION__, $e->getMessage());
87
  }
 
88
  }
89
 
90
  /**
108
  return;
109
  }
110
  if (isset($checkout_info['issuer_id']) && !empty($checkout_info['issuer_id'])) {
111
+ $issuer_id = (int)($checkout_info['issuer_id']);
112
  }
113
  if (isset($checkout_info['payment_method_id']) && !empty($checkout_info['payment_method_id'])) {
114
  $payment_method_id = $checkout_info['payment_method_id'];
143
  $order->update_meta_data(
144
  'Mercado Pago - Payment ' . $data['id'],
145
  '[Date ' . date('Y-m-d H:i:s', strtotime($data['date_created'])) .
146
+ ']/[Amount ' . $data['transaction_amount'] .
147
+ ']/[Paid ' . $total_paid .
148
+ ']/[Refund ' . $total_refund . ']'
149
  );
150
  $order->update_meta_data('_Mercado_Pago_Payment_IDs', $data['id']);
151
  $order->save();
162
  $order->id,
163
  'Mercado Pago - Payment ' . $data['id'],
164
  '[Date ' . date('Y-m-d H:i:s', strtotime($data['date_created'])) .
165
+ ']/[Amount ' . $data['transaction_amount'] .
166
+ ']/[Paid ' . $total_paid .
167
+ ']/[Refund ' . $total_refund . ']'
168
  );
169
  update_post_meta($order->id, '_Mercado_Pago_Payment_IDs', $data['id']);
170
  }
includes/payments/WC_WooMercadoPago_BasicGateway.php CHANGED
@@ -188,16 +188,12 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
188
  if (isset($this->settings['enabled']) && $this->settings['enabled'] == 'yes') {
189
  if ($this->mp instanceof MP) {
190
  $accessToken = $this->mp->get_access_token();
191
- if (strpos($accessToken, 'APP_USR') === false && strpos($accessToken, 'TEST') === false) {
192
  return false;
193
- } else {
194
- if(strpos($accessToken, 'TEST') === false && $this->sandbox == true) {
195
- return false;
196
- }
197
 
198
- if(strpos($accessToken, 'APP_USR') === false && $this->sandbox == false) {
199
- return false;
200
- }
201
  }
202
  return true;
203
  }
@@ -517,7 +513,7 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
517
  //add css
518
  wp_enqueue_style(
519
  'woocommerce-mercadopago-basic-checkout-styles',
520
- plugins_url('../assets/css/basic_checkout_mercadopago.css', plugin_dir_path(__FILE__))
521
  );
522
 
523
  //validate active payments methods
@@ -580,6 +576,7 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
580
  {
581
  $order = wc_get_order($order_id);
582
  $amount = $this->get_order_total();
 
583
  if (method_exists($order, 'update_meta_data')) {
584
  $order->update_meta_data('_used_gateway', get_class($this));
585
 
188
  if (isset($this->settings['enabled']) && $this->settings['enabled'] == 'yes') {
189
  if ($this->mp instanceof MP) {
190
  $accessToken = $this->mp->get_access_token();
191
+ if (WC_WooMercadoPago_Credentials::validateCredentialsTest($this->mp ,$accessToken) == false && $this->sandbox == true) {
192
  return false;
193
+ }
 
 
 
194
 
195
+ if (WC_WooMercadoPago_Credentials::validateCredentialsProd($this->mp ,$accessToken) == false && $this->sandbox == false) {
196
+ return false;
 
197
  }
198
  return true;
199
  }
513
  //add css
514
  wp_enqueue_style(
515
  'woocommerce-mercadopago-basic-checkout-styles',
516
+ plugins_url('../assets/css/basic_checkout_mercadopago' . $suffix . '.css', plugin_dir_path(__FILE__))
517
  );
518
 
519
  //validate active payments methods
576
  {
577
  $order = wc_get_order($order_id);
578
  $amount = $this->get_order_total();
579
+
580
  if (method_exists($order, 'update_meta_data')) {
581
  $order->update_meta_data('_used_gateway', get_class($this));
582
 
includes/payments/WC_WooMercadoPago_CustomGateway.php CHANGED
@@ -264,9 +264,11 @@ class WC_WooMercadoPago_CustomGateway extends WC_WooMercadoPago_PaymentAbstract
264
  public function payment_fields()
265
  {
266
  //add css
 
 
267
  wp_enqueue_style(
268
  'woocommerce-mercadopago-basic-checkout-styles',
269
- plugins_url('../assets/css/basic_checkout_mercadopago.css', plugin_dir_path(__FILE__))
270
  );
271
 
272
  $amount = $this->get_order_total();
@@ -520,7 +522,7 @@ class WC_WooMercadoPago_CustomGateway extends WC_WooMercadoPago_PaymentAbstract
520
  }
521
 
522
  $_mp_access_token = get_option('_mp_access_token_prod');
523
- $is_prod_credentials = strpos($_mp_access_token, 'TEST') === false;
524
 
525
  if ((empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'off') && $is_prod_credentials) {
526
  $this->log->write_log(__FUNCTION__, 'NO HTTPS, Custom unavailable.');
264
  public function payment_fields()
265
  {
266
  //add css
267
+ $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
268
+
269
  wp_enqueue_style(
270
  'woocommerce-mercadopago-basic-checkout-styles',
271
+ plugins_url('../assets/css/basic_checkout_mercadopago' . $suffix . '.css', plugin_dir_path(__FILE__))
272
  );
273
 
274
  $amount = $this->get_order_total();
522
  }
523
 
524
  $_mp_access_token = get_option('_mp_access_token_prod');
525
+ $is_prod_credentials = WC_WooMercadoPago_Credentials::validateCredentialsTest($this->mp, $_mp_access_token, null) == false;
526
 
527
  if ((empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'off') && $is_prod_credentials) {
528
  $this->log->write_log(__FUNCTION__, 'NO HTTPS, Custom unavailable.');
includes/payments/WC_WooMercadoPago_PaymentAbstract.php CHANGED
@@ -123,7 +123,8 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
123
  $homolog_validate = (int)get_option('homolog_validate', 0);
124
  if (($this->isProductionMode() && !empty($this->mp_access_token_prod)) && $homolog_validate == 0) {
125
  if ($this->mp instanceof MP) {
126
- $homolog_validate = $this->mp->homologValidate($this->mp_access_token_prod);
 
127
  update_option('homolog_validate', $homolog_validate, true);
128
  return $homolog_validate;
129
  }
@@ -529,8 +530,11 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
529
  if (empty($mp_access_token_prod)) {
530
  return '';
531
  } else {
532
- $application_id = explode('-', $mp_access_token_prod);
533
- return $application_id[1];
 
 
 
534
  }
535
  }
536
 
123
  $homolog_validate = (int)get_option('homolog_validate', 0);
124
  if (($this->isProductionMode() && !empty($this->mp_access_token_prod)) && $homolog_validate == 0) {
125
  if ($this->mp instanceof MP) {
126
+ $homolog_validate = $this->mp->getCredentialsWrapper($this->mp_access_token_prod);
127
+ $homolog_validate = isset($homolog_validate['homologated']) && $homolog_validate['homologated'] == true ? 1 : 0;
128
  update_option('homolog_validate', $homolog_validate, true);
129
  return $homolog_validate;
130
  }
530
  if (empty($mp_access_token_prod)) {
531
  return '';
532
  } else {
533
+ $application_id = $this->mp->getCredentialsWrapper($this->mp_access_token_prod);
534
+ if (is_array($application_id) && isset($application_id['client_id'])) {
535
+ return $application_id['client_id'];
536
+ }
537
+ return '';
538
  }
539
  }
540
 
includes/payments/WC_WooMercadoPago_TicketGateway.php CHANGED
@@ -353,9 +353,11 @@ class WC_WooMercadoPago_TicketGateway extends WC_WooMercadoPago_PaymentAbstract
353
  public function payment_fields()
354
  {
355
  //add css
 
 
356
  wp_enqueue_style(
357
  'woocommerce-mercadopago-basic-checkout-styles',
358
- plugins_url('../assets/css/basic_checkout_mercadopago.css', plugin_dir_path(__FILE__))
359
  );
360
 
361
  $amount = $this->get_order_total();
353
  public function payment_fields()
354
  {
355
  //add css
356
+ $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
357
+
358
  wp_enqueue_style(
359
  'woocommerce-mercadopago-basic-checkout-styles',
360
+ plugins_url('../assets/css/basic_checkout_mercadopago' . $suffix . '.css', plugin_dir_path(__FILE__))
361
  );
362
 
363
  $amount = $this->get_order_total();
includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php CHANGED
@@ -66,40 +66,6 @@ abstract class WC_WooMercadoPago_Hook_Abstract
66
  }
67
  }
68
 
69
- /**
70
- * Analytics Save
71
- */
72
- public function send_settings_mp()
73
- {
74
- if (!empty($this->payment->getAccessToken()) && !empty($this->siteId)) {
75
- if (!$this->testUser) {
76
- $this->payment->mp->analytics_save_settings($this->define_settings_to_send());
77
- }
78
- }
79
- }
80
-
81
- /**
82
- * @return array
83
- */
84
- public function define_settings_to_send()
85
- {
86
- $infra_data = WC_WooMercadoPago_Module::get_common_settings();
87
- switch (get_class($this->payment)) {
88
- case 'WC_WooMercadoPago_BasicGateway':
89
- $infra_data['checkout_basic'] = ($this->payment->settings['enabled'] == 'yes' ? 'true' : 'false');
90
- break;
91
- case 'WC_WooMercadoPago_CustomGateway':
92
- $infra_data['checkout_custom_credit_card'] = ($this->payment->settings['enabled'] == 'yes' ? 'true' : 'false');
93
- $infra_data['checkout_custom_credit_card_coupon'] = ($this->payment->settings['coupon_mode'] == 'yes' ? 'true' : 'false');
94
- break;
95
- case 'WC_WooMercadoPago_TicketGateway':
96
- $infra_data['checkout_custom_ticket'] = ($this->payment->settings['enabled'] == 'yes' ? 'true' : 'false');
97
- $infra_data['checkout_custom_ticket_coupon'] = ($this->payment->settings['coupon_mode'] == 'yes' ? 'true' : 'false');
98
- break;
99
- }
100
- return $infra_data;
101
- }
102
-
103
  /**
104
  * @param $title
105
  * @return string
@@ -212,7 +178,6 @@ abstract class WC_WooMercadoPago_Hook_Abstract
212
  $this->payment->settings[$key] = $value;
213
  }
214
  }
215
- $this->send_settings_mp();
216
 
217
  $result = update_option($this->payment->get_option_key(), apply_filters('woocommerce_settings_api_sanitized_fields_' . $this->payment->id, $this->payment->settings));
218
 
@@ -272,24 +237,15 @@ abstract class WC_WooMercadoPago_Hook_Abstract
272
  return false;
273
  }
274
 
275
- if ($key == '_mp_public_key_prod' && strpos($value, 'APP_USR') === false) {
276
- update_option($key, '', true);
277
- return true;
278
- }
279
-
280
- if ($key == '_mp_public_key_test' && strpos($value, 'TEST') === false) {
281
  update_option($key, '', true);
 
282
  return true;
283
  }
284
 
285
- if (WC_WooMercadoPago_Credentials::public_key_is_valid($value) === false) {
286
  update_option($key, '', true);
287
-
288
- if ($key == '_mp_public_key_prod') {
289
- add_action('admin_notices', array($this, 'noticeInvalidPublicKeyProd'));
290
- } else {
291
- add_action('admin_notices', array($this, 'noticeInvalidPublicKeyTest'));
292
- }
293
  return true;
294
  }
295
 
@@ -309,12 +265,14 @@ abstract class WC_WooMercadoPago_Hook_Abstract
309
  return false;
310
  }
311
 
312
- if ($key == '_mp_access_token_prod' && strpos($value, 'APP_USR') === false) {
 
313
  update_option($key, '', true);
314
  return true;
315
  }
316
 
317
- if ($key == '_mp_access_token_test' && strpos($value, 'TEST') === false) {
 
318
  update_option($key, '', true);
319
  return true;
320
  }
@@ -327,7 +285,8 @@ abstract class WC_WooMercadoPago_Hook_Abstract
327
  update_option($key, $value, true);
328
 
329
  if ($key == '_mp_access_token_prod') {
330
- $homolog_validate = $this->mpInstance->homologValidate($value);
 
331
  update_option('homolog_validate', $homolog_validate, true);
332
  if ($isProduction == 'yes' && $homolog_validate == 0) {
333
  add_action('admin_notices', array($this, 'enablePaymentNotice'));
66
  }
67
  }
68
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  /**
70
  * @param $title
71
  * @return string
178
  $this->payment->settings[$key] = $value;
179
  }
180
  }
 
181
 
182
  $result = update_option($this->payment->get_option_key(), apply_filters('woocommerce_settings_api_sanitized_fields_' . $this->payment->id, $this->payment->settings));
183
 
237
  return false;
238
  }
239
 
240
+ if($key == '_mp_public_key_prod' && WC_WooMercadoPago_Credentials::validateCredentialsProd($this->mpInstance, null ,$value) == false) {
 
 
 
 
 
241
  update_option($key, '', true);
242
+ add_action('admin_notices', array($this, 'noticeInvalidPublicKeyProd'));
243
  return true;
244
  }
245
 
246
+ if($key == '_mp_public_key_test' && WC_WooMercadoPago_Credentials::validateCredentialsTest($this->mpInstance, null ,$value) == false) {
247
  update_option($key, '', true);
248
+ add_action('admin_notices', array($this, 'noticeInvalidPublicKeyTest'));
 
 
 
 
 
249
  return true;
250
  }
251
 
265
  return false;
266
  }
267
 
268
+ if ($key == '_mp_access_token_prod' && WC_WooMercadoPago_Credentials::validateCredentialsProd($this->mpInstance, $value, null) == false) {
269
+ add_action('admin_notices', array($this, 'noticeInvalidProdCredentials'));
270
  update_option($key, '', true);
271
  return true;
272
  }
273
 
274
+ if ($key == '_mp_access_token_test' && WC_WooMercadoPago_Credentials::validateCredentialsTest($this->mpInstance, $value, null) == false) {
275
+ add_action('admin_notices', array($this, 'noticeInvalidTestCredentials'));
276
  update_option($key, '', true);
277
  return true;
278
  }
285
  update_option($key, $value, true);
286
 
287
  if ($key == '_mp_access_token_prod') {
288
+ $homolog_validate = $this->mpInstance->getCredentialsWrapper($value);
289
+ $homolog_validate = isset($homolog_validate['homologated']) && $homolog_validate['homologated'] == true? 1 : 0;
290
  update_option('homolog_validate', $homolog_validate, true);
291
  if ($isProduction == 'yes' && $homolog_validate == 0) {
292
  add_action('admin_notices', array($this, 'enablePaymentNotice'));
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: ecommerce, mercadopago, woocommerce
4
  Requires at least: 4.9.10
5
  Tested up to: 5.5
6
  Requires PHP: 5.6
7
- Stable tag: 4.4.0
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -12,61 +12,62 @@ Offer to your clients the best experience in e-Commerce by using Mercado Pago as
12
 
13
  == Description ==
14
 
15
- Mercado Pago leads the technological transformation of finance in Latin America and develops tools to take its collections to another level. Integrate a payment avenue in your website with our official WooCommerce plugin. With out checkout options you can offer the payment methods that everyone prefers, with the best possible financing: purchases in up to 24 installments, credit and debit cards, in-person payments and money in the Mercado Pago account.
16
 
17
- = Why choose Mercado Pago? =
18
 
19
- We operate in Argentina, Brazil, Mexico, Peru, Chile, Uruguay and Colombia with businesses of all sizes. They choose us, from entrepreneurs who are just beginning to consolidated big brands in the market.
 
 
 
 
 
 
 
20
 
21
- We process more than 6 million transactions with Visa and Mastercard cards every year and we do so protecting your money, always. Accept payments with the most used cards and offer installments with the best possible financing. With our ready-to-use solutions, going further is in your hands.
22
 
23
- You can trust us as you trust a strategic partner. Use the money from your sales once it is available in your Mercado Pago account, with our prepaid card, or withdraw it to your bank at no additional cost. View our fees and have the money from your sales instantly.
 
24
 
25
- = Main Functionalities of Mercado Pago =
26
- * Processing via IPN / Webhook online and in real time;
27
- * High approval rates thanks to a robust fraud analysis;
28
- * Potential clients: more than 120 million users in Latin America trust us;
29
- * Sandbox test environment;
30
- * Log and debug options;
31
- * PCI level 1 Certification;
32
- * Accept the payment methods everyone prefers;
33
- * Installment payments;
34
- * Payments in advance from 2 to 14 business days, according to our Terms and Conditions;
35
- * One-click payments with the basic and personalized Mercado Pago checkouts;
36
- * Payments via tickets (Boletos);
37
- * Seller Protection Program.
38
-
39
- = Compatibility =
40
- - WooCommerce 3.0 or higher.
41
 
42
  == Screenshots ==
43
 
44
- 1. `High approval rates.`
45
- 2. `Your money available instantly.`
46
- 3. `All payment methods.`
47
- 4. `You do not need to write a single line of code to receive payments.`
48
- 5. `01 Create an account in Mercado Pago.`
49
- 6. `02 Activate the module in your store.`
50
- 7. `03 Receive the money from your sales.`
51
 
52
  == Frequently Asked Questions ==
53
 
54
- = How do we protect the sellers =
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
 
56
- We take care of the money with maximum security
57
- We help you in case of problems
58
- We protect your sales against chargebacks
59
 
60
- = Where can I find the documentation? =
61
 
62
- Check out our official documentation for installing and configuring the Mercado Pago plugin in your store.
63
 
64
- = Where and how can I contribute? =
65
 
66
- Suggest documentation improvement on [our website](https://www.mercadopago.com.br/developers/es/plugins_sdks/plugins/official/woo-commerce/) for integrators and developers,
67
- Subscribe to the [development log](https://plugins.trac.wordpress.org/log/woocommerce-mercadopago/) by [RSS](https://plugins.trac.wordpress.org/log/woocommerce-mercadopago/?limit=100&mode=stop_on_copy&format=rss),
68
- [Review the code](https://plugins.trac.wordpress.org/browser/woocommerce-mercadopago/) and visit the [SVN repository](https://plugins.svn.wordpress.org/woocommerce-mercadopago/),
69
- Help us translate WordPress: [Translate](https://translate.wordpress.org/projects/wp-plugins/woocommerce-mercadopago/) the plugin for your country.
70
 
71
  == Installation ==
72
 
@@ -115,11 +116,27 @@ 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.4.0 (21/09/2020) =
119
  * Features
120
  - Compatibility with WooCommerce v4.5.x
121
 
122
- * Bug fixes
123
  - Adjusted error when shipping is not used
124
 
125
  = v4.3.1 (10/09/2020) =
4
  Requires at least: 4.9.10
5
  Tested up to: 5.5
6
  Requires PHP: 5.6
7
+ Stable tag: 4.5.0
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
12
 
13
  == Description ==
14
 
15
+ The official Mercado Pago plugin allows you to process payments for your online store, allowing users to finalize their purchase with their preferred payment method.
16
 
17
+ To install it, **you don't need to have technical knowledge:** you can follow the [step by step of how to integrate it](https://www.mercadopago.com.ar/developers/es/guides/plugins/woocommerce/introduction/). from our developer website and start selling today.
18
 
19
+ ### What to do with the Mercado Pago Plugin?
20
+ * Activate **Checkout Pro** to offer logged-in payments with money in Mercado Pago account, saved cards and off means.
21
+ * Offer payments without the need of having a Mercado Pago account, through the **Custom Checkout** for cards and off means (cash or bank transfer).
22
+ * Automatically convert the currency of your products: from Mexican pesos to U.S. dollars and vice versa.
23
+ * Sell in **installments** and offer the current promotions in Checkout Pro or apply your own discount coupon in Custom Checkout.
24
+ * Test your store before going into production with our Sandbox environment.
25
+ * **Receive the money** from your sales on the same day.
26
+ * **IMPORTANT:** At the moment the Mercado Envíos service is deactivated.
27
 
28
+ ### Adapted to your business
29
 
30
+ Prepared for any type of store and category: electronics, clothing, kitchen, bazaar, whatever you want!
31
+ Just focus on selling and **we'll take care of the security:** keep your store's payments protected with our fraud prevention and analysis tool.
32
 
33
+ Boost your sales with Mercado Pago payments for WooCommerce!
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
 
35
  == Screenshots ==
36
 
37
+ 1. RECEIVE THE MONEY FROM YOUR SALES ON THE SAME DAY
38
+ 2. This is what the Checkout Pro looks like in your store. You can choose between a modal experience or a redirect experience.
39
+ 3. This is what the Customized Checkout looks like in your store. You can activate payments with cards and also cash.
40
+ 4. Once you install the Mercado Pago Plugin, you will find the 3 checkouts available in the Payment settings in WooCommerce. You can activate them simultaneously or choose one of them. Remember that they must be configured before enabling them.
41
+ 5. To configure it, follow the step by step indicated in each Checkout. Remember that you can review the official documentation of our plugin on the Mercado Pago developer website.
42
+ 6. ACCEPT ALL PAYMENT METHODS
 
43
 
44
  == Frequently Asked Questions ==
45
 
46
+ = I had a question during setup, where can I check the documentation? =
47
+
48
+ In our developer website you will find the step by step of [how to integrate the Mercado Pago Plugin](https://www.mercadopago.com.ar/developers/es/guides/plugins/woocommerce/introduction/) in your online store.
49
+
50
+ = What are the requirements for the plugin to work properly? =
51
+
52
+ You must have an SSL certificate, connecting your website with the HTTPS protocol.
53
+
54
+ If you need to check the protocol configuration, [test it here](https://www.ssllabs.com/ssltest/).
55
+
56
+ Finally, remember that the plugin receives IPN (Instant Payment Notification) notifications automatically, you don't need to configure it!
57
+
58
+ = I already finished the configuration but the Sandbox environment is not working. =
59
+
60
+ Remember that to test the Checkout Pro you must log out of your Mercado Pago account, as it is not possible to use it to sell and buy at the same time.
61
 
62
+ Please note that with the Test Environment enabled, the Checkout Pro does not send notifications as does the Custom Checkout.
 
 
63
 
64
+ = How do I configure the sending of emails to my customers? =
65
 
66
+ The configuration of sending emails must be done from the WooCommerce administrator. The Mercado Pago Plugin only contemplates sending transactions made in the Checkout Pro.
67
 
68
+ = I reviewed the documentation and these FAQs but still have problems in my store, what can I do? =
69
 
70
+ If you have already reviewed the documentation and have not found a solution, you can contact our support team through their [contact form](https://www.mercadopago.com.ar/developers/es/support/). Please note that we guarantee a response within {7 days} of your query.
 
 
 
71
 
72
  == Installation ==
73
 
116
  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.
117
 
118
  == Changelog ==
119
+ = v4.5.0 (26/10/2020) =
120
+ * Features
121
+ - Compatibility with WooCommerce v4.6.x
122
+ - Improved security (added access token in the header for all calls to Mercado Livre and Mercado Pago endpoints)
123
+ - Add new endpoint to validate Access Token and Public key to substitute old process to validation
124
+ - Improved performance with CSS minification
125
+
126
+ * Bug fixes
127
+ - Fixed conflict with wc-api webhook and Mercado Pago webhook/IPN.
128
+ - Fixed alert in currency conversion
129
+ - Fixed tranlate in currency conversion
130
+ - Bug fixed when updating orders that have two or more payments associated.
131
+
132
+ * Bug fixes
133
+ - Fixed conflict with wc-api webhook and Mercado Pago webhook/IPN.
134
+
135
  = v4.4.0 (21/09/2020) =
136
  * Features
137
  - Compatibility with WooCommerce v4.5.x
138
 
139
+ * Bug fixes
140
  - Adjusted error when shipping is not used
141
 
142
  = v4.3.1 (10/09/2020) =
woocommerce-mercadopago.php CHANGED
@@ -4,13 +4,13 @@
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.4.0
8
  * Author: Mercado Pago
9
  * Author URI: https://developers.mercadopago.com/
10
  * Text Domain: woocommerce-mercadopago
11
  * Domain Path: /i18n/languages/
12
  * WC requires at least: 3.0.0
13
- * WC tested up to: 4.5.0
14
  * @package MercadoPago
15
  * @category Core
16
  * @author Mercado Pago
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.5.0
8
  * Author: Mercado Pago
9
  * Author URI: https://developers.mercadopago.com/
10
  * Text Domain: woocommerce-mercadopago
11
  * Domain Path: /i18n/languages/
12
  * WC requires at least: 3.0.0
13
+ * WC tested up to: 4.6.0
14
  * @package MercadoPago
15
  * @category Core
16
  * @author Mercado Pago