Version Description
Download this release
Release Info
Developer | mercadopago |
Plugin | WooCommerce MercadoPago |
Version | 4.2.0 |
Comparing to | |
See all releases |
Code changes from version 4.1.1 to 4.2.0
- assets/css/admin_notice_mercadopago.css +18 -0
- assets/css/basic_checkout_mercadopago.css +4 -0
- assets/css/config_mercadopago.css +0 -20
- assets/js/basic-cho.js +7 -7
- assets/js/basic-cho.min.js +1 -0
- assets/js/basic_config_mercadopago.js +219 -214
- assets/js/basic_config_mercadopago.min.js +1 -0
- assets/js/credit-card.js +800 -735
- assets/js/credit-card.min.js +1 -0
- assets/js/custom_config_mercadopago.js +72 -81
- assets/js/custom_config_mercadopago.min.js +1 -0
- assets/js/ticket.js +267 -186
- assets/js/ticket.min.js +1 -0
- assets/js/ticket_config_mercadopago.js +94 -92
- assets/js/ticket_config_mercadopago.min.js +1 -0
- i18n/languages/woocommerce-mercadopago-es_AR.mo +0 -0
- i18n/languages/woocommerce-mercadopago-es_AR.po +71 -39
- i18n/languages/woocommerce-mercadopago-es_CL.mo +0 -0
- i18n/languages/woocommerce-mercadopago-es_CL.po +69 -37
- i18n/languages/woocommerce-mercadopago-es_CO.mo +0 -0
- i18n/languages/woocommerce-mercadopago-es_CO.po +69 -37
- i18n/languages/woocommerce-mercadopago-es_ES.mo +0 -0
- i18n/languages/woocommerce-mercadopago-es_ES.po +69 -37
- i18n/languages/woocommerce-mercadopago-es_MX.mo +0 -0
- i18n/languages/woocommerce-mercadopago-es_MX.po +69 -37
- i18n/languages/woocommerce-mercadopago-es_PE.mo +0 -0
- i18n/languages/woocommerce-mercadopago-es_PE.po +69 -37
- i18n/languages/woocommerce-mercadopago-es_UY.mo +0 -0
- i18n/languages/woocommerce-mercadopago-es_UY.po +69 -37
- i18n/languages/woocommerce-mercadopago-es_VE.mo +0 -0
- i18n/languages/woocommerce-mercadopago-es_VE.po +69 -37
- i18n/languages/woocommerce-mercadopago-pt_BR.mo +0 -0
- i18n/languages/woocommerce-mercadopago-pt_BR.po +71 -39
- i18n/languages/woocommerce-mercadopago.pot +54 -23
- includes/admin/notices/WC_WooMercadoPago_Notices.php +142 -0
- includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php +2 -2
- includes/module/WC_WooMercadoPago_Configs.php +5 -29
- includes/module/WC_WooMercadoPago_Credentials.php +52 -20
- includes/module/WC_WooMercadoPago_Module.php +108 -42
- includes/module/config/WC_WooMercadoPago_Constants.php +1 -1
- includes/module/preference/WC_WooMercadoPago_PreferenceAbstract.php +56 -11
- includes/module/preference/WC_WooMercadoPago_PreferenceBasic.php +5 -5
- includes/module/preference/WC_WooMercadoPago_PreferenceTicket.php +15 -0
- includes/module/sdk/lib/MP.php +1 -1
- includes/module/sdk/lib/RestClient/AbstractRestClient.php +2 -1
- includes/notification/WC_WooMercadoPago_Notification_Abstract.php +40 -25
- includes/notification/WC_WooMercadoPago_Notification_IPN.php +15 -12
- includes/notification/WC_WooMercadoPago_Notification_Webhook.php +19 -16
- includes/payments/WC_WooMercadoPago_BasicGateway.php +30 -14
- includes/payments/WC_WooMercadoPago_CustomGateway.php +15 -8
- includes/payments/WC_WooMercadoPago_PaymentAbstract.php +69 -17
- includes/payments/WC_WooMercadoPago_TicketGateway.php +44 -16
- includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php +38 -7
- includes/payments/hooks/WC_WooMercadoPago_Hook_Custom.php +8 -2
- includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php +8 -1
- readme.txt +34 -3
- templates/checkout/basic_checkout.php +8 -8
- templates/checkout/custom_checkout.php +30 -19
- templates/checkout/ticket_checkout.php +52 -25
- woocommerce-mercadopago.php +83 -57
assets/css/admin_notice_mercadopago.css
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.mp-alert-frame {
|
2 |
+
align-items: center;
|
3 |
+
display: inline-flex;
|
4 |
+
justify-content: center;
|
5 |
+
justify-items: center;
|
6 |
+
}
|
7 |
+
|
8 |
+
.mp-left-alert {
|
9 |
+
padding-top: 5px;
|
10 |
+
}
|
11 |
+
|
12 |
+
.mp-left-alert img {
|
13 |
+
max-width: 150px;
|
14 |
+
}
|
15 |
+
|
16 |
+
.mp-right-alert {
|
17 |
+
padding-top: 0px;
|
18 |
+
}
|
assets/css/basic_checkout_mercadopago.css
CHANGED
@@ -565,6 +565,10 @@
|
|
565 |
display: none;
|
566 |
}
|
567 |
|
|
|
|
|
|
|
|
|
568 |
.mp-discount {
|
569 |
border-style: solid;
|
570 |
border-width: thin;
|
565 |
display: none;
|
566 |
}
|
567 |
|
568 |
+
#mp-card-holder-div {
|
569 |
+
display: none;
|
570 |
+
}
|
571 |
+
|
572 |
.mp-discount {
|
573 |
border-style: solid;
|
574 |
border-width: thin;
|
assets/css/config_mercadopago.css
CHANGED
@@ -328,26 +328,6 @@
|
|
328 |
display: none;
|
329 |
}
|
330 |
|
331 |
-
|
332 |
-
.mp-alert-frame {
|
333 |
-
align-items: center;
|
334 |
-
display: inline-flex;
|
335 |
-
justify-content: center;
|
336 |
-
justify-items: center;
|
337 |
-
}
|
338 |
-
|
339 |
-
.mp-left-alert {
|
340 |
-
padding-top: 5px;
|
341 |
-
}
|
342 |
-
|
343 |
-
.mp-left-alert img {
|
344 |
-
max-width: 150px;
|
345 |
-
}
|
346 |
-
|
347 |
-
.mp-right-alert {
|
348 |
-
padding-top: 0px;
|
349 |
-
}
|
350 |
-
|
351 |
.mp_title_header {
|
352 |
font-family: sans-serif;
|
353 |
font-size: 22px !important;
|
328 |
display: none;
|
329 |
}
|
330 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
331 |
.mp_title_header {
|
332 |
font-family: sans-serif;
|
333 |
font-size: 22px !important;
|
assets/js/basic-cho.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
(function () {
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
}
|
8 |
}
|
9 |
-
}
|
|
1 |
(function () {
|
2 |
+
if (document.getElementById('payment') !== undefined && document.getElementById('payment').offsetWidth <= 530) {
|
3 |
+
var framePayments = document.querySelectorAll('#framePayments');
|
4 |
+
for (var i = 0; i < framePayments.length; i++) {
|
5 |
+
framePayments[i].className = '';
|
6 |
+
framePayments[i].classList.add('mp-col-md-12');
|
|
|
7 |
}
|
8 |
+
}
|
9 |
+
})();
|
assets/js/basic-cho.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(){if(void 0!==document.getElementById("payment")&&document.getElementById("payment").offsetWidth<=530)for(var e=document.querySelectorAll("#framePayments"),t=0;t<e.length;t++)e[t].className="",e[t].classList.add("mp-col-md-12")}();
|
assets/js/basic_config_mercadopago.js
CHANGED
@@ -1,246 +1,251 @@
|
|
1 |
-
|
2 |
-
//remove link breadcrumb, header and save button
|
3 |
-
document.querySelector(".wc-admin-breadcrumb").style.display = 'none';
|
4 |
-
document.querySelector(".mp-header-logo").style.display = 'none';
|
5 |
-
document.querySelector("#_wpnonce").parentElement.style.display = 'none';
|
6 |
-
document.querySelectorAll("h2")[4].style.display = 'none';
|
7 |
-
|
8 |
-
|
9 |
-
var descriptionInput = document.querySelectorAll("p.description");
|
10 |
-
for (var i = 0; i < descriptionInput.length; i++) {
|
11 |
-
descriptionInput[i].style.width = '420px';
|
12 |
-
}
|
13 |
-
|
14 |
-
//update form_fields label
|
15 |
-
var label = document.querySelectorAll("th.titledesc");
|
16 |
-
for (var i = 0; i < label.length; i++) {
|
17 |
-
label[i].id = "mp_field_text";
|
18 |
-
if (label[i].children[0].children[0] != null) {
|
19 |
-
label[i].children[0].children[0].style.position = 'relative';
|
20 |
-
label[i].children[0].children[0].style.fontSize = '22px';
|
21 |
-
}
|
22 |
-
}
|
23 |
-
|
24 |
-
//collpase ajustes avanzados
|
25 |
-
var table = document.querySelectorAll(".form-table");
|
26 |
-
for (i = 0; i < table.length; i++) {
|
27 |
-
table[i].id = "mp_table_" + i;
|
28 |
-
}
|
29 |
-
|
30 |
-
// Remove title and description label necessary for custom
|
31 |
-
document.querySelector(".hidden-field-mp-title").setAttribute("type", "hidden");
|
32 |
-
document.querySelector(".hidden-field-mp-desc").setAttribute("type", "hidden");
|
33 |
-
var removeLabel = document.querySelectorAll("#mp_table_0");
|
34 |
-
removeLabel[0].children[0].children[0].style.display = 'none';
|
35 |
-
removeLabel[0].children[0].children[1].style.display = 'none';
|
36 |
-
|
37 |
-
//clone save button
|
38 |
-
var cloneSaveButton = document.getElementById('woocommerce_woo-mercado-pago-basic_checkout_btn_save');
|
39 |
-
if (document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_homolog_title") != undefined || document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_credential_description_prod") != undefined) {
|
40 |
-
document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_credential_description_prod").nextElementSibling.append(cloneSaveButton.cloneNode(true));
|
41 |
-
}
|
42 |
-
|
43 |
-
if (document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_homolog_title") != undefined || document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_options_title") != undefined) {
|
44 |
-
|
45 |
-
document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_advanced_settings").nextElementSibling.append(cloneSaveButton.cloneNode(true));
|
46 |
-
document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_options_subtitle").nextElementSibling.append(cloneSaveButton.cloneNode(true));
|
47 |
-
document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_payments_description").nextElementSibling.append(cloneSaveButton.cloneNode(true));
|
48 |
-
document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_payments_advanced_description").nextElementSibling.append(cloneSaveButton.cloneNode(true));
|
49 |
-
|
50 |
-
var collapse_title = document.querySelector("#woocommerce_woo-mercado-pago-basic_checkout_advanced_settings");
|
51 |
-
var collapse_table = collapse_title.nextElementSibling;
|
52 |
-
collapse_table.style.display = "none";
|
53 |
-
collapse_title.style.cursor = "pointer";
|
54 |
-
|
55 |
-
collapse_title.innerHTML += "<span class='mp-btn-collapsible' id='header_plus' style='display:block'>+</span>\
|
56 |
-
<span class='mp-btn-collapsible' id='header_less' style='display:none'>-</span>";
|
57 |
-
|
58 |
-
var header_plus = document.querySelector("#header_plus");
|
59 |
-
var header_less = document.querySelector("#header_less");
|
60 |
-
|
61 |
-
collapse_title.onclick = function () {
|
62 |
-
if (collapse_table.style.display == "none") {
|
63 |
-
collapse_table.style.display = "block";
|
64 |
-
header_less.style.display = "block";
|
65 |
-
header_plus.style.display = "none";
|
66 |
-
}
|
67 |
-
else {
|
68 |
-
collapse_table.style.display = "none";
|
69 |
-
header_less.style.display = "none";
|
70 |
-
header_plus.style.display = "block";
|
71 |
-
}
|
72 |
-
}
|
73 |
|
74 |
-
|
75 |
-
var
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
collapse_description_2.style.display = "none";
|
80 |
-
collapse_title_2.style.cursor = "pointer";
|
81 |
|
82 |
-
|
83 |
-
|
|
|
|
|
|
|
84 |
|
85 |
-
var header_plus_2 = document.querySelector("#header_plus_2");
|
86 |
-
var header_less_2 = document.querySelector("#header_less_2");
|
87 |
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
collapse_description_2.style.display = "block";
|
92 |
-
header_less_2.style.display = "block";
|
93 |
-
header_plus_2.style.display = "none";
|
94 |
-
}
|
95 |
-
else {
|
96 |
-
collapse_table_2.style.display = "none";
|
97 |
-
collapse_description_2.style.display = "none";
|
98 |
-
header_less_2.style.display = "none";
|
99 |
-
header_plus_2.style.display = "block";
|
100 |
-
}
|
101 |
}
|
102 |
|
103 |
-
//
|
104 |
-
var
|
105 |
-
var
|
106 |
-
|
107 |
-
|
|
|
|
|
|
|
108 |
}
|
109 |
|
110 |
-
//
|
111 |
-
var
|
112 |
-
var
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
}
|
119 |
-
}
|
120 |
|
121 |
-
|
122 |
-
|
123 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
<label for=
|
129 |
-
<input type=
|
130 |
-
|
131 |
</label>\
|
132 |
-
</div>
|
133 |
-
|
134 |
-
|
|
|
135 |
}
|
136 |
-
}
|
137 |
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
var
|
144 |
-
|
145 |
-
|
|
|
|
|
146 |
}
|
147 |
-
}
|
148 |
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
<label for=
|
157 |
-
<input type=
|
158 |
-
|
159 |
</label>\
|
160 |
-
</div>
|
161 |
-
|
162 |
-
|
|
|
163 |
}
|
164 |
-
}
|
165 |
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
var
|
172 |
-
|
173 |
-
|
|
|
|
|
174 |
}
|
175 |
-
}
|
176 |
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
<label for=
|
185 |
-
<input type=
|
186 |
-
|
187 |
</label>\
|
188 |
-
</div>
|
189 |
-
|
190 |
-
|
|
|
191 |
}
|
192 |
}
|
193 |
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
behavior: "smooth"
|
201 |
});
|
202 |
-
});
|
203 |
-
}
|
204 |
-
}
|
205 |
-
|
206 |
-
//Online payments
|
207 |
-
function completeOnlineCheckbox() {
|
208 |
-
var onlineCheck = document.getElementById("checkmeon").checked;
|
209 |
-
var onlineInputs = document.querySelectorAll(".online_payment_method");
|
210 |
-
for (var i = 0; i < onlineInputs.length; i++) {
|
211 |
-
if (onlineCheck == true) {
|
212 |
-
onlineInputs[i].checked = true;
|
213 |
-
}
|
214 |
-
else {
|
215 |
-
onlineInputs[i].checked = false;
|
216 |
}
|
217 |
-
}
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
}
|
231 |
-
}
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
|
|
|
|
|
|
241 |
}
|
242 |
-
|
243 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
244 |
}
|
245 |
-
}
|
246 |
-
}
|
1 |
+
/*jshint multistr: true */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
+
window.onload = function () {
|
4 |
+
var makeCollapsibleOptions = function (id_plus, id_less) {
|
5 |
+
return '<span class="mp-btn-collapsible" id="' + id_plus + '" style="display:block">+</span>\
|
6 |
+
<span class="mp-btn-collapsible" id="'+ id_less + '" style="display:none">-</span>';
|
7 |
+
};
|
|
|
|
|
8 |
|
9 |
+
//remove link breadcrumb, header and save button
|
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');
|
17 |
+
for (var i = 0; i < descriptionInput.length; i++) {
|
18 |
+
descriptionInput[i].style.width = '420px';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
}
|
20 |
|
21 |
+
//update form_fields label
|
22 |
+
var label = document.querySelectorAll('th.titledesc');
|
23 |
+
for (var j = 0; j < label.length; j++) {
|
24 |
+
label[j].id = 'mp_field_text';
|
25 |
+
if (label[j].children[0].children[0] != null) {
|
26 |
+
label[j].children[0].children[0].style.position = 'relative';
|
27 |
+
label[j].children[0].children[0].style.fontSize = '22px';
|
28 |
+
}
|
29 |
}
|
30 |
|
31 |
+
//collpase ajustes avanzados
|
32 |
+
var table = document.querySelectorAll('.form-table');
|
33 |
+
for (var k = 0; k < table.length; k++) {
|
34 |
+
table[k].id = 'mp_table_' + k;
|
35 |
+
}
|
36 |
+
|
37 |
+
// Remove title and description label necessary for custom
|
38 |
+
document.querySelector('.hidden-field-mp-title').setAttribute('type', 'hidden');
|
39 |
+
document.querySelector('.hidden-field-mp-desc').setAttribute('type', 'hidden');
|
40 |
+
var removeLabel = document.querySelectorAll('#mp_table_0');
|
41 |
+
removeLabel[0].children[0].children[0].style.display = 'none';
|
42 |
+
removeLabel[0].children[0].children[1].style.display = 'none';
|
43 |
+
|
44 |
+
//clone save button
|
45 |
+
var cloneSaveButton = document.getElementById('woocommerce_woo-mercado-pago-basic_checkout_btn_save');
|
46 |
+
if (document.getElementById('woocommerce_woo-mercado-pago-basic_checkout_homolog_title') !== null || document.getElementById('woocommerce_woo-mercado-pago-basic_checkout_credential_description_prod') !== null) {
|
47 |
+
document.getElementById('woocommerce_woo-mercado-pago-basic_checkout_credential_description_prod').nextElementSibling.append(cloneSaveButton.cloneNode(true));
|
48 |
+
}
|
49 |
+
|
50 |
+
if (document.getElementById('woocommerce_woo-mercado-pago-basic_checkout_homolog_title') !== null || document.getElementById('woocommerce_woo-mercado-pago-basic_checkout_options_title') !== null) {
|
51 |
+
|
52 |
+
document.getElementById('woocommerce_woo-mercado-pago-basic_checkout_advanced_settings').nextElementSibling.append(cloneSaveButton.cloneNode(true));
|
53 |
+
document.getElementById('woocommerce_woo-mercado-pago-basic_checkout_options_subtitle').nextElementSibling.append(cloneSaveButton.cloneNode(true));
|
54 |
+
document.getElementById('woocommerce_woo-mercado-pago-basic_checkout_payments_description').nextElementSibling.append(cloneSaveButton.cloneNode(true));
|
55 |
+
document.getElementById('woocommerce_woo-mercado-pago-basic_checkout_payments_advanced_description').nextElementSibling.append(cloneSaveButton.cloneNode(true));
|
56 |
+
|
57 |
+
var collapse_title = document.querySelector('#woocommerce_woo-mercado-pago-basic_checkout_advanced_settings');
|
58 |
+
var collapse_table = collapse_title.nextElementSibling;
|
59 |
+
collapse_table.style.display = 'none';
|
60 |
+
collapse_title.style.cursor = 'pointer';
|
61 |
+
|
62 |
+
collapse_title.innerHTML += makeCollapsibleOptions('header_plus', 'header_less');
|
63 |
+
|
64 |
+
var header_plus = document.querySelector('#header_plus');
|
65 |
+
var header_less = document.querySelector('#header_less');
|
66 |
+
|
67 |
+
collapse_title.onclick = function () {
|
68 |
+
if (collapse_table.style.display === 'none') {
|
69 |
+
collapse_table.style.display = 'block';
|
70 |
+
header_less.style.display = 'block';
|
71 |
+
header_plus.style.display = 'none';
|
72 |
+
} else {
|
73 |
+
collapse_table.style.display = 'none';
|
74 |
+
header_less.style.display = 'none';
|
75 |
+
header_plus.style.display = 'block';
|
76 |
+
}
|
77 |
+
};
|
78 |
+
|
79 |
+
//collpase Configuración Avanzada
|
80 |
+
var collapse_title_2 = document.querySelector('#woocommerce_woo-mercado-pago-basic_checkout_payments_advanced_title');
|
81 |
+
var collapse_table_2 = document.querySelector('#woocommerce_woo-mercado-pago-basic_checkout_payments_advanced_description').nextElementSibling;
|
82 |
+
var collapse_description_2 = document.querySelector('#woocommerce_woo-mercado-pago-basic_checkout_payments_advanced_description');
|
83 |
+
collapse_table_2.style.display = 'none';
|
84 |
+
collapse_description_2.style.display = 'none';
|
85 |
+
collapse_title_2.style.cursor = 'pointer';
|
86 |
+
|
87 |
+
collapse_title_2.innerHTML += makeCollapsibleOptions('header_plus_2', 'header_less_2');
|
88 |
+
|
89 |
+
var header_plus_2 = document.querySelector('#header_plus_2');
|
90 |
+
var header_less_2 = document.querySelector('#header_less_2');
|
91 |
+
|
92 |
+
collapse_title_2.onclick = function () {
|
93 |
+
if (collapse_table_2.style.display === 'none') {
|
94 |
+
collapse_table_2.style.display = 'block';
|
95 |
+
collapse_description_2.style.display = 'block';
|
96 |
+
header_less_2.style.display = 'block';
|
97 |
+
header_plus_2.style.display = 'none';
|
98 |
+
}
|
99 |
+
else {
|
100 |
+
collapse_table_2.style.display = 'none';
|
101 |
+
collapse_description_2.style.display = 'none';
|
102 |
+
header_less_2.style.display = 'none';
|
103 |
+
header_plus_2.style.display = 'block';
|
104 |
+
}
|
105 |
+
};
|
106 |
+
|
107 |
+
//payment methods
|
108 |
+
var tablePayments = document.querySelector('#woocommerce_woo-mercado-pago-basic_checkout_payments_description').nextElementSibling.getAttribute('class');
|
109 |
+
var mp_input_payments = document.querySelectorAll('.' + tablePayments + ' td.forminp label');
|
110 |
+
for (i = 0; i < mp_input_payments.length; i++) {
|
111 |
+
mp_input_payments[i].id = 'mp_input_payments_mt';
|
112 |
}
|
|
|
113 |
|
114 |
+
//online payments
|
115 |
+
var online_payment_translate = '';
|
116 |
+
var onlineChecked = '';
|
117 |
+
var countOnlineChecked = 0;
|
118 |
+
var onlineInputs = document.querySelectorAll('.online_payment_method');
|
119 |
+
for (var ion = 0; ion < onlineInputs.length; ion++) {
|
120 |
+
online_payment_translate = onlineInputs[ion].getAttribute('data-translate');
|
121 |
+
if (onlineInputs[ion].checked === true) {
|
122 |
+
countOnlineChecked += 1;
|
123 |
+
}
|
124 |
+
}
|
125 |
+
|
126 |
+
if (countOnlineChecked === onlineInputs.length) {
|
127 |
+
onlineChecked = 'checked';
|
128 |
+
}
|
129 |
|
130 |
+
for (var oni = 0; oni < onlineInputs.length; oni++) {
|
131 |
+
if (oni === 0) {
|
132 |
+
var checkbox_online_prepend = '<div class="all_checkbox">\
|
133 |
+
<label for="checkmeon" id="mp_input_payments">\
|
134 |
+
<input type="checkbox" name="checkmeon" id="checkmeon" '+ onlineChecked + ' onclick="completeOnlineCheckbox()">\
|
135 |
+
'+ online_payment_translate + '\
|
136 |
</label>\
|
137 |
+
</div>';
|
138 |
+
onlineInputs[oni].parentElement.insertAdjacentHTML('beforebegin', checkbox_online_prepend);
|
139 |
+
break;
|
140 |
+
}
|
141 |
}
|
|
|
142 |
|
143 |
+
//debit and prepaid payments
|
144 |
+
var debit_payment_translate = '';
|
145 |
+
var debitChecked = '';
|
146 |
+
var countDebitChecked = 0;
|
147 |
+
var debitInputs = document.querySelectorAll('.debit_payment_method');
|
148 |
+
for (var ideb = 0; ideb < debitInputs.length; ideb++) {
|
149 |
+
debit_payment_translate = debitInputs[ideb].getAttribute('data-translate');
|
150 |
+
if (debitInputs[ideb].checked === true) {
|
151 |
+
countDebitChecked += 1;
|
152 |
+
}
|
153 |
}
|
|
|
154 |
|
155 |
+
if (countDebitChecked === debitInputs.length) {
|
156 |
+
debitChecked = 'checked';
|
157 |
+
}
|
158 |
|
159 |
+
for (var debi = 0; debi < debitInputs.length; debi++) {
|
160 |
+
if (debi === 0) {
|
161 |
+
var checkbox_debit_prepend = '<div class="all_checkbox">\
|
162 |
+
<label for="checkmedeb" id="mp_input_payments">\
|
163 |
+
<input type="checkbox" name="checkmedeb" id="checkmedeb" ' + debitChecked + ' onclick="completeDebitCheckbox()">\
|
164 |
+
'+ debit_payment_translate + '\
|
165 |
</label>\
|
166 |
+
</div>';
|
167 |
+
debitInputs[debi].parentElement.insertAdjacentHTML('beforebegin', checkbox_debit_prepend);
|
168 |
+
break;
|
169 |
+
}
|
170 |
}
|
|
|
171 |
|
172 |
+
//offline payments configuration form
|
173 |
+
var offline_payment_translate = '';
|
174 |
+
var offlineChecked = '';
|
175 |
+
var countOfflineChecked = 0;
|
176 |
+
var offlineInputs = document.querySelectorAll('.offline_payment_method');
|
177 |
+
for (var ioff = 0; ioff < offlineInputs.length; ioff++) {
|
178 |
+
offline_payment_translate = offlineInputs[ioff].getAttribute(['data-translate']);
|
179 |
+
if (offlineInputs[ioff].checked === true) {
|
180 |
+
countOfflineChecked += 1;
|
181 |
+
}
|
182 |
}
|
|
|
183 |
|
184 |
+
if (countOfflineChecked === offlineInputs.length) {
|
185 |
+
offlineChecked = 'checked';
|
186 |
+
}
|
187 |
|
188 |
+
for (var offi = 0; offi < offlineInputs.length; offi++) {
|
189 |
+
if (offi === 0) {
|
190 |
+
var checkbox_offline_prepend = '<div class="all_checkbox">\
|
191 |
+
<label for="checkmeoff" id="mp_input_payments" style="margin-bottom: 37px !important;">\
|
192 |
+
<input type="checkbox" name="checkmeoff" id="checkmeoff" '+ offlineChecked + ' onclick="completeOfflineCheckboxMP()">\
|
193 |
+
'+ offline_payment_translate + '\
|
194 |
</label>\
|
195 |
+
</div>';
|
196 |
+
offlineInputs[offi].parentElement.insertAdjacentHTML('beforebegin', checkbox_offline_prepend);
|
197 |
+
break;
|
198 |
+
}
|
199 |
}
|
200 |
}
|
201 |
|
202 |
+
if (document.querySelector('.homologScroll') != null) {
|
203 |
+
document.querySelector('.homologScroll').addEventListener('click', function () {
|
204 |
+
document.querySelector('#woocommerce_woo-mercado-pago-basic__mp_access_token_prod').scrollIntoView({
|
205 |
+
block: 'start',
|
206 |
+
behavior: 'smooth'
|
207 |
+
});
|
|
|
208 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
209 |
}
|
210 |
+
};
|
211 |
+
|
212 |
+
//Online payments
|
213 |
+
window.completeOnlineCheckbox = function () {
|
214 |
+
var onlineCheck = document.getElementById('checkmeon').checked;
|
215 |
+
var onlineInputs = document.querySelectorAll('.online_payment_method');
|
216 |
+
for (var i = 0; i < onlineInputs.length; i++) {
|
217 |
+
if (onlineCheck === true) {
|
218 |
+
onlineInputs[i].checked = true;
|
219 |
+
}
|
220 |
+
else {
|
221 |
+
onlineInputs[i].checked = false;
|
222 |
+
}
|
223 |
}
|
224 |
+
};
|
225 |
+
|
226 |
+
//Debit and prepaid payments
|
227 |
+
window.completeDebitCheckbox = function () {
|
228 |
+
var debitCheck = document.getElementById('checkmedeb').checked;
|
229 |
+
var debitInputs = document.querySelectorAll('.debit_payment_method');
|
230 |
+
for (var i = 0; i < debitInputs.length; i++) {
|
231 |
+
if (debitCheck === true) {
|
232 |
+
debitInputs[i].checked = true;
|
233 |
+
}
|
234 |
+
else {
|
235 |
+
debitInputs[i].checked = false;
|
236 |
+
}
|
237 |
}
|
238 |
+
};
|
239 |
+
|
240 |
+
//Offline payments
|
241 |
+
window.completeOfflineCheckboxMP = function () {
|
242 |
+
var offlineCheck = document.getElementById('checkmeoff').checked;
|
243 |
+
var offlineInputs = document.querySelectorAll('.offline_payment_method');
|
244 |
+
for (var i = 0; i < offlineInputs.length; i++) {
|
245 |
+
if (offlineCheck === true) {
|
246 |
+
offlineInputs[i].checked = true;
|
247 |
+
} else {
|
248 |
+
offlineInputs[i].checked = false;
|
249 |
+
}
|
250 |
}
|
251 |
+
};
|
|
assets/js/basic_config_mercadopago.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
window.onload=function(){function e(e,o){return'<span class="mp-btn-collapsible" id="'+e+'" style="display:block">+</span> <span class="mp-btn-collapsible" id="'+o+'" style="display:none">-</span>'}document.querySelector(".wc-admin-breadcrumb").style.display="none",document.querySelector(".mp-header-logo").style.display="none",document.querySelector("#_wpnonce").parentElement.style.display="none",document.querySelectorAll("h2")[4].style.display="none";for(var o=document.querySelectorAll("p.description"),t=0;t<o.length;t++)o[t].style.width="420px";for(var c=document.querySelectorAll("th.titledesc"),n=0;n<c.length;n++)c[n].id="mp_field_text",null!=c[n].children[0].children[0]&&(c[n].children[0].children[0].style.position="relative",c[n].children[0].children[0].style.fontSize="22px");for(var l=document.querySelectorAll(".form-table"),d=0;d<l.length;d++)l[d].id="mp_table_"+d;document.querySelector(".hidden-field-mp-title").setAttribute("type","hidden"),document.querySelector(".hidden-field-mp-desc").setAttribute("type","hidden");var r=document.querySelectorAll("#mp_table_0");r[0].children[0].children[0].style.display="none",r[0].children[0].children[1].style.display="none";var a=document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_btn_save");if(null===document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_homolog_title")&&null===document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_credential_description_prod")||document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_credential_description_prod").nextElementSibling.append(a.cloneNode(!0)),null!==document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_homolog_title")||null!==document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_options_title")){document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_advanced_settings").nextElementSibling.append(a.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_options_subtitle").nextElementSibling.append(a.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_payments_description").nextElementSibling.append(a.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-basic_checkout_payments_advanced_description").nextElementSibling.append(a.cloneNode(!0));var i=document.querySelector("#woocommerce_woo-mercado-pago-basic_checkout_advanced_settings"),m=i.nextElementSibling;m.style.display="none",i.style.cursor="pointer",i.innerHTML+=e("header_plus","header_less");var s=document.querySelector("#header_plus"),p=document.querySelector("#header_less");i.onclick=function(){"none"===m.style.display?(m.style.display="block",p.style.display="block",s.style.display="none"):(m.style.display="none",p.style.display="none",s.style.display="block")};var y=document.querySelector("#woocommerce_woo-mercado-pago-basic_checkout_payments_advanced_title"),u=document.querySelector("#woocommerce_woo-mercado-pago-basic_checkout_payments_advanced_description").nextElementSibling,_=document.querySelector("#woocommerce_woo-mercado-pago-basic_checkout_payments_advanced_description");u.style.display="none",_.style.display="none",y.style.cursor="pointer",y.innerHTML+=e("header_plus_2","header_less_2");var h=document.querySelector("#header_plus_2"),b=document.querySelector("#header_less_2");y.onclick=function(){"none"===u.style.display?(u.style.display="block",_.style.display="block",b.style.display="block",h.style.display="none"):(u.style.display="none",_.style.display="none",b.style.display="none",h.style.display="block")};var k=document.querySelector("#woocommerce_woo-mercado-pago-basic_checkout_payments_description").nextElementSibling.getAttribute("class"),g=document.querySelectorAll("."+k+" td.forminp label");for(t=0;t<g.length;t++)g[t].id="mp_input_payments_mt";for(var f="",w="",S=0,v=document.querySelectorAll(".online_payment_method"),q=0;q<v.length;q++)f=v[q].getAttribute("data-translate"),!0===v[q].checked&&(S+=1);S===v.length&&(w="checked");for(var E=0;E<v.length;E++)if(0===E){var x='<div class="all_checkbox"> <label for="checkmeon" id="mp_input_payments"> <input type="checkbox" name="checkmeon" id="checkmeon" '+w+' onclick="completeOnlineCheckbox()"> '+f+" </label> </div>";v[E].parentElement.insertAdjacentHTML("beforebegin",x);break}for(var A="",I="",B=0,M=document.querySelectorAll(".debit_payment_method"),C=0;C<M.length;C++)A=M[C].getAttribute("data-translate"),!0===M[C].checked&&(B+=1);B===M.length&&(I="checked");for(var L=0;L<M.length;L++)if(0===L){var H='<div class="all_checkbox"> <label for="checkmedeb" id="mp_input_payments"> <input type="checkbox" name="checkmedeb" id="checkmedeb" '+I+' onclick="completeDebitCheckbox()"> '+A+" </label> </div>";M[L].parentElement.insertAdjacentHTML("beforebegin",H);break}for(var N="",T="",O=0,j=document.querySelectorAll(".offline_payment_method"),D=0;D<j.length;D++)N=j[D].getAttribute(["data-translate"]),!0===j[D].checked&&(O+=1);O===j.length&&(T="checked");for(var P=0;P<j.length;P++)if(0===P){var z='<div class="all_checkbox"> <label for="checkmeoff" id="mp_input_payments" style="margin-bottom: 37px !important;"> <input type="checkbox" name="checkmeoff" id="checkmeoff" '+T+' onclick="completeOfflineCheckboxMP()"> '+N+" </label> </div>";j[P].parentElement.insertAdjacentHTML("beforebegin",z);break}}null!=document.querySelector(".homologScroll")&&document.querySelector(".homologScroll").addEventListener("click",function(){document.querySelector("#woocommerce_woo-mercado-pago-basic__mp_access_token_prod").scrollIntoView({block:"start",behavior:"smooth"})})},window.completeOnlineCheckbox=function(){for(var e=document.getElementById("checkmeon").checked,o=document.querySelectorAll(".online_payment_method"),t=0;t<o.length;t++)o[t].checked=!0===e},window.completeDebitCheckbox=function(){for(var e=document.getElementById("checkmedeb").checked,o=document.querySelectorAll(".debit_payment_method"),t=0;t<o.length;t++)o[t].checked=!0===e},window.completeOfflineCheckboxMP=function(){for(var e=document.getElementById("checkmeoff").checked,o=document.querySelectorAll(".offline_payment_method"),t=0;t<o.length;t++)o[t].checked=!0===e};
|
assets/js/credit-card.js
CHANGED
@@ -1,744 +1,809 @@
|
|
|
|
1 |
(function ($) {
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
/**
|
47 |
-
* Clear Card input and all dependents inputs
|
48 |
-
*/
|
49 |
-
function clearCard() {
|
50 |
-
if (document.getElementById('mp-card-number').value != 0) {
|
51 |
-
document.getElementById('mp-card-number').value = '';
|
52 |
-
resetBackgroundCard();
|
53 |
-
clearInstallments();
|
54 |
-
clearTax();
|
55 |
-
clearIssuer();
|
56 |
-
clearDoc();
|
57 |
-
}
|
58 |
-
}
|
59 |
-
|
60 |
-
/**
|
61 |
-
* Show Payments accepted when link was clicked
|
62 |
-
*/
|
63 |
-
function showPaymentsLink() {
|
64 |
-
var frame_payments = document.querySelector("#mp-frame-payments");
|
65 |
-
$('#button-show-payments').on('click', function () {
|
66 |
-
frame_payments.style.display = frame_payments.style.display == 'inline-block' ? 'none' : 'inline-block';
|
67 |
-
});
|
68 |
-
}
|
69 |
-
|
70 |
-
/**
|
71 |
-
* Get Bin from Card Number
|
72 |
-
*/
|
73 |
-
function getBin() {
|
74 |
-
var cardnumber = document.getElementById('mp-card-number');
|
75 |
-
return cardnumber.value.replace(/[ .-]/g, "").slice(0, 6);
|
76 |
-
}
|
77 |
-
|
78 |
-
/**
|
79 |
-
* Execute before event focusout on input Card Number
|
80 |
-
*
|
81 |
-
* @param {object} event
|
82 |
-
*/
|
83 |
-
function guessingPaymentMethod(event) {
|
84 |
-
clearIssuer();
|
85 |
-
clearInstallments();
|
86 |
-
clearTax();
|
87 |
-
clearDoc();
|
88 |
-
|
89 |
-
var bin = getBin();
|
90 |
-
|
91 |
-
if (bin.length < 6) {
|
92 |
-
resetBackgroundCard();
|
93 |
-
return;
|
94 |
-
}
|
95 |
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
};
|
112 |
|
113 |
-
|
114 |
-
|
115 |
-
*/
|
116 |
-
function getAmount() {
|
117 |
-
return (document.getElementById('mp-amount').value - document.getElementById('mp-discount').value) * document.getElementById('currency_ratio').value;
|
118 |
-
}
|
119 |
-
|
120 |
-
/**
|
121 |
-
* Handle payment Method response
|
122 |
-
*
|
123 |
-
* @param {number} status
|
124 |
-
* @param {object} response
|
125 |
-
*/
|
126 |
-
function paymentMethodHandler(status, response) {
|
127 |
-
if (status == 200) {
|
128 |
-
objPaymentMethod = response[0];
|
129 |
-
setPaymentMethodId(objPaymentMethod.id);
|
130 |
-
setImageCard(objPaymentMethod.secure_thumbnail);
|
131 |
-
loadAdditionalInfo(objPaymentMethod.additional_info_needed);
|
132 |
-
additionalInfoHandler();
|
133 |
-
} else {
|
134 |
-
document.getElementById('mp-card-number').innerHTML = '';
|
135 |
-
}
|
136 |
-
}
|
137 |
-
|
138 |
-
/**
|
139 |
-
*
|
140 |
-
* Load Additional Info to use for build payment form
|
141 |
-
*
|
142 |
-
* @param {array} additional_info_needed
|
143 |
-
*/
|
144 |
-
function loadAdditionalInfo(additional_info_needed) {
|
145 |
-
additionalInfoNeeded = {
|
146 |
-
'issuer': false,
|
147 |
-
'cardholder_name': false,
|
148 |
-
'cardholder_identification_type': false,
|
149 |
-
'cardholder_identification_number': false
|
150 |
-
}
|
151 |
-
|
152 |
-
for (var i = 0; i < additional_info_needed.length; i++) {
|
153 |
-
if (additional_info_needed[i] == 'issuer_id') {
|
154 |
-
additionalInfoNeeded.issuer = true;
|
155 |
-
}
|
156 |
-
if (additional_info_needed[i] == 'cardholder_name') {
|
157 |
-
additionalInfoNeeded.cardholder_name = true;
|
158 |
-
}
|
159 |
-
if (additional_info_needed[i] == 'cardholder_identification_type') {
|
160 |
-
additionalInfoNeeded.cardholder_identification_type = true;
|
161 |
-
}
|
162 |
-
if (additional_info_needed[i] == 'cardholder_identification_number') {
|
163 |
-
additionalInfoNeeded.cardholder_identification_number = true;
|
164 |
-
}
|
165 |
-
};
|
166 |
-
}
|
167 |
-
|
168 |
-
/**
|
169 |
-
* Check what information is necessary to pay and show inputs
|
170 |
-
*/
|
171 |
-
function additionalInfoHandler() {
|
172 |
-
if (additionalInfoNeeded.issuer) {
|
173 |
-
document.getElementById('mp-issuer-div').style.display = 'block';
|
174 |
-
document.getElementById('installments-div').classList.remove('mp-col-md-12');
|
175 |
-
document.getElementById('installments-div').classList.add('mp-col-md-8');
|
176 |
-
Mercadopago.getIssuers(objPaymentMethod.id, issuersHandler);
|
177 |
-
} else {
|
178 |
-
clearIssuer();
|
179 |
-
setInstallments();
|
180 |
-
}
|
181 |
-
|
182 |
-
if (additionalInfoNeeded.cardholder_identification_type) {
|
183 |
-
document.getElementById('mp-doc-div').style.display = 'inline-block';
|
184 |
-
document.getElementById('mp-doc-type-div').style.display = "block";
|
185 |
-
Mercadopago.getIdentificationTypes();
|
186 |
-
} else {
|
187 |
-
document.getElementById('mp-doc-type-div').style.display = 'none'
|
188 |
-
}
|
189 |
-
|
190 |
-
if (additionalInfoNeeded.cardholder_identification_number) {
|
191 |
-
document.getElementById('mp-doc-div').style.display = 'inline-block';
|
192 |
-
document.getElementById('mp-doc-number-div').style.display = "block";
|
193 |
-
} else {
|
194 |
-
document.getElementById('mp-doc-number-div').style.display = 'none';
|
195 |
-
}
|
196 |
-
|
197 |
-
if (!additionalInfoNeeded.cardholder_identification_type &&
|
198 |
-
!additionalInfoNeeded.cardholder_identification_number) {
|
199 |
-
document.getElementById('mp-doc-div').style.display = 'none';
|
200 |
-
}
|
201 |
-
}
|
202 |
-
|
203 |
-
/**
|
204 |
-
* Remove background image from imput
|
205 |
-
*/
|
206 |
-
function resetBackgroundCard() {
|
207 |
-
document.getElementById('mp-card-number').style.background = 'no-repeat #fff';
|
208 |
-
}
|
209 |
-
|
210 |
-
/**
|
211 |
-
* Set value on paymentMethodId element
|
212 |
-
*
|
213 |
-
* @param {string} paymentMethodId
|
214 |
-
*/
|
215 |
-
function setPaymentMethodId(paymentMethodId) {
|
216 |
-
var paymentMethodElement = document.getElementById('paymentMethodId');
|
217 |
-
paymentMethodElement.value = paymentMethodId;
|
218 |
-
}
|
219 |
-
|
220 |
-
/**
|
221 |
-
* Set Imagem card on element
|
222 |
-
*
|
223 |
-
* @param {string} secureThumbnail
|
224 |
-
*/
|
225 |
-
function setImageCard(secureThumbnail) {
|
226 |
-
document.getElementById('mp-card-number').style.background = 'url(' + secureThumbnail + ') 98% 50% no-repeat #fff';
|
227 |
-
}
|
228 |
-
|
229 |
-
/**
|
230 |
-
* Resolution 51/2017
|
231 |
-
*
|
232 |
-
* @param {*} payerCosts
|
233 |
-
* @returns {string}
|
234 |
-
*/
|
235 |
-
function argentinaResolution(payerCosts) {
|
236 |
-
var dataInput = '';
|
237 |
-
if (seller.site_id == 'MLA') {
|
238 |
-
for (var l = 0; l < payerCosts.length; l++) {
|
239 |
-
if (payerCosts[l].indexOf('CFT_') !== -1) {
|
240 |
-
dataInput = 'data-tax="' + payerCosts[l] + '"';
|
241 |
-
}
|
242 |
-
}
|
243 |
-
return dataInput;
|
244 |
-
}
|
245 |
-
return dataInput;
|
246 |
-
}
|
247 |
-
|
248 |
-
/**
|
249 |
-
* Get instalments
|
250 |
-
*
|
251 |
-
* @param {number} status
|
252 |
-
* @param {object} response
|
253 |
-
*/
|
254 |
-
function installmentHandler(status, response) {
|
255 |
-
if (status == 200) {
|
256 |
-
var selectorInstallments = document.getElementById('mp-installments');
|
257 |
-
var html_option = "<option value='-1'>" + wc_mercadopago_params.choose + "...</option>";
|
258 |
-
var payerCosts = [];
|
259 |
-
for (var i = 0; i < response.length; i++) {
|
260 |
-
if (response[i].processing_mode == 'aggregator') {
|
261 |
-
payerCosts = response[i].payer_costs;
|
262 |
-
}
|
263 |
-
}
|
264 |
-
|
265 |
-
for (var i = 0; i < payerCosts.length; i++) {
|
266 |
-
html_option += "<option value='" + payerCosts[i].installments + "' " + argentinaResolution(payerCosts[i].labels) + ">" +
|
267 |
-
(payerCosts[i].recommended_message || payerCosts[i].installments) +
|
268 |
-
"</option>";
|
269 |
-
}
|
270 |
-
|
271 |
-
selectorInstallments.innerHTML = html_option;
|
272 |
-
if (seller.site_id == "MLA") {
|
273 |
-
clearTax();
|
274 |
-
$('body').on('change', '#mp-installments', showTaxes);
|
275 |
-
}
|
276 |
-
} else {
|
277 |
-
clearInstallments();
|
278 |
-
clearTax();
|
279 |
-
}
|
280 |
-
}
|
281 |
-
|
282 |
-
/**
|
283 |
-
* Show taxes resolution 51/2017 for MLA
|
284 |
-
*/
|
285 |
-
function showTaxes() {
|
286 |
-
var selectorInstallments = document.querySelector('#mp-installments');
|
287 |
-
var tax = selectorInstallments.options[selectorInstallments.selectedIndex].getAttribute("data-tax");
|
288 |
-
var cft = "";
|
289 |
-
var tea = "";
|
290 |
-
if (tax != null) {
|
291 |
-
var tax_split = tax.split("|");
|
292 |
-
cft = tax_split[0].replace("_", " ");
|
293 |
-
tea = tax_split[1].replace("_", " ");
|
294 |
-
if (cft == "CFT 0,00%" && tea == "TEA 0,00%") {
|
295 |
-
cft = "";
|
296 |
-
tea = "";
|
297 |
-
}
|
298 |
-
}
|
299 |
-
document.querySelector('#mp-tax-cft-text').innerHTML = cft;
|
300 |
-
document.querySelector('#mp-tax-tea-text').innerHTML = tea;
|
301 |
-
}
|
302 |
-
|
303 |
-
/**
|
304 |
-
* Clear input select
|
305 |
-
*/
|
306 |
-
function clearInstallments() {
|
307 |
-
document.getElementById('mp-installments').innerHTML = '';
|
308 |
-
}
|
309 |
-
|
310 |
-
/**
|
311 |
-
* Clear Tax
|
312 |
-
*/
|
313 |
-
function clearTax() {
|
314 |
-
document.querySelector('#mp-tax-cft-text').innerHTML = '';
|
315 |
-
document.querySelector('#mp-tax-tea-text').innerHTML = '';
|
316 |
-
}
|
317 |
-
|
318 |
-
/**
|
319 |
-
* Clear input select and change to default layout
|
320 |
-
*/
|
321 |
-
function clearIssuer() {
|
322 |
-
document.getElementById('mp-issuer-div').style.display = 'none';
|
323 |
-
document.getElementById('installments-div').classList.remove('mp-col-md-8');
|
324 |
-
document.getElementById('installments-div').classList.add('mp-dis-md-12');
|
325 |
-
document.getElementById('mp-issuer').innerHTML = '';
|
326 |
-
}
|
327 |
-
|
328 |
-
function clearDoc() {
|
329 |
-
document.getElementById('mp-doc-div').style.display = 'none';
|
330 |
-
document.getElementById('mp-doc-type-div').style.display = 'none';
|
331 |
-
document.getElementById('docType').innerHTML = '';
|
332 |
-
document.getElementById('docNumber').value = '';
|
333 |
-
}
|
334 |
-
|
335 |
-
/**
|
336 |
-
* Call insttalments with issuer ou not, depends on additionalInfoHandler()
|
337 |
-
*/
|
338 |
-
function setInstallments() {
|
339 |
-
var params_installments = {};
|
340 |
-
var amount = getAmount();
|
341 |
-
var issuer = false;
|
342 |
-
for (var i = 0; i < objPaymentMethod.additional_info_needed.length; i++) {
|
343 |
-
if (objPaymentMethod.additional_info_needed[i] == 'issuer_id') {
|
344 |
-
issuer = true;
|
345 |
-
}
|
346 |
-
}
|
347 |
-
if (issuer) {
|
348 |
-
var issuerId = document.getElementById('mp-issuer').value;
|
349 |
-
params_installments = {
|
350 |
-
"bin": getBin(),
|
351 |
-
"amount": amount,
|
352 |
-
"issuer_id": issuerId
|
353 |
-
}
|
354 |
-
|
355 |
-
if (issuerId === "-1") {
|
356 |
-
return;
|
357 |
-
}
|
358 |
-
} else {
|
359 |
-
params_installments = {
|
360 |
-
"bin": getBin(),
|
361 |
-
"amount": amount
|
362 |
-
}
|
363 |
-
}
|
364 |
-
Mercadopago.getInstallments(params_installments, installmentHandler);
|
365 |
-
}
|
366 |
-
|
367 |
-
/**
|
368 |
-
* Handle issuers response and build select
|
369 |
-
*
|
370 |
-
* @param {status} status
|
371 |
-
* @param {object} response
|
372 |
-
*/
|
373 |
-
function issuersHandler(status, response) {
|
374 |
-
if (status == 200) {
|
375 |
-
// If the API does not return any bank.
|
376 |
-
var issuersSelector = document.getElementById('mp-issuer');
|
377 |
-
var fragment = document.createDocumentFragment();
|
378 |
-
|
379 |
-
issuersSelector.options.length = 0;
|
380 |
-
var option = new Option(wc_mercadopago_params.choose + "...", "-1");
|
381 |
-
fragment.appendChild(option);
|
382 |
-
|
383 |
-
for (var i = 0; i < response.length; i++) {
|
384 |
-
var name = response[i].name == 'default' ? 'Otro' : response[i].name;
|
385 |
-
fragment.appendChild(new Option(name, response[i].id));
|
386 |
-
}
|
387 |
-
|
388 |
-
issuersSelector.appendChild(fragment);
|
389 |
-
issuersSelector.removeAttribute("disabled");
|
390 |
-
$('body').on('change', '#mp-issuer', setInstallments);
|
391 |
-
}
|
392 |
-
else {
|
393 |
-
clearIssuer();
|
394 |
-
}
|
395 |
-
}
|
396 |
-
|
397 |
-
/**
|
398 |
-
* Get form
|
399 |
-
*/
|
400 |
-
function getForm() {
|
401 |
-
return document.querySelector('#mercadopago-form');
|
402 |
-
}
|
403 |
-
|
404 |
-
/**
|
405 |
-
* Validate Additional Inputs
|
406 |
-
*
|
407 |
-
* @return {bool}
|
408 |
-
*/
|
409 |
-
function validateAdditionalInputs() {
|
410 |
-
if (additionalInfoNeeded.issuer) {
|
411 |
-
var inputMpIssuer = document.getElementById('mp-issuer');
|
412 |
-
if (inputMpIssuer.value == -1 || inputMpIssuer.value == "") {
|
413 |
-
inputMpIssuer.focus();
|
414 |
-
return false;
|
415 |
-
}
|
416 |
-
}
|
417 |
-
if (additionalInfoNeeded.cardholder_name) {
|
418 |
-
var inputCardholderName = document.getElementById('mp-card-holder-name');
|
419 |
-
if (inputCardholderName.value == -1 || inputCardholderName.value == "") {
|
420 |
-
inputCardholderName.focus();
|
421 |
-
return false;
|
422 |
-
}
|
423 |
-
}
|
424 |
-
if (additionalInfoNeeded.cardholder_identification_type) {
|
425 |
-
var inputDocType = document.getElementById('docType');
|
426 |
-
if (inputDocType.value == -1 || inputDocType.value == "") {
|
427 |
-
docType.focus();
|
428 |
-
return false;
|
429 |
-
}
|
430 |
-
}
|
431 |
-
if (additionalInfoNeeded.cardholder_identification_number) {
|
432 |
-
var docNumber = document.getElementById('docNumber');
|
433 |
-
if (docNumber.value == -1 || docNumber.value == "") {
|
434 |
-
docNumber.focus();
|
435 |
-
return false;
|
436 |
-
}
|
437 |
-
}
|
438 |
-
return true;
|
439 |
-
}
|
440 |
-
|
441 |
-
/**
|
442 |
-
* Validate Inputs to Create Token
|
443 |
-
*
|
444 |
-
* @return {bool}
|
445 |
-
*/
|
446 |
-
function validateInputsCreateToken() {
|
447 |
-
var form_inputs = getForm().querySelectorAll("[data-checkout]");
|
448 |
-
var fixed_inputs = [
|
449 |
-
'cardNumber',
|
450 |
-
'cardExpirationDate',
|
451 |
-
'securityCode',
|
452 |
-
'installments'
|
453 |
-
];
|
454 |
-
|
455 |
-
for (var x = 0; x < form_inputs.length; x++) {
|
456 |
-
var element = form_inputs[x];
|
457 |
-
// Check is a input to create token.
|
458 |
-
if (fixed_inputs.indexOf(element.getAttribute("data-checkout")) > -1) {
|
459 |
-
if (element.value == -1 || element.value == "") {
|
460 |
-
element.focus();
|
461 |
-
removeBlockOverlay();
|
462 |
-
return false;
|
463 |
-
}
|
464 |
-
}
|
465 |
-
}
|
466 |
-
|
467 |
-
if (objPaymentMethod.length == 0) {
|
468 |
-
document.getElementById('mp-card-number').focus();
|
469 |
-
removeBlockOverlay();
|
470 |
-
return false;
|
471 |
-
}
|
472 |
-
|
473 |
-
if (!validateAdditionalInputs()) {
|
474 |
-
removeBlockOverlay();
|
475 |
-
return false;
|
476 |
-
}
|
477 |
-
|
478 |
-
return true;
|
479 |
-
}
|
480 |
-
|
481 |
-
/**
|
482 |
-
* Hide errors when return of cardToken error
|
483 |
-
*/
|
484 |
-
function hideErrors() {
|
485 |
-
for (var x = 0; x < document.querySelectorAll("[data-checkout]").length; x++) {
|
486 |
-
var $field = document.querySelectorAll("[data-checkout]")[x];
|
487 |
-
$field.classList.remove("mp-error-input");
|
488 |
-
$field.classList.remove("mp-form-control-error");
|
489 |
-
}
|
490 |
-
|
491 |
-
for (var x = 0; x < document.querySelectorAll(".mp-error").length; x++) {
|
492 |
-
var $span = document.querySelectorAll(".mp-error")[x];
|
493 |
-
$span.style.display = "none";
|
494 |
-
}
|
495 |
-
}
|
496 |
-
|
497 |
-
/**
|
498 |
-
* Create Token call Mercadopago.createToken
|
499 |
-
*
|
500 |
-
* @return {bool}
|
501 |
-
*/
|
502 |
-
function createToken() {
|
503 |
-
hideErrors();
|
504 |
-
|
505 |
-
// Show loading.
|
506 |
-
document.querySelector('#mp-box-loading').style.background =
|
507 |
-
'url(' + wc_mercadopago_params.loading + ') 0 50% no-repeat #fff';
|
508 |
-
|
509 |
-
// Form.
|
510 |
-
var form = getForm();
|
511 |
-
|
512 |
-
Mercadopago.createToken(form, sdkResponseHandler);
|
513 |
-
|
514 |
-
return false;
|
515 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
516 |
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
function removeBlockOverlay() {
|
521 |
-
if ($('form#order_review').length > 0) {
|
522 |
-
$('.blockOverlay').css('display', 'none');
|
523 |
-
}
|
524 |
-
}
|
525 |
-
|
526 |
-
/**
|
527 |
-
* Handler Response of Mercadopago.createToken
|
528 |
-
*
|
529 |
-
* @param {number} status
|
530 |
-
* @param {object} response
|
531 |
-
*/
|
532 |
-
function sdkResponseHandler(status, response) {
|
533 |
-
document.querySelector('#mp-box-loading').style.background = "";
|
534 |
-
|
535 |
-
if (status != 200 && status != 201) {
|
536 |
-
showErrors(response);
|
537 |
-
removeBlockOverlay();
|
538 |
-
} else {
|
539 |
-
var token = document.querySelector('#token');
|
540 |
-
token.value = response.id;
|
541 |
-
mercado_pago_submit = true;
|
542 |
-
$('form.checkout, form#order_review').submit();
|
543 |
-
}
|
544 |
-
}
|
545 |
-
|
546 |
-
/**
|
547 |
-
*
|
548 |
-
* @param { obje } response
|
549 |
-
*/
|
550 |
-
function showErrors(response) {
|
551 |
-
var form = getForm();
|
552 |
-
for (var x = 0; x < response.cause.length; x++) {
|
553 |
-
var error = response.cause[x];
|
554 |
-
|
555 |
-
if (error.code == 208 || error.code == 209 || error.code == 325 || error.code == 326) {
|
556 |
-
var span = form.querySelector("#mp-error-208");
|
557 |
-
} else {
|
558 |
-
var span = form.querySelector("#mp-error-" + error.code);
|
559 |
-
}
|
560 |
-
|
561 |
-
if (span != undefined) {
|
562 |
-
var input = form.querySelector(span.getAttribute("data-main"));
|
563 |
-
span.style.display = "inline-block";
|
564 |
-
input.classList.add("mp-form-control-error");
|
565 |
-
}
|
566 |
-
}
|
567 |
-
return;
|
568 |
-
}
|
569 |
-
|
570 |
-
/**
|
571 |
-
* Discount Campaigns Handler
|
572 |
-
*/
|
573 |
-
function discountCampaignsHandler() {
|
574 |
-
clearCard();
|
575 |
-
document.querySelector('#mpCouponApplyed').style.display = "none";
|
576 |
-
|
577 |
-
if (document.querySelector('#couponCode').value == "") {
|
578 |
-
coupon_of_discounts.status = false;
|
579 |
-
document.querySelector('#mpCouponError').style.display = "block";
|
580 |
-
document.querySelector('#mpCouponError').innerHTML = wc_mercadopago_params.coupon_empty;
|
581 |
-
document.querySelector('#couponCode').style.background = null;
|
582 |
-
document.querySelector('#applyCoupon').value = wc_mercadopago_params.apply;
|
583 |
-
document.querySelector('#mp-discount').value = 0;
|
584 |
-
|
585 |
-
} else if (coupon_of_discounts.status) {
|
586 |
-
coupon_of_discounts.status = false;
|
587 |
-
document.querySelector('#mpCouponError').style.display = "none";
|
588 |
-
document.querySelector('#applyCoupon').style.background = null;
|
589 |
-
document.querySelector('#applyCoupon').value = wc_mercadopago_params.apply;
|
590 |
-
document.querySelector('#couponCode').value = "";
|
591 |
-
document.querySelector('#couponCode').style.background = null;
|
592 |
-
document.querySelector('#mp-discount').value = 0;
|
593 |
-
|
594 |
-
} else {
|
595 |
-
document.querySelector('#mpCouponError').style.display = "none";
|
596 |
-
document.querySelector('#couponCode').style.background = "url(" + wc_mercadopago_params.loading + ") 98% 50% no-repeat #fff";
|
597 |
-
document.querySelector('#couponCode').style.border = "1px solid #cecece";
|
598 |
-
document.querySelector('#applyCoupon').disabled = true;
|
599 |
-
getDiscountCampaigns();
|
600 |
-
}
|
601 |
-
}
|
602 |
-
|
603 |
-
/**
|
604 |
-
* Get Discount Campaigns
|
605 |
-
*/
|
606 |
-
function getDiscountCampaigns() {
|
607 |
-
var url = coupon_of_discounts.discount_action_url;
|
608 |
-
var sp = "?";
|
609 |
-
if (url.indexOf("?") >= 0) {
|
610 |
-
sp = "&";
|
611 |
-
}
|
612 |
-
url += sp + "site_id=" + wc_mercadopago_params.site_id;
|
613 |
-
url += "&coupon_id=" + document.querySelector('#couponCode').value;
|
614 |
-
url += "&amount=" + document.querySelector('#mp-amount').value;
|
615 |
-
url += "&payer=" + coupon_of_discounts.payer_email;
|
616 |
-
|
617 |
-
$.ajax({
|
618 |
-
url: url,
|
619 |
-
method: "GET",
|
620 |
-
timeout: 5000,
|
621 |
-
error: function () {
|
622 |
-
coupon_of_discounts.status = false;
|
623 |
-
document.querySelector('#mpCouponApplyed').style.display = "none";
|
624 |
-
document.querySelector('#mpCouponError').style.display = "none";
|
625 |
-
document.querySelector('#applyCoupon').style.background = null;
|
626 |
-
document.querySelector('#applyCoupon').value = wc_mercadopago_params.apply;
|
627 |
-
document.querySelector('#couponCode').value = "";
|
628 |
-
document.querySelector('#couponCode').style.background = null;
|
629 |
-
document.querySelector('#mp-discount').value = 0;
|
630 |
-
},
|
631 |
-
success: function (response, status) {
|
632 |
-
if (response.status == 200) {
|
633 |
-
coupon_of_discounts.status = true;
|
634 |
-
document.querySelector('#mpCouponApplyed').style.display = "block";
|
635 |
-
document.querySelector('#mp-discount').value = response.response.coupon_amount;
|
636 |
-
document.querySelector('#mpCouponApplyed').innerHTML =
|
637 |
-
wc_mercadopago_params.discount_info1 + " <strong>" +
|
638 |
-
currencyIdToCurrency(response.response.currency_id) + " " +
|
639 |
-
Math.round(response.response.coupon_amount * 100) / 100 +
|
640 |
-
"</strong> " + wc_mercadopago_params.discount_info2 + " " +
|
641 |
-
response.response.name + ".<br>" + wc_mercadopago_params.discount_info3 + " <strong>" +
|
642 |
-
currencyIdToCurrency(response.response.currency_id) + " " +
|
643 |
-
Math.round(getAmountWithoutDiscount() * 100) / 100 +
|
644 |
-
"</strong><br>" + wc_mercadopago_params.discount_info4 + " <strong>" +
|
645 |
-
currencyIdToCurrency(response.response.currency_id) + " " +
|
646 |
-
Math.round(getAmount() * 100) / 100 + "*</strong><br>" +
|
647 |
-
"<i>" + wc_mercadopago_params.discount_info5 + "</i><br>" +
|
648 |
-
"<a href='https://api.mercadolibre.com/campaigns/" +
|
649 |
-
response.response.id +
|
650 |
-
"/terms_and_conditions?format_type=html' target='_blank'>" +
|
651 |
-
wc_mercadopago_params.discount_info6 + "</a>";
|
652 |
-
document.querySelector('#mpCouponError').style.display = "none";
|
653 |
-
document.querySelector('#couponCode').style.background = null;
|
654 |
-
document.querySelector('#couponCode').style.background = "url(" + wc_mercadopago_params.check + ") 94% 50% no-repeat #fff";
|
655 |
-
document.querySelector('#couponCode').style.border = "1px solid #cecece";
|
656 |
-
document.querySelector('#applyCoupon').value = wc_mercadopago_params.remove;
|
657 |
-
document.querySelector('#campaign_id').value = response.response.id;
|
658 |
-
document.querySelector('#campaign').value = response.response.name;
|
659 |
-
} else {
|
660 |
-
coupon_of_discounts.status = false;
|
661 |
-
document.querySelector('#mpCouponApplyed').style.display = "none";
|
662 |
-
document.querySelector('#mpCouponError').style.display = "block";
|
663 |
-
document.querySelector('#mpCouponError').innerHTML = response.response.message;
|
664 |
-
document.querySelector('#couponCode').style.background = null;
|
665 |
-
document.querySelector('#couponCode').style.background = "url(" + wc_mercadopago_params.error + ") 94% 50% no-repeat #fff";
|
666 |
-
document.querySelector('#applyCoupon').value = wc_mercadopago_params.apply;
|
667 |
-
document.querySelector('#mp-discount').value = 0;
|
668 |
-
}
|
669 |
-
document.querySelector('#applyCoupon').disabled = false;
|
670 |
-
}
|
671 |
-
});
|
672 |
-
}
|
673 |
-
|
674 |
-
/**
|
675 |
-
* CurrencyId to Currency
|
676 |
-
*
|
677 |
-
* @param {string} currency_id
|
678 |
-
*/
|
679 |
-
function currencyIdToCurrency(currency_id) {
|
680 |
-
if (currency_id == "ARS") {
|
681 |
-
return "$";
|
682 |
-
} else if (currency_id == "BRL") {
|
683 |
-
return "R$";
|
684 |
-
} else if (currency_id == "COP") {
|
685 |
-
return "$";
|
686 |
-
} else if (currency_id == "CLP") {
|
687 |
-
return "$";
|
688 |
-
} else if (currency_id == "MXN") {
|
689 |
-
return "$";
|
690 |
-
} else if (currency_id == "VEF") {
|
691 |
-
return "Bs";
|
692 |
-
} else if (currency_id == "PEN") {
|
693 |
-
return "S/";
|
694 |
-
} else if (currency_id == "UYU") {
|
695 |
-
return "$U";
|
696 |
-
} else {
|
697 |
-
return "$";
|
698 |
-
}
|
699 |
-
}
|
700 |
-
|
701 |
-
/**
|
702 |
-
* Get Amount Without Discount
|
703 |
-
*
|
704 |
-
* @return {string}
|
705 |
-
*/
|
706 |
-
function getAmountWithoutDiscount() {
|
707 |
-
return document.querySelector('#mp-amount').value;
|
708 |
-
}
|
709 |
-
|
710 |
-
/**
|
711 |
-
* Handler submit
|
712 |
-
*
|
713 |
-
* @return {bool}
|
714 |
-
*/
|
715 |
-
function mercadoPagoFormHandler() {
|
716 |
-
if (mercado_pago_submit) {
|
717 |
-
mercado_pago_submit = false;
|
718 |
-
return true;
|
719 |
-
}
|
720 |
-
|
721 |
-
if (!document.getElementById('payment_method_woo-mercado-pago-custom').checked) {
|
722 |
-
return true;
|
723 |
-
}
|
724 |
-
|
725 |
-
if (validateInputsCreateToken()) {
|
726 |
-
return createToken();
|
727 |
-
}
|
728 |
-
|
729 |
-
return false;
|
730 |
-
}
|
731 |
-
|
732 |
-
// Process when submit the checkout form.
|
733 |
-
$('form.checkout').on('checkout_place_order_woo-mercado-pago-custom', function () {
|
734 |
-
return mercadoPagoFormHandler();
|
735 |
-
});
|
736 |
-
|
737 |
-
// If payment fail, retry on next checkout page
|
738 |
-
$('form#order_review').submit(function () {
|
739 |
-
return mercadoPagoFormHandler();
|
740 |
-
});
|
741 |
-
|
742 |
});
|
743 |
|
|
|
|
|
|
|
|
|
|
|
744 |
}(jQuery));
|
1 |
+
/* globals wc_mercadopago_params, Mercadopago */
|
2 |
(function ($) {
|
3 |
+
'use strict';
|
4 |
+
|
5 |
+
$(function () {
|
6 |
+
var mercado_pago_submit = false;
|
7 |
+
|
8 |
+
var seller = {
|
9 |
+
site_id: wc_mercadopago_params.site_id,
|
10 |
+
public_key: wc_mercadopago_params.public_key
|
11 |
+
};
|
12 |
+
|
13 |
+
var sdkTagScript = document.createElement('script');
|
14 |
+
sdkTagScript.src = 'https://secure.mlstatic.com/sdk/javascript/v1/mercadopago.js';
|
15 |
+
sdkTagScript.onload = function () {
|
16 |
+
Mercadopago.setPublishableKey(seller.public_key);
|
17 |
+
};
|
18 |
+
|
19 |
+
var coupon_of_discounts = {
|
20 |
+
discount_action_url: wc_mercadopago_params.discount_action_url,
|
21 |
+
payer_email: wc_mercadopago_params.payer_email,
|
22 |
+
activated: wc_mercadopago_params.coupon_mode,
|
23 |
+
status: false
|
24 |
+
};
|
25 |
+
|
26 |
+
var objPaymentMethod = {};
|
27 |
+
var additionalInfoNeeded = {};
|
28 |
+
|
29 |
+
if ($('form#order_review').length > 0) {
|
30 |
+
if (coupon_of_discounts.activated === 'yes') {
|
31 |
+
$('#applyCoupon').on('click', discountCampaignsHandler);
|
32 |
+
}
|
33 |
+
showPaymentsLink();
|
34 |
+
}
|
35 |
+
|
36 |
+
// Load woocommerce checkout form
|
37 |
+
$('body').on('updated_checkout', function () {
|
38 |
+
|
39 |
+
if (coupon_of_discounts.activated === 'yes') {
|
40 |
+
$('#applyCoupon').on('click', discountCampaignsHandler);
|
41 |
+
}
|
42 |
+
|
43 |
+
clearCard();
|
44 |
+
showPaymentsLink();
|
45 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
|
47 |
+
$('body').on('keyup', '#mp-card-number', guessingPaymentMethod);
|
48 |
+
$('body').on('change', '#mp-card-number', guessingPaymentMethod);
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Clear Card input and all dependents inputs
|
52 |
+
*/
|
53 |
+
function clearCard() {
|
54 |
+
if (document.getElementById('mp-card-number').value !== 0) {
|
55 |
+
document.getElementById('mp-card-number').value = '';
|
56 |
+
resetBackgroundCard();
|
57 |
+
clearInstallments();
|
58 |
+
clearTax();
|
59 |
+
clearIssuer();
|
60 |
+
clearDoc();
|
61 |
+
}
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Show Payments accepted when link was clicked
|
66 |
+
*/
|
67 |
+
function showPaymentsLink() {
|
68 |
+
var frame_payments = document.querySelector('#mp-frame-payments');
|
69 |
+
$('#button-show-payments').on('click', function () {
|
70 |
+
frame_payments.style.display = frame_payments.style.display === 'inline-block' ? 'none' : 'inline-block';
|
71 |
+
});
|
72 |
+
}
|
73 |
+
|
74 |
+
/**
|
75 |
+
* Get Bin from Card Number
|
76 |
+
*/
|
77 |
+
function getBin() {
|
78 |
+
var cardnumber = document.getElementById('mp-card-number');
|
79 |
+
return cardnumber.value.replace(/[ .-]/g, '').slice(0, 6);
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Execute before event focusout on input Card Number
|
84 |
+
*
|
85 |
+
* @param {object} event
|
86 |
+
*/
|
87 |
+
function guessingPaymentMethod(event) {
|
88 |
+
hideErrors();
|
89 |
+
clearHolderName();
|
90 |
+
clearExpirationDate();
|
91 |
+
clearSecurityCode();
|
92 |
+
clearIssuer();
|
93 |
+
clearInstallments();
|
94 |
+
clearTax();
|
95 |
+
clearDoc();
|
96 |
+
|
97 |
+
var bin = getBin();
|
98 |
+
|
99 |
+
if (bin.length < 6) {
|
100 |
+
resetBackgroundCard();
|
101 |
+
return;
|
102 |
+
}
|
103 |
+
|
104 |
+
if (event.type === 'keyup') {
|
105 |
+
if (bin.length >= 6) {
|
106 |
+
Mercadopago.getPaymentMethod({
|
107 |
+
'bin': bin
|
108 |
+
}, paymentMethodHandler);
|
109 |
+
}
|
110 |
+
} else {
|
111 |
+
setTimeout(function () {
|
112 |
+
if (bin.length >= 6) {
|
113 |
+
Mercadopago.getPaymentMethod({
|
114 |
+
'bin': bin
|
115 |
+
}, paymentMethodHandler);
|
116 |
+
}
|
117 |
+
}, 100);
|
118 |
+
}
|
119 |
+
}
|
120 |
+
|
121 |
+
/**
|
122 |
+
* Get Amount end calculate discount for hide inputs
|
123 |
+
*/
|
124 |
+
function getAmount() {
|
125 |
+
return (document.getElementById('mp-amount').value - document.getElementById('mp-discount').value) * document.getElementById('currency_ratio').value;
|
126 |
+
}
|
127 |
+
|
128 |
+
/**
|
129 |
+
* Handle payment Method response
|
130 |
+
*
|
131 |
+
* @param {number} status
|
132 |
+
* @param {object} response
|
133 |
+
*/
|
134 |
+
function paymentMethodHandler(status, response) {
|
135 |
+
if (status === 200) {
|
136 |
+
objPaymentMethod = response[0];
|
137 |
+
setPaymentMethodId(objPaymentMethod.id);
|
138 |
+
setImageCard(objPaymentMethod.secure_thumbnail);
|
139 |
+
loadAdditionalInfo(objPaymentMethod.additional_info_needed);
|
140 |
+
additionalInfoHandler();
|
141 |
+
document.getElementById('mp-card-number').classList.remove('mp-form-control-error');
|
142 |
+
document.getElementById('mp-error-E301').style.display = 'none';
|
143 |
+
} else {
|
144 |
+
resetBackgroundCard();
|
145 |
+
document.getElementById('mp-card-number').classList.add('mp-form-control-error');
|
146 |
+
document.getElementById('mp-error-E301').style.display = 'inline-block';
|
147 |
+
}
|
148 |
+
}
|
149 |
+
|
150 |
+
/**
|
151 |
+
*
|
152 |
+
* Load Additional Info to use for build payment form
|
153 |
+
*
|
154 |
+
* @param {array} additional_info_needed
|
155 |
+
*/
|
156 |
+
function loadAdditionalInfo(additional_info_needed) {
|
157 |
+
additionalInfoNeeded = {
|
158 |
+
'issuer': false,
|
159 |
+
'cardholder_name': false,
|
160 |
+
'cardholder_identification_type': false,
|
161 |
+
'cardholder_identification_number': false
|
162 |
+
};
|
163 |
+
|
164 |
+
for (var i = 0; i < additional_info_needed.length; i++) {
|
165 |
+
if (additional_info_needed[i] === 'issuer_id') {
|
166 |
+
additionalInfoNeeded.issuer = true;
|
167 |
+
}
|
168 |
+
if (additional_info_needed[i] === 'cardholder_name') {
|
169 |
+
additionalInfoNeeded.cardholder_name = true;
|
170 |
+
}
|
171 |
+
if (additional_info_needed[i] === 'cardholder_identification_type') {
|
172 |
+
additionalInfoNeeded.cardholder_identification_type = true;
|
173 |
+
}
|
174 |
+
if (additional_info_needed[i] === 'cardholder_identification_number') {
|
175 |
+
additionalInfoNeeded.cardholder_identification_number = true;
|
176 |
+
}
|
177 |
+
}
|
178 |
+
}
|
179 |
+
|
180 |
+
/**
|
181 |
+
* Check what information is necessary to pay and show inputs
|
182 |
+
*/
|
183 |
+
function additionalInfoHandler() {
|
184 |
+
if (additionalInfoNeeded.cardholder_name) {
|
185 |
+
document.getElementById('mp-card-holder-div').style.display = 'block';
|
186 |
+
} else {
|
187 |
+
document.getElementById('mp-card-holder-div').style.display = 'none';
|
188 |
+
}
|
189 |
+
|
190 |
+
if (additionalInfoNeeded.issuer) {
|
191 |
+
document.getElementById('mp-issuer-div').style.display = 'block';
|
192 |
+
document.getElementById('installments-div').classList.remove('mp-col-md-12');
|
193 |
+
document.getElementById('installments-div').classList.add('mp-col-md-8');
|
194 |
+
Mercadopago.getIssuers(objPaymentMethod.id, issuersHandler);
|
195 |
+
} else {
|
196 |
+
clearIssuer();
|
197 |
+
setInstallments();
|
198 |
+
}
|
199 |
+
|
200 |
+
if (additionalInfoNeeded.cardholder_identification_type) {
|
201 |
+
document.getElementById('mp-doc-div').style.display = 'inline-block';
|
202 |
+
document.getElementById('mp-doc-type-div').style.display = 'block';
|
203 |
+
Mercadopago.getIdentificationTypes();
|
204 |
+
} else {
|
205 |
+
document.getElementById('mp-doc-type-div').style.display = 'none';
|
206 |
+
}
|
207 |
+
|
208 |
+
if (additionalInfoNeeded.cardholder_identification_number) {
|
209 |
+
document.getElementById('mp-doc-div').style.display = 'inline-block';
|
210 |
+
document.getElementById('mp-doc-number-div').style.display = 'block';
|
211 |
+
} else {
|
212 |
+
document.getElementById('mp-doc-number-div').style.display = 'none';
|
213 |
+
}
|
214 |
+
|
215 |
+
if (!additionalInfoNeeded.cardholder_identification_type && !additionalInfoNeeded.cardholder_identification_number) {
|
216 |
+
document.getElementById('mp-doc-div').style.display = 'none';
|
217 |
+
}
|
218 |
+
}
|
219 |
+
|
220 |
+
/**
|
221 |
+
* Remove background image from imput
|
222 |
+
*/
|
223 |
+
function resetBackgroundCard() {
|
224 |
+
document.getElementById('mp-card-number').style.background = 'no-repeat #fff';
|
225 |
+
}
|
226 |
+
|
227 |
+
/**
|
228 |
+
* Set value on paymentMethodId element
|
229 |
+
*
|
230 |
+
* @param {string} paymentMethodId
|
231 |
+
*/
|
232 |
+
function setPaymentMethodId(paymentMethodId) {
|
233 |
+
document.getElementById('paymentMethodId').value = paymentMethodId;
|
234 |
+
}
|
235 |
+
|
236 |
+
/**
|
237 |
+
* Set Imagem card on element
|
238 |
+
*
|
239 |
+
* @param {string} secureThumbnail
|
240 |
+
*/
|
241 |
+
function setImageCard(secureThumbnail) {
|
242 |
+
document.getElementById('mp-card-number').style.background = 'url(' + secureThumbnail + ') 98% 50% no-repeat #fff';
|
243 |
+
}
|
244 |
+
|
245 |
+
/**
|
246 |
+
* Resolution 51/2017
|
247 |
+
*
|
248 |
+
* @param {*} payerCosts
|
249 |
+
* @returns {string}
|
250 |
+
*/
|
251 |
+
function argentinaResolution(payerCosts) {
|
252 |
+
var dataInput = '';
|
253 |
+
if (seller.site_id === 'MLA') {
|
254 |
+
for (var l = 0; l < payerCosts.length; l++) {
|
255 |
+
if (payerCosts[l].indexOf('CFT_') !== -1) {
|
256 |
+
dataInput = 'data-tax="' + payerCosts[l] + '"';
|
257 |
+
}
|
258 |
+
}
|
259 |
+
return dataInput;
|
260 |
+
}
|
261 |
+
return dataInput;
|
262 |
+
}
|
263 |
+
|
264 |
+
/**
|
265 |
+
* Get instalments
|
266 |
+
*
|
267 |
+
* @param {number} status
|
268 |
+
* @param {object} response
|
269 |
+
*/
|
270 |
+
function installmentHandler(status, response) {
|
271 |
+
if (status === 200) {
|
272 |
+
var selectorInstallments = document.getElementById('mp-installments');
|
273 |
+
var html_option = '<option value="-1">' + wc_mercadopago_params.choose + '...</option>';
|
274 |
+
var payerCosts = [];
|
275 |
+
for (var i = 0; i < response.length; i++) {
|
276 |
+
if (response[i].processing_mode === 'aggregator') {
|
277 |
+
payerCosts = response[i].payer_costs;
|
278 |
+
}
|
279 |
+
}
|
280 |
+
|
281 |
+
for (var j = 0; j < payerCosts.length; j++) {
|
282 |
+
html_option += '<option value="' + payerCosts[j].installments + '" ' + argentinaResolution(payerCosts[j].labels) + '>' +
|
283 |
+
(payerCosts[j].recommended_message || payerCosts[j].installments) +
|
284 |
+
'</option>';
|
285 |
+
}
|
286 |
+
|
287 |
+
selectorInstallments.innerHTML = html_option;
|
288 |
+
if (seller.site_id === 'MLA') {
|
289 |
+
clearTax();
|
290 |
+
$('body').on('change', '#mp-installments', showTaxes);
|
291 |
+
}
|
292 |
+
} else {
|
293 |
+
clearInstallments();
|
294 |
+
clearTax();
|
295 |
+
}
|
296 |
+
}
|
297 |
+
|
298 |
+
/**
|
299 |
+
* Show taxes resolution 51/2017 for MLA
|
300 |
+
*/
|
301 |
+
function showTaxes() {
|
302 |
+
var selectorInstallments = document.querySelector('#mp-installments');
|
303 |
+
var tax = selectorInstallments.options[selectorInstallments.selectedIndex].getAttribute('data-tax');
|
304 |
+
var cft = '';
|
305 |
+
var tea = '';
|
306 |
+
if (tax != null) {
|
307 |
+
var tax_split = tax.split('|');
|
308 |
+
cft = tax_split[0].replace('_', ' ');
|
309 |
+
tea = tax_split[1].replace('_', ' ');
|
310 |
+
if (cft === 'CFT 0,00%' && tea === 'TEA 0,00%') {
|
311 |
+
cft = '';
|
312 |
+
tea = '';
|
313 |
+
}
|
314 |
+
}
|
315 |
+
document.querySelector('#mp-tax-cft-text').innerHTML = cft;
|
316 |
+
document.querySelector('#mp-tax-tea-text').innerHTML = tea;
|
317 |
+
}
|
318 |
+
|
319 |
+
/**
|
320 |
+
* Clear input select
|
321 |
+
*/
|
322 |
+
function clearInstallments() {
|
323 |
+
document.getElementById('mp-installments').innerHTML = '';
|
324 |
+
}
|
325 |
+
|
326 |
+
/**
|
327 |
+
* Clear Tax
|
328 |
+
*/
|
329 |
+
function clearTax() {
|
330 |
+
document.querySelector('#mp-tax-cft-text').innerHTML = '';
|
331 |
+
document.querySelector('#mp-tax-tea-text').innerHTML = '';
|
332 |
+
}
|
333 |
+
|
334 |
+
/**
|
335 |
+
* Clear input select and change to default layout
|
336 |
+
*/
|
337 |
+
function clearIssuer() {
|
338 |
+
document.getElementById('mp-issuer-div').style.display = 'none';
|
339 |
+
document.getElementById('installments-div').classList.remove('mp-col-md-8');
|
340 |
+
document.getElementById('installments-div').classList.add('mp-dis-md-12');
|
341 |
+
document.getElementById('mp-issuer').innerHTML = '';
|
342 |
+
}
|
343 |
+
|
344 |
+
function clearDoc() {
|
345 |
+
document.getElementById('mp-doc-div').style.display = 'none';
|
346 |
+
document.getElementById('mp-doc-type-div').style.display = 'none';
|
347 |
+
document.getElementById('docType').innerHTML = '';
|
348 |
+
document.getElementById('docNumber').value = '';
|
349 |
+
}
|
350 |
+
/**
|
351 |
+
* Clear input
|
352 |
+
*/
|
353 |
+
function clearHolderName() {
|
354 |
+
document.getElementById('mp-card-holder-name').value = '';
|
355 |
+
}
|
356 |
+
function clearExpirationDate() {
|
357 |
+
document.getElementById('mp-card-expiration-date').value = '';
|
358 |
+
}
|
359 |
+
function clearSecurityCode() {
|
360 |
+
document.getElementById('mp-security-code').value = '';
|
361 |
+
}
|
362 |
+
/**
|
363 |
+
* Call insttalments with issuer ou not, depends on additionalInfoHandler()
|
364 |
+
*/
|
365 |
+
function setInstallments() {
|
366 |
+
var params_installments = {};
|
367 |
+
var amount = getAmount();
|
368 |
+
var issuer = false;
|
369 |
+
for (var i = 0; i < objPaymentMethod.additional_info_needed.length; i++) {
|
370 |
+
if (objPaymentMethod.additional_info_needed[i] === 'issuer_id') {
|
371 |
+
issuer = true;
|
372 |
+
}
|
373 |
+
}
|
374 |
+
if (issuer) {
|
375 |
+
var issuerId = document.getElementById('mp-issuer').value;
|
376 |
+
params_installments = {
|
377 |
+
'bin': getBin(),
|
378 |
+
'amount': amount,
|
379 |
+
'issuer_id': issuerId
|
380 |
};
|
381 |
|
382 |
+
if (issuerId === '-1') {
|
383 |
+
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
384 |
}
|
385 |
+
} else {
|
386 |
+
params_installments = {
|
387 |
+
'bin': getBin(),
|
388 |
+
'amount': amount
|
389 |
+
};
|
390 |
+
}
|
391 |
+
Mercadopago.getInstallments(params_installments, installmentHandler);
|
392 |
+
}
|
393 |
+
|
394 |
+
/**
|
395 |
+
* Handle issuers response and build select
|
396 |
+
*
|
397 |
+
* @param {status} status
|
398 |
+
* @param {object} response
|
399 |
+
*/
|
400 |
+
function issuersHandler(status, response) {
|
401 |
+
if (status === 200) {
|
402 |
+
// If the API does not return any bank.
|
403 |
+
var issuersSelector = document.getElementById('mp-issuer');
|
404 |
+
var fragment = document.createDocumentFragment();
|
405 |
+
|
406 |
+
issuersSelector.options.length = 0;
|
407 |
+
var option = new Option(wc_mercadopago_params.choose + '...', '-1');
|
408 |
+
fragment.appendChild(option);
|
409 |
+
|
410 |
+
for (var i = 0; i < response.length; i++) {
|
411 |
+
var name = response[i].name === 'default' ? 'Otro' : response[i].name;
|
412 |
+
fragment.appendChild(new Option(name, response[i].id));
|
413 |
+
}
|
414 |
+
|
415 |
+
issuersSelector.appendChild(fragment);
|
416 |
+
issuersSelector.removeAttribute('disabled');
|
417 |
+
$('body').on('change', '#mp-issuer', setInstallments);
|
418 |
+
} else {
|
419 |
+
clearIssuer();
|
420 |
+
}
|
421 |
+
}
|
422 |
+
|
423 |
+
/**
|
424 |
+
* Get form
|
425 |
+
*/
|
426 |
+
function getForm() {
|
427 |
+
return document.querySelector('#mercadopago-form');
|
428 |
+
}
|
429 |
+
|
430 |
+
/**
|
431 |
+
* Validate Additional Inputs
|
432 |
+
*
|
433 |
+
* @return {bool}
|
434 |
+
*/
|
435 |
+
function validateAdditionalInputs() {
|
436 |
+
var emptyInputs = false;
|
437 |
+
|
438 |
+
if (additionalInfoNeeded.issuer) {
|
439 |
+
var inputMpIssuer = document.getElementById('mp-issuer');
|
440 |
+
if (inputMpIssuer.value === '-1' || inputMpIssuer.value === '') {
|
441 |
+
inputMpIssuer.classList.add('mp-form-control-error');
|
442 |
+
emptyInputs = true;
|
443 |
+
}
|
444 |
+
}
|
445 |
+
if (additionalInfoNeeded.cardholder_name) {
|
446 |
+
var inputCardholderName = document.getElementById('mp-card-holder-name');
|
447 |
+
if (inputCardholderName.value === '-1' || inputCardholderName.value === '') {
|
448 |
+
inputCardholderName.classList.add('mp-form-control-error');
|
449 |
+
emptyInputs = true;
|
450 |
+
}
|
451 |
+
}
|
452 |
+
if (additionalInfoNeeded.cardholder_identification_type) {
|
453 |
+
var inputDocType = document.getElementById('docType');
|
454 |
+
if (inputDocType.value === '-1' || inputDocType.value === '') {
|
455 |
+
inputDocType.classList.add('mp-form-control-error');
|
456 |
+
emptyInputs = true;
|
457 |
+
}
|
458 |
+
}
|
459 |
+
if (additionalInfoNeeded.cardholder_identification_number) {
|
460 |
+
var docNumber = document.getElementById('docNumber');
|
461 |
+
if (docNumber.value === '-1' || docNumber.value === '') {
|
462 |
+
docNumber.classList.add('mp-form-control-error');
|
463 |
+
document.getElementById('mp-error-324').style.display = 'inline-block';
|
464 |
+
emptyInputs = true;
|
465 |
+
}
|
466 |
+
}
|
467 |
+
|
468 |
+
if (emptyInputs) {
|
469 |
+
return emptyInputs;
|
470 |
+
} else {
|
471 |
+
return emptyInputs;
|
472 |
+
}
|
473 |
+
}
|
474 |
+
|
475 |
+
/**
|
476 |
+
* Validate Inputs to Create Token
|
477 |
+
*
|
478 |
+
* @return {bool}
|
479 |
+
*/
|
480 |
+
function validateInputsCreateToken() {
|
481 |
+
hideErrors();
|
482 |
+
var fixedInputs = validateFixedInputs();
|
483 |
+
var additionalInputs = validateAdditionalInputs();
|
484 |
+
|
485 |
+
if (fixedInputs || additionalInputs) {
|
486 |
+
removeBlockOverlay();
|
487 |
+
focusInputError();
|
488 |
+
return false;
|
489 |
+
}
|
490 |
+
|
491 |
+
return true;
|
492 |
+
}
|
493 |
+
|
494 |
+
/**
|
495 |
+
* Focus input with error
|
496 |
+
*
|
497 |
+
* @return {bool}
|
498 |
+
*/
|
499 |
+
function focusInputError() {
|
500 |
+
if (document.querySelectorAll('.mp-form-control-error') !== undefined) {
|
501 |
+
var form_inputs = document.querySelectorAll('.mp-form-control-error');
|
502 |
+
form_inputs[0].focus();
|
503 |
+
}
|
504 |
+
}
|
505 |
+
|
506 |
+
/**
|
507 |
+
* Validate fixed Inputs is empty
|
508 |
+
*
|
509 |
+
* @return {bool}
|
510 |
+
*/
|
511 |
+
function validateFixedInputs() {
|
512 |
+
var emptyInputs = false;
|
513 |
+
var form = getForm();
|
514 |
+
var form_inputs = form.querySelectorAll('[data-checkout]');
|
515 |
+
var fixed_inputs = [
|
516 |
+
'installments',
|
517 |
+
'securityCode',
|
518 |
+
'cardExpirationDate',
|
519 |
+
'cardNumber'
|
520 |
+
];
|
521 |
+
|
522 |
+
for (var x = 0; x < form_inputs.length; x++) {
|
523 |
+
var element = form_inputs[x];
|
524 |
+
// Check is a input to create token.
|
525 |
+
if (fixed_inputs.indexOf(element.getAttribute('data-checkout')) > -1) {
|
526 |
+
if (element.value === '-1' || element.value === '') {
|
527 |
+
var span = form.querySelectorAll('span[data-main="#' + element.id + '"]');
|
528 |
+
if (span.length > 0) {
|
529 |
+
span[0].style.display = 'inline-block';
|
530 |
+
}
|
531 |
+
element.classList.add('mp-form-control-error');
|
532 |
+
emptyInputs = true;
|
533 |
+
}
|
534 |
+
}
|
535 |
+
}
|
536 |
+
|
537 |
+
if (emptyInputs) {
|
538 |
+
return emptyInputs;
|
539 |
+
} else {
|
540 |
+
return emptyInputs;
|
541 |
+
}
|
542 |
+
}
|
543 |
+
|
544 |
+
/**
|
545 |
+
* Hide errors when return of cardToken error
|
546 |
+
*/
|
547 |
+
function hideErrors() {
|
548 |
+
for (var x = 0; x < document.querySelectorAll('[data-checkout]').length; x++) {
|
549 |
+
var field = document.querySelectorAll('[data-checkout]')[x];
|
550 |
+
field.classList.remove('mp-error-input');
|
551 |
+
field.classList.remove('mp-form-control-error');
|
552 |
+
}
|
553 |
+
|
554 |
+
for (var y = 0; y < document.querySelectorAll('.mp-error').length; y++) {
|
555 |
+
var span = document.querySelectorAll('.mp-error')[y];
|
556 |
+
span.style.display = 'none';
|
557 |
+
}
|
558 |
+
}
|
559 |
+
|
560 |
+
/**
|
561 |
+
* Create Token call Mercadopago.createToken
|
562 |
+
*
|
563 |
+
* @return {bool}
|
564 |
+
*/
|
565 |
+
function createToken() {
|
566 |
+
hideErrors();
|
567 |
+
|
568 |
+
// Show loading.
|
569 |
+
document.querySelector('#mp-box-loading').style.background = 'url(' + wc_mercadopago_params.loading + ') 0 50% no-repeat #fff';
|
570 |
+
|
571 |
+
// Form.
|
572 |
+
var form = getForm();
|
573 |
+
|
574 |
+
Mercadopago.createToken(form, sdkResponseHandler);
|
575 |
+
|
576 |
+
return false;
|
577 |
+
}
|
578 |
+
|
579 |
+
/**
|
580 |
+
* Remove Block Overlay from Order Review page
|
581 |
+
*/
|
582 |
+
function removeBlockOverlay() {
|
583 |
+
if ($('form#order_review').length > 0) {
|
584 |
+
$('.blockOverlay').css('display', 'none');
|
585 |
+
}
|
586 |
+
}
|
587 |
+
|
588 |
+
/**
|
589 |
+
* Handler Response of Mercadopago.createToken
|
590 |
+
*
|
591 |
+
* @param {number} status
|
592 |
+
* @param {object} response
|
593 |
+
*/
|
594 |
+
function sdkResponseHandler(status, response) {
|
595 |
+
document.querySelector('#mp-box-loading').style.background = '';
|
596 |
+
|
597 |
+
if (status !== 200 && status !== 201) {
|
598 |
+
showErrors(response);
|
599 |
+
removeBlockOverlay();
|
600 |
+
focusInputError();
|
601 |
+
} else {
|
602 |
+
var token = document.querySelector('#token');
|
603 |
+
token.value = response.id;
|
604 |
+
mercado_pago_submit = true;
|
605 |
+
$('form.checkout, form#order_review').submit();
|
606 |
+
}
|
607 |
+
}
|
608 |
+
|
609 |
+
/**
|
610 |
+
*
|
611 |
+
* @param { obje } response
|
612 |
+
*/
|
613 |
+
function showErrors(response) {
|
614 |
+
var form = getForm();
|
615 |
+
for (var x = 0; x < response.cause.length; x++) {
|
616 |
+
var error = response.cause[x];
|
617 |
+
var span = undefined;
|
618 |
+
|
619 |
+
if (error.code === '208' || error.code === '209' || error.code === '325' || error.code === '326') {
|
620 |
+
span = form.querySelector('#mp-error-208');
|
621 |
+
} else {
|
622 |
+
span = form.querySelector('#mp-error-' + error.code);
|
623 |
+
}
|
624 |
+
|
625 |
+
if (span !== undefined) {
|
626 |
+
var input = form.querySelector(span.getAttribute('data-main'));
|
627 |
+
span.style.display = 'inline-block';
|
628 |
+
input.classList.add('mp-form-control-error');
|
629 |
+
}
|
630 |
+
}
|
631 |
+
return;
|
632 |
+
}
|
633 |
+
|
634 |
+
/**
|
635 |
+
* Discount Campaigns Handler
|
636 |
+
*/
|
637 |
+
function discountCampaignsHandler() {
|
638 |
+
clearCard();
|
639 |
+
document.querySelector('#mpCouponApplyed').style.display = 'none';
|
640 |
+
|
641 |
+
if (document.querySelector('#couponCode').value === '') {
|
642 |
+
coupon_of_discounts.status = false;
|
643 |
+
document.querySelector('#mpCouponError').style.display = 'block';
|
644 |
+
document.querySelector('#mpCouponError').innerHTML = wc_mercadopago_params.coupon_empty;
|
645 |
+
document.querySelector('#couponCode').style.background = null;
|
646 |
+
document.querySelector('#applyCoupon').value = wc_mercadopago_params.apply;
|
647 |
+
document.querySelector('#mp-discount').value = 0;
|
648 |
+
} else if (coupon_of_discounts.status) {
|
649 |
+
coupon_of_discounts.status = false;
|
650 |
+
document.querySelector('#mpCouponError').style.display = 'none';
|
651 |
+
document.querySelector('#applyCoupon').style.background = null;
|
652 |
+
document.querySelector('#applyCoupon').value = wc_mercadopago_params.apply;
|
653 |
+
document.querySelector('#couponCode').value = '';
|
654 |
+
document.querySelector('#couponCode').style.background = null;
|
655 |
+
document.querySelector('#mp-discount').value = 0;
|
656 |
+
} else {
|
657 |
+
document.querySelector('#mpCouponError').style.display = 'none';
|
658 |
+
document.querySelector('#couponCode').style.background = 'url(' + wc_mercadopago_params.loading + ') 98% 50% no-repeat #fff';
|
659 |
+
document.querySelector('#couponCode').style.border = '1px solid #cecece';
|
660 |
+
document.querySelector('#applyCoupon').disabled = true;
|
661 |
+
getDiscountCampaigns();
|
662 |
+
}
|
663 |
+
}
|
664 |
+
|
665 |
+
/**
|
666 |
+
* Get Discount Campaigns
|
667 |
+
*/
|
668 |
+
function getDiscountCampaigns() {
|
669 |
+
var url = coupon_of_discounts.discount_action_url;
|
670 |
+
var sp = '?';
|
671 |
+
if (url.indexOf('?') >= 0) {
|
672 |
+
sp = '&';
|
673 |
+
}
|
674 |
+
url += sp + 'site_id=' + wc_mercadopago_params.site_id;
|
675 |
+
url += '&coupon_id=' + document.querySelector('#couponCode').value;
|
676 |
+
url += '&amount=' + document.querySelector('#mp-amount').value;
|
677 |
+
url += '&payer=' + coupon_of_discounts.payer_email;
|
678 |
+
|
679 |
+
$.ajax({
|
680 |
+
url: url,
|
681 |
+
method: 'GET',
|
682 |
+
timeout: 5000,
|
683 |
+
error: function () {
|
684 |
+
coupon_of_discounts.status = false;
|
685 |
+
document.querySelector('#mpCouponApplyed').style.display = 'none';
|
686 |
+
document.querySelector('#mpCouponError').style.display = 'none';
|
687 |
+
document.querySelector('#applyCoupon').style.background = null;
|
688 |
+
document.querySelector('#applyCoupon').value = wc_mercadopago_params.apply;
|
689 |
+
document.querySelector('#couponCode').value = '';
|
690 |
+
document.querySelector('#couponCode').style.background = null;
|
691 |
+
document.querySelector('#mp-discount').value = 0;
|
692 |
+
},
|
693 |
+
success: function (response) {
|
694 |
+
if (response.status === 200) {
|
695 |
+
coupon_of_discounts.status = true;
|
696 |
+
document.querySelector('#mpCouponApplyed').style.display = 'block';
|
697 |
+
document.querySelector('#mp-discount').value = response.response.coupon_amount;
|
698 |
+
document.querySelector('#mpCouponApplyed').innerHTML =
|
699 |
+
wc_mercadopago_params.discount_info1 + ' <strong>' +
|
700 |
+
currencyIdToCurrency(response.response.currency_id) + ' ' +
|
701 |
+
Math.round(response.response.coupon_amount * 100) / 100 +
|
702 |
+
'</strong> ' + wc_mercadopago_params.discount_info2 + ' ' +
|
703 |
+
response.response.name + '.<br>' + wc_mercadopago_params.discount_info3 + ' <strong>' +
|
704 |
+
currencyIdToCurrency(response.response.currency_id) + ' ' +
|
705 |
+
Math.round(getAmountWithoutDiscount() * 100) / 100 +
|
706 |
+
'</strong><br>' + wc_mercadopago_params.discount_info4 + ' <strong>' +
|
707 |
+
currencyIdToCurrency(response.response.currency_id) + ' ' +
|
708 |
+
Math.round(getAmount() * 100) / 100 + '*</strong><br>' +
|
709 |
+
'<i>' + wc_mercadopago_params.discount_info5 + '</i><br>' +
|
710 |
+
'<a href="https://api.mercadolibre.com/campaigns/' +
|
711 |
+
response.response.id +
|
712 |
+
'/terms_and_conditions?format_type=html" target="_blank">' +
|
713 |
+
wc_mercadopago_params.discount_info6 + '</a>';
|
714 |
+
document.querySelector('#mpCouponError').style.display = 'none';
|
715 |
+
document.querySelector('#couponCode').style.background = null;
|
716 |
+
document.querySelector('#couponCode').style.background = 'url(' + wc_mercadopago_params.check + ') 94% 50% no-repeat #fff';
|
717 |
+
document.querySelector('#couponCode').style.border = '1px solid #cecece';
|
718 |
+
document.querySelector('#applyCoupon').value = wc_mercadopago_params.remove;
|
719 |
+
document.querySelector('#campaign_id').value = response.response.id;
|
720 |
+
document.querySelector('#campaign').value = response.response.name;
|
721 |
+
} else {
|
722 |
+
coupon_of_discounts.status = false;
|
723 |
+
document.querySelector('#mpCouponApplyed').style.display = 'none';
|
724 |
+
document.querySelector('#mpCouponError').style.display = 'block';
|
725 |
+
document.querySelector('#mpCouponError').innerHTML = response.response.message;
|
726 |
+
document.querySelector('#couponCode').style.background = null;
|
727 |
+
document.querySelector('#couponCode').style.background = 'url(' + wc_mercadopago_params.error + ') 94% 50% no-repeat #fff';
|
728 |
+
document.querySelector('#applyCoupon').value = wc_mercadopago_params.apply;
|
729 |
+
document.querySelector('#mp-discount').value = 0;
|
730 |
+
}
|
731 |
+
document.querySelector('#applyCoupon').disabled = false;
|
732 |
+
}
|
733 |
+
});
|
734 |
+
}
|
735 |
+
|
736 |
+
/**
|
737 |
+
* CurrencyId to Currency
|
738 |
+
*
|
739 |
+
* @param {string} currency_id
|
740 |
+
*/
|
741 |
+
function currencyIdToCurrency(currency_id) {
|
742 |
+
if (currency_id === 'ARS') {
|
743 |
+
return '$';
|
744 |
+
} else if (currency_id === 'BRL') {
|
745 |
+
return 'R$';
|
746 |
+
} else if (currency_id === 'COP') {
|
747 |
+
return '$';
|
748 |
+
} else if (currency_id === 'CLP') {
|
749 |
+
return '$';
|
750 |
+
} else if (currency_id === 'MXN') {
|
751 |
+
return '$';
|
752 |
+
} else if (currency_id === 'VEF') {
|
753 |
+
return 'Bs';
|
754 |
+
} else if (currency_id === 'PEN') {
|
755 |
+
return 'S/';
|
756 |
+
} else if (currency_id === 'UYU') {
|
757 |
+
return '$U';
|
758 |
+
} else {
|
759 |
+
return '$';
|
760 |
+
}
|
761 |
+
}
|
762 |
+
|
763 |
+
/**
|
764 |
+
* Get Amount Without Discount
|
765 |
+
*
|
766 |
+
* @return {string}
|
767 |
+
*/
|
768 |
+
function getAmountWithoutDiscount() {
|
769 |
+
return document.querySelector('#mp-amount').value;
|
770 |
+
}
|
771 |
+
|
772 |
+
/**
|
773 |
+
* Handler submit
|
774 |
+
*
|
775 |
+
* @return {bool}
|
776 |
+
*/
|
777 |
+
function mercadoPagoFormHandler() {
|
778 |
+
if (mercado_pago_submit) {
|
779 |
+
mercado_pago_submit = false;
|
780 |
+
return true;
|
781 |
+
}
|
782 |
+
|
783 |
+
if (!document.getElementById('payment_method_woo-mercado-pago-custom').checked) {
|
784 |
+
return true;
|
785 |
+
}
|
786 |
+
|
787 |
+
if (validateInputsCreateToken()) {
|
788 |
+
return createToken();
|
789 |
+
}
|
790 |
+
|
791 |
+
return false;
|
792 |
+
}
|
793 |
+
|
794 |
+
// Process when submit the checkout form.
|
795 |
+
$('form.checkout').on('checkout_place_order_woo-mercado-pago-custom', function () {
|
796 |
+
return mercadoPagoFormHandler();
|
797 |
+
});
|
798 |
|
799 |
+
// If payment fail, retry on next checkout page
|
800 |
+
$('form#order_review').submit(function () {
|
801 |
+
return mercadoPagoFormHandler();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
802 |
});
|
803 |
|
804 |
+
window.onload = function() {
|
805 |
+
var body = document.querySelector('body');
|
806 |
+
body.append(sdkTagScript);
|
807 |
+
};
|
808 |
+
});
|
809 |
}(jQuery));
|
assets/js/credit-card.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(x){"use strict";x(function(){var t=!1,a={site_id:wc_mercadopago_params.site_id,public_key:wc_mercadopago_params.public_key},e=document.createElement("script");e.src="https://secure.mlstatic.com/sdk/javascript/v1/mercadopago.js",e.onload=function(){Mercadopago.setPublishableKey(a.public_key)};var n={discount_action_url:wc_mercadopago_params.discount_action_url,payer_email:wc_mercadopago_params.payer_email,activated:wc_mercadopago_params.coupon_mode,status:!1},c={},d={};function o(){0!==document.getElementById("mp-card-number").value&&(document.getElementById("mp-card-number").value="",p(),_(),f(),v(),b())}function r(){var e=document.querySelector("#mp-frame-payments");x("#button-show-payments").on("click",function(){e.style.display="inline-block"===e.style.display?"none":"inline-block"})}function u(){return document.getElementById("mp-card-number").value.replace(/[ .-]/g,"").slice(0,6)}function l(e){I(),document.getElementById("mp-card-holder-name").value="",document.getElementById("mp-card-expiration-date").value="",document.getElementById("mp-security-code").value="",v(),_(),f(),b();var o=u();o.length<6?p():"keyup"===e.type?6<=o.length&&Mercadopago.getPaymentMethod({bin:o},i):setTimeout(function(){6<=o.length&&Mercadopago.getPaymentMethod({bin:o},i)},100)}function m(){return(document.getElementById("mp-amount").value-document.getElementById("mp-discount").value)*document.getElementById("currency_ratio").value}function i(e,o){var t,n;200===e?(c=o[0],n=c.id,document.getElementById("paymentMethodId").value=n,t=c.secure_thumbnail,document.getElementById("mp-card-number").style.background="url("+t+") 98% 50% no-repeat #fff",function(e){d={issuer:!1,cardholder_name:!1,cardholder_identification_type:!1,cardholder_identification_number:!1};for(var o=0;o<e.length;o++)"issuer_id"===e[o]&&(d.issuer=!0),"cardholder_name"===e[o]&&(d.cardholder_name=!0),"cardholder_identification_type"===e[o]&&(d.cardholder_identification_type=!0),"cardholder_identification_number"===e[o]&&(d.cardholder_identification_number=!0)}(c.additional_info_needed),function(){d.cardholder_name?document.getElementById("mp-card-holder-div").style.display="block":document.getElementById("mp-card-holder-div").style.display="none";d.issuer?(document.getElementById("mp-issuer-div").style.display="block",document.getElementById("installments-div").classList.remove("mp-col-md-12"),document.getElementById("installments-div").classList.add("mp-col-md-8"),Mercadopago.getIssuers(c.id,S)):(v(),h());d.cardholder_identification_type?(document.getElementById("mp-doc-div").style.display="inline-block",document.getElementById("mp-doc-type-div").style.display="block",Mercadopago.getIdentificationTypes()):document.getElementById("mp-doc-type-div").style.display="none";d.cardholder_identification_number?(document.getElementById("mp-doc-div").style.display="inline-block",document.getElementById("mp-doc-number-div").style.display="block"):document.getElementById("mp-doc-number-div").style.display="none";d.cardholder_identification_type||d.cardholder_identification_number||(document.getElementById("mp-doc-div").style.display="none")}(),document.getElementById("mp-card-number").classList.remove("mp-form-control-error"),document.getElementById("mp-error-E301").style.display="none"):(p(),document.getElementById("mp-card-number").classList.add("mp-form-control-error"),document.getElementById("mp-error-E301").style.display="inline-block")}function p(){document.getElementById("mp-card-number").style.background="no-repeat #fff"}function s(e){var o="";if("MLA"!==a.site_id)return o;for(var t=0;t<e.length;t++)-1!==e[t].indexOf("CFT_")&&(o='data-tax="'+e[t]+'"');return o}function y(e,o){if(200===e){for(var t=document.getElementById("mp-installments"),n='<option value="-1">'+wc_mercadopago_params.choose+"...</option>",r=[],c=0;c<o.length;c++)"aggregator"===o[c].processing_mode&&(r=o[c].payer_costs);for(var d=0;d<r.length;d++)n+='<option value="'+r[d].installments+'" '+s(r[d].labels)+">"+(r[d].recommended_message||r[d].installments)+"</option>";t.innerHTML=n,"MLA"===a.site_id&&(f(),x("body").on("change","#mp-installments",g))}else _(),f()}function g(){var e=document.querySelector("#mp-installments"),o=e.options[e.selectedIndex].getAttribute("data-tax"),t="",n="";if(null!=o){var r=o.split("|");t=r[0].replace("_"," "),n=r[1].replace("_"," "),"CFT 0,00%"===t&&"TEA 0,00%"===n&&(n=t="")}document.querySelector("#mp-tax-cft-text").innerHTML=t,document.querySelector("#mp-tax-tea-text").innerHTML=n}function _(){document.getElementById("mp-installments").innerHTML=""}function f(){document.querySelector("#mp-tax-cft-text").innerHTML="",document.querySelector("#mp-tax-tea-text").innerHTML=""}function v(){document.getElementById("mp-issuer-div").style.display="none",document.getElementById("installments-div").classList.remove("mp-col-md-8"),document.getElementById("installments-div").classList.add("mp-dis-md-12"),document.getElementById("mp-issuer").innerHTML=""}function b(){document.getElementById("mp-doc-div").style.display="none",document.getElementById("mp-doc-type-div").style.display="none",document.getElementById("docType").innerHTML="",document.getElementById("docNumber").value=""}function h(){for(var e={},o=m(),t=!1,n=0;n<c.additional_info_needed.length;n++)"issuer_id"===c.additional_info_needed[n]&&(t=!0);if(t){var r=document.getElementById("mp-issuer").value;if(e={bin:u(),amount:o,issuer_id:r},"-1"===r)return}else e={bin:u(),amount:o};Mercadopago.getInstallments(e,y)}function S(e,o){if(200===e){var t=document.getElementById("mp-issuer"),n=document.createDocumentFragment();t.options.length=0;var r=new Option(wc_mercadopago_params.choose+"...","-1");n.appendChild(r);for(var c=0;c<o.length;c++){var d="default"===o[c].name?"Otro":o[c].name;n.appendChild(new Option(d,o[c].id))}t.appendChild(n),t.removeAttribute("disabled"),x("body").on("change","#mp-issuer",h)}else v()}function q(){return document.querySelector("#mercadopago-form")}function E(){I();var e=function(){for(var e=!1,o=q(),t=o.querySelectorAll("[data-checkout]"),n=["installments","securityCode","cardExpirationDate","cardNumber"],r=0;r<t.length;r++){var c=t[r];if(-1<n.indexOf(c.getAttribute("data-checkout"))&&("-1"===c.value||""===c.value)){var d=o.querySelectorAll('span[data-main="#'+c.id+'"]');0<d.length&&(d[0].style.display="inline-block"),c.classList.add("mp-form-control-error"),e=!0}}return e||e}(),o=function(){var e=!1;if(d.issuer){var o=document.getElementById("mp-issuer");"-1"!==o.value&&""!==o.value||(o.classList.add("mp-form-control-error"),e=!0)}if(d.cardholder_name){var t=document.getElementById("mp-card-holder-name");"-1"!==t.value&&""!==t.value||(t.classList.add("mp-form-control-error"),e=!0)}if(d.cardholder_identification_type){var n=document.getElementById("docType");"-1"!==n.value&&""!==n.value||(n.classList.add("mp-form-control-error"),e=!0)}if(d.cardholder_identification_number){var r=document.getElementById("docNumber");"-1"!==r.value&&""!==r.value||(r.classList.add("mp-form-control-error"),document.getElementById("mp-error-324").style.display="inline-block",e=!0)}return e||e}();return!e&&!o||(B(),void k())}function k(){void 0!==document.querySelectorAll(".mp-form-control-error")&&document.querySelectorAll(".mp-form-control-error")[0].focus()}function I(){for(var e=0;e<document.querySelectorAll("[data-checkout]").length;e++){var o=document.querySelectorAll("[data-checkout]")[e];o.classList.remove("mp-error-input"),o.classList.remove("mp-form-control-error")}for(var t=0;t<document.querySelectorAll(".mp-error").length;t++){document.querySelectorAll(".mp-error")[t].style.display="none"}}function B(){0<x("form#order_review").length&&x(".blockOverlay").css("display","none")}function C(e,o){(document.querySelector("#mp-box-loading").style.background="",200!==e&&201!==e)?(function(e){for(var o=q(),t=0;t<e.cause.length;t++){var n=e.cause[t],r=void 0;if(void 0!==(r="208"===n.code||"209"===n.code||"325"===n.code||"326"===n.code?o.querySelector("#mp-error-208"):o.querySelector("#mp-error-"+n.code))){var c=o.querySelector(r.getAttribute("data-main"));r.style.display="inline-block",c.classList.add("mp-form-control-error")}}}(o),B(),k()):(document.querySelector("#token").value=o.id,t=!0,x("form.checkout, form#order_review").submit())}function w(){o(),document.querySelector("#mpCouponApplyed").style.display="none",""===document.querySelector("#couponCode").value?(n.status=!1,document.querySelector("#mpCouponError").style.display="block",document.querySelector("#mpCouponError").innerHTML=wc_mercadopago_params.coupon_empty,document.querySelector("#couponCode").style.background=null,document.querySelector("#applyCoupon").value=wc_mercadopago_params.apply,document.querySelector("#mp-discount").value=0):n.status?(n.status=!1,document.querySelector("#mpCouponError").style.display="none",document.querySelector("#applyCoupon").style.background=null,document.querySelector("#applyCoupon").value=wc_mercadopago_params.apply,document.querySelector("#couponCode").value="",document.querySelector("#couponCode").style.background=null,document.querySelector("#mp-discount").value=0):(document.querySelector("#mpCouponError").style.display="none",document.querySelector("#couponCode").style.background="url("+wc_mercadopago_params.loading+") 98% 50% no-repeat #fff",document.querySelector("#couponCode").style.border="1px solid #cecece",document.querySelector("#applyCoupon").disabled=!0,function(){var e=n.discount_action_url,o="?";0<=e.indexOf("?")&&(o="&");e+=o+"site_id="+wc_mercadopago_params.site_id,e+="&coupon_id="+document.querySelector("#couponCode").value,e+="&amount="+document.querySelector("#mp-amount").value,e+="&payer="+n.payer_email,x.ajax({url:e,method:"GET",timeout:5e3,error:function(){n.status=!1,document.querySelector("#mpCouponApplyed").style.display="none",document.querySelector("#mpCouponError").style.display="none",document.querySelector("#applyCoupon").style.background=null,document.querySelector("#applyCoupon").value=wc_mercadopago_params.apply,document.querySelector("#couponCode").value="",document.querySelector("#couponCode").style.background=null,document.querySelector("#mp-discount").value=0},success:function(e){200===e.status?(n.status=!0,document.querySelector("#mpCouponApplyed").style.display="block",document.querySelector("#mp-discount").value=e.response.coupon_amount,document.querySelector("#mpCouponApplyed").innerHTML=wc_mercadopago_params.discount_info1+" <strong>"+L(e.response.currency_id)+" "+Math.round(100*e.response.coupon_amount)/100+"</strong> "+wc_mercadopago_params.discount_info2+" "+e.response.name+".<br>"+wc_mercadopago_params.discount_info3+" <strong>"+L(e.response.currency_id)+" "+Math.round(100*document.querySelector("#mp-amount").value)/100+"</strong><br>"+wc_mercadopago_params.discount_info4+" <strong>"+L(e.response.currency_id)+" "+Math.round(100*m())/100+"*</strong><br><i>"+wc_mercadopago_params.discount_info5+'</i><br><a href="https://api.mercadolibre.com/campaigns/'+e.response.id+'/terms_and_conditions?format_type=html" target="_blank">'+wc_mercadopago_params.discount_info6+"</a>",document.querySelector("#mpCouponError").style.display="none",document.querySelector("#couponCode").style.background=null,document.querySelector("#couponCode").style.background="url("+wc_mercadopago_params.check+") 94% 50% no-repeat #fff",document.querySelector("#couponCode").style.border="1px solid #cecece",document.querySelector("#applyCoupon").value=wc_mercadopago_params.remove,document.querySelector("#campaign_id").value=e.response.id,document.querySelector("#campaign").value=e.response.name):(n.status=!1,document.querySelector("#mpCouponApplyed").style.display="none",document.querySelector("#mpCouponError").style.display="block",document.querySelector("#mpCouponError").innerHTML=e.response.message,document.querySelector("#couponCode").style.background=null,document.querySelector("#couponCode").style.background="url("+wc_mercadopago_params.error+") 94% 50% no-repeat #fff",document.querySelector("#applyCoupon").value=wc_mercadopago_params.apply,document.querySelector("#mp-discount").value=0),document.querySelector("#applyCoupon").disabled=!1}})}())}function L(e){return"ARS"===e?"$":"BRL"===e?"R$":"COP"===e||"CLP"===e||"MXN"===e?"$":"VEF"===e?"Bs":"PEN"===e?"S/":"UYU"===e?"$U":"$"}function M(){return t?!(t=!1):!document.getElementById("payment_method_woo-mercado-pago-custom").checked||!!E()&&function(){I(),document.querySelector("#mp-box-loading").style.background="url("+wc_mercadopago_params.loading+") 0 50% no-repeat #fff";var e=q();return Mercadopago.createToken(e,C),!1}()}0<x("form#order_review").length&&("yes"===n.activated&&x("#applyCoupon").on("click",w),r()),x("body").on("updated_checkout",function(){"yes"===n.activated&&x("#applyCoupon").on("click",w),o(),r()}),x("body").on("keyup","#mp-card-number",l),x("body").on("change","#mp-card-number",l),x("form.checkout").on("checkout_place_order_woo-mercado-pago-custom",function(){return M()}),x("form#order_review").submit(function(){return M()}),window.onload=function(){document.querySelector("body").append(e)}})}(jQuery);
|
assets/js/custom_config_mercadopago.js
CHANGED
@@ -1,122 +1,113 @@
|
|
|
|
|
|
1 |
window.onload = function () {
|
2 |
//remove link breadcrumb, header and save button
|
3 |
-
document.querySelector(
|
4 |
-
document.querySelector(
|
5 |
-
document.querySelector(
|
6 |
-
document.querySelectorAll(
|
7 |
|
8 |
-
var descriptionInput = document.querySelectorAll(
|
9 |
for (var i = 0; i < descriptionInput.length; i++) {
|
10 |
descriptionInput[i].style.width = '420px';
|
11 |
}
|
12 |
|
13 |
//update form_fields label
|
14 |
-
var label = document.querySelectorAll(
|
15 |
-
for (var
|
16 |
-
label[
|
17 |
-
if (label[
|
18 |
-
label[
|
19 |
-
label[
|
20 |
}
|
21 |
}
|
22 |
|
23 |
//collpase ajustes avanzados
|
24 |
-
var table = document.querySelectorAll(
|
25 |
-
for (
|
26 |
-
table[
|
27 |
}
|
28 |
|
29 |
// Remove title and description label necessary for custom
|
30 |
-
document.querySelector(
|
31 |
-
document.querySelector(
|
32 |
-
var removeLabel = document.querySelectorAll(
|
33 |
removeLabel[0].children[0].children[0].style.display = 'none';
|
34 |
removeLabel[0].children[0].children[1].style.display = 'none';
|
35 |
|
36 |
//clone save button
|
37 |
var cloneSaveButton = document.getElementById('woocommerce_woo-mercado-pago-custom_checkout_btn_save');
|
38 |
|
39 |
-
if (document.getElementById(
|
40 |
-
document.getElementById(
|
41 |
}
|
42 |
|
43 |
-
if (document.getElementById(
|
44 |
-
document.getElementById(
|
45 |
-
document.getElementById(
|
46 |
-
document.getElementById(
|
47 |
-
document.getElementById(
|
48 |
|
49 |
-
|
50 |
-
|
51 |
-
var collapse_title = document.querySelector("#woocommerce_woo-mercado-pago-custom_checkout_advanced_settings");
|
52 |
var collapse_table = collapse_title.nextElementSibling;
|
53 |
-
collapse_table.style.display =
|
54 |
-
collapse_title.style.cursor =
|
55 |
|
56 |
-
collapse_title.innerHTML +=
|
57 |
-
<span class=
|
58 |
|
59 |
-
var header_plus = document.querySelector(
|
60 |
-
var header_less = document.querySelector(
|
61 |
|
62 |
collapse_title.onclick = function () {
|
63 |
-
if (collapse_table.style.display
|
64 |
-
collapse_table.style.display =
|
65 |
-
header_less.style.display =
|
66 |
-
header_plus.style.display =
|
67 |
-
}
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
header_plus.style.display = "block";
|
72 |
}
|
73 |
-
}
|
74 |
|
75 |
//collpase Configuración Avanzada
|
76 |
-
document.querySelector(
|
77 |
-
|
78 |
-
|
79 |
-
var collapse_title_2 = document.querySelector("#woocommerce_woo-mercado-pago-custom_checkout_custom_payments_advanced_title");
|
80 |
-
var collapse_table_2 = document.querySelector("#woocommerce_woo-mercado-pago-custom_checkout_payments_advanced_description").nextElementSibling;
|
81 |
-
var collapse_description_2 = document.querySelector("#woocommerce_woo-mercado-pago-custom_checkout_payments_advanced_description");
|
82 |
-
collapse_table_2.style.display = "none";
|
83 |
-
collapse_description_2.style.display = "none";
|
84 |
-
collapse_title_2.style.cursor = "pointer";
|
85 |
|
86 |
-
|
87 |
-
|
|
|
|
|
|
|
|
|
88 |
|
89 |
-
collapse_title_2.innerHTML +=
|
90 |
-
<span class=
|
91 |
|
92 |
-
var header_plus_2 = document.querySelector(
|
93 |
-
var header_less_2 = document.querySelector(
|
94 |
|
95 |
collapse_title_2.onclick = function () {
|
96 |
-
if (collapse_table_2.style.display
|
97 |
-
collapse_table_2.style.display =
|
98 |
-
header_less_2.style.display =
|
99 |
-
collapse_table_2.style.display =
|
100 |
-
header_plus_2.style.display =
|
101 |
-
|
|
|
|
|
|
|
|
|
102 |
}
|
103 |
-
|
104 |
-
collapse_table_2.style.display = "none";
|
105 |
-
header_less_2.style.display = "none";
|
106 |
-
collapse_description_2.style.display = "none";
|
107 |
-
header_plus_2.style.display = "block";
|
108 |
-
// text_advanced_config.style.display = "none";
|
109 |
-
}
|
110 |
-
}
|
111 |
-
|
112 |
}
|
113 |
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
});
|
121 |
-
|
122 |
-
}
|
1 |
+
/*jshint multistr: true */
|
2 |
+
|
3 |
window.onload = function () {
|
4 |
//remove link breadcrumb, header and save button
|
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++) {
|
12 |
descriptionInput[i].style.width = '420px';
|
13 |
}
|
14 |
|
15 |
//update form_fields label
|
16 |
+
var label = document.querySelectorAll('th.titledesc');
|
17 |
+
for (var j = 0; j < label.length; j++) {
|
18 |
+
label[j].id = 'mp_field_text';
|
19 |
+
if (label[j].children[0].children[0] != null) {
|
20 |
+
label[j].children[0].children[0].style.position = 'relative';
|
21 |
+
label[j].children[0].children[0].style.fontSize = '22px';
|
22 |
}
|
23 |
}
|
24 |
|
25 |
//collpase ajustes avanzados
|
26 |
+
var table = document.querySelectorAll('.form-table');
|
27 |
+
for (var k = 0; k < table.length; k++) {
|
28 |
+
table[k].id = 'mp_table_' + k;
|
29 |
}
|
30 |
|
31 |
// Remove title and description label necessary for custom
|
32 |
+
document.querySelector('.hidden-field-mp-title').setAttribute('type', 'hidden');
|
33 |
+
document.querySelector('.hidden-field-mp-desc').setAttribute('type', 'hidden');
|
34 |
+
var removeLabel = document.querySelectorAll('#mp_table_0');
|
35 |
removeLabel[0].children[0].children[0].style.display = 'none';
|
36 |
removeLabel[0].children[0].children[1].style.display = 'none';
|
37 |
|
38 |
//clone save button
|
39 |
var cloneSaveButton = document.getElementById('woocommerce_woo-mercado-pago-custom_checkout_btn_save');
|
40 |
|
41 |
+
if (document.getElementById('woocommerce_woo-mercado-pago-custom_checkout_homolog_title') !== null || document.getElementById('woocommerce_woo-mercado-pago-custom_checkout_credential_description_prod') !== null) {
|
42 |
+
document.getElementById('woocommerce_woo-mercado-pago-custom_checkout_credential_description_prod').nextElementSibling.append(cloneSaveButton.cloneNode(true));
|
43 |
}
|
44 |
|
45 |
+
if (document.getElementById('woocommerce_woo-mercado-pago-custom_checkout_homolog_title') !== null || document.getElementById('woocommerce_woo-mercado-pago-custom_checkout_custom_options_title') !== null) {
|
46 |
+
document.getElementById('woocommerce_woo-mercado-pago-custom_checkout_advanced_settings').nextElementSibling.append(cloneSaveButton.cloneNode(true));
|
47 |
+
document.getElementById('woocommerce_woo-mercado-pago-custom_checkout_custom_options_subtitle').nextElementSibling.append(cloneSaveButton.cloneNode(true));
|
48 |
+
document.getElementById('woocommerce_woo-mercado-pago-custom_checkout_payments_description').nextElementSibling.append(cloneSaveButton.cloneNode(true));
|
49 |
+
document.getElementById('woocommerce_woo-mercado-pago-custom_checkout_payments_advanced_description').nextElementSibling.append(cloneSaveButton.cloneNode(true));
|
50 |
|
51 |
+
var collapse_title = document.querySelector('#woocommerce_woo-mercado-pago-custom_checkout_advanced_settings');
|
|
|
|
|
52 |
var collapse_table = collapse_title.nextElementSibling;
|
53 |
+
collapse_table.style.display = 'none';
|
54 |
+
collapse_title.style.cursor = 'pointer';
|
55 |
|
56 |
+
collapse_title.innerHTML += '<span class="mp-btn-collapsible" id="header_plus" style="display:block">+</span>\
|
57 |
+
<span class="mp-btn-collapsible" id="header_less" style="display:none">-</span>';
|
58 |
|
59 |
+
var header_plus = document.querySelector('#header_plus');
|
60 |
+
var header_less = document.querySelector('#header_less');
|
61 |
|
62 |
collapse_title.onclick = function () {
|
63 |
+
if (collapse_table.style.display === 'none') {
|
64 |
+
collapse_table.style.display = 'block';
|
65 |
+
header_less.style.display = 'block';
|
66 |
+
header_plus.style.display = 'none';
|
67 |
+
} else {
|
68 |
+
collapse_table.style.display = 'none';
|
69 |
+
header_less.style.display = 'none';
|
70 |
+
header_plus.style.display = 'block';
|
|
|
71 |
}
|
72 |
+
};
|
73 |
|
74 |
//collpase Configuración Avanzada
|
75 |
+
document.querySelector('#woocommerce_woo-mercado-pago-custom_checkout_payments_advanced_description').nextElementSibling.style.display = 'none';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
|
77 |
+
var collapse_title_2 = document.querySelector('#woocommerce_woo-mercado-pago-custom_checkout_custom_payments_advanced_title');
|
78 |
+
var collapse_table_2 = document.querySelector('#woocommerce_woo-mercado-pago-custom_checkout_payments_advanced_description').nextElementSibling;
|
79 |
+
var collapse_description_2 = document.querySelector('#woocommerce_woo-mercado-pago-custom_checkout_payments_advanced_description');
|
80 |
+
collapse_table_2.style.display = 'none';
|
81 |
+
collapse_description_2.style.display = 'none';
|
82 |
+
collapse_title_2.style.cursor = 'pointer';
|
83 |
|
84 |
+
collapse_title_2.innerHTML += '<span class="mp-btn-collapsible" id="header_plus_2" style="display:block">+</span>\
|
85 |
+
<span class="mp-btn-collapsible" id="header_less_2" style="display:none">-</span>';
|
86 |
|
87 |
+
var header_plus_2 = document.querySelector('#header_plus_2');
|
88 |
+
var header_less_2 = document.querySelector('#header_less_2');
|
89 |
|
90 |
collapse_title_2.onclick = function () {
|
91 |
+
if (collapse_table_2.style.display === 'none') {
|
92 |
+
collapse_table_2.style.display = 'block';
|
93 |
+
header_less_2.style.display = 'block';
|
94 |
+
collapse_table_2.style.display = 'block';
|
95 |
+
header_plus_2.style.display = 'none';
|
96 |
+
} else {
|
97 |
+
collapse_table_2.style.display = 'none';
|
98 |
+
header_less_2.style.display = 'none';
|
99 |
+
collapse_description_2.style.display = 'none';
|
100 |
+
header_plus_2.style.display = 'block';
|
101 |
}
|
102 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
}
|
104 |
|
105 |
+
if (document.querySelector('.homologScroll') != null) {
|
106 |
+
document.querySelector('.homologScroll').addEventListener('click', function () {
|
107 |
+
document.querySelector('#woocommerce_woo-mercado-pago-custom__mp_access_token_prod').scrollIntoView({
|
108 |
+
block: 'start',
|
109 |
+
behavior: 'smooth'
|
110 |
+
});
|
111 |
});
|
112 |
+
}
|
113 |
+
};
|
assets/js/custom_config_mercadopago.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
window.onload=function(){document.querySelector(".wc-admin-breadcrumb").style.display="none",document.querySelector(".mp-header-logo").style.display="none",document.querySelector("#_wpnonce").parentElement.style.display="none",document.querySelectorAll("h2")[4].style.display="none";for(var e=document.querySelectorAll("p.description"),o=0;o<e.length;o++)e[o].style.width="420px";for(var t=document.querySelectorAll("th.titledesc"),c=0;c<t.length;c++)t[c].id="mp_field_text",null!=t[c].children[0].children[0]&&(t[c].children[0].children[0].style.position="relative",t[c].children[0].children[0].style.fontSize="22px");for(var l=document.querySelectorAll(".form-table"),n=0;n<l.length;n++)l[n].id="mp_table_"+n;document.querySelector(".hidden-field-mp-title").setAttribute("type","hidden"),document.querySelector(".hidden-field-mp-desc").setAttribute("type","hidden");var d=document.querySelectorAll("#mp_table_0");d[0].children[0].children[0].style.display="none",d[0].children[0].children[1].style.display="none";var s=document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_btn_save");if(null===document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_homolog_title")&&null===document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_credential_description_prod")||document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_credential_description_prod").nextElementSibling.append(s.cloneNode(!0)),null!==document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_homolog_title")||null!==document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_custom_options_title")){document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_advanced_settings").nextElementSibling.append(s.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_custom_options_subtitle").nextElementSibling.append(s.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_payments_description").nextElementSibling.append(s.cloneNode(!0)),document.getElementById("woocommerce_woo-mercado-pago-custom_checkout_payments_advanced_description").nextElementSibling.append(s.cloneNode(!0));var m=document.querySelector("#woocommerce_woo-mercado-pago-custom_checkout_advanced_settings"),r=m.nextElementSibling;r.style.display="none",m.style.cursor="pointer",m.innerHTML+='<span class="mp-btn-collapsible" id="header_plus" style="display:block">+</span> <span class="mp-btn-collapsible" id="header_less" style="display:none">-</span>';var a=document.querySelector("#header_plus"),i=document.querySelector("#header_less");m.onclick=function(){"none"===r.style.display?(r.style.display="block",i.style.display="block",a.style.display="none"):(r.style.display="none",i.style.display="none",a.style.display="block")},document.querySelector("#woocommerce_woo-mercado-pago-custom_checkout_payments_advanced_description").nextElementSibling.style.display="none";var p=document.querySelector("#woocommerce_woo-mercado-pago-custom_checkout_custom_payments_advanced_title"),u=document.querySelector("#woocommerce_woo-mercado-pago-custom_checkout_payments_advanced_description").nextElementSibling,y=document.querySelector("#woocommerce_woo-mercado-pago-custom_checkout_payments_advanced_description");u.style.display="none",y.style.display="none",p.style.cursor="pointer",p.innerHTML+='<span class="mp-btn-collapsible" id="header_plus_2" style="display:block">+</span> <span class="mp-btn-collapsible" id="header_less_2" style="display:none">-</span>';var _=document.querySelector("#header_plus_2"),h=document.querySelector("#header_less_2");p.onclick=function(){"none"===u.style.display?(u.style.display="block",h.style.display="block",u.style.display="block",_.style.display="none"):(u.style.display="none",h.style.display="none",y.style.display="none",_.style.display="block")}}null!=document.querySelector(".homologScroll")&&document.querySelector(".homologScroll").addEventListener("click",function(){document.querySelector("#woocommerce_woo-mercado-pago-custom__mp_access_token_prod").scrollIntoView({block:"start",behavior:"smooth"})})};
|
assets/js/ticket.js
CHANGED
@@ -1,34 +1,36 @@
|
|
|
|
|
|
1 |
(function ($) {
|
2 |
'use strict';
|
3 |
|
4 |
$(function () {
|
5 |
var mercado_pago_submit_ticket = false;
|
6 |
-
var mercado_pago_docnumber =
|
7 |
|
8 |
var seller = {
|
9 |
-
site_id: wc_mercadopago_ticket_params.site_id
|
10 |
-
}
|
11 |
|
12 |
var coupon_of_discounts = {
|
13 |
discount_action_url: wc_mercadopago_ticket_params.discount_action_url,
|
14 |
payer_email: wc_mercadopago_ticket_params.payer_email,
|
15 |
-
|
16 |
status: false
|
17 |
-
}
|
18 |
|
19 |
if ($('form#order_review').length > 0) {
|
20 |
-
if (
|
21 |
$('#applyCouponTicket').on('click', discountCampaignsHandler);
|
22 |
}
|
23 |
}
|
24 |
|
25 |
// Load woocommerce checkout form
|
26 |
$('body').on('updated_checkout', function () {
|
27 |
-
if (seller.site_id
|
28 |
validateDocumentInputs();
|
29 |
}
|
30 |
|
31 |
-
if (
|
32 |
$('#applyCouponTicket').on('click', discountCampaignsHandler);
|
33 |
}
|
34 |
});
|
@@ -37,39 +39,47 @@
|
|
37 |
* Validate input depending on document type
|
38 |
*/
|
39 |
function validateDocumentInputs() {
|
40 |
-
var mp_box_lastname = document.getElementById(
|
41 |
-
var mp_box_firstname = document.getElementById(
|
42 |
-
var mp_firstname_label = document.getElementById(
|
43 |
-
var mp_socialname_label = document.getElementById(
|
44 |
-
var mp_cpf_label = document.getElementById(
|
45 |
-
var mp_cnpj_label = document.getElementById(
|
46 |
-
var mp_doc_number = document.getElementById(
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
|
|
|
|
|
|
|
|
60 |
} else {
|
61 |
-
mp_cpf_label.style.display =
|
62 |
-
mp_box_lastname.style.display =
|
63 |
-
mp_firstname_label.style.display =
|
64 |
-
mp_cnpj_label.style.display =
|
65 |
-
mp_socialname_label.style.display =
|
66 |
-
mp_box_firstname.classList.
|
67 |
-
mp_box_firstname.classList.
|
68 |
-
mp_doc_number.setAttribute(
|
69 |
-
mp_doc_number.setAttribute(
|
70 |
-
mercado_pago_docnumber =
|
71 |
}
|
72 |
-
}
|
|
|
|
|
|
|
|
|
73 |
}
|
74 |
|
75 |
/**
|
@@ -77,16 +87,26 @@
|
|
77 |
* @return {bool}
|
78 |
*/
|
79 |
function mercadoPagoFormHandlerTicket() {
|
80 |
-
|
81 |
if (!document.getElementById('payment_method_woo-mercado-pago-ticket').checked) {
|
82 |
return true;
|
83 |
}
|
84 |
-
|
85 |
-
if (seller.site_id
|
86 |
if (validateInputs() && validateDocumentNumber()) {
|
87 |
mercado_pago_submit_ticket = true;
|
88 |
} else {
|
89 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
}
|
91 |
|
92 |
return mercado_pago_submit_ticket;
|
@@ -115,28 +135,28 @@
|
|
115 |
*/
|
116 |
function validateInputs() {
|
117 |
var form = getForm();
|
118 |
-
var form_inputs = form.querySelectorAll(
|
119 |
-
var span = form.querySelectorAll(
|
120 |
|
121 |
//Show or hide error message and border
|
122 |
for (var i = 0; i < form_inputs.length; i++) {
|
123 |
var element = form_inputs[i];
|
124 |
-
var input = form.querySelector(span[i].getAttribute(
|
125 |
|
126 |
-
if (element.parentNode.style.display
|
127 |
-
span[i].style.display =
|
128 |
-
input.classList.add(
|
129 |
} else {
|
130 |
-
span[i].style.display =
|
131 |
-
input.classList.remove(
|
132 |
}
|
133 |
}
|
134 |
|
135 |
//Focus on the element with error
|
136 |
-
for (var
|
137 |
-
var
|
138 |
-
if (
|
139 |
-
|
140 |
return false;
|
141 |
}
|
142 |
}
|
@@ -149,23 +169,25 @@
|
|
149 |
* @return {bool}
|
150 |
*/
|
151 |
function validateDocumentNumber() {
|
152 |
-
var docnumber_input = document.getElementById(
|
153 |
-
var docnumber_error = document.getElementById(
|
154 |
var docnumber_validate = false;
|
155 |
|
156 |
-
if (
|
157 |
-
docnumber_validate =
|
158 |
-
}
|
159 |
-
|
|
|
|
|
160 |
}
|
161 |
|
162 |
if (!docnumber_validate) {
|
163 |
-
docnumber_error.style.display =
|
164 |
-
docnumber_input.classList.add(
|
165 |
docnumber_input.focus();
|
166 |
} else {
|
167 |
-
docnumber_error.style.display =
|
168 |
-
docnumber_input.classList.remove(
|
169 |
docnumber_validate = true;
|
170 |
}
|
171 |
|
@@ -173,37 +195,67 @@
|
|
173 |
}
|
174 |
|
175 |
/**
|
176 |
-
|
177 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
178 |
* @return {bool}
|
179 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
function validateCPF(strCPF) {
|
181 |
var Soma;
|
182 |
var Resto;
|
183 |
|
184 |
Soma = 0;
|
185 |
-
strCPF = strCPF.replace(/[.-\s]/g,
|
186 |
|
187 |
-
if (strCPF
|
188 |
return false;
|
189 |
}
|
190 |
|
191 |
for (var i = 1; i <= 9; i++) {
|
192 |
-
Soma = Soma + parseInt(strCPF.substring(i - 1, i)) * (11 - i);
|
193 |
}
|
194 |
|
195 |
Resto = (Soma * 10) % 11;
|
196 |
-
if ((Resto
|
197 |
-
|
|
|
|
|
198 |
return false;
|
199 |
}
|
200 |
|
201 |
Soma = 0;
|
202 |
-
for (var
|
|
|
|
|
203 |
|
204 |
Resto = (Soma * 10) % 11;
|
205 |
-
if ((Resto
|
206 |
-
|
|
|
|
|
207 |
return false;
|
208 |
}
|
209 |
|
@@ -215,70 +267,99 @@
|
|
215 |
* @param {string} strCNPJ
|
216 |
* @return {bool}
|
217 |
*/
|
218 |
-
function validateCNPJ(strCNPJ)
|
219 |
-
|
|
|
220 |
|
221 |
-
strCNPJ
|
222 |
-
|
223 |
-
|
224 |
-
strCNPJ = strCNPJ.replace("-", "");
|
225 |
-
strCNPJ = strCNPJ.replace("/", "");
|
226 |
-
digitos_iguais = 1;
|
227 |
|
228 |
-
if (strCNPJ.length
|
229 |
return false;
|
230 |
}
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
236 |
}
|
237 |
-
if (!digitos_iguais) {
|
238 |
-
tamanho = strCNPJ.length - 2
|
239 |
-
numeros = strCNPJ.substring(0, tamanho);
|
240 |
-
digitos = strCNPJ.substring(tamanho);
|
241 |
-
soma = 0;
|
242 |
-
pos = tamanho - 7;
|
243 |
-
|
244 |
-
for (i = tamanho; i >= 1; i--) {
|
245 |
-
soma += numeros.charAt(tamanho - i) * pos--;
|
246 |
-
if (pos < 2) {
|
247 |
-
pos = 9;
|
248 |
-
}
|
249 |
-
}
|
250 |
|
251 |
-
|
252 |
-
|
253 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
254 |
}
|
|
|
255 |
|
256 |
-
|
257 |
-
numeros = strCNPJ.substring(0, tamanho);
|
258 |
-
soma = 0;
|
259 |
-
pos = tamanho - 7;
|
260 |
-
for (i = tamanho; i >= 1; i--) {
|
261 |
-
soma += numeros.charAt(tamanho - i) * pos--;
|
262 |
-
if (pos < 2) {
|
263 |
-
pos = 9;
|
264 |
-
}
|
265 |
-
}
|
266 |
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
}
|
271 |
|
272 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
273 |
}
|
274 |
-
|
|
|
|
|
|
|
275 |
return false;
|
276 |
}
|
|
|
|
|
277 |
}
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
282 |
function removeBlockOverlay() {
|
283 |
if ($('form#order_review').length > 0) {
|
284 |
$('.blockOverlay').css('display', 'none');
|
@@ -289,11 +370,11 @@
|
|
289 |
* Discount Campaigns Handler
|
290 |
*/
|
291 |
function discountCampaignsHandler() {
|
292 |
-
document.querySelector('#mpCouponApplyedTicket').style.display =
|
293 |
|
294 |
-
if (document.querySelector('#couponCodeTicket').value
|
295 |
coupon_of_discounts.status = false;
|
296 |
-
document.querySelector('#mpCouponErrorTicket').style.display =
|
297 |
document.querySelector('#mpCouponErrorTicket').innerHTML = wc_mercadopago_ticket_params.coupon_empty;
|
298 |
document.querySelector('#couponCodeTicket').style.background = null;
|
299 |
document.querySelector('#applyCouponTicket').value = wc_mercadopago_ticket_params.apply;
|
@@ -301,17 +382,17 @@
|
|
301 |
|
302 |
} else if (coupon_of_discounts.status) {
|
303 |
coupon_of_discounts.status = false;
|
304 |
-
document.querySelector('#mpCouponErrorTicket').style.display =
|
305 |
document.querySelector('#applyCouponTicket').style.background = null;
|
306 |
document.querySelector('#applyCouponTicket').value = wc_mercadopago_ticket_params.apply;
|
307 |
-
document.querySelector('#couponCodeTicket').value =
|
308 |
document.querySelector('#couponCodeTicket').style.background = null;
|
309 |
document.querySelector('#discountTicket').value = 0;
|
310 |
|
311 |
} else {
|
312 |
-
document.querySelector('#mpCouponErrorTicket').style.display =
|
313 |
-
document.querySelector('#couponCodeTicket').style.background =
|
314 |
-
document.querySelector('#couponCodeTicket').style.border =
|
315 |
document.querySelector('#applyCouponTicket').disabled = true;
|
316 |
getDiscountCampaigns();
|
317 |
}
|
@@ -322,64 +403,64 @@
|
|
322 |
*/
|
323 |
function getDiscountCampaigns() {
|
324 |
var url = coupon_of_discounts.discount_action_url;
|
325 |
-
var sp =
|
326 |
-
if (url.indexOf(
|
327 |
-
sp =
|
328 |
}
|
329 |
-
url += sp +
|
330 |
-
url +=
|
331 |
-
url +=
|
332 |
-
url +=
|
333 |
|
334 |
$.ajax({
|
335 |
url: url,
|
336 |
-
method:
|
337 |
timeout: 5000,
|
338 |
error: function () {
|
339 |
coupon_of_discounts.status = false;
|
340 |
-
document.querySelector('#mpCouponApplyedTicket').style.display =
|
341 |
-
document.querySelector('#mpCouponErrorTicket').style.display =
|
342 |
document.querySelector('#applyCouponTicket').style.background = null;
|
343 |
document.querySelector('#applyCouponTicket').value = wc_mercadopago_ticket_params.apply;
|
344 |
-
document.querySelector('#couponCodeTicket').value =
|
345 |
document.querySelector('#couponCodeTicket').style.background = null;
|
346 |
document.querySelector('#discountTicket').value = 0;
|
347 |
},
|
348 |
-
success: function (response
|
349 |
-
if (response.status
|
350 |
coupon_of_discounts.status = true;
|
351 |
-
document.querySelector('#mpCouponApplyedTicket').style.display =
|
352 |
document.querySelector('#discountTicket').value = response.response.coupon_amount;
|
353 |
document.querySelector('#mpCouponApplyedTicket').innerHTML =
|
354 |
-
wc_mercadopago_ticket_params.discount_info1 +
|
355 |
-
currencyIdToCurrency(response.response.currency_id) +
|
356 |
Math.round(response.response.coupon_amount * 100) / 100 +
|
357 |
-
|
358 |
-
response.response.name +
|
359 |
-
currencyIdToCurrency(response.response.currency_id) +
|
360 |
Math.round(getAmountWithoutDiscount() * 100) / 100 +
|
361 |
-
|
362 |
-
currencyIdToCurrency(response.response.currency_id) +
|
363 |
-
Math.round(getAmount() * 100) / 100 +
|
364 |
-
|
365 |
-
|
366 |
response.response.id +
|
367 |
-
|
368 |
-
wc_mercadopago_ticket_params.discount_info6 +
|
369 |
-
document.querySelector('#mpCouponErrorTicket').style.display =
|
370 |
document.querySelector('#couponCodeTicket').style.background = null;
|
371 |
-
document.querySelector('#couponCodeTicket').style.background =
|
372 |
-
document.querySelector('#couponCodeTicket').style.border =
|
373 |
document.querySelector('#applyCouponTicket').value = wc_mercadopago_ticket_params.remove;
|
374 |
document.querySelector('#campaign_idTicket').value = response.response.id;
|
375 |
document.querySelector('#campaignTicket').value = response.response.name;
|
376 |
} else {
|
377 |
coupon_of_discounts.status = false;
|
378 |
-
document.querySelector('#mpCouponApplyedTicket').style.display =
|
379 |
-
document.querySelector('#mpCouponErrorTicket').style.display =
|
380 |
document.querySelector('#mpCouponErrorTicket').innerHTML = response.response.message;
|
381 |
document.querySelector('#couponCodeTicket').style.background = null;
|
382 |
-
document.querySelector('#couponCodeTicket').style.background =
|
383 |
document.querySelector('#applyCouponTicket').value = wc_mercadopago_ticket_params.apply;
|
384 |
document.querySelector('#discountTicket').value = 0;
|
385 |
}
|
@@ -390,34 +471,34 @@
|
|
390 |
|
391 |
/**
|
392 |
* CurrencyId to Currency
|
393 |
-
*
|
394 |
-
* @param {string} currency_id
|
395 |
*/
|
396 |
function currencyIdToCurrency(currency_id) {
|
397 |
-
if (currency_id
|
398 |
-
return
|
399 |
-
} else if (currency_id
|
400 |
-
return
|
401 |
-
} else if (currency_id
|
402 |
-
return
|
403 |
-
} else if (currency_id
|
404 |
-
return
|
405 |
-
} else if (currency_id
|
406 |
-
return
|
407 |
-
} else if (currency_id
|
408 |
-
return
|
409 |
-
} else if (currency_id
|
410 |
-
return
|
411 |
-
} else if (currency_id
|
412 |
-
return
|
413 |
} else {
|
414 |
-
return
|
415 |
}
|
416 |
}
|
417 |
|
418 |
/**
|
419 |
* Get Amount Without Discount
|
420 |
-
*
|
421 |
* @return {string}
|
422 |
*/
|
423 |
function getAmountWithoutDiscount() {
|
@@ -433,4 +514,4 @@
|
|
433 |
|
434 |
});
|
435 |
|
436 |
-
}(jQuery));
|
1 |
+
/* jshint es3: false */
|
2 |
+
/* globals wc_mercadopago_ticket_params */
|
3 |
(function ($) {
|
4 |
'use strict';
|
5 |
|
6 |
$(function () {
|
7 |
var mercado_pago_submit_ticket = false;
|
8 |
+
var mercado_pago_docnumber = 'CPF';
|
9 |
|
10 |
var seller = {
|
11 |
+
site_id: wc_mercadopago_ticket_params.site_id
|
12 |
+
};
|
13 |
|
14 |
var coupon_of_discounts = {
|
15 |
discount_action_url: wc_mercadopago_ticket_params.discount_action_url,
|
16 |
payer_email: wc_mercadopago_ticket_params.payer_email,
|
17 |
+
activated: wc_mercadopago_ticket_params.coupon_mode,
|
18 |
status: false
|
19 |
+
};
|
20 |
|
21 |
if ($('form#order_review').length > 0) {
|
22 |
+
if (coupon_of_discounts.activated === 'yes') {
|
23 |
$('#applyCouponTicket').on('click', discountCampaignsHandler);
|
24 |
}
|
25 |
}
|
26 |
|
27 |
// Load woocommerce checkout form
|
28 |
$('body').on('updated_checkout', function () {
|
29 |
+
if (seller.site_id === 'MLB') {
|
30 |
validateDocumentInputs();
|
31 |
}
|
32 |
|
33 |
+
if (coupon_of_discounts.activated === 'yes') {
|
34 |
$('#applyCouponTicket').on('click', discountCampaignsHandler);
|
35 |
}
|
36 |
});
|
39 |
* Validate input depending on document type
|
40 |
*/
|
41 |
function validateDocumentInputs() {
|
42 |
+
var mp_box_lastname = document.getElementById('mp_box_lastname');
|
43 |
+
var mp_box_firstname = document.getElementById('mp_box_firstname');
|
44 |
+
var mp_firstname_label = document.getElementById('mp_firstname_label');
|
45 |
+
var mp_socialname_label = document.getElementById('mp_socialname_label');
|
46 |
+
var mp_cpf_label = document.getElementById('mp_cpf_label');
|
47 |
+
var mp_cnpj_label = document.getElementById('mp_cnpj_label');
|
48 |
+
var mp_doc_number = document.getElementById('mp_doc_number');
|
49 |
+
var mp_doc_type = document.querySelectorAll('input[type=radio][name="mercadopago_ticket[docType]"]');
|
50 |
+
|
51 |
+
mp_cnpj_label.style.display = 'none';
|
52 |
+
mp_socialname_label.style.display = 'none';
|
53 |
+
|
54 |
+
var choose_document = function () {
|
55 |
+
if (this.value === 'CPF') {
|
56 |
+
mp_cpf_label.style.display = 'block';
|
57 |
+
mp_box_lastname.style.display = 'grid';
|
58 |
+
mp_firstname_label.style.display = 'block';
|
59 |
+
mp_cnpj_label.style.display = 'none';
|
60 |
+
mp_socialname_label.style.display = 'none';
|
61 |
+
mp_box_firstname.classList.remove('mp-col-md-8');
|
62 |
+
mp_box_firstname.classList.add('mp-col-md-4');
|
63 |
+
mp_doc_number.setAttribute('maxlength', '14');
|
64 |
+
mp_doc_number.setAttribute('onkeyup', 'mpMaskInput(this, mpCpf)');
|
65 |
+
mercado_pago_docnumber = 'CPF';
|
66 |
} else {
|
67 |
+
mp_cpf_label.style.display = 'none';
|
68 |
+
mp_box_lastname.style.display = 'none';
|
69 |
+
mp_firstname_label.style.display = 'none';
|
70 |
+
mp_cnpj_label.style.display = 'block';
|
71 |
+
mp_socialname_label.style.display = 'block';
|
72 |
+
mp_box_firstname.classList.remove('mp-col-md-4');
|
73 |
+
mp_box_firstname.classList.add('mp-col-md-8');
|
74 |
+
mp_doc_number.setAttribute('maxlength', '18');
|
75 |
+
mp_doc_number.setAttribute('onkeyup', 'mpMaskInput(this, mpCnpj)');
|
76 |
+
mercado_pago_docnumber = 'CNPJ';
|
77 |
}
|
78 |
+
};
|
79 |
+
|
80 |
+
for (var i = 0; i < mp_doc_type.length; i++) {
|
81 |
+
mp_doc_type[i].addEventListener('change', choose_document);
|
82 |
+
}
|
83 |
}
|
84 |
|
85 |
/**
|
87 |
* @return {bool}
|
88 |
*/
|
89 |
function mercadoPagoFormHandlerTicket() {
|
90 |
+
|
91 |
if (!document.getElementById('payment_method_woo-mercado-pago-ticket').checked) {
|
92 |
return true;
|
93 |
}
|
94 |
+
|
95 |
+
if (seller.site_id === 'MLB') {
|
96 |
if (validateInputs() && validateDocumentNumber()) {
|
97 |
mercado_pago_submit_ticket = true;
|
98 |
} else {
|
99 |
+
removeBlockOverlay();
|
100 |
+
}
|
101 |
+
|
102 |
+
return mercado_pago_submit_ticket;
|
103 |
+
}
|
104 |
+
|
105 |
+
if (seller.site_id === 'MLU') {
|
106 |
+
if (validateDocumentNumber()) {
|
107 |
+
mercado_pago_submit_ticket = true;
|
108 |
+
} else {
|
109 |
+
removeBlockOverlay();
|
110 |
}
|
111 |
|
112 |
return mercado_pago_submit_ticket;
|
135 |
*/
|
136 |
function validateInputs() {
|
137 |
var form = getForm();
|
138 |
+
var form_inputs = form.querySelectorAll('[data-checkout]');
|
139 |
+
var span = form.querySelectorAll('.mp-erro_febraban');
|
140 |
|
141 |
//Show or hide error message and border
|
142 |
for (var i = 0; i < form_inputs.length; i++) {
|
143 |
var element = form_inputs[i];
|
144 |
+
var input = form.querySelector(span[i].getAttribute('data-main'));
|
145 |
|
146 |
+
if (element.parentNode.style.display !== 'none' && (element.value === -1 || element.value === '')) {
|
147 |
+
span[i].style.display = 'inline-block';
|
148 |
+
input.classList.add('mp-form-control-error');
|
149 |
} else {
|
150 |
+
span[i].style.display = 'none';
|
151 |
+
input.classList.remove('mp-form-control-error');
|
152 |
}
|
153 |
}
|
154 |
|
155 |
//Focus on the element with error
|
156 |
+
for (var j = 0; j < form_inputs.length; j++) {
|
157 |
+
var elementFocus = form_inputs[j];
|
158 |
+
if (elementFocus.parentNode.style.display !== 'none' && (elementFocus.value === -1 || elementFocus.value === '')) {
|
159 |
+
elementFocus.focus();
|
160 |
return false;
|
161 |
}
|
162 |
}
|
169 |
* @return {bool}
|
170 |
*/
|
171 |
function validateDocumentNumber() {
|
172 |
+
var docnumber_input = document.getElementById('mp_doc_number');
|
173 |
+
var docnumber_error = document.getElementById('mp_error_docnumber');
|
174 |
var docnumber_validate = false;
|
175 |
|
176 |
+
if (seller.site_id === 'MLB') {
|
177 |
+
docnumber_validate = validateDocTypeMLB(docnumber_input.value);
|
178 |
+
}
|
179 |
+
|
180 |
+
if (seller.site_id === 'MLU') {
|
181 |
+
docnumber_validate = validateDocTypeMLU(docnumber_input.value);
|
182 |
}
|
183 |
|
184 |
if (!docnumber_validate) {
|
185 |
+
docnumber_error.style.display = 'block';
|
186 |
+
docnumber_input.classList.add('mp-form-control-error');
|
187 |
docnumber_input.focus();
|
188 |
} else {
|
189 |
+
docnumber_error.style.display = 'none';
|
190 |
+
docnumber_input.classList.remove('mp-form-control-error');
|
191 |
docnumber_validate = true;
|
192 |
}
|
193 |
|
195 |
}
|
196 |
|
197 |
/**
|
198 |
+
* Validate Document number for MLB
|
199 |
+
* @param {string} docnumber
|
200 |
+
* @return {bool}
|
201 |
+
*/
|
202 |
+
function validateDocTypeMLB(docnumber) {
|
203 |
+
if (mercado_pago_docnumber === 'CPF') {
|
204 |
+
return validateCPF(docnumber);
|
205 |
+
}
|
206 |
+
return validateCNPJ(docnumber);
|
207 |
+
}
|
208 |
+
|
209 |
+
/**
|
210 |
+
* Validate Document number for MLU
|
211 |
+
* @param {string} docnumber
|
212 |
* @return {bool}
|
213 |
*/
|
214 |
+
function validateDocTypeMLU(docnumber) {
|
215 |
+
if (docnumber !== '') {
|
216 |
+
return validateCI(docnumber);
|
217 |
+
}
|
218 |
+
return false;
|
219 |
+
}
|
220 |
+
|
221 |
+
/**
|
222 |
+
* Validate CPF
|
223 |
+
* @param {string} strCPF
|
224 |
+
* @return {bool}
|
225 |
+
*/
|
226 |
function validateCPF(strCPF) {
|
227 |
var Soma;
|
228 |
var Resto;
|
229 |
|
230 |
Soma = 0;
|
231 |
+
strCPF = strCPF.replace(/[.-\s]/g, '');
|
232 |
|
233 |
+
if (strCPF === '00000000000') {
|
234 |
return false;
|
235 |
}
|
236 |
|
237 |
for (var i = 1; i <= 9; i++) {
|
238 |
+
Soma = Soma + parseInt(strCPF.substring(i - 1, i), 10) * (11 - i);
|
239 |
}
|
240 |
|
241 |
Resto = (Soma * 10) % 11;
|
242 |
+
if ((Resto === 10) || (Resto === 11)) {
|
243 |
+
Resto = 0;
|
244 |
+
}
|
245 |
+
if (Resto !== parseInt(strCPF.substring(9, 10), 10)) {
|
246 |
return false;
|
247 |
}
|
248 |
|
249 |
Soma = 0;
|
250 |
+
for (var j = 1; j <= 10; j++) {
|
251 |
+
Soma = Soma + parseInt(strCPF.substring(j - 1, j), 10) * (12 - j);
|
252 |
+
}
|
253 |
|
254 |
Resto = (Soma * 10) % 11;
|
255 |
+
if ((Resto === 10) || (Resto === 11)) {
|
256 |
+
Resto = 0;
|
257 |
+
}
|
258 |
+
if (Resto !== parseInt(strCPF.substring(10, 11), 10)) {
|
259 |
return false;
|
260 |
}
|
261 |
|
267 |
* @param {string} strCNPJ
|
268 |
* @return {bool}
|
269 |
*/
|
270 |
+
function validateCNPJ(strCNPJ)
|
271 |
+
{
|
272 |
+
strCNPJ = strCNPJ.replace(/[^\d]+/g, '');
|
273 |
|
274 |
+
if (strCNPJ === '') {
|
275 |
+
return false;
|
276 |
+
}
|
|
|
|
|
|
|
277 |
|
278 |
+
if (strCNPJ.length !== 14) {
|
279 |
return false;
|
280 |
}
|
281 |
+
|
282 |
+
if (strCNPJ === '00000000000000' ||
|
283 |
+
strCNPJ === '11111111111111' ||
|
284 |
+
strCNPJ === '22222222222222' ||
|
285 |
+
strCNPJ === '33333333333333' ||
|
286 |
+
strCNPJ === '44444444444444' ||
|
287 |
+
strCNPJ === '55555555555555' ||
|
288 |
+
strCNPJ === '66666666666666' ||
|
289 |
+
strCNPJ === '77777777777777' ||
|
290 |
+
strCNPJ === '88888888888888' ||
|
291 |
+
strCNPJ === '99999999999999') {
|
292 |
+
return false;
|
293 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
294 |
|
295 |
+
var tamanho = strCNPJ.length - 2;
|
296 |
+
var numeros = strCNPJ.substring(0, tamanho);
|
297 |
+
var digitos = strCNPJ.substring(tamanho);
|
298 |
+
var soma = 0;
|
299 |
+
var pos = tamanho - 7;
|
300 |
+
for (var i = tamanho; i >= 1; i--) {
|
301 |
+
soma += numeros.charAt(tamanho - i) * pos--;
|
302 |
+
if (pos < 2) {
|
303 |
+
pos = 9;
|
304 |
}
|
305 |
+
}
|
306 |
|
307 |
+
var resultado = soma % 11 < 2 ? 0 : 11 - soma % 11;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
308 |
|
309 |
+
if (resultado.toString() !== digitos[0]) {
|
310 |
+
return false;
|
311 |
+
}
|
|
|
312 |
|
313 |
+
tamanho = tamanho + 1;
|
314 |
+
numeros = strCNPJ.substring(0, tamanho);
|
315 |
+
soma = 0;
|
316 |
+
pos = tamanho - 7;
|
317 |
+
for (i = tamanho; i >= 1; i--) {
|
318 |
+
soma += numeros.charAt(tamanho - i) * pos--;
|
319 |
+
if (pos < 2) {
|
320 |
+
pos = 9;
|
321 |
+
}
|
322 |
}
|
323 |
+
|
324 |
+
resultado = soma % 11 < 2 ? 0 : 11 - soma % 11;
|
325 |
+
|
326 |
+
if (resultado.toString() !== digitos[1]) {
|
327 |
return false;
|
328 |
}
|
329 |
+
|
330 |
+
return true;
|
331 |
}
|
332 |
+
|
333 |
+
/**
|
334 |
+
* Validate CI MLU
|
335 |
+
* @param {string} docNumber
|
336 |
+
* @return {bool}
|
337 |
+
*/
|
338 |
+
function validateCI(docNumber) {
|
339 |
+
var x = 0;
|
340 |
+
var y = 0;
|
341 |
+
var docCI = 0;
|
342 |
+
var dig = docNumber[docNumber.length - 1];
|
343 |
+
|
344 |
+
if (docNumber.length <= 6) {
|
345 |
+
for (y = docNumber.length; y < 7; y++) {
|
346 |
+
docNumber = '0' + docNumber;
|
347 |
+
}
|
348 |
+
}
|
349 |
+
for (y = 0; y < 7; y++) {
|
350 |
+
x += (parseInt('2987634'[y], 10) * parseInt(docNumber[y], 10)) % 10;
|
351 |
+
}
|
352 |
+
if (x % 10 === 0) {
|
353 |
+
docCI = 0;
|
354 |
+
} else {
|
355 |
+
docCI = 10 - x % 10;
|
356 |
+
}
|
357 |
+
return (dig === docCI);
|
358 |
+
}
|
359 |
+
|
360 |
+
/**
|
361 |
+
* Remove Block Overlay from Order Review page
|
362 |
+
*/
|
363 |
function removeBlockOverlay() {
|
364 |
if ($('form#order_review').length > 0) {
|
365 |
$('.blockOverlay').css('display', 'none');
|
370 |
* Discount Campaigns Handler
|
371 |
*/
|
372 |
function discountCampaignsHandler() {
|
373 |
+
document.querySelector('#mpCouponApplyedTicket').style.display = 'none';
|
374 |
|
375 |
+
if (document.querySelector('#couponCodeTicket').value === '') {
|
376 |
coupon_of_discounts.status = false;
|
377 |
+
document.querySelector('#mpCouponErrorTicket').style.display = 'block';
|
378 |
document.querySelector('#mpCouponErrorTicket').innerHTML = wc_mercadopago_ticket_params.coupon_empty;
|
379 |
document.querySelector('#couponCodeTicket').style.background = null;
|
380 |
document.querySelector('#applyCouponTicket').value = wc_mercadopago_ticket_params.apply;
|
382 |
|
383 |
} else if (coupon_of_discounts.status) {
|
384 |
coupon_of_discounts.status = false;
|
385 |
+
document.querySelector('#mpCouponErrorTicket').style.display = 'none';
|
386 |
document.querySelector('#applyCouponTicket').style.background = null;
|
387 |
document.querySelector('#applyCouponTicket').value = wc_mercadopago_ticket_params.apply;
|
388 |
+
document.querySelector('#couponCodeTicket').value = '';
|
389 |
document.querySelector('#couponCodeTicket').style.background = null;
|
390 |
document.querySelector('#discountTicket').value = 0;
|
391 |
|
392 |
} else {
|
393 |
+
document.querySelector('#mpCouponErrorTicket').style.display = 'none';
|
394 |
+
document.querySelector('#couponCodeTicket').style.background = 'url(' + wc_mercadopago_ticket_params.loading + ') 98% 50% no-repeat #fff';
|
395 |
+
document.querySelector('#couponCodeTicket').style.border = '1px solid #cecece';
|
396 |
document.querySelector('#applyCouponTicket').disabled = true;
|
397 |
getDiscountCampaigns();
|
398 |
}
|
403 |
*/
|
404 |
function getDiscountCampaigns() {
|
405 |
var url = coupon_of_discounts.discount_action_url;
|
406 |
+
var sp = '?';
|
407 |
+
if (url.indexOf('?') >= 0) {
|
408 |
+
sp = '&';
|
409 |
}
|
410 |
+
url += sp + 'site_id=' + wc_mercadopago_ticket_params.site_id;
|
411 |
+
url += '&coupon_id=' + document.querySelector('#couponCodeTicket').value;
|
412 |
+
url += '&amount=' + document.querySelector('#amountTicket').value;
|
413 |
+
url += '&payer=' + coupon_of_discounts.payer_email;
|
414 |
|
415 |
$.ajax({
|
416 |
url: url,
|
417 |
+
method: 'GET',
|
418 |
timeout: 5000,
|
419 |
error: function () {
|
420 |
coupon_of_discounts.status = false;
|
421 |
+
document.querySelector('#mpCouponApplyedTicket').style.display = 'none';
|
422 |
+
document.querySelector('#mpCouponErrorTicket').style.display = 'none';
|
423 |
document.querySelector('#applyCouponTicket').style.background = null;
|
424 |
document.querySelector('#applyCouponTicket').value = wc_mercadopago_ticket_params.apply;
|
425 |
+
document.querySelector('#couponCodeTicket').value = '';
|
426 |
document.querySelector('#couponCodeTicket').style.background = null;
|
427 |
document.querySelector('#discountTicket').value = 0;
|
428 |
},
|
429 |
+
success: function (response) {
|
430 |
+
if (response.status === 200) {
|
431 |
coupon_of_discounts.status = true;
|
432 |
+
document.querySelector('#mpCouponApplyedTicket').style.display = 'block';
|
433 |
document.querySelector('#discountTicket').value = response.response.coupon_amount;
|
434 |
document.querySelector('#mpCouponApplyedTicket').innerHTML =
|
435 |
+
wc_mercadopago_ticket_params.discount_info1 + ' <strong>' +
|
436 |
+
currencyIdToCurrency(response.response.currency_id) + ' ' +
|
437 |
Math.round(response.response.coupon_amount * 100) / 100 +
|
438 |
+
'</strong> ' + wc_mercadopago_ticket_params.discount_info2 + ' ' +
|
439 |
+
response.response.name + '.<br>' + wc_mercadopago_ticket_params.discount_info3 + ' <strong>' +
|
440 |
+
currencyIdToCurrency(response.response.currency_id) + ' ' +
|
441 |
Math.round(getAmountWithoutDiscount() * 100) / 100 +
|
442 |
+
'</strong><br>' + wc_mercadopago_ticket_params.discount_info4 + ' <strong>' +
|
443 |
+
currencyIdToCurrency(response.response.currency_id) + ' ' +
|
444 |
+
Math.round(getAmount() * 100) / 100 + '*</strong><br>' +
|
445 |
+
'<i>' + wc_mercadopago_ticket_params.discount_info5 + '</i><br>' +
|
446 |
+
'<a href="https://api.mercadolibre.com/campaigns/' +
|
447 |
response.response.id +
|
448 |
+
'/terms_and_conditions?format_type=html" target="_blank">' +
|
449 |
+
wc_mercadopago_ticket_params.discount_info6 + '</a>';
|
450 |
+
document.querySelector('#mpCouponErrorTicket').style.display = 'none';
|
451 |
document.querySelector('#couponCodeTicket').style.background = null;
|
452 |
+
document.querySelector('#couponCodeTicket').style.background = 'url(' + wc_mercadopago_ticket_params.check + ') 94% 50% no-repeat #fff';
|
453 |
+
document.querySelector('#couponCodeTicket').style.border = '1px solid #cecece';
|
454 |
document.querySelector('#applyCouponTicket').value = wc_mercadopago_ticket_params.remove;
|
455 |
document.querySelector('#campaign_idTicket').value = response.response.id;
|
456 |
document.querySelector('#campaignTicket').value = response.response.name;
|
457 |
} else {
|
458 |
coupon_of_discounts.status = false;
|
459 |
+
document.querySelector('#mpCouponApplyedTicket').style.display = 'none';
|
460 |
+
document.querySelector('#mpCouponErrorTicket').style.display = 'block';
|
461 |
document.querySelector('#mpCouponErrorTicket').innerHTML = response.response.message;
|
462 |
document.querySelector('#couponCodeTicket').style.background = null;
|
463 |
+
document.querySelector('#couponCodeTicket').style.background = 'url(' + wc_mercadopago_ticket_params.error + ') 94% 50% no-repeat #fff';
|
464 |
document.querySelector('#applyCouponTicket').value = wc_mercadopago_ticket_params.apply;
|
465 |
document.querySelector('#discountTicket').value = 0;
|
466 |
}
|
471 |
|
472 |
/**
|
473 |
* CurrencyId to Currency
|
474 |
+
*
|
475 |
+
* @param {string} currency_id
|
476 |
*/
|
477 |
function currencyIdToCurrency(currency_id) {
|
478 |
+
if (currency_id === 'ARS') {
|
479 |
+
return '$';
|
480 |
+
} else if (currency_id === 'BRL') {
|
481 |
+
return 'R$';
|
482 |
+
} else if (currency_id === 'COP') {
|
483 |
+
return '$';
|
484 |
+
} else if (currency_id === 'CLP') {
|
485 |
+
return '$';
|
486 |
+
} else if (currency_id === 'MXN') {
|
487 |
+
return '$';
|
488 |
+
} else if (currency_id === 'VEF') {
|
489 |
+
return 'Bs';
|
490 |
+
} else if (currency_id === 'PEN') {
|
491 |
+
return 'S/';
|
492 |
+
} else if (currency_id === 'UYU') {
|
493 |
+
return '$U';
|
494 |
} else {
|
495 |
+
return '$';
|
496 |
}
|
497 |
}
|
498 |
|
499 |
/**
|
500 |
* Get Amount Without Discount
|
501 |
+
*
|
502 |
* @return {string}
|
503 |
*/
|
504 |
function getAmountWithoutDiscount() {
|
514 |
|
515 |
});
|
516 |
|
517 |
+
}(jQuery));
|
assets/js/ticket.min.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(l){"use strict";l(function(){var e=!1,d="CPF",n={site_id:wc_mercadopago_ticket_params.site_id},o={discount_action_url:wc_mercadopago_ticket_params.discount_action_url,payer_email:wc_mercadopago_ticket_params.payer_email,activated:wc_mercadopago_ticket_params.coupon_mode,status:!1};function t(){return!document.getElementById("payment_method_woo-mercado-pago-ticket").checked||("MLB"===n.site_id?(function(){for(var e=document.querySelector("#mercadopago-form-ticket"),t=e.querySelectorAll("[data-checkout]"),o=e.querySelectorAll(".mp-erro_febraban"),r=0;r<t.length;r++){var c=t[r],n=e.querySelector(o[r].getAttribute("data-main"));"none"===c.parentNode.style.display||-1!==c.value&&""!==c.value?(o[r].style.display="none",n.classList.remove("mp-form-control-error")):(o[r].style.display="inline-block",n.classList.add("mp-form-control-error"))}for(var u=0;u<t.length;u++){var a=t[u];if("none"!==a.parentNode.style.display&&(-1===a.value||""===a.value))return void a.focus()}return 1}()&&r()?e=!0:c(),e):"MLU"===n.site_id?(r()?e=!0:c(),e):void 0)}function r(){var e,t,o=document.getElementById("mp_doc_number"),r=document.getElementById("mp_error_docnumber"),c=!1;return"MLB"===n.site_id&&(e=o.value,c=("CPF"!==d?function(e){if(""===(e=e.replace(/[^\d]+/g,"")))return!1;if(14!==e.length)return!1;if("00000000000000"===e||"11111111111111"===e||"22222222222222"===e||"33333333333333"===e||"44444444444444"===e||"55555555555555"===e||"66666666666666"===e||"77777777777777"===e||"88888888888888"===e||"99999999999999"===e)return!1;for(var t=e.length-2,o=e.substring(0,t),r=e.substring(t),c=0,n=t-7,u=t;1<=u;u--)c+=o.charAt(t-u)*n--,n<2&&(n=9);var a=c%11<2?0:11-c%11;if(a.toString()!==r[0])return!1;for(t+=1,o=e.substring(0,t),c=0,n=t-7,u=t;1<=u;u--)c+=o.charAt(t-u)*n--,n<2&&(n=9);return(a=c%11<2?0:11-c%11).toString()===r[1]}:function(e){var t,o;if(t=0,"00000000000"===(e=e.replace(/[.-\s]/g,"")))return!1;for(var r=1;r<=9;r++)t+=parseInt(e.substring(r-1,r),10)*(11-r);if(10!=(o=10*t%11)&&11!==o||(o=0),o!==parseInt(e.substring(9,10),10))return!1;t=0;for(var c=1;c<=10;c++)t+=parseInt(e.substring(c-1,c),10)*(12-c);return 10!=(o=10*t%11)&&11!==o||(o=0),o===parseInt(e.substring(10,11),10)})(e)),"MLU"===n.site_id&&(c=""!==(t=o.value)&&function(e){var t=0,o=0,r=e[e.length-1];if(e.length<=6)for(o=e.length;o<7;o++)e="0"+e;for(o=0;o<7;o++)t+=parseInt("2987634"[o],10)*parseInt(e[o],10)%10;return r===(t%10==0?0:10-t%10)}(t)),c?(r.style.display="none",o.classList.remove("mp-form-control-error"),c=!0):(r.style.display="block",o.classList.add("mp-form-control-error"),o.focus()),c}function c(){0<l("form#order_review").length&&l(".blockOverlay").css("display","none")}function u(){document.querySelector("#mpCouponApplyedTicket").style.display="none",""===document.querySelector("#couponCodeTicket").value?(o.status=!1,document.querySelector("#mpCouponErrorTicket").style.display="block",document.querySelector("#mpCouponErrorTicket").innerHTML=wc_mercadopago_ticket_params.coupon_empty,document.querySelector("#couponCodeTicket").style.background=null,document.querySelector("#applyCouponTicket").value=wc_mercadopago_ticket_params.apply,document.querySelector("#discountTicket").value=0):o.status?(o.status=!1,document.querySelector("#mpCouponErrorTicket").style.display="none",document.querySelector("#applyCouponTicket").style.background=null,document.querySelector("#applyCouponTicket").value=wc_mercadopago_ticket_params.apply,document.querySelector("#couponCodeTicket").value="",document.querySelector("#couponCodeTicket").style.background=null,document.querySelector("#discountTicket").value=0):(document.querySelector("#mpCouponErrorTicket").style.display="none",document.querySelector("#couponCodeTicket").style.background="url("+wc_mercadopago_ticket_params.loading+") 98% 50% no-repeat #fff",document.querySelector("#couponCodeTicket").style.border="1px solid #cecece",document.querySelector("#applyCouponTicket").disabled=!0,function(){var e=o.discount_action_url,t="?";0<=e.indexOf("?")&&(t="&");e+=t+"site_id="+wc_mercadopago_ticket_params.site_id,e+="&coupon_id="+document.querySelector("#couponCodeTicket").value,e+="&amount="+document.querySelector("#amountTicket").value,e+="&payer="+o.payer_email,l.ajax({url:e,method:"GET",timeout:5e3,error:function(){o.status=!1,document.querySelector("#mpCouponApplyedTicket").style.display="none",document.querySelector("#mpCouponErrorTicket").style.display="none",document.querySelector("#applyCouponTicket").style.background=null,document.querySelector("#applyCouponTicket").value=wc_mercadopago_ticket_params.apply,document.querySelector("#couponCodeTicket").value="",document.querySelector("#couponCodeTicket").style.background=null,document.querySelector("#discountTicket").value=0},success:function(e){200===e.status?(o.status=!0,document.querySelector("#mpCouponApplyedTicket").style.display="block",document.querySelector("#discountTicket").value=e.response.coupon_amount,document.querySelector("#mpCouponApplyedTicket").innerHTML=wc_mercadopago_ticket_params.discount_info1+" <strong>"+a(e.response.currency_id)+" "+Math.round(100*e.response.coupon_amount)/100+"</strong> "+wc_mercadopago_ticket_params.discount_info2+" "+e.response.name+".<br>"+wc_mercadopago_ticket_params.discount_info3+" <strong>"+a(e.response.currency_id)+" "+Math.round(100*document.querySelector("#amountTicket").value)/100+"</strong><br>"+wc_mercadopago_ticket_params.discount_info4+" <strong>"+a(e.response.currency_id)+" "+Math.round(100*(document.getElementById("amountTicket").value-document.getElementById("discountTicket").value))/100+"*</strong><br><i>"+wc_mercadopago_ticket_params.discount_info5+'</i><br><a href="https://api.mercadolibre.com/campaigns/'+e.response.id+'/terms_and_conditions?format_type=html" target="_blank">'+wc_mercadopago_ticket_params.discount_info6+"</a>",document.querySelector("#mpCouponErrorTicket").style.display="none",document.querySelector("#couponCodeTicket").style.background=null,document.querySelector("#couponCodeTicket").style.background="url("+wc_mercadopago_ticket_params.check+") 94% 50% no-repeat #fff",document.querySelector("#couponCodeTicket").style.border="1px solid #cecece",document.querySelector("#applyCouponTicket").value=wc_mercadopago_ticket_params.remove,document.querySelector("#campaign_idTicket").value=e.response.id,document.querySelector("#campaignTicket").value=e.response.name):(o.status=!1,document.querySelector("#mpCouponApplyedTicket").style.display="none",document.querySelector("#mpCouponErrorTicket").style.display="block",document.querySelector("#mpCouponErrorTicket").innerHTML=e.response.message,document.querySelector("#couponCodeTicket").style.background=null,document.querySelector("#couponCodeTicket").style.background="url("+wc_mercadopago_ticket_params.error+") 94% 50% no-repeat #fff",document.querySelector("#applyCouponTicket").value=wc_mercadopago_ticket_params.apply,document.querySelector("#discountTicket").value=0),document.querySelector("#applyCouponTicket").disabled=!1}})}())}function a(e){return"ARS"===e?"$":"BRL"===e?"R$":"COP"===e||"CLP"===e||"MXN"===e?"$":"VEF"===e?"Bs":"PEN"===e?"S/":"UYU"===e?"$U":"$"}0<l("form#order_review").length&&"yes"===o.activated&&l("#applyCouponTicket").on("click",u),l("body").on("updated_checkout",function(){"MLB"===n.site_id&&function(){var e=document.getElementById("mp_box_lastname"),t=document.getElementById("mp_box_firstname"),o=document.getElementById("mp_firstname_label"),r=document.getElementById("mp_socialname_label"),c=document.getElementById("mp_cpf_label"),n=document.getElementById("mp_cnpj_label"),u=document.getElementById("mp_doc_number"),a=document.querySelectorAll('input[type=radio][name="mercadopago_ticket[docType]"]');n.style.display="none",r.style.display="none";for(var l=function(){d="CPF"===this.value?(c.style.display="block",e.style.display="grid",o.style.display="block",n.style.display="none",r.style.display="none",t.classList.remove("mp-col-md-8"),t.classList.add("mp-col-md-4"),u.setAttribute("maxlength","14"),u.setAttribute("onkeyup","mpMaskInput(this, mpCpf)"),"CPF"):(c.style.display="none",e.style.display="none",o.style.display="none",n.style.display="block",r.style.display="block",t.classList.remove("mp-col-md-4"),t.classList.add("mp-col-md-8"),u.setAttribute("maxlength","18"),u.setAttribute("onkeyup","mpMaskInput(this, mpCnpj)"),"CNPJ")},i=0;i<a.length;i++)a[i].addEventListener("change",l)}(),"yes"===o.activated&&l("#applyCouponTicket").on("click",u)}),l("form.checkout").on("checkout_place_order_woo-mercado-pago-ticket",function(){return t()}),l("form#order_review").submit(function(){return t()})})}(jQuery);
|
assets/js/ticket_config_mercadopago.js
CHANGED
@@ -1,160 +1,162 @@
|
|
|
|
|
|
1 |
window.onload = function () {
|
2 |
//remove link breadcrumb, header and save button
|
3 |
-
document.querySelector(
|
4 |
-
document.querySelector(
|
5 |
-
document.querySelector(
|
6 |
-
document.querySelectorAll(
|
7 |
|
8 |
-
var descriptionInput = document.querySelectorAll(
|
9 |
for (var i = 0; i < descriptionInput.length; i++) {
|
10 |
descriptionInput[i].style.width = '420px';
|
11 |
}
|
12 |
|
13 |
//update form_fields label
|
14 |
-
var label = document.querySelectorAll(
|
15 |
-
for (var
|
16 |
-
label[
|
17 |
-
if (label[
|
18 |
-
label[
|
19 |
-
label[
|
20 |
}
|
21 |
}
|
22 |
|
23 |
//collpase ajustes avanzados
|
24 |
-
var table = document.querySelectorAll(
|
25 |
-
for (
|
26 |
-
table[
|
27 |
}
|
28 |
|
29 |
// Remove title and description label necessary for custom
|
30 |
-
document.querySelector(
|
31 |
-
document.querySelector(
|
32 |
-
var removeLabel = document.querySelectorAll(
|
33 |
removeLabel[0].children[0].children[0].style.display = 'none';
|
34 |
removeLabel[0].children[0].children[1].style.display = 'none';
|
35 |
|
36 |
//clone save button
|
37 |
var cloneSaveButton = document.getElementById('woocommerce_woo-mercado-pago-ticket_checkout_btn_save');
|
38 |
-
if (document.getElementById(
|
39 |
-
document.getElementById(
|
40 |
}
|
41 |
|
42 |
-
if (document.getElementById(
|
43 |
-
|
44 |
-
document.getElementById(
|
45 |
-
document.getElementById(
|
46 |
-
document.getElementById(
|
47 |
|
48 |
-
var collapse_title = document.querySelector(
|
49 |
var collapse_table = collapse_title.nextElementSibling;
|
50 |
-
collapse_table.style.display =
|
51 |
-
collapse_title.style.cursor =
|
52 |
|
53 |
-
collapse_title.innerHTML +=
|
54 |
-
|
55 |
|
56 |
-
var header_plus = document.querySelector(
|
57 |
-
var header_less = document.querySelector(
|
58 |
|
59 |
collapse_title.onclick = function () {
|
60 |
-
if (collapse_table.style.display
|
61 |
-
collapse_table.style.display =
|
62 |
-
header_less.style.display =
|
63 |
-
header_plus.style.display =
|
64 |
-
}
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
header_plus.style.display = "block";
|
69 |
}
|
70 |
-
}
|
71 |
|
72 |
//collpase Configuración Avanzada
|
73 |
-
var collapse_title_2 = document.querySelector(
|
74 |
-
var collapse_table_2 =
|
75 |
-
var collapse_description_2 = document.querySelector(
|
76 |
-
collapse_table_2.style.display =
|
77 |
-
collapse_description_2.style.display =
|
78 |
-
collapse_title_2.style.cursor =
|
79 |
|
80 |
-
collapse_title_2.innerHTML +=
|
81 |
-
|
82 |
|
83 |
-
var header_plus_2 = document.querySelector(
|
84 |
-
var header_less_2 = document.querySelector(
|
85 |
|
86 |
collapse_title_2.onclick = function () {
|
87 |
-
if (collapse_table_2.style.display
|
88 |
-
collapse_table_2.style.display =
|
89 |
-
collapse_description_2.style.display =
|
90 |
-
header_less_2.style.display =
|
91 |
-
header_plus_2.style.display =
|
92 |
}
|
93 |
else {
|
94 |
-
collapse_table_2.style.display =
|
95 |
-
collapse_description_2.style.display =
|
96 |
-
header_less_2.style.display =
|
97 |
-
header_plus_2.style.display =
|
98 |
}
|
99 |
-
}
|
100 |
|
101 |
//payment methods
|
102 |
-
var tablePayments = document.querySelector(
|
103 |
-
var mp_input_payments = document.querySelectorAll(
|
104 |
-
for (
|
105 |
-
mp_input_payments[
|
106 |
}
|
107 |
|
108 |
//offline payments configuration form
|
109 |
-
var
|
|
|
110 |
var countOfflineChecked = 0;
|
111 |
-
var offlineInputs = document.querySelectorAll(
|
112 |
for (var ioff = 0; ioff < offlineInputs.length; ioff++) {
|
113 |
-
|
114 |
-
if (offlineInputs[ioff].checked
|
115 |
countOfflineChecked += 1;
|
116 |
}
|
117 |
}
|
118 |
|
119 |
-
if (countOfflineChecked
|
120 |
-
offlineChecked =
|
121 |
}
|
122 |
|
123 |
-
for (
|
124 |
-
if (
|
125 |
-
var checkbox_offline_prepend =
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
offlineInputs[
|
132 |
break;
|
133 |
}
|
134 |
}
|
135 |
|
136 |
}
|
137 |
|
138 |
-
if(document.querySelector('.homologScroll') != null) {
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
});
|
145 |
}
|
146 |
-
}
|
147 |
|
148 |
//Offline payments
|
149 |
-
function
|
150 |
-
var offlineCheck = document.getElementById(
|
151 |
-
var offlineInputs = document.querySelectorAll(
|
152 |
for (var i = 0; i < offlineInputs.length; i++) {
|
153 |
-
if (offlineCheck
|
154 |
offlineInputs[i].checked = true;
|
155 |
}
|
156 |
else {
|
157 |
offlineInputs[i].checked = false;
|
158 |
}
|
159 |
}
|
160 |
-
}
|
1 |
+
/*jshint multistr: true */
|
2 |
+
|
3 |
window.onload = function () {
|
4 |
//remove link breadcrumb, header and save button
|
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++) {
|
12 |
descriptionInput[i].style.width = '420px';
|
13 |
}
|
14 |
|
15 |
//update form_fields label
|
16 |
+
var label = document.querySelectorAll('th.titledesc');
|
17 |
+
for (var j = 0; j < label.length; j++) {
|
18 |
+
label[j].id = 'mp_field_text';
|
19 |
+
if (label[j].children[0].children[0] != null) {
|
20 |
+
label[j].children[0].children[0].style.position = 'relative';
|
21 |
+
label[j].children[0].children[0].style.fontSize = '22px';
|
22 |
}
|
23 |
}
|
24 |
|
25 |
//collpase ajustes avanzados
|
26 |
+
var table = document.querySelectorAll('.form-table');
|
27 |
+
for (var k = 0; k < table.length; k++) {
|
28 |
+
table[k].id = 'mp_table_' + k;
|
29 |
}
|
30 |
|
31 |
// Remove title and description label necessary for custom
|
32 |
+
document.querySelector('.hidden-field-mp-title').setAttribute('type', 'hidden');
|
33 |
+
document.querySelector('.hidden-field-mp-desc').setAttribute('type', 'hidden');
|
34 |
+
var removeLabel = document.querySelectorAll('#mp_table_0');
|
35 |
removeLabel[0].children[0].children[0].style.display = 'none';
|
36 |
removeLabel[0].children[0].children[1].style.display = 'none';
|
37 |
|
38 |
//clone save button
|
39 |
var cloneSaveButton = document.getElementById('woocommerce_woo-mercado-pago-ticket_checkout_btn_save');
|
40 |
+
if (document.getElementById('woocommerce_woo-mercado-pago-ticket_checkout_homolog_title') !== null || document.getElementById('woocommerce_woo-mercado-pago-ticket_checkout_credential_description_prod') !== null) {
|
41 |
+
document.getElementById('woocommerce_woo-mercado-pago-ticket_checkout_credential_description_prod').nextElementSibling.append(cloneSaveButton.cloneNode(true));
|
42 |
}
|
43 |
|
44 |
+
if (document.getElementById('woocommerce_woo-mercado-pago-ticket_checkout_homolog_title') !== null || document.getElementById('woocommerce_woo-mercado-pago-ticket_checkout_ticket_options_title') !== null) {
|
45 |
+
document.getElementById('woocommerce_woo-mercado-pago-ticket_checkout_ticket_options_subtitle').nextElementSibling.append(cloneSaveButton.cloneNode(true));
|
46 |
+
document.getElementById('woocommerce_woo-mercado-pago-ticket_checkout_advanced_settings').nextElementSibling.append(cloneSaveButton.cloneNode(true));
|
47 |
+
document.getElementById('woocommerce_woo-mercado-pago-ticket_checkout_payments_description').nextElementSibling.append(cloneSaveButton.cloneNode(true));
|
48 |
+
document.getElementById('woocommerce_woo-mercado-pago-ticket_checkout_payments_advanced_description').nextElementSibling.append(cloneSaveButton.cloneNode(true));
|
49 |
|
50 |
+
var collapse_title = document.querySelector('#woocommerce_woo-mercado-pago-ticket_checkout_advanced_settings');
|
51 |
var collapse_table = collapse_title.nextElementSibling;
|
52 |
+
collapse_table.style.display = 'none';
|
53 |
+
collapse_title.style.cursor = 'pointer';
|
54 |
|
55 |
+
collapse_title.innerHTML += '<span class="mp-btn-collapsible" id="header_plus" style="display:block">+</span>\
|
56 |
+
<span class="mp-btn-collapsible" id="header_less" style="display:none">-</span>';
|
57 |
|
58 |
+
var header_plus = document.querySelector('#header_plus');
|
59 |
+
var header_less = document.querySelector('#header_less');
|
60 |
|
61 |
collapse_title.onclick = function () {
|
62 |
+
if (collapse_table.style.display === 'none') {
|
63 |
+
collapse_table.style.display = 'block';
|
64 |
+
header_less.style.display = 'block';
|
65 |
+
header_plus.style.display = 'none';
|
66 |
+
} else {
|
67 |
+
collapse_table.style.display = 'none';
|
68 |
+
header_less.style.display = 'none';
|
69 |
+
header_plus.style.display = 'block';
|
|
|
70 |
}
|
71 |
+
};
|
72 |
|
73 |
//collpase Configuración Avanzada
|
74 |
+
var collapse_title_2 = document.querySelector('#woocommerce_woo-mercado-pago-ticket_checkout_ticket_payments_advanced_title');
|
75 |
+
var collapse_table_2 = document.querySelector('#woocommerce_woo-mercado-pago-ticket_checkout_payments_advanced_description').nextElementSibling;
|
76 |
+
var collapse_description_2 = document.querySelector('#woocommerce_woo-mercado-pago-ticket_checkout_payments_advanced_description');
|
77 |
+
collapse_table_2.style.display = 'none';
|
78 |
+
collapse_description_2.style.display = 'none';
|
79 |
+
collapse_title_2.style.cursor = 'pointer';
|
80 |
|
81 |
+
collapse_title_2.innerHTML += '<span class="mp-btn-collapsible" id="header_plus_2" style="display:block">+</span>\
|
82 |
+
<span class="mp-btn-collapsible" id="header_less_2" style="display:none">-</span>';
|
83 |
|
84 |
+
var header_plus_2 = document.querySelector('#header_plus_2');
|
85 |
+
var header_less_2 = document.querySelector('#header_less_2');
|
86 |
|
87 |
collapse_title_2.onclick = function () {
|
88 |
+
if (collapse_table_2.style.display === 'none') {
|
89 |
+
collapse_table_2.style.display = 'block';
|
90 |
+
collapse_description_2.style.display = 'block';
|
91 |
+
header_less_2.style.display = 'block';
|
92 |
+
header_plus_2.style.display = 'none';
|
93 |
}
|
94 |
else {
|
95 |
+
collapse_table_2.style.display = 'none';
|
96 |
+
collapse_description_2.style.display = 'none';
|
97 |
+
header_less_2.style.display = 'none';
|
98 |
+
header_plus_2.style.display = 'block';
|
99 |
}
|
100 |
+
};
|
101 |
|
102 |
//payment methods
|
103 |
+
var tablePayments = document.querySelector('#woocommerce_woo-mercado-pago-ticket_checkout_payments_description').nextElementSibling.getAttribute('class');
|
104 |
+
var mp_input_payments = document.querySelectorAll('.' + tablePayments + ' td.forminp label');
|
105 |
+
for (var ip = 0; ip < mp_input_payments.length; ip++) {
|
106 |
+
mp_input_payments[ip].id = 'mp_input_payments_mt';
|
107 |
}
|
108 |
|
109 |
//offline payments configuration form
|
110 |
+
var offline_payment_translate = '';
|
111 |
+
var offlineChecked = '';
|
112 |
var countOfflineChecked = 0;
|
113 |
+
var offlineInputs = document.querySelectorAll('.ticket_payment_method_select');
|
114 |
for (var ioff = 0; ioff < offlineInputs.length; ioff++) {
|
115 |
+
offline_payment_translate = offlineInputs[ioff].getAttribute('data-translate');
|
116 |
+
if (offlineInputs[ioff].checked === true) {
|
117 |
countOfflineChecked += 1;
|
118 |
}
|
119 |
}
|
120 |
|
121 |
+
if (countOfflineChecked === offlineInputs.length) {
|
122 |
+
offlineChecked = 'checked';
|
123 |
}
|
124 |
|
125 |
+
for (var offi = 0; offi < offlineInputs.length; offi++) {
|
126 |
+
if (offi === 0) {
|
127 |
+
var checkbox_offline_prepend = '<div class="all_checkbox">\
|
128 |
+
<label for="checkmeoff" id="mp_input_payments" style="margin-bottom: 37px !important;">\
|
129 |
+
<input type="checkbox" name="checkmeoff" id="checkmeoff" ' + offlineChecked + ' onclick="completeOfflineCheckbox()">\
|
130 |
+
'+ offline_payment_translate + '\
|
131 |
+
</label>\
|
132 |
+
</div>';
|
133 |
+
offlineInputs[offi].parentElement.insertAdjacentHTML('beforebegin', checkbox_offline_prepend);
|
134 |
break;
|
135 |
}
|
136 |
}
|
137 |
|
138 |
}
|
139 |
|
140 |
+
if (document.querySelector('.homologScroll') != null) {
|
141 |
+
document.querySelector('.homologScroll').addEventListener('click', function () {
|
142 |
+
document.querySelector('#woocommerce_woo-mercado-pago-ticket__mp_access_token_prod').scrollIntoView({
|
143 |
+
block: 'start',
|
144 |
+
behavior: 'smooth'
|
145 |
+
});
|
146 |
});
|
147 |
}
|
148 |
+
};
|
149 |
|
150 |
//Offline payments
|
151 |
+
window.completeOfflineCheckbox = function () {
|
152 |
+
var offlineCheck = document.getElementById('checkmeoff').checked;
|
153 |
+
var offlineInputs = document.querySelectorAll('.ticket_payment_method_select');
|
154 |
for (var i = 0; i < offlineInputs.length; i++) {
|
155 |
+
if (offlineCheck === true) {
|
156 |
offlineInputs[i].checked = true;
|
157 |
}
|
158 |
else {
|
159 |
offlineInputs[i].checked = false;
|
160 |
}
|
161 |
}
|
162 |
+
};
|
assets/js/ticket_config_mercadopago.min.js
ADDED
@@ -0,0 +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"),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 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_subtitle").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_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,_=document.querySelector("#woocommerce_woo-mercado-pago-ticket_checkout_payments_advanced_description");y.style.display="none",_.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 u=document.querySelector("#header_plus_2"),h=document.querySelector("#header_less_2");p.onclick=function(){"none"===y.style.display?(y.style.display="block",_.style.display="block",h.style.display="block",u.style.display="none"):(y.style.display="none",_.style.display="none",h.style.display="none",u.style.display="block")};for(var k=document.querySelector("#woocommerce_woo-mercado-pago-ticket_checkout_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 w="",S="",f=0,v=document.querySelectorAll(".ticket_payment_method_select"),q=0;q<v.length;q++)w=v[q].getAttribute("data-translate"),!0===v[q].checked&&(f+=1);f===v.length&&(S="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" '+S+' onclick="completeOfflineCheckbox()"> '+w+" </label> </div>";v[E].parentElement.insertAdjacentHTML("beforebegin",x);break}}null!=document.querySelector(".homologScroll")&&document.querySelector(".homologScroll").addEventListener("click",function(){document.querySelector("#woocommerce_woo-mercado-pago-ticket__mp_access_token_prod").scrollIntoView({block:"start",behavior:"smooth"})})},window.completeOfflineCheckbox=function(){for(var e=document.getElementById("checkmeoff").checked,o=document.querySelectorAll(".ticket_payment_method_select"),t=0;t<o.length;t++)o[t].checked=!0===e};
|
i18n/languages/woocommerce-mercadopago-es_AR.mo
CHANGED
Binary file
|
i18n/languages/woocommerce-mercadopago-es_AR.po
CHANGED
@@ -2,15 +2,15 @@
|
|
2 |
# This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Mercado Pago payments for WooCommerce 4.
|
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-
|
13 |
-
"X-Generator: Poedit 2.
|
14 |
"X-Domain: woocommerce-mercadopago\n"
|
15 |
"Last-Translator: \n"
|
16 |
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
@@ -62,20 +62,20 @@ msgid "Discount provided by store"
|
|
62 |
msgstr "Descuento proporcionado por la tienda"
|
63 |
|
64 |
#: includes/module/WC_WooMercadoPago_Configs.php:112
|
65 |
-
msgid "The store
|
66 |
-
msgstr "La tienda debe tener HTTPS para
|
67 |
|
68 |
#: includes/module/WC_WooMercadoPago_Configs.php:118 includes/module/WC_WooMercadoPago_Module.php:250
|
69 |
msgid "Discard"
|
70 |
msgstr "Descartar"
|
71 |
|
72 |
#: includes/module/WC_WooMercadoPago_Module.php:244
|
73 |
-
msgid "
|
74 |
-
msgstr "
|
75 |
|
76 |
#: includes/module/WC_WooMercadoPago_Module.php:263
|
77 |
-
msgid "The
|
78 |
-
msgstr "¡El módulo de
|
79 |
|
80 |
#: includes/module/WC_WooMercadoPago_Module.php:273
|
81 |
msgid "Set up"
|
@@ -319,13 +319,21 @@ msgstr " y comisión de"
|
|
319 |
msgid "fee of"
|
320 |
msgstr "comisión de"
|
321 |
|
322 |
-
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:
|
323 |
-
msgid "
|
324 |
-
msgstr "
|
325 |
|
326 |
-
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:
|
327 |
-
msgid "
|
328 |
-
msgstr "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
329 |
|
330 |
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Basic.php:74
|
331 |
msgid "Thanks for your purchase. Please continue to the payment page by clicking on the button below."
|
@@ -469,8 +477,8 @@ msgid "Set payment preferences in your store"
|
|
469 |
msgstr "Configura las preferencias de pago en tu tienda"
|
470 |
|
471 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
|
472 |
-
msgid "
|
473 |
-
msgstr "
|
474 |
|
475 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
|
476 |
msgid "Payment experience"
|
@@ -533,8 +541,8 @@ msgid "Payment methods"
|
|
533 |
msgstr "Medios de"
|
534 |
|
535 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:468 includes/payments/WC_WooMercadoPago_TicketGateway.php:325
|
536 |
-
msgid "
|
537 |
-
msgstr "
|
538 |
|
539 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:486
|
540 |
msgid "Return to the store"
|
@@ -689,24 +697,24 @@ msgid "<b>Follow these steps to activate Mercado Pago in your store:</b>"
|
|
689 |
msgstr "<b>Sigue estos pasos para activar Mercado Pago en tu tienda:</b>"
|
690 |
|
691 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:395
|
692 |
-
msgid "Upload your
|
693 |
-
msgstr "
|
694 |
|
695 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
|
696 |
-
msgid "Approve your account to be able to charge."
|
697 |
-
msgstr "
|
698 |
|
699 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:409
|
700 |
-
msgid "Add the basic information of your business in the plugin configuration."
|
701 |
-
msgstr "
|
702 |
|
703 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:416
|
704 |
-
msgid "Configure the
|
705 |
-
msgstr "
|
706 |
|
707 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:423
|
708 |
msgid "<b>Go to advanced settings</b> only when you want to change the presets."
|
709 |
-
msgstr "<b>
|
710 |
|
711 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
|
712 |
msgid ""
|
@@ -772,8 +780,8 @@ msgid "Production"
|
|
772 |
msgstr "Producción"
|
773 |
|
774 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
|
775 |
-
msgid "Choose
|
776 |
-
msgstr "
|
777 |
|
778 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
|
779 |
msgid "Load credentials"
|
@@ -800,8 +808,8 @@ msgid "Access token"
|
|
800 |
msgstr "Access token"
|
801 |
|
802 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:729
|
803 |
-
msgid "Production credentials
|
804 |
-
msgstr "Credenciales para producción
|
805 |
|
806 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:741
|
807 |
msgid "With these keys you can receive real payments from your customers."
|
@@ -820,8 +828,8 @@ msgid "Homologate account in Mercado Pago"
|
|
820 |
msgstr "Homologar cuenta en Mercado Pago"
|
821 |
|
822 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:830
|
823 |
-
msgid "Store
|
824 |
-
msgstr "
|
825 |
|
826 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:832
|
827 |
msgid "This name will appear on your customers invoice."
|
@@ -852,7 +860,7 @@ msgid "WC-"
|
|
852 |
msgstr "WC-"
|
853 |
|
854 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:878
|
855 |
-
msgid "Advanced
|
856 |
msgstr "Ajustes avanzados"
|
857 |
|
858 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:891
|
@@ -1216,10 +1224,14 @@ msgstr "Fecha de vencimiento"
|
|
1216 |
msgid "Invalid Expiration Date"
|
1217 |
msgstr "Fecha de expiracion inválida"
|
1218 |
|
1219 |
-
#: templates/checkout/custom_checkout.php:
|
1220 |
-
msgid "
|
1221 |
msgstr "Código de seguridad"
|
1222 |
|
|
|
|
|
|
|
|
|
1223 |
#: templates/checkout/custom_checkout.php:148
|
1224 |
msgid "In how many installments do you want to pay"
|
1225 |
msgstr "En cuántas cuotas quieres pagar"
|
@@ -1429,5 +1441,25 @@ msgid "Accept card payments on your website with the best possible financing and
|
|
1429 |
msgstr "Acepta pagos con tarjeta en tu sitio web con la mejor financiación posible y maximiza la conversión de tu negocio. Con el checkout personalizado tus clientes pagan ¡sin salir de tu tienda!"
|
1430 |
|
1431 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:471 includes/payments/WC_WooMercadoPago_TicketGateway.php:331
|
1432 |
-
msgid "
|
1433 |
-
msgstr "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
# This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Mercado Pago payments for WooCommerce 4.2.0\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
|
7 |
"Language-Team: \n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
11 |
"POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
|
12 |
+
"PO-Revision-Date: 2020-05-08 14:41-0300\n"
|
13 |
+
"X-Generator: Poedit 2.3\n"
|
14 |
"X-Domain: woocommerce-mercadopago\n"
|
15 |
"Last-Translator: \n"
|
16 |
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
62 |
msgstr "Descuento proporcionado por la tienda"
|
63 |
|
64 |
#: includes/module/WC_WooMercadoPago_Configs.php:112
|
65 |
+
msgid "The store should have HTTPS in order to activate both Checkout Personalizado and Ticket Checkout."
|
66 |
+
msgstr "La tienda debe tener HTTPS para activar el Checkout Personalizado y el Ticket Checkout."
|
67 |
|
68 |
#: includes/module/WC_WooMercadoPago_Configs.php:118 includes/module/WC_WooMercadoPago_Module.php:250
|
69 |
msgid "Discard"
|
70 |
msgstr "Descartar"
|
71 |
|
72 |
#: includes/module/WC_WooMercadoPago_Module.php:244
|
73 |
+
msgid "Fill in your credentials to enable payment methods."
|
74 |
+
msgstr "Completá tus credenciales para habilitar los medios de pago."
|
75 |
|
76 |
#: includes/module/WC_WooMercadoPago_Module.php:263
|
77 |
+
msgid "The Mercado Pago module needs an active version of %s in order to work!"
|
78 |
+
msgstr "¡El módulo de Mercado Pago necesita una versión de %s activa para funcionar!"
|
79 |
|
80 |
#: includes/module/WC_WooMercadoPago_Module.php:273
|
81 |
msgid "Set up"
|
319 |
msgid "fee of"
|
320 |
msgstr "comisión de"
|
321 |
|
322 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:361
|
323 |
+
msgid "<b>Public Key</b> production credential is invalid. Remember that it must be complete to receive real payments."
|
324 |
+
msgstr "La credencial para producción <b>Public Key</b> es inválida. Revísala para poder recibir pagos reales."
|
325 |
|
326 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:371
|
327 |
+
msgid "<b>Public Key</b> test credential is invalid. Remember that it must be complete to carry out tests in your store."
|
328 |
+
msgstr "La credencial de prueba <b>Public Key</b> es inválida. Revísala para poder realizar pruebas en tu tienda."
|
329 |
+
|
330 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:381
|
331 |
+
msgid "<b>Access Token</b> production credential is invalid. Remember that it must be complete to receive real payments."
|
332 |
+
msgstr "La credencial para producción <b>Access Token</b> es inválida. Revísala para poder recibir pagos reales."
|
333 |
+
|
334 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:391
|
335 |
+
msgid "<b>Access Token</b> test credential is invalid. Remember that it must be complete to carry out tests in your store."
|
336 |
+
msgstr "La credencial de prueba <b>Access Token</b> es inválida. Revísala para poder realizar pruebas en tu tienda."
|
337 |
|
338 |
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Basic.php:74
|
339 |
msgid "Thanks for your purchase. Please continue to the payment page by clicking on the button below."
|
477 |
msgstr "Configura las preferencias de pago en tu tienda"
|
478 |
|
479 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
|
480 |
+
msgid "Advanced settings"
|
481 |
+
msgstr "Configuración avanzada"
|
482 |
|
483 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
|
484 |
msgid "Payment experience"
|
541 |
msgstr "Medios de"
|
542 |
|
543 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:468 includes/payments/WC_WooMercadoPago_TicketGateway.php:325
|
544 |
+
msgid "Activate the available payment methods to your clients."
|
545 |
+
msgstr "Habilitá los medios de pago disponibles para tus clientes."
|
546 |
|
547 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:486
|
548 |
msgid "Return to the store"
|
697 |
msgstr "<b>Sigue estos pasos para activar Mercado Pago en tu tienda:</b>"
|
698 |
|
699 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:395
|
700 |
+
msgid "<b>Upload your credentials</b> depending on the country in which you are registered."
|
701 |
+
msgstr "<b>Cargá tus credenciales</b> según el país en el que estés registrado."
|
702 |
|
703 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
|
704 |
+
msgid "<b>Approve your account</b> to be able to charge."
|
705 |
+
msgstr "<b>Homologá tu cuenta</b> para poder cobrar."
|
706 |
|
707 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:409
|
708 |
+
msgid "<b>Add the basic information of your business</b> in the plugin configuration."
|
709 |
+
msgstr "<b>Agregá la información básica de tu negocio</b> en la configuración del plugin"
|
710 |
|
711 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:416
|
712 |
+
msgid "<b>Configure the payment preferences</b> for your customers."
|
713 |
+
msgstr "<b>Configurá las preferencias de pago</b> para tus clientes."
|
714 |
|
715 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:423
|
716 |
msgid "<b>Go to advanced settings</b> only when you want to change the presets."
|
717 |
+
msgstr "<b>Andá a configuraciones avanzadas</b> sólo cuando quieras modificar los ajustes preestablecidos."
|
718 |
|
719 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
|
720 |
msgid ""
|
780 |
msgstr "Producción"
|
781 |
|
782 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
|
783 |
+
msgid "Choose “Yes” only when you’re ready to sell. Switch to “No” to activate Testing mode."
|
784 |
+
msgstr "Elegí “Sí” sólo cuando estés listo para vender. Cambiá a “No” para activar el modo Pruebas."
|
785 |
|
786 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
|
787 |
msgid "Load credentials"
|
808 |
msgstr "Access token"
|
809 |
|
810 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:729
|
811 |
+
msgid "Production credentials"
|
812 |
+
msgstr "Credenciales para producción"
|
813 |
|
814 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:741
|
815 |
msgid "With these keys you can receive real payments from your customers."
|
828 |
msgstr "Homologar cuenta en Mercado Pago"
|
829 |
|
830 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:830
|
831 |
+
msgid "Store name"
|
832 |
+
msgstr "Nombre de la tienda"
|
833 |
|
834 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:832
|
835 |
msgid "This name will appear on your customers invoice."
|
860 |
msgstr "WC-"
|
861 |
|
862 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:878
|
863 |
+
msgid "Advanced adjustment"
|
864 |
msgstr "Ajustes avanzados"
|
865 |
|
866 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:891
|
1224 |
msgid "Invalid Expiration Date"
|
1225 |
msgstr "Fecha de expiracion inválida"
|
1226 |
|
1227 |
+
#: templates/checkout/custom_checkout.php:103
|
1228 |
+
msgid "Security code"
|
1229 |
msgstr "Código de seguridad"
|
1230 |
|
1231 |
+
#: templates/checkout/custom_checkout.php:105
|
1232 |
+
msgid "Last 3 numbers on the back"
|
1233 |
+
msgstr "Últimos 3 números en el reverso"
|
1234 |
+
|
1235 |
#: templates/checkout/custom_checkout.php:148
|
1236 |
msgid "In how many installments do you want to pay"
|
1237 |
msgstr "En cuántas cuotas quieres pagar"
|
1441 |
msgstr "Acepta pagos con tarjeta en tu sitio web con la mejor financiación posible y maximiza la conversión de tu negocio. Con el checkout personalizado tus clientes pagan ¡sin salir de tu tienda!"
|
1442 |
|
1443 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:471 includes/payments/WC_WooMercadoPago_TicketGateway.php:331
|
1444 |
+
msgid "Choose the available payment methods in your store."
|
1445 |
+
msgstr "Seleccioná los medios de pago disponibles en tu tienda."
|
1446 |
+
|
1447 |
+
#: includes/admin/notices/WC_WooMercadoPago_Notices.php:94
|
1448 |
+
msgid "Activate WooCommerce"
|
1449 |
+
msgstr "Activar WooCommerce"
|
1450 |
+
|
1451 |
+
#: includes/admin/notices/WC_WooMercadoPago_Notices.php:97
|
1452 |
+
msgid "Install WooCommerce"
|
1453 |
+
msgstr "Instalar WooCommerce"
|
1454 |
+
|
1455 |
+
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:898
|
1456 |
+
msgid "Integrator ID"
|
1457 |
+
msgstr "Integrator ID"
|
1458 |
+
|
1459 |
+
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:900
|
1460 |
+
msgid "Do not forget to enter your integrator_id as a certified Mercado Pago Partner. If you don`t have it, you can %s"
|
1461 |
+
msgstr "No olvides ingresar tu integrator_id como Partner certificado de Mercado Pago. Si no lo tenés, podés %s"
|
1462 |
+
|
1463 |
+
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:903
|
1464 |
+
msgid "request it now."
|
1465 |
+
msgstr "solicitarlo ahora."
|
i18n/languages/woocommerce-mercadopago-es_CL.mo
CHANGED
Binary file
|
i18n/languages/woocommerce-mercadopago-es_CL.po
CHANGED
@@ -2,15 +2,15 @@
|
|
2 |
# This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Mercado Pago payments for WooCommerce 4.
|
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-
|
13 |
-
"X-Generator: Poedit 2.
|
14 |
"X-Domain: woocommerce-mercadopago\n"
|
15 |
"Last-Translator: \n"
|
16 |
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
@@ -62,20 +62,20 @@ msgid "Discount provided by store"
|
|
62 |
msgstr "Descuento proporcionado por la tienda"
|
63 |
|
64 |
#: includes/module/WC_WooMercadoPago_Configs.php:112
|
65 |
-
msgid "The store
|
66 |
-
msgstr "La tienda debe tener HTTPS para
|
67 |
|
68 |
#: includes/module/WC_WooMercadoPago_Configs.php:118 includes/module/WC_WooMercadoPago_Module.php:250
|
69 |
msgid "Discard"
|
70 |
msgstr "Descartar"
|
71 |
|
72 |
#: includes/module/WC_WooMercadoPago_Module.php:244
|
73 |
-
msgid "
|
74 |
-
msgstr "
|
75 |
|
76 |
#: includes/module/WC_WooMercadoPago_Module.php:263
|
77 |
-
msgid "The
|
78 |
-
msgstr "¡El módulo de
|
79 |
|
80 |
#: includes/module/WC_WooMercadoPago_Module.php:273
|
81 |
msgid "Set up"
|
@@ -319,13 +319,21 @@ msgstr " y comisión de"
|
|
319 |
msgid "fee of"
|
320 |
msgstr "comisión de"
|
321 |
|
322 |
-
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:
|
323 |
-
msgid "
|
324 |
-
msgstr "
|
325 |
|
326 |
-
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:
|
327 |
-
msgid "
|
328 |
-
msgstr "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
329 |
|
330 |
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Basic.php:74
|
331 |
msgid "Thanks for your purchase. Please continue to the payment page by clicking on the button below."
|
@@ -469,8 +477,8 @@ msgid "Set payment preferences in your store"
|
|
469 |
msgstr "Configura las preferencias de pago en tu tienda"
|
470 |
|
471 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
|
472 |
-
msgid "
|
473 |
-
msgstr "
|
474 |
|
475 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
|
476 |
msgid "Payment experience"
|
@@ -533,7 +541,7 @@ msgid "Payment methods"
|
|
533 |
msgstr "Medios de"
|
534 |
|
535 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:468 includes/payments/WC_WooMercadoPago_TicketGateway.php:325
|
536 |
-
msgid "
|
537 |
msgstr "Habilita los medios de pago disponibles para tus clientes."
|
538 |
|
539 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:486
|
@@ -689,24 +697,24 @@ msgid "<b>Follow these steps to activate Mercado Pago in your store:</b>"
|
|
689 |
msgstr "<b>Sigue estos pasos para activar Mercado Pago en tu tienda:</b>"
|
690 |
|
691 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:395
|
692 |
-
msgid "Upload your
|
693 |
-
msgstr "Carga tus
|
694 |
|
695 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
|
696 |
-
msgid "Approve your account to be able to charge."
|
697 |
-
msgstr "Homologa tu cuenta para poder cobrar."
|
698 |
|
699 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:409
|
700 |
-
msgid "Add the basic information of your business in the plugin configuration."
|
701 |
-
msgstr "Añade la información básica de tu negocio en la configuración del plugin
|
702 |
|
703 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:416
|
704 |
-
msgid "Configure the
|
705 |
-
msgstr "Configura las preferencias de pago para tus clientes."
|
706 |
|
707 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:423
|
708 |
msgid "<b>Go to advanced settings</b> only when you want to change the presets."
|
709 |
-
msgstr "<b>Ve a configuraciones avanzadas</b>
|
710 |
|
711 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
|
712 |
msgid ""
|
@@ -772,8 +780,8 @@ msgid "Production"
|
|
772 |
msgstr "Producción"
|
773 |
|
774 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
|
775 |
-
msgid "Choose
|
776 |
-
msgstr "Elige
|
777 |
|
778 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
|
779 |
msgid "Load credentials"
|
@@ -800,8 +808,8 @@ msgid "Access token"
|
|
800 |
msgstr "Access token"
|
801 |
|
802 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:729
|
803 |
-
msgid "Production credentials
|
804 |
-
msgstr "Credenciales para producción
|
805 |
|
806 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:741
|
807 |
msgid "With these keys you can receive real payments from your customers."
|
@@ -820,8 +828,8 @@ msgid "Homologate account in Mercado Pago"
|
|
820 |
msgstr "Homologar cuenta en Mercado Pago"
|
821 |
|
822 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:830
|
823 |
-
msgid "Store
|
824 |
-
msgstr "
|
825 |
|
826 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:832
|
827 |
msgid "This name will appear on your customers invoice."
|
@@ -852,7 +860,7 @@ msgid "WC-"
|
|
852 |
msgstr "WC-"
|
853 |
|
854 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:878
|
855 |
-
msgid "Advanced
|
856 |
msgstr "Ajustes avanzados"
|
857 |
|
858 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:891
|
@@ -1216,10 +1224,14 @@ msgstr "Fecha de vencimiento"
|
|
1216 |
msgid "Invalid Expiration Date"
|
1217 |
msgstr "Fecha de expiracion inválida"
|
1218 |
|
1219 |
-
#: templates/checkout/custom_checkout.php:
|
1220 |
-
msgid "
|
1221 |
msgstr "Código de seguridad"
|
1222 |
|
|
|
|
|
|
|
|
|
1223 |
#: templates/checkout/custom_checkout.php:148
|
1224 |
msgid "In how many installments do you want to pay"
|
1225 |
msgstr "En cuántas cuotas quieres pagar"
|
@@ -1429,5 +1441,25 @@ msgid "Accept card payments on your website with the best possible financing and
|
|
1429 |
msgstr "Acepta pagos con tarjeta en tu sitio web con la mejor financiación posible y maximiza la conversión de tu negocio. Con el checkout personalizado tus clientes pagan ¡sin salir de tu tienda!"
|
1430 |
|
1431 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:471 includes/payments/WC_WooMercadoPago_TicketGateway.php:331
|
1432 |
-
msgid "
|
1433 |
msgstr "Selecciona los medios de pago disponibles en tu tienda."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
# This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Mercado Pago payments for WooCommerce 4.2.0\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
|
7 |
"Language-Team: \n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
11 |
"POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
|
12 |
+
"PO-Revision-Date: 2020-05-08 14:41-0300\n"
|
13 |
+
"X-Generator: Poedit 2.3\n"
|
14 |
"X-Domain: woocommerce-mercadopago\n"
|
15 |
"Last-Translator: \n"
|
16 |
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
62 |
msgstr "Descuento proporcionado por la tienda"
|
63 |
|
64 |
#: includes/module/WC_WooMercadoPago_Configs.php:112
|
65 |
+
msgid "The store should have HTTPS in order to activate both Checkout Personalizado and Ticket Checkout."
|
66 |
+
msgstr "La tienda debe tener HTTPS para activar el Checkout Personalizado y el Ticket Checkout."
|
67 |
|
68 |
#: includes/module/WC_WooMercadoPago_Configs.php:118 includes/module/WC_WooMercadoPago_Module.php:250
|
69 |
msgid "Discard"
|
70 |
msgstr "Descartar"
|
71 |
|
72 |
#: includes/module/WC_WooMercadoPago_Module.php:244
|
73 |
+
msgid "Fill in your credentials to enable payment methods."
|
74 |
+
msgstr "Completa tus credenciales para habilitar los medios de pago."
|
75 |
|
76 |
#: includes/module/WC_WooMercadoPago_Module.php:263
|
77 |
+
msgid "The Mercado Pago module needs an active version of %s in order to work!"
|
78 |
+
msgstr "¡El módulo de Mercado Pago necesita una versión de %s activa para funcionar!"
|
79 |
|
80 |
#: includes/module/WC_WooMercadoPago_Module.php:273
|
81 |
msgid "Set up"
|
319 |
msgid "fee of"
|
320 |
msgstr "comisión de"
|
321 |
|
322 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:361
|
323 |
+
msgid "<b>Public Key</b> production credential is invalid. Review the field to receive real payments."
|
324 |
+
msgstr "La credencial para producción <b>Public Key</b> es inválida. Revísala para poder recibir pagos reales."
|
325 |
|
326 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:371
|
327 |
+
msgid "<b>Public Key</b> test credential is invalid. Review the field to perform tests in your store."
|
328 |
+
msgstr "La credencial de prueba <b>Public Key</b> es inválida. Revísala para poder realizar pruebas en tu tienda."
|
329 |
+
|
330 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:381
|
331 |
+
msgid "<b>Access Token</b> production credential is invalid. Remember that it must be complete to receive real payments."
|
332 |
+
msgstr "La credencial para producción <b>Access Token</b> es inválida. Revísala para poder recibir pagos reales."
|
333 |
+
|
334 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:391
|
335 |
+
msgid "<b>Access Token</b> test credential is invalid. Review the field to perform tests in your store."
|
336 |
+
msgstr "La credencial de prueba <b>Access Token</b> es inválida. Revísala para poder realizar pruebas en tu tienda."
|
337 |
|
338 |
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Basic.php:74
|
339 |
msgid "Thanks for your purchase. Please continue to the payment page by clicking on the button below."
|
477 |
msgstr "Configura las preferencias de pago en tu tienda"
|
478 |
|
479 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
|
480 |
+
msgid "Advanced settings"
|
481 |
+
msgstr "Configuración avanzada"
|
482 |
|
483 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
|
484 |
msgid "Payment experience"
|
541 |
msgstr "Medios de"
|
542 |
|
543 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:468 includes/payments/WC_WooMercadoPago_TicketGateway.php:325
|
544 |
+
msgid "Activate the available payment methods to your clients."
|
545 |
msgstr "Habilita los medios de pago disponibles para tus clientes."
|
546 |
|
547 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:486
|
697 |
msgstr "<b>Sigue estos pasos para activar Mercado Pago en tu tienda:</b>"
|
698 |
|
699 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:395
|
700 |
+
msgid "<b>Upload your credentials</b> depending on the country in which you are registered."
|
701 |
+
msgstr "<b>Carga tus credenciales</b> según el país en el que estés registrado."
|
702 |
|
703 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
|
704 |
+
msgid "<b>Approve your account</b> to be able to charge."
|
705 |
+
msgstr "<b>Homologa tu cuenta</b> para poder cobrar."
|
706 |
|
707 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:409
|
708 |
+
msgid "<b>Add the basic information of your business</b> in the plugin configuration."
|
709 |
+
msgstr "<b>Añade la información básica de tu negocio</b> en la configuración del plugin"
|
710 |
|
711 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:416
|
712 |
+
msgid "<b>Configure the payment preferences</b> for your customers."
|
713 |
+
msgstr "<b>Configura las preferencias de pago</b> para tus clientes."
|
714 |
|
715 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:423
|
716 |
msgid "<b>Go to advanced settings</b> only when you want to change the presets."
|
717 |
+
msgstr "<b>Ve a configuraciones avanzadas</b> sólo cuando quieras modificar los ajustes preestablecidos."
|
718 |
|
719 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
|
720 |
msgid ""
|
780 |
msgstr "Producción"
|
781 |
|
782 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
|
783 |
+
msgid "Choose “Yes” only when you’re ready to sell. Switch to “No” to activate Testing mode."
|
784 |
+
msgstr "Elige “Sí” sólo cuando estés listo para vender. Cambia a “No” para activar el modo Pruebas."
|
785 |
|
786 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
|
787 |
msgid "Load credentials"
|
808 |
msgstr "Access token"
|
809 |
|
810 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:729
|
811 |
+
msgid "Production credentials"
|
812 |
+
msgstr "Credenciales para producción"
|
813 |
|
814 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:741
|
815 |
msgid "With these keys you can receive real payments from your customers."
|
828 |
msgstr "Homologar cuenta en Mercado Pago"
|
829 |
|
830 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:830
|
831 |
+
msgid "Store name"
|
832 |
+
msgstr "Nombre de la tienda"
|
833 |
|
834 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:832
|
835 |
msgid "This name will appear on your customers invoice."
|
860 |
msgstr "WC-"
|
861 |
|
862 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:878
|
863 |
+
msgid "Advanced adjustment"
|
864 |
msgstr "Ajustes avanzados"
|
865 |
|
866 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:891
|
1224 |
msgid "Invalid Expiration Date"
|
1225 |
msgstr "Fecha de expiracion inválida"
|
1226 |
|
1227 |
+
#: templates/checkout/custom_checkout.php:103
|
1228 |
+
msgid "Security code"
|
1229 |
msgstr "Código de seguridad"
|
1230 |
|
1231 |
+
#: templates/checkout/custom_checkout.php:105
|
1232 |
+
msgid "Last 3 numbers on the back"
|
1233 |
+
msgstr "Últimos 3 números en el reverso"
|
1234 |
+
|
1235 |
#: templates/checkout/custom_checkout.php:148
|
1236 |
msgid "In how many installments do you want to pay"
|
1237 |
msgstr "En cuántas cuotas quieres pagar"
|
1441 |
msgstr "Acepta pagos con tarjeta en tu sitio web con la mejor financiación posible y maximiza la conversión de tu negocio. Con el checkout personalizado tus clientes pagan ¡sin salir de tu tienda!"
|
1442 |
|
1443 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:471 includes/payments/WC_WooMercadoPago_TicketGateway.php:331
|
1444 |
+
msgid "Choose the available payment methods in your store."
|
1445 |
msgstr "Selecciona los medios de pago disponibles en tu tienda."
|
1446 |
+
|
1447 |
+
#: includes/admin/notices/WC_WooMercadoPago_Notices.php:94
|
1448 |
+
msgid "Activate WooCommerce"
|
1449 |
+
msgstr "Activar WooCommerce"
|
1450 |
+
|
1451 |
+
#: includes/admin/notices/WC_WooMercadoPago_Notices.php:97
|
1452 |
+
msgid "Install WooCommerce"
|
1453 |
+
msgstr "Instalar WooCommerce"
|
1454 |
+
|
1455 |
+
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:898
|
1456 |
+
msgid "Integrator ID"
|
1457 |
+
msgstr "Integrator ID"
|
1458 |
+
|
1459 |
+
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:900
|
1460 |
+
msgid "Do not forget to enter your integrator_id as a certified Mercado Pago Partner. If you don`t have it, you can %s"
|
1461 |
+
msgstr "No olvides ingresar tu integrator_id como Partner certificado de Mercado Pago. Si no lo tienes, puedes %s"
|
1462 |
+
|
1463 |
+
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:903
|
1464 |
+
msgid "request it now."
|
1465 |
+
msgstr "solicitarlo ahora."
|
i18n/languages/woocommerce-mercadopago-es_CO.mo
CHANGED
Binary file
|
i18n/languages/woocommerce-mercadopago-es_CO.po
CHANGED
@@ -2,15 +2,15 @@
|
|
2 |
# This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Mercado Pago payments for WooCommerce 4.
|
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-
|
13 |
-
"X-Generator: Poedit 2.
|
14 |
"X-Domain: woocommerce-mercadopago\n"
|
15 |
"Last-Translator: \n"
|
16 |
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
@@ -62,20 +62,20 @@ msgid "Discount provided by store"
|
|
62 |
msgstr "Descuento proporcionado por la tienda"
|
63 |
|
64 |
#: includes/module/WC_WooMercadoPago_Configs.php:112
|
65 |
-
msgid "The store
|
66 |
-
msgstr "La tienda debe tener HTTPS para
|
67 |
|
68 |
#: includes/module/WC_WooMercadoPago_Configs.php:118 includes/module/WC_WooMercadoPago_Module.php:250
|
69 |
msgid "Discard"
|
70 |
msgstr "Descartar"
|
71 |
|
72 |
#: includes/module/WC_WooMercadoPago_Module.php:244
|
73 |
-
msgid "
|
74 |
-
msgstr "
|
75 |
|
76 |
#: includes/module/WC_WooMercadoPago_Module.php:263
|
77 |
-
msgid "The
|
78 |
-
msgstr "¡El módulo de
|
79 |
|
80 |
#: includes/module/WC_WooMercadoPago_Module.php:273
|
81 |
msgid "Set up"
|
@@ -319,13 +319,21 @@ msgstr " y comisión de"
|
|
319 |
msgid "fee of"
|
320 |
msgstr "comisión de"
|
321 |
|
322 |
-
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:
|
323 |
-
msgid "
|
324 |
-
msgstr "
|
325 |
|
326 |
-
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:
|
327 |
-
msgid "
|
328 |
-
msgstr "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
329 |
|
330 |
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Basic.php:74
|
331 |
msgid "Thanks for your purchase. Please continue to the payment page by clicking on the button below."
|
@@ -469,8 +477,8 @@ msgid "Set payment preferences in your store"
|
|
469 |
msgstr "Configura las preferencias de pago en tu tienda"
|
470 |
|
471 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
|
472 |
-
msgid "
|
473 |
-
msgstr "
|
474 |
|
475 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
|
476 |
msgid "Payment experience"
|
@@ -533,7 +541,7 @@ msgid "Payment methods"
|
|
533 |
msgstr "Medios de"
|
534 |
|
535 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:468 includes/payments/WC_WooMercadoPago_TicketGateway.php:325
|
536 |
-
msgid "
|
537 |
msgstr "Habilita los medios de pago disponibles para tus clientes."
|
538 |
|
539 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:486
|
@@ -689,24 +697,24 @@ msgid "<b>Follow these steps to activate Mercado Pago in your store:</b>"
|
|
689 |
msgstr "<b>Sigue estos pasos para activar Mercado Pago en tu tienda:</b>"
|
690 |
|
691 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:395
|
692 |
-
msgid "Upload your
|
693 |
-
msgstr "Carga tus
|
694 |
|
695 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
|
696 |
-
msgid "Approve your account to be able to charge."
|
697 |
-
msgstr "Homologa tu cuenta para poder cobrar."
|
698 |
|
699 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:409
|
700 |
-
msgid "Add the basic information of your business in the plugin configuration."
|
701 |
-
msgstr "Añade la información básica de tu negocio en la configuración del plugin
|
702 |
|
703 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:416
|
704 |
-
msgid "Configure the
|
705 |
-
msgstr "Configura las preferencias de pago para tus clientes."
|
706 |
|
707 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:423
|
708 |
msgid "<b>Go to advanced settings</b> only when you want to change the presets."
|
709 |
-
msgstr "<b>Ve a configuraciones avanzadas</b>
|
710 |
|
711 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
|
712 |
msgid ""
|
@@ -772,8 +780,8 @@ msgid "Production"
|
|
772 |
msgstr "Producción"
|
773 |
|
774 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
|
775 |
-
msgid "Choose
|
776 |
-
msgstr "Elige
|
777 |
|
778 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
|
779 |
msgid "Load credentials"
|
@@ -800,8 +808,8 @@ msgid "Access token"
|
|
800 |
msgstr "Access token"
|
801 |
|
802 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:729
|
803 |
-
msgid "Production credentials
|
804 |
-
msgstr "Credenciales para producción
|
805 |
|
806 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:741
|
807 |
msgid "With these keys you can receive real payments from your customers."
|
@@ -820,8 +828,8 @@ msgid "Homologate account in Mercado Pago"
|
|
820 |
msgstr "Homologar cuenta en Mercado Pago"
|
821 |
|
822 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:830
|
823 |
-
msgid "Store
|
824 |
-
msgstr "
|
825 |
|
826 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:832
|
827 |
msgid "This name will appear on your customers invoice."
|
@@ -852,7 +860,7 @@ msgid "WC-"
|
|
852 |
msgstr "WC-"
|
853 |
|
854 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:878
|
855 |
-
msgid "Advanced
|
856 |
msgstr "Ajustes avanzados"
|
857 |
|
858 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:891
|
@@ -1216,10 +1224,14 @@ msgstr "Fecha de vencimiento"
|
|
1216 |
msgid "Invalid Expiration Date"
|
1217 |
msgstr "Fecha de expiracion inválida"
|
1218 |
|
1219 |
-
#: templates/checkout/custom_checkout.php:
|
1220 |
-
msgid "
|
1221 |
msgstr "Código de seguridad"
|
1222 |
|
|
|
|
|
|
|
|
|
1223 |
#: templates/checkout/custom_checkout.php:148
|
1224 |
msgid "In how many installments do you want to pay"
|
1225 |
msgstr "En cuántas cuotas quieres pagar"
|
@@ -1429,5 +1441,25 @@ msgid "Accept card payments on your website with the best possible financing and
|
|
1429 |
msgstr "Acepta pagos con tarjeta en tu sitio web con la mejor financiación posible y maximiza la conversión de tu negocio. Con el checkout personalizado tus clientes pagan ¡sin salir de tu tienda!"
|
1430 |
|
1431 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:471 includes/payments/WC_WooMercadoPago_TicketGateway.php:331
|
1432 |
-
msgid "
|
1433 |
msgstr "Selecciona los medios de pago disponibles en tu tienda."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
# This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Mercado Pago payments for WooCommerce 4.2.0\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
|
7 |
"Language-Team: \n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
11 |
"POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
|
12 |
+
"PO-Revision-Date: 2020-05-08 14:41-0300\n"
|
13 |
+
"X-Generator: Poedit 2.3\n"
|
14 |
"X-Domain: woocommerce-mercadopago\n"
|
15 |
"Last-Translator: \n"
|
16 |
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
62 |
msgstr "Descuento proporcionado por la tienda"
|
63 |
|
64 |
#: includes/module/WC_WooMercadoPago_Configs.php:112
|
65 |
+
msgid "The store should have HTTPS in order to activate both Checkout Personalizado and Ticket Checkout."
|
66 |
+
msgstr "La tienda debe tener HTTPS para activar el Checkout Personalizado y el Ticket Checkout."
|
67 |
|
68 |
#: includes/module/WC_WooMercadoPago_Configs.php:118 includes/module/WC_WooMercadoPago_Module.php:250
|
69 |
msgid "Discard"
|
70 |
msgstr "Descartar"
|
71 |
|
72 |
#: includes/module/WC_WooMercadoPago_Module.php:244
|
73 |
+
msgid "Fill in your credentials to enable payment methods."
|
74 |
+
msgstr "Completa tus credenciales para habilitar los medios de pago."
|
75 |
|
76 |
#: includes/module/WC_WooMercadoPago_Module.php:263
|
77 |
+
msgid "The Mercado Pago module needs an active version of %s in order to work!"
|
78 |
+
msgstr "¡El módulo de Mercado Pago necesita una versión de %s activa para funcionar!"
|
79 |
|
80 |
#: includes/module/WC_WooMercadoPago_Module.php:273
|
81 |
msgid "Set up"
|
319 |
msgid "fee of"
|
320 |
msgstr "comisión de"
|
321 |
|
322 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:361
|
323 |
+
msgid "<b>Public Key</b> production credential is invalid. Review the field to receive real payments."
|
324 |
+
msgstr "La credencial para producción <b>Public Key</b> es inválida. Revísala para poder recibir pagos reales."
|
325 |
|
326 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:371
|
327 |
+
msgid "<b>Public Key</b> test credential is invalid. Review the field to perform tests in your store."
|
328 |
+
msgstr "La credencial de prueba <b>Public Key</b> es inválida. Revísala para poder realizar pruebas en tu tienda."
|
329 |
+
|
330 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:381
|
331 |
+
msgid "<b>Access Token</b> production credential is invalid. Remember that it must be complete to receive real payments."
|
332 |
+
msgstr "La credencial para producción <b>Access Token</b> es inválida. Revísala para poder recibir pagos reales."
|
333 |
+
|
334 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:391
|
335 |
+
msgid "<b>Access Token</b> test credential is invalid. Review the field to perform tests in your store."
|
336 |
+
msgstr "La credencial de prueba <b>Access Token</b> es inválida. Revísala para poder realizar pruebas en tu tienda."
|
337 |
|
338 |
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Basic.php:74
|
339 |
msgid "Thanks for your purchase. Please continue to the payment page by clicking on the button below."
|
477 |
msgstr "Configura las preferencias de pago en tu tienda"
|
478 |
|
479 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
|
480 |
+
msgid "Advanced settings"
|
481 |
+
msgstr "Configuración avanzada"
|
482 |
|
483 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
|
484 |
msgid "Payment experience"
|
541 |
msgstr "Medios de"
|
542 |
|
543 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:468 includes/payments/WC_WooMercadoPago_TicketGateway.php:325
|
544 |
+
msgid "Activate the available payment methods to your clients."
|
545 |
msgstr "Habilita los medios de pago disponibles para tus clientes."
|
546 |
|
547 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:486
|
697 |
msgstr "<b>Sigue estos pasos para activar Mercado Pago en tu tienda:</b>"
|
698 |
|
699 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:395
|
700 |
+
msgid "<b>Upload your credentials</b> depending on the country in which you are registered."
|
701 |
+
msgstr "<b>Carga tus credenciales</b> según el país en el que estés registrado."
|
702 |
|
703 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
|
704 |
+
msgid "<b>Approve your account</b> to be able to charge."
|
705 |
+
msgstr "<b>Homologa tu cuenta</b> para poder cobrar."
|
706 |
|
707 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:409
|
708 |
+
msgid "<b>Add the basic information of your business</b> in the plugin configuration."
|
709 |
+
msgstr "<b>Añade la información básica de tu negocio</b> en la configuración del plugin"
|
710 |
|
711 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:416
|
712 |
+
msgid "<b>Configure the payment preferences</b> for your customers."
|
713 |
+
msgstr "<b>Configura las preferencias de pago</b> para tus clientes."
|
714 |
|
715 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:423
|
716 |
msgid "<b>Go to advanced settings</b> only when you want to change the presets."
|
717 |
+
msgstr "<b>Ve a configuraciones avanzadas</b> sólo cuando quieras modificar los ajustes preestablecidos."
|
718 |
|
719 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
|
720 |
msgid ""
|
780 |
msgstr "Producción"
|
781 |
|
782 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
|
783 |
+
msgid "Choose “Yes” only when you’re ready to sell. Switch to “No” to activate Testing mode."
|
784 |
+
msgstr "Elige “Sí” sólo cuando estés listo para vender. Cambia a “No” para activar el modo Pruebas."
|
785 |
|
786 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
|
787 |
msgid "Load credentials"
|
808 |
msgstr "Access token"
|
809 |
|
810 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:729
|
811 |
+
msgid "Production credentials"
|
812 |
+
msgstr "Credenciales para producción"
|
813 |
|
814 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:741
|
815 |
msgid "With these keys you can receive real payments from your customers."
|
828 |
msgstr "Homologar cuenta en Mercado Pago"
|
829 |
|
830 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:830
|
831 |
+
msgid "Store name"
|
832 |
+
msgstr "Nombre de la tienda"
|
833 |
|
834 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:832
|
835 |
msgid "This name will appear on your customers invoice."
|
860 |
msgstr "WC-"
|
861 |
|
862 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:878
|
863 |
+
msgid "Advanced adjustment"
|
864 |
msgstr "Ajustes avanzados"
|
865 |
|
866 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:891
|
1224 |
msgid "Invalid Expiration Date"
|
1225 |
msgstr "Fecha de expiracion inválida"
|
1226 |
|
1227 |
+
#: templates/checkout/custom_checkout.php:103
|
1228 |
+
msgid "Security code"
|
1229 |
msgstr "Código de seguridad"
|
1230 |
|
1231 |
+
#: templates/checkout/custom_checkout.php:105
|
1232 |
+
msgid "Last 3 numbers on the back"
|
1233 |
+
msgstr "Últimos 3 números en el reverso"
|
1234 |
+
|
1235 |
#: templates/checkout/custom_checkout.php:148
|
1236 |
msgid "In how many installments do you want to pay"
|
1237 |
msgstr "En cuántas cuotas quieres pagar"
|
1441 |
msgstr "Acepta pagos con tarjeta en tu sitio web con la mejor financiación posible y maximiza la conversión de tu negocio. Con el checkout personalizado tus clientes pagan ¡sin salir de tu tienda!"
|
1442 |
|
1443 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:471 includes/payments/WC_WooMercadoPago_TicketGateway.php:331
|
1444 |
+
msgid "Choose the available payment methods in your store."
|
1445 |
msgstr "Selecciona los medios de pago disponibles en tu tienda."
|
1446 |
+
|
1447 |
+
#: includes/admin/notices/WC_WooMercadoPago_Notices.php:94
|
1448 |
+
msgid "Activate WooCommerce"
|
1449 |
+
msgstr "Activar WooCommerce"
|
1450 |
+
|
1451 |
+
#: includes/admin/notices/WC_WooMercadoPago_Notices.php:97
|
1452 |
+
msgid "Install WooCommerce"
|
1453 |
+
msgstr "Instalar WooCommerce"
|
1454 |
+
|
1455 |
+
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:898
|
1456 |
+
msgid "Integrator ID"
|
1457 |
+
msgstr "Integrator ID"
|
1458 |
+
|
1459 |
+
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:900
|
1460 |
+
msgid "Do not forget to enter your integrator_id as a certified Mercado Pago Partner. If you don`t have it, you can %s"
|
1461 |
+
msgstr "No olvides ingresar tu integrator_id como Partner certificado de Mercado Pago. Si no lo tienes, puedes %s"
|
1462 |
+
|
1463 |
+
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:903
|
1464 |
+
msgid "request it now."
|
1465 |
+
msgstr "solicitarlo ahora."
|
i18n/languages/woocommerce-mercadopago-es_ES.mo
CHANGED
Binary file
|
i18n/languages/woocommerce-mercadopago-es_ES.po
CHANGED
@@ -2,15 +2,15 @@
|
|
2 |
# This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Mercado Pago payments for WooCommerce 4.
|
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-
|
13 |
-
"X-Generator: Poedit 2.
|
14 |
"X-Domain: woocommerce-mercadopago\n"
|
15 |
"Last-Translator: \n"
|
16 |
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
@@ -62,20 +62,20 @@ msgid "Discount provided by store"
|
|
62 |
msgstr "Descuento proporcionado por la tienda"
|
63 |
|
64 |
#: includes/module/WC_WooMercadoPago_Configs.php:112
|
65 |
-
msgid "The store
|
66 |
-
msgstr "La tienda debe tener HTTPS para
|
67 |
|
68 |
#: includes/module/WC_WooMercadoPago_Configs.php:118 includes/module/WC_WooMercadoPago_Module.php:250
|
69 |
msgid "Discard"
|
70 |
msgstr "Descartar"
|
71 |
|
72 |
#: includes/module/WC_WooMercadoPago_Module.php:244
|
73 |
-
msgid "
|
74 |
-
msgstr "
|
75 |
|
76 |
#: includes/module/WC_WooMercadoPago_Module.php:263
|
77 |
-
msgid "The
|
78 |
-
msgstr "¡El módulo de
|
79 |
|
80 |
#: includes/module/WC_WooMercadoPago_Module.php:273
|
81 |
msgid "Set up"
|
@@ -319,13 +319,21 @@ msgstr " y comisión de"
|
|
319 |
msgid "fee of"
|
320 |
msgstr "comisión de"
|
321 |
|
322 |
-
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:
|
323 |
-
msgid "
|
324 |
-
msgstr "
|
325 |
|
326 |
-
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:
|
327 |
-
msgid "
|
328 |
-
msgstr "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
329 |
|
330 |
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Basic.php:74
|
331 |
msgid "Thanks for your purchase. Please continue to the payment page by clicking on the button below."
|
@@ -469,8 +477,8 @@ msgid "Set payment preferences in your store"
|
|
469 |
msgstr "Configura las preferencias de pago en tu tienda"
|
470 |
|
471 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
|
472 |
-
msgid "
|
473 |
-
msgstr "
|
474 |
|
475 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
|
476 |
msgid "Payment experience"
|
@@ -533,7 +541,7 @@ msgid "Payment methods"
|
|
533 |
msgstr "Medios de"
|
534 |
|
535 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:468 includes/payments/WC_WooMercadoPago_TicketGateway.php:325
|
536 |
-
msgid "
|
537 |
msgstr "Habilita los medios de pago disponibles para tus clientes."
|
538 |
|
539 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:486
|
@@ -689,24 +697,24 @@ msgid "<b>Follow these steps to activate Mercado Pago in your store:</b>"
|
|
689 |
msgstr "<b>Sigue estos pasos para activar Mercado Pago en tu tienda:</b>"
|
690 |
|
691 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:395
|
692 |
-
msgid "Upload your
|
693 |
-
msgstr "Carga tus
|
694 |
|
695 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
|
696 |
-
msgid "Approve your account to be able to charge."
|
697 |
-
msgstr "Homologa tu cuenta para poder cobrar."
|
698 |
|
699 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:409
|
700 |
-
msgid "Add the basic information of your business in the plugin configuration."
|
701 |
-
msgstr "Añade la información básica de tu negocio en la configuración del plugin
|
702 |
|
703 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:416
|
704 |
-
msgid "Configure the
|
705 |
-
msgstr "Configura las preferencias de pago para tus clientes."
|
706 |
|
707 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:423
|
708 |
msgid "<b>Go to advanced settings</b> only when you want to change the presets."
|
709 |
-
msgstr "<b>Ve a configuraciones avanzadas</b>
|
710 |
|
711 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
|
712 |
msgid ""
|
@@ -772,8 +780,8 @@ msgid "Production"
|
|
772 |
msgstr "Producción"
|
773 |
|
774 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
|
775 |
-
msgid "Choose
|
776 |
-
msgstr "Elige
|
777 |
|
778 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
|
779 |
msgid "Load credentials"
|
@@ -800,8 +808,8 @@ msgid "Access token"
|
|
800 |
msgstr "Access token"
|
801 |
|
802 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:729
|
803 |
-
msgid "Production credentials
|
804 |
-
msgstr "Credenciales para producción
|
805 |
|
806 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:741
|
807 |
msgid "With these keys you can receive real payments from your customers."
|
@@ -820,8 +828,8 @@ msgid "Homologate account in Mercado Pago"
|
|
820 |
msgstr "Homologar cuenta en Mercado Pago"
|
821 |
|
822 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:830
|
823 |
-
msgid "Store
|
824 |
-
msgstr "
|
825 |
|
826 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:832
|
827 |
msgid "This name will appear on your customers invoice."
|
@@ -852,7 +860,7 @@ msgid "WC-"
|
|
852 |
msgstr "WC-"
|
853 |
|
854 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:878
|
855 |
-
msgid "Advanced
|
856 |
msgstr "Ajustes avanzados"
|
857 |
|
858 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:891
|
@@ -1216,10 +1224,14 @@ msgstr "Fecha de vencimiento"
|
|
1216 |
msgid "Invalid Expiration Date"
|
1217 |
msgstr "Fecha de expiracion inválida"
|
1218 |
|
1219 |
-
#: templates/checkout/custom_checkout.php:
|
1220 |
-
msgid "
|
1221 |
msgstr "Código de seguridad"
|
1222 |
|
|
|
|
|
|
|
|
|
1223 |
#: templates/checkout/custom_checkout.php:148
|
1224 |
msgid "In how many installments do you want to pay"
|
1225 |
msgstr "En cuántas cuotas quieres pagar"
|
@@ -1449,5 +1461,25 @@ msgid "<b>Attention:</b> The currency settings you have in WooCommerce are not c
|
|
1449 |
msgstr "<b>Atención:</b> La configuración de moneda que tienes en WooCommerce no es compatible con la moneda que usas en tu cuenta de Mercado Pago. Activa la conversión de moneda."
|
1450 |
|
1451 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:471 includes/payments/WC_WooMercadoPago_TicketGateway.php:331
|
1452 |
-
msgid "
|
1453 |
msgstr "Selecciona los medios de pago disponibles en tu tienda."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
# This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Mercado Pago payments for WooCommerce 4.2.0\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
|
7 |
"Language-Team: \n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
11 |
"POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
|
12 |
+
"PO-Revision-Date: 2020-05-08 14:42-0300\n"
|
13 |
+
"X-Generator: Poedit 2.3\n"
|
14 |
"X-Domain: woocommerce-mercadopago\n"
|
15 |
"Last-Translator: \n"
|
16 |
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
62 |
msgstr "Descuento proporcionado por la tienda"
|
63 |
|
64 |
#: includes/module/WC_WooMercadoPago_Configs.php:112
|
65 |
+
msgid "The store should have HTTPS in order to activate both Checkout Personalizado and Ticket Checkout."
|
66 |
+
msgstr "La tienda debe tener HTTPS para activar el Checkout Personalizado y el Ticket Checkout."
|
67 |
|
68 |
#: includes/module/WC_WooMercadoPago_Configs.php:118 includes/module/WC_WooMercadoPago_Module.php:250
|
69 |
msgid "Discard"
|
70 |
msgstr "Descartar"
|
71 |
|
72 |
#: includes/module/WC_WooMercadoPago_Module.php:244
|
73 |
+
msgid "Fill in your credentials to enable payment methods."
|
74 |
+
msgstr "Completa tus credenciales para habilitar los medios de pago."
|
75 |
|
76 |
#: includes/module/WC_WooMercadoPago_Module.php:263
|
77 |
+
msgid "The Mercado Pago module needs an active version of %s in order to work!"
|
78 |
+
msgstr "¡El módulo de Mercado Pago necesita una versión de %s activa para funcionar!"
|
79 |
|
80 |
#: includes/module/WC_WooMercadoPago_Module.php:273
|
81 |
msgid "Set up"
|
319 |
msgid "fee of"
|
320 |
msgstr "comisión de"
|
321 |
|
322 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:361
|
323 |
+
msgid "<b>Public Key</b> production credential is invalid. Review the field to receive real payments."
|
324 |
+
msgstr "La credencial para producción <b>Public Key</b> es inválida. Revísala para poder recibir pagos reales."
|
325 |
|
326 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:371
|
327 |
+
msgid "<b>Public Key</b> test credential is invalid. Review the field to perform tests in your store."
|
328 |
+
msgstr "La credencial de prueba <b>Public Key</b> es inválida. Revísala para poder realizar pruebas en tu tienda."
|
329 |
+
|
330 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:381
|
331 |
+
msgid "<b>Access Token</b> production credential is invalid. Remember that it must be complete to receive real payments."
|
332 |
+
msgstr "La credencial para producción <b>Access Token</b> es inválida. Revísala para poder recibir pagos reales."
|
333 |
+
|
334 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:391
|
335 |
+
msgid "<b>Access Token</b> test credential is invalid. Review the field to perform tests in your store."
|
336 |
+
msgstr "La credencial de prueba <b>Access Token</b> es inválida. Revísala para poder realizar pruebas en tu tienda."
|
337 |
|
338 |
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Basic.php:74
|
339 |
msgid "Thanks for your purchase. Please continue to the payment page by clicking on the button below."
|
477 |
msgstr "Configura las preferencias de pago en tu tienda"
|
478 |
|
479 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
|
480 |
+
msgid "Advanced settings"
|
481 |
+
msgstr "Configuración avanzada"
|
482 |
|
483 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
|
484 |
msgid "Payment experience"
|
541 |
msgstr "Medios de"
|
542 |
|
543 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:468 includes/payments/WC_WooMercadoPago_TicketGateway.php:325
|
544 |
+
msgid "Activate the available payment methods to your clients."
|
545 |
msgstr "Habilita los medios de pago disponibles para tus clientes."
|
546 |
|
547 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:486
|
697 |
msgstr "<b>Sigue estos pasos para activar Mercado Pago en tu tienda:</b>"
|
698 |
|
699 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:395
|
700 |
+
msgid "<b>Upload your credentials</b> depending on the country in which you are registered."
|
701 |
+
msgstr "<b>Carga tus credenciales</b> según el país en el que estés registrado."
|
702 |
|
703 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
|
704 |
+
msgid "<b>Approve your account</b> to be able to charge."
|
705 |
+
msgstr "<b>Homologa tu cuenta</b> para poder cobrar."
|
706 |
|
707 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:409
|
708 |
+
msgid "<b>Add the basic information of your business</b> in the plugin configuration."
|
709 |
+
msgstr "<b>Añade la información básica de tu negocio</b> en la configuración del plugin"
|
710 |
|
711 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:416
|
712 |
+
msgid "<b>Configure the payment preferences</b> for your customers."
|
713 |
+
msgstr "<b>Configura las preferencias de pago</b> para tus clientes."
|
714 |
|
715 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:423
|
716 |
msgid "<b>Go to advanced settings</b> only when you want to change the presets."
|
717 |
+
msgstr "<b>Ve a configuraciones avanzadas</b> sólo cuando quieras modificar los ajustes preestablecidos."
|
718 |
|
719 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
|
720 |
msgid ""
|
780 |
msgstr "Producción"
|
781 |
|
782 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
|
783 |
+
msgid "Choose “Yes” only when you’re ready to sell. Switch to “No” to activate Testing mode."
|
784 |
+
msgstr "Elige “Sí” sólo cuando estés listo para vender. Cambia a “No” para activar el modo Pruebas."
|
785 |
|
786 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
|
787 |
msgid "Load credentials"
|
808 |
msgstr "Access token"
|
809 |
|
810 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:729
|
811 |
+
msgid "Production credentials"
|
812 |
+
msgstr "Credenciales para producción"
|
813 |
|
814 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:741
|
815 |
msgid "With these keys you can receive real payments from your customers."
|
828 |
msgstr "Homologar cuenta en Mercado Pago"
|
829 |
|
830 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:830
|
831 |
+
msgid "Store name"
|
832 |
+
msgstr "Nombre de la tienda"
|
833 |
|
834 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:832
|
835 |
msgid "This name will appear on your customers invoice."
|
860 |
msgstr "WC-"
|
861 |
|
862 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:878
|
863 |
+
msgid "Advanced adjustment"
|
864 |
msgstr "Ajustes avanzados"
|
865 |
|
866 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:891
|
1224 |
msgid "Invalid Expiration Date"
|
1225 |
msgstr "Fecha de expiracion inválida"
|
1226 |
|
1227 |
+
#: templates/checkout/custom_checkout.php:103
|
1228 |
+
msgid "Security code"
|
1229 |
msgstr "Código de seguridad"
|
1230 |
|
1231 |
+
#: templates/checkout/custom_checkout.php:105
|
1232 |
+
msgid "Last 3 numbers on the back"
|
1233 |
+
msgstr "Últimos 3 números en el reverso"
|
1234 |
+
|
1235 |
#: templates/checkout/custom_checkout.php:148
|
1236 |
msgid "In how many installments do you want to pay"
|
1237 |
msgstr "En cuántas cuotas quieres pagar"
|
1461 |
msgstr "<b>Atención:</b> La configuración de moneda que tienes en WooCommerce no es compatible con la moneda que usas en tu cuenta de Mercado Pago. Activa la conversión de moneda."
|
1462 |
|
1463 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:471 includes/payments/WC_WooMercadoPago_TicketGateway.php:331
|
1464 |
+
msgid "Choose the available payment methods in your store."
|
1465 |
msgstr "Selecciona los medios de pago disponibles en tu tienda."
|
1466 |
+
|
1467 |
+
#: includes/admin/notices/WC_WooMercadoPago_Notices.php:94
|
1468 |
+
msgid "Activate WooCommerce"
|
1469 |
+
msgstr "Activar WooCommerce"
|
1470 |
+
|
1471 |
+
#: includes/admin/notices/WC_WooMercadoPago_Notices.php:97
|
1472 |
+
msgid "Install WooCommerce"
|
1473 |
+
msgstr "Instalar WooCommerce"
|
1474 |
+
|
1475 |
+
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:898
|
1476 |
+
msgid "Integrator ID"
|
1477 |
+
msgstr "Integrator ID"
|
1478 |
+
|
1479 |
+
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:900
|
1480 |
+
msgid "Do not forget to enter your integrator_id as a certified Mercado Pago Partner. If you don`t have it, you can %s"
|
1481 |
+
msgstr "No olvides ingresar tu integrator_id como Partner certificado de Mercado Pago. Si no lo tienes, puedes %s"
|
1482 |
+
|
1483 |
+
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:903
|
1484 |
+
msgid "request it now."
|
1485 |
+
msgstr "solicitarlo ahora."
|
i18n/languages/woocommerce-mercadopago-es_MX.mo
CHANGED
Binary file
|
i18n/languages/woocommerce-mercadopago-es_MX.po
CHANGED
@@ -2,15 +2,15 @@
|
|
2 |
# This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Mercado Pago payments for WooCommerce 4.
|
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-
|
13 |
-
"X-Generator: Poedit 2.
|
14 |
"X-Domain: woocommerce-mercadopago\n"
|
15 |
"Last-Translator: \n"
|
16 |
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
@@ -62,20 +62,20 @@ msgid "Discount provided by store"
|
|
62 |
msgstr "Descuento proporcionado por la tienda"
|
63 |
|
64 |
#: includes/module/WC_WooMercadoPago_Configs.php:112
|
65 |
-
msgid "The store
|
66 |
-
msgstr "La tienda debe tener HTTPS para
|
67 |
|
68 |
#: includes/module/WC_WooMercadoPago_Configs.php:118 includes/module/WC_WooMercadoPago_Module.php:250
|
69 |
msgid "Discard"
|
70 |
msgstr "Descartar"
|
71 |
|
72 |
#: includes/module/WC_WooMercadoPago_Module.php:244
|
73 |
-
msgid "
|
74 |
-
msgstr "
|
75 |
|
76 |
#: includes/module/WC_WooMercadoPago_Module.php:263
|
77 |
-
msgid "The
|
78 |
-
msgstr "¡El módulo de
|
79 |
|
80 |
#: includes/module/WC_WooMercadoPago_Module.php:273
|
81 |
msgid "Set up"
|
@@ -319,13 +319,21 @@ msgstr " y comisión de"
|
|
319 |
msgid "fee of"
|
320 |
msgstr "comisión de"
|
321 |
|
322 |
-
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:
|
323 |
-
msgid "
|
324 |
-
msgstr "
|
325 |
|
326 |
-
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:
|
327 |
-
msgid "
|
328 |
-
msgstr "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
329 |
|
330 |
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Basic.php:74
|
331 |
msgid "Thanks for your purchase. Please continue to the payment page by clicking on the button below."
|
@@ -469,8 +477,8 @@ msgid "Set payment preferences in your store"
|
|
469 |
msgstr "Configura las preferencias de pago en tu tienda"
|
470 |
|
471 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
|
472 |
-
msgid "
|
473 |
-
msgstr "
|
474 |
|
475 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
|
476 |
msgid "Payment experience"
|
@@ -533,7 +541,7 @@ msgid "Payment methods"
|
|
533 |
msgstr "Medios de"
|
534 |
|
535 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:468 includes/payments/WC_WooMercadoPago_TicketGateway.php:325
|
536 |
-
msgid "
|
537 |
msgstr "Habilita los medios de pago disponibles para tus clientes."
|
538 |
|
539 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:486
|
@@ -689,24 +697,24 @@ msgid "<b>Follow these steps to activate Mercado Pago in your store:</b>"
|
|
689 |
msgstr "<b>Sigue estos pasos para activar Mercado Pago en tu tienda:</b>"
|
690 |
|
691 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:395
|
692 |
-
msgid "Upload your
|
693 |
-
msgstr "Carga tus
|
694 |
|
695 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
|
696 |
-
msgid "Approve your account to be able to charge."
|
697 |
-
msgstr "Homologa tu cuenta para poder cobrar."
|
698 |
|
699 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:409
|
700 |
-
msgid "Add the basic information of your business in the plugin configuration."
|
701 |
-
msgstr "Añade la información básica de tu negocio en la configuración del plugin
|
702 |
|
703 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:416
|
704 |
-
msgid "Configure the
|
705 |
-
msgstr "Configura las preferencias de pago para tus clientes."
|
706 |
|
707 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:423
|
708 |
msgid "<b>Go to advanced settings</b> only when you want to change the presets."
|
709 |
-
msgstr "<b>Ve a configuraciones avanzadas</b>
|
710 |
|
711 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
|
712 |
msgid ""
|
@@ -772,8 +780,8 @@ msgid "Production"
|
|
772 |
msgstr "Producción"
|
773 |
|
774 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
|
775 |
-
msgid "Choose
|
776 |
-
msgstr "Elige
|
777 |
|
778 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
|
779 |
msgid "Load credentials"
|
@@ -800,8 +808,8 @@ msgid "Access token"
|
|
800 |
msgstr "Access token"
|
801 |
|
802 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:729
|
803 |
-
msgid "Production credentials
|
804 |
-
msgstr "Credenciales para producción
|
805 |
|
806 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:741
|
807 |
msgid "With these keys you can receive real payments from your customers."
|
@@ -820,8 +828,8 @@ msgid "Homologate account in Mercado Pago"
|
|
820 |
msgstr "Homologar cuenta en Mercado Pago"
|
821 |
|
822 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:830
|
823 |
-
msgid "Store
|
824 |
-
msgstr "
|
825 |
|
826 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:832
|
827 |
msgid "This name will appear on your customers invoice."
|
@@ -852,7 +860,7 @@ msgid "WC-"
|
|
852 |
msgstr "WC-"
|
853 |
|
854 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:878
|
855 |
-
msgid "Advanced
|
856 |
msgstr "Ajustes avanzados"
|
857 |
|
858 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:891
|
@@ -1216,10 +1224,14 @@ msgstr "Fecha de vencimiento"
|
|
1216 |
msgid "Invalid Expiration Date"
|
1217 |
msgstr "Fecha de expiracion inválida"
|
1218 |
|
1219 |
-
#: templates/checkout/custom_checkout.php:
|
1220 |
-
msgid "
|
1221 |
msgstr "Código de seguridad"
|
1222 |
|
|
|
|
|
|
|
|
|
1223 |
#: templates/checkout/custom_checkout.php:148
|
1224 |
msgid "In how many installments do you want to pay"
|
1225 |
msgstr "En cuántas cuotas quieres pagar"
|
@@ -1429,5 +1441,25 @@ msgid "Accept card payments on your website with the best possible financing and
|
|
1429 |
msgstr "Acepta pagos con tarjeta en tu sitio web con la mejor financiación posible y maximiza la conversión de tu negocio. Con el checkout personalizado tus clientes pagan ¡sin salir de tu tienda!"
|
1430 |
|
1431 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:471 includes/payments/WC_WooMercadoPago_TicketGateway.php:331
|
1432 |
-
msgid "
|
1433 |
msgstr "Selecciona los medios de pago disponibles en tu tienda."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
# This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Mercado Pago payments for WooCommerce 4.2.0\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
|
7 |
"Language-Team: \n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
11 |
"POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
|
12 |
+
"PO-Revision-Date: 2020-05-08 14:42-0300\n"
|
13 |
+
"X-Generator: Poedit 2.3\n"
|
14 |
"X-Domain: woocommerce-mercadopago\n"
|
15 |
"Last-Translator: \n"
|
16 |
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
62 |
msgstr "Descuento proporcionado por la tienda"
|
63 |
|
64 |
#: includes/module/WC_WooMercadoPago_Configs.php:112
|
65 |
+
msgid "The store should have HTTPS in order to activate both Checkout Personalizado and Ticket Checkout."
|
66 |
+
msgstr "La tienda debe tener HTTPS para activar el Checkout Personalizado y el Ticket Checkout."
|
67 |
|
68 |
#: includes/module/WC_WooMercadoPago_Configs.php:118 includes/module/WC_WooMercadoPago_Module.php:250
|
69 |
msgid "Discard"
|
70 |
msgstr "Descartar"
|
71 |
|
72 |
#: includes/module/WC_WooMercadoPago_Module.php:244
|
73 |
+
msgid "Fill in your credentials to enable payment methods."
|
74 |
+
msgstr "Completa tus credenciales para habilitar los medios de pago."
|
75 |
|
76 |
#: includes/module/WC_WooMercadoPago_Module.php:263
|
77 |
+
msgid "The Mercado Pago module needs an active version of %s in order to work!"
|
78 |
+
msgstr "¡El módulo de Mercado Pago necesita una versión de %s activa para funcionar!"
|
79 |
|
80 |
#: includes/module/WC_WooMercadoPago_Module.php:273
|
81 |
msgid "Set up"
|
319 |
msgid "fee of"
|
320 |
msgstr "comisión de"
|
321 |
|
322 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:361
|
323 |
+
msgid "<b>Public Key</b> production credential is invalid. Review the field to receive real payments."
|
324 |
+
msgstr "La credencial para producción <b>Public Key</b> es inválida. Revísala para poder recibir pagos reales."
|
325 |
|
326 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:371
|
327 |
+
msgid "<b>Public Key</b> test credential is invalid. Review the field to perform tests in your store."
|
328 |
+
msgstr "La credencial de prueba <b>Public Key</b> es inválida. Revísala para poder realizar pruebas en tu tienda."
|
329 |
+
|
330 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:381
|
331 |
+
msgid "<b>Access Token</b> production credential is invalid. Remember that it must be complete to receive real payments."
|
332 |
+
msgstr "La credencial para producción <b>Access Token</b> es inválida. Revísala para poder recibir pagos reales."
|
333 |
+
|
334 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:391
|
335 |
+
msgid "<b>Access Token</b> test credential is invalid. Review the field to perform tests in your store."
|
336 |
+
msgstr "La credencial de prueba <b>Access Token</b> es inválida. Revísala para poder realizar pruebas en tu tienda."
|
337 |
|
338 |
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Basic.php:74
|
339 |
msgid "Thanks for your purchase. Please continue to the payment page by clicking on the button below."
|
477 |
msgstr "Configura las preferencias de pago en tu tienda"
|
478 |
|
479 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
|
480 |
+
msgid "Advanced settings"
|
481 |
+
msgstr "Configuración avanzada"
|
482 |
|
483 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
|
484 |
msgid "Payment experience"
|
541 |
msgstr "Medios de"
|
542 |
|
543 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:468 includes/payments/WC_WooMercadoPago_TicketGateway.php:325
|
544 |
+
msgid "Activate the available payment methods to your clients."
|
545 |
msgstr "Habilita los medios de pago disponibles para tus clientes."
|
546 |
|
547 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:486
|
697 |
msgstr "<b>Sigue estos pasos para activar Mercado Pago en tu tienda:</b>"
|
698 |
|
699 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:395
|
700 |
+
msgid "<b>Upload your credentials</b> depending on the country in which you are registered."
|
701 |
+
msgstr "<b>Carga tus credenciales</b> según el país en el que estés registrado."
|
702 |
|
703 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
|
704 |
+
msgid "<b>Approve your account</b> to be able to charge."
|
705 |
+
msgstr "<b>Homologa tu cuenta</b> para poder cobrar."
|
706 |
|
707 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:409
|
708 |
+
msgid "<b>Add the basic information of your business</b> in the plugin configuration."
|
709 |
+
msgstr "<b>Añade la información básica de tu negocio</b> en la configuración del plugin"
|
710 |
|
711 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:416
|
712 |
+
msgid "<b>Configure the payment preferences</b> for your customers."
|
713 |
+
msgstr "<b>Configura las preferencias de pago</b> para tus clientes."
|
714 |
|
715 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:423
|
716 |
msgid "<b>Go to advanced settings</b> only when you want to change the presets."
|
717 |
+
msgstr "<b>Ve a configuraciones avanzadas</b> sólo cuando quieras modificar los ajustes preestablecidos."
|
718 |
|
719 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
|
720 |
msgid ""
|
780 |
msgstr "Producción"
|
781 |
|
782 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
|
783 |
+
msgid "Choose “Yes” only when you’re ready to sell. Switch to “No” to activate Testing mode."
|
784 |
+
msgstr "Elige “Sí” sólo cuando estés listo para vender. Cambia a “No” para activar el modo Pruebas."
|
785 |
|
786 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
|
787 |
msgid "Load credentials"
|
808 |
msgstr "Access token"
|
809 |
|
810 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:729
|
811 |
+
msgid "Production credentials"
|
812 |
+
msgstr "Credenciales para producción"
|
813 |
|
814 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:741
|
815 |
msgid "With these keys you can receive real payments from your customers."
|
828 |
msgstr "Homologar cuenta en Mercado Pago"
|
829 |
|
830 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:830
|
831 |
+
msgid "Store name"
|
832 |
+
msgstr "Nombre de la tienda"
|
833 |
|
834 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:832
|
835 |
msgid "This name will appear on your customers invoice."
|
860 |
msgstr "WC-"
|
861 |
|
862 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:878
|
863 |
+
msgid "Advanced adjustment"
|
864 |
msgstr "Ajustes avanzados"
|
865 |
|
866 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:891
|
1224 |
msgid "Invalid Expiration Date"
|
1225 |
msgstr "Fecha de expiracion inválida"
|
1226 |
|
1227 |
+
#: templates/checkout/custom_checkout.php:103
|
1228 |
+
msgid "Security code"
|
1229 |
msgstr "Código de seguridad"
|
1230 |
|
1231 |
+
#: templates/checkout/custom_checkout.php:105
|
1232 |
+
msgid "Last 3 numbers on the back"
|
1233 |
+
msgstr "Últimos 3 números en el reverso"
|
1234 |
+
|
1235 |
#: templates/checkout/custom_checkout.php:148
|
1236 |
msgid "In how many installments do you want to pay"
|
1237 |
msgstr "En cuántas cuotas quieres pagar"
|
1441 |
msgstr "Acepta pagos con tarjeta en tu sitio web con la mejor financiación posible y maximiza la conversión de tu negocio. Con el checkout personalizado tus clientes pagan ¡sin salir de tu tienda!"
|
1442 |
|
1443 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:471 includes/payments/WC_WooMercadoPago_TicketGateway.php:331
|
1444 |
+
msgid "Choose the available payment methods in your store."
|
1445 |
msgstr "Selecciona los medios de pago disponibles en tu tienda."
|
1446 |
+
|
1447 |
+
#: includes/admin/notices/WC_WooMercadoPago_Notices.php:94
|
1448 |
+
msgid "Activate WooCommerce"
|
1449 |
+
msgstr "Activar WooCommerce"
|
1450 |
+
|
1451 |
+
#: includes/admin/notices/WC_WooMercadoPago_Notices.php:97
|
1452 |
+
msgid "Install WooCommerce"
|
1453 |
+
msgstr "Instalar WooCommerce"
|
1454 |
+
|
1455 |
+
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:898
|
1456 |
+
msgid "Integrator ID"
|
1457 |
+
msgstr "Integrator ID"
|
1458 |
+
|
1459 |
+
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:900
|
1460 |
+
msgid "Do not forget to enter your integrator_id as a certified Mercado Pago Partner. If you don`t have it, you can %s"
|
1461 |
+
msgstr "No olvides ingresar tu integrator_id como Partner certificado de Mercado Pago. Si no lo tienes, puedes %s"
|
1462 |
+
|
1463 |
+
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:903
|
1464 |
+
msgid "request it now."
|
1465 |
+
msgstr "solicitarlo ahora."
|
i18n/languages/woocommerce-mercadopago-es_PE.mo
CHANGED
Binary file
|
i18n/languages/woocommerce-mercadopago-es_PE.po
CHANGED
@@ -2,15 +2,15 @@
|
|
2 |
# This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Mercado Pago payments for WooCommerce 4.
|
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-
|
13 |
-
"X-Generator: Poedit 2.
|
14 |
"X-Domain: woocommerce-mercadopago\n"
|
15 |
"Last-Translator: \n"
|
16 |
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
@@ -62,20 +62,20 @@ msgid "Discount provided by store"
|
|
62 |
msgstr "Descuento proporcionado por la tienda"
|
63 |
|
64 |
#: includes/module/WC_WooMercadoPago_Configs.php:112
|
65 |
-
msgid "The store
|
66 |
-
msgstr "La tienda debe tener HTTPS para
|
67 |
|
68 |
#: includes/module/WC_WooMercadoPago_Configs.php:118 includes/module/WC_WooMercadoPago_Module.php:250
|
69 |
msgid "Discard"
|
70 |
msgstr "Descartar"
|
71 |
|
72 |
#: includes/module/WC_WooMercadoPago_Module.php:244
|
73 |
-
msgid "
|
74 |
-
msgstr "
|
75 |
|
76 |
#: includes/module/WC_WooMercadoPago_Module.php:263
|
77 |
-
msgid "The
|
78 |
-
msgstr "¡El módulo de
|
79 |
|
80 |
#: includes/module/WC_WooMercadoPago_Module.php:273
|
81 |
msgid "Set up"
|
@@ -319,13 +319,21 @@ msgstr " y comisión de"
|
|
319 |
msgid "fee of"
|
320 |
msgstr "comisión de"
|
321 |
|
322 |
-
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:
|
323 |
-
msgid "
|
324 |
-
msgstr "
|
325 |
|
326 |
-
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:
|
327 |
-
msgid "
|
328 |
-
msgstr "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
329 |
|
330 |
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Basic.php:74
|
331 |
msgid "Thanks for your purchase. Please continue to the payment page by clicking on the button below."
|
@@ -469,8 +477,8 @@ msgid "Set payment preferences in your store"
|
|
469 |
msgstr "Configura las preferencias de pago en tu tienda"
|
470 |
|
471 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
|
472 |
-
msgid "
|
473 |
-
msgstr "
|
474 |
|
475 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
|
476 |
msgid "Payment experience"
|
@@ -533,7 +541,7 @@ msgid "Payment methods"
|
|
533 |
msgstr "Medios de"
|
534 |
|
535 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:468 includes/payments/WC_WooMercadoPago_TicketGateway.php:325
|
536 |
-
msgid "
|
537 |
msgstr "Habilita los medios de pago disponibles para tus clientes."
|
538 |
|
539 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:486
|
@@ -689,24 +697,24 @@ msgid "<b>Follow these steps to activate Mercado Pago in your store:</b>"
|
|
689 |
msgstr "<b>Sigue estos pasos para activar Mercado Pago en tu tienda:</b>"
|
690 |
|
691 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:395
|
692 |
-
msgid "Upload your
|
693 |
-
msgstr "Carga tus
|
694 |
|
695 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
|
696 |
-
msgid "Approve your account to be able to charge."
|
697 |
-
msgstr "Homologa tu cuenta para poder cobrar."
|
698 |
|
699 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:409
|
700 |
-
msgid "Add the basic information of your business in the plugin configuration."
|
701 |
-
msgstr "Añade la información básica de tu negocio en la configuración del plugin
|
702 |
|
703 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:416
|
704 |
-
msgid "Configure the
|
705 |
-
msgstr "Configura las preferencias de pago para tus clientes."
|
706 |
|
707 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:423
|
708 |
msgid "<b>Go to advanced settings</b> only when you want to change the presets."
|
709 |
-
msgstr "<b>Ve a configuraciones avanzadas</b>
|
710 |
|
711 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
|
712 |
msgid ""
|
@@ -772,8 +780,8 @@ msgid "Production"
|
|
772 |
msgstr "Producción"
|
773 |
|
774 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
|
775 |
-
msgid "Choose
|
776 |
-
msgstr "Elige
|
777 |
|
778 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
|
779 |
msgid "Load credentials"
|
@@ -800,8 +808,8 @@ msgid "Access token"
|
|
800 |
msgstr "Access token"
|
801 |
|
802 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:729
|
803 |
-
msgid "Production credentials
|
804 |
-
msgstr "Credenciales para producción
|
805 |
|
806 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:741
|
807 |
msgid "With these keys you can receive real payments from your customers."
|
@@ -820,8 +828,8 @@ msgid "Homologate account in Mercado Pago"
|
|
820 |
msgstr "Homologar cuenta en Mercado Pago"
|
821 |
|
822 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:830
|
823 |
-
msgid "Store
|
824 |
-
msgstr "
|
825 |
|
826 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:832
|
827 |
msgid "This name will appear on your customers invoice."
|
@@ -852,7 +860,7 @@ msgid "WC-"
|
|
852 |
msgstr "WC-"
|
853 |
|
854 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:878
|
855 |
-
msgid "Advanced
|
856 |
msgstr "Ajustes avanzados"
|
857 |
|
858 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:891
|
@@ -1216,10 +1224,14 @@ msgstr "Fecha de vencimiento"
|
|
1216 |
msgid "Invalid Expiration Date"
|
1217 |
msgstr "Fecha de expiracion inválida"
|
1218 |
|
1219 |
-
#: templates/checkout/custom_checkout.php:
|
1220 |
-
msgid "
|
1221 |
msgstr "Código de seguridad"
|
1222 |
|
|
|
|
|
|
|
|
|
1223 |
#: templates/checkout/custom_checkout.php:148
|
1224 |
msgid "In how many installments do you want to pay"
|
1225 |
msgstr "En cuántas cuotas quieres pagar"
|
@@ -1429,5 +1441,25 @@ msgid "Accept card payments on your website with the best possible financing and
|
|
1429 |
msgstr "Acepta pagos con tarjeta en tu sitio web con la mejor financiación posible y maximiza la conversión de tu negocio. Con el checkout personalizado tus clientes pagan ¡sin salir de tu tienda!"
|
1430 |
|
1431 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:471 includes/payments/WC_WooMercadoPago_TicketGateway.php:331
|
1432 |
-
msgid "
|
1433 |
msgstr "Selecciona los medios de pago disponibles en tu tienda."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
# This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Mercado Pago payments for WooCommerce 4.2.0\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
|
7 |
"Language-Team: \n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
11 |
"POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
|
12 |
+
"PO-Revision-Date: 2020-05-08 14:42-0300\n"
|
13 |
+
"X-Generator: Poedit 2.3\n"
|
14 |
"X-Domain: woocommerce-mercadopago\n"
|
15 |
"Last-Translator: \n"
|
16 |
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
62 |
msgstr "Descuento proporcionado por la tienda"
|
63 |
|
64 |
#: includes/module/WC_WooMercadoPago_Configs.php:112
|
65 |
+
msgid "The store should have HTTPS in order to activate both Checkout Personalizado and Ticket Checkout."
|
66 |
+
msgstr "La tienda debe tener HTTPS para activar el Checkout Personalizado y el Ticket Checkout."
|
67 |
|
68 |
#: includes/module/WC_WooMercadoPago_Configs.php:118 includes/module/WC_WooMercadoPago_Module.php:250
|
69 |
msgid "Discard"
|
70 |
msgstr "Descartar"
|
71 |
|
72 |
#: includes/module/WC_WooMercadoPago_Module.php:244
|
73 |
+
msgid "Fill in your credentials to enable payment methods."
|
74 |
+
msgstr "Completa tus credenciales para habilitar los medios de pago."
|
75 |
|
76 |
#: includes/module/WC_WooMercadoPago_Module.php:263
|
77 |
+
msgid "The Mercado Pago module needs an active version of %s in order to work!"
|
78 |
+
msgstr "¡El módulo de Mercado Pago necesita una versión de %s activa para funcionar!"
|
79 |
|
80 |
#: includes/module/WC_WooMercadoPago_Module.php:273
|
81 |
msgid "Set up"
|
319 |
msgid "fee of"
|
320 |
msgstr "comisión de"
|
321 |
|
322 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:361
|
323 |
+
msgid "<b>Public Key</b> production credential is invalid. Review the field to receive real payments."
|
324 |
+
msgstr "La credencial para producción <b>Public Key</b> es inválida. Revísala para poder recibir pagos reales."
|
325 |
|
326 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:371
|
327 |
+
msgid "<b>Public Key</b> test credential is invalid. Review the field to perform tests in your store."
|
328 |
+
msgstr "La credencial de prueba <b>Public Key</b> es inválida. Revísala para poder realizar pruebas en tu tienda."
|
329 |
+
|
330 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:381
|
331 |
+
msgid "<b>Access Token</b> production credential is invalid. Remember that it must be complete to receive real payments."
|
332 |
+
msgstr "La credencial para producción <b>Access Token</b> es inválida. Revísala para poder recibir pagos reales."
|
333 |
+
|
334 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:391
|
335 |
+
msgid "<b>Access Token</b> test credential is invalid. Review the field to perform tests in your store."
|
336 |
+
msgstr "La credencial de prueba <b>Access Token</b> es inválida. Revísala para poder realizar pruebas en tu tienda."
|
337 |
|
338 |
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Basic.php:74
|
339 |
msgid "Thanks for your purchase. Please continue to the payment page by clicking on the button below."
|
477 |
msgstr "Configura las preferencias de pago en tu tienda"
|
478 |
|
479 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
|
480 |
+
msgid "Advanced settings"
|
481 |
+
msgstr "Configuración avanzada"
|
482 |
|
483 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
|
484 |
msgid "Payment experience"
|
541 |
msgstr "Medios de"
|
542 |
|
543 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:468 includes/payments/WC_WooMercadoPago_TicketGateway.php:325
|
544 |
+
msgid "Activate the available payment methods to your clients."
|
545 |
msgstr "Habilita los medios de pago disponibles para tus clientes."
|
546 |
|
547 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:486
|
697 |
msgstr "<b>Sigue estos pasos para activar Mercado Pago en tu tienda:</b>"
|
698 |
|
699 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:395
|
700 |
+
msgid "<b>Upload your credentials</b> depending on the country in which you are registered."
|
701 |
+
msgstr "<b>Carga tus credenciales</b> según el país en el que estés registrado."
|
702 |
|
703 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
|
704 |
+
msgid "<b>Approve your account</b> to be able to charge."
|
705 |
+
msgstr "<b>Homologa tu cuenta</b> para poder cobrar."
|
706 |
|
707 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:409
|
708 |
+
msgid "<b>Add the basic information of your business</b> in the plugin configuration."
|
709 |
+
msgstr "<b>Añade la información básica de tu negocio</b> en la configuración del plugin"
|
710 |
|
711 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:416
|
712 |
+
msgid "<b>Configure the payment preferences</b> for your customers."
|
713 |
+
msgstr "<b>Configura las preferencias de pago</b> para tus clientes."
|
714 |
|
715 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:423
|
716 |
msgid "<b>Go to advanced settings</b> only when you want to change the presets."
|
717 |
+
msgstr "<b>Ve a configuraciones avanzadas</b> sólo cuando quieras modificar los ajustes preestablecidos."
|
718 |
|
719 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
|
720 |
msgid ""
|
780 |
msgstr "Producción"
|
781 |
|
782 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
|
783 |
+
msgid "Choose “Yes” only when you’re ready to sell. Switch to “No” to activate Testing mode."
|
784 |
+
msgstr "Elige “Sí” sólo cuando estés listo para vender. Cambia a “No” para activar el modo Pruebas."
|
785 |
|
786 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
|
787 |
msgid "Load credentials"
|
808 |
msgstr "Access token"
|
809 |
|
810 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:729
|
811 |
+
msgid "Production credentials"
|
812 |
+
msgstr "Credenciales para producción"
|
813 |
|
814 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:741
|
815 |
msgid "With these keys you can receive real payments from your customers."
|
828 |
msgstr "Homologar cuenta en Mercado Pago"
|
829 |
|
830 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:830
|
831 |
+
msgid "Store name"
|
832 |
+
msgstr "Nombre de la tienda"
|
833 |
|
834 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:832
|
835 |
msgid "This name will appear on your customers invoice."
|
860 |
msgstr "WC-"
|
861 |
|
862 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:878
|
863 |
+
msgid "Advanced adjustment"
|
864 |
msgstr "Ajustes avanzados"
|
865 |
|
866 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:891
|
1224 |
msgid "Invalid Expiration Date"
|
1225 |
msgstr "Fecha de expiracion inválida"
|
1226 |
|
1227 |
+
#: templates/checkout/custom_checkout.php:103
|
1228 |
+
msgid "Security code"
|
1229 |
msgstr "Código de seguridad"
|
1230 |
|
1231 |
+
#: templates/checkout/custom_checkout.php:105
|
1232 |
+
msgid "Last 3 numbers on the back"
|
1233 |
+
msgstr "Últimos 3 números en el reverso"
|
1234 |
+
|
1235 |
#: templates/checkout/custom_checkout.php:148
|
1236 |
msgid "In how many installments do you want to pay"
|
1237 |
msgstr "En cuántas cuotas quieres pagar"
|
1441 |
msgstr "Acepta pagos con tarjeta en tu sitio web con la mejor financiación posible y maximiza la conversión de tu negocio. Con el checkout personalizado tus clientes pagan ¡sin salir de tu tienda!"
|
1442 |
|
1443 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:471 includes/payments/WC_WooMercadoPago_TicketGateway.php:331
|
1444 |
+
msgid "Choose the available payment methods in your store."
|
1445 |
msgstr "Selecciona los medios de pago disponibles en tu tienda."
|
1446 |
+
|
1447 |
+
#: includes/admin/notices/WC_WooMercadoPago_Notices.php:94
|
1448 |
+
msgid "Activate WooCommerce"
|
1449 |
+
msgstr "Activar WooCommerce"
|
1450 |
+
|
1451 |
+
#: includes/admin/notices/WC_WooMercadoPago_Notices.php:97
|
1452 |
+
msgid "Install WooCommerce"
|
1453 |
+
msgstr "Instalar WooCommerce"
|
1454 |
+
|
1455 |
+
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:898
|
1456 |
+
msgid "Integrator ID"
|
1457 |
+
msgstr "Integrator ID"
|
1458 |
+
|
1459 |
+
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:900
|
1460 |
+
msgid "Do not forget to enter your integrator_id as a certified Mercado Pago Partner. If you don`t have it, you can %s"
|
1461 |
+
msgstr "No olvides ingresar tu integrator_id como Partner certificado de Mercado Pago. Si no lo tienes, puedes %s"
|
1462 |
+
|
1463 |
+
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:903
|
1464 |
+
msgid "request it now."
|
1465 |
+
msgstr "solicitarlo ahora."
|
i18n/languages/woocommerce-mercadopago-es_UY.mo
CHANGED
Binary file
|
i18n/languages/woocommerce-mercadopago-es_UY.po
CHANGED
@@ -2,15 +2,15 @@
|
|
2 |
# This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Mercado Pago payments for WooCommerce 4.
|
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-
|
13 |
-
"X-Generator: Poedit 2.
|
14 |
"X-Domain: woocommerce-mercadopago\n"
|
15 |
"Last-Translator: \n"
|
16 |
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
@@ -62,20 +62,20 @@ msgid "Discount provided by store"
|
|
62 |
msgstr "Descuento proporcionado por la tienda"
|
63 |
|
64 |
#: includes/module/WC_WooMercadoPago_Configs.php:112
|
65 |
-
msgid "The store
|
66 |
-
msgstr "La tienda debe tener HTTPS para
|
67 |
|
68 |
#: includes/module/WC_WooMercadoPago_Configs.php:118 includes/module/WC_WooMercadoPago_Module.php:250
|
69 |
msgid "Discard"
|
70 |
msgstr "Descartar"
|
71 |
|
72 |
#: includes/module/WC_WooMercadoPago_Module.php:244
|
73 |
-
msgid "
|
74 |
-
msgstr "
|
75 |
|
76 |
#: includes/module/WC_WooMercadoPago_Module.php:263
|
77 |
-
msgid "The
|
78 |
-
msgstr "¡El módulo de
|
79 |
|
80 |
#: includes/module/WC_WooMercadoPago_Module.php:273
|
81 |
msgid "Set up"
|
@@ -319,13 +319,21 @@ msgstr " y comisión de"
|
|
319 |
msgid "fee of"
|
320 |
msgstr "comisión de"
|
321 |
|
322 |
-
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:
|
323 |
-
msgid "
|
324 |
-
msgstr "
|
325 |
|
326 |
-
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:
|
327 |
-
msgid "
|
328 |
-
msgstr "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
329 |
|
330 |
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Basic.php:74
|
331 |
msgid "Thanks for your purchase. Please continue to the payment page by clicking on the button below."
|
@@ -469,8 +477,8 @@ msgid "Set payment preferences in your store"
|
|
469 |
msgstr "Configura las preferencias de pago en tu tienda"
|
470 |
|
471 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
|
472 |
-
msgid "
|
473 |
-
msgstr "
|
474 |
|
475 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
|
476 |
msgid "Payment experience"
|
@@ -533,7 +541,7 @@ msgid "Payment methods"
|
|
533 |
msgstr "Medios de"
|
534 |
|
535 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:468 includes/payments/WC_WooMercadoPago_TicketGateway.php:325
|
536 |
-
msgid "
|
537 |
msgstr "Habilita los medios de pago disponibles para tus clientes."
|
538 |
|
539 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:486
|
@@ -689,24 +697,24 @@ msgid "<b>Follow these steps to activate Mercado Pago in your store:</b>"
|
|
689 |
msgstr "<b>Sigue estos pasos para activar Mercado Pago en tu tienda:</b>"
|
690 |
|
691 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:395
|
692 |
-
msgid "Upload your
|
693 |
-
msgstr "Carga tus
|
694 |
|
695 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
|
696 |
-
msgid "Approve your account to be able to charge."
|
697 |
-
msgstr "Homologa tu cuenta para poder cobrar."
|
698 |
|
699 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:409
|
700 |
-
msgid "Add the basic information of your business in the plugin configuration."
|
701 |
-
msgstr "Añade la información básica de tu negocio en la configuración del plugin
|
702 |
|
703 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:416
|
704 |
-
msgid "Configure the
|
705 |
-
msgstr "Configura las preferencias de pago para tus clientes."
|
706 |
|
707 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:423
|
708 |
msgid "<b>Go to advanced settings</b> only when you want to change the presets."
|
709 |
-
msgstr "<b>Ve a configuraciones avanzadas</b>
|
710 |
|
711 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
|
712 |
msgid ""
|
@@ -772,8 +780,8 @@ msgid "Production"
|
|
772 |
msgstr "Producción"
|
773 |
|
774 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
|
775 |
-
msgid "Choose
|
776 |
-
msgstr "Elige
|
777 |
|
778 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
|
779 |
msgid "Load credentials"
|
@@ -800,8 +808,8 @@ msgid "Access token"
|
|
800 |
msgstr "Access token"
|
801 |
|
802 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:729
|
803 |
-
msgid "Production credentials
|
804 |
-
msgstr "Credenciales para producción
|
805 |
|
806 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:741
|
807 |
msgid "With these keys you can receive real payments from your customers."
|
@@ -820,8 +828,8 @@ msgid "Homologate account in Mercado Pago"
|
|
820 |
msgstr "Homologar cuenta en Mercado Pago"
|
821 |
|
822 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:830
|
823 |
-
msgid "Store
|
824 |
-
msgstr "
|
825 |
|
826 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:832
|
827 |
msgid "This name will appear on your customers invoice."
|
@@ -852,7 +860,7 @@ msgid "WC-"
|
|
852 |
msgstr "WC-"
|
853 |
|
854 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:878
|
855 |
-
msgid "Advanced
|
856 |
msgstr "Ajustes avanzados"
|
857 |
|
858 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:891
|
@@ -1216,10 +1224,14 @@ msgstr "Fecha de vencimiento"
|
|
1216 |
msgid "Invalid Expiration Date"
|
1217 |
msgstr "Fecha de expiracion inválida"
|
1218 |
|
1219 |
-
#: templates/checkout/custom_checkout.php:
|
1220 |
-
msgid "
|
1221 |
msgstr "Código de seguridad"
|
1222 |
|
|
|
|
|
|
|
|
|
1223 |
#: templates/checkout/custom_checkout.php:148
|
1224 |
msgid "In how many installments do you want to pay"
|
1225 |
msgstr "En cuántas cuotas quieres pagar"
|
@@ -1429,5 +1441,25 @@ msgid "Accept card payments on your website with the best possible financing and
|
|
1429 |
msgstr "Acepta pagos con tarjeta en tu sitio web con la mejor financiación posible y maximiza la conversión de tu negocio. Con el checkout personalizado tus clientes pagan ¡sin salir de tu tienda!"
|
1430 |
|
1431 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:471 includes/payments/WC_WooMercadoPago_TicketGateway.php:331
|
1432 |
-
msgid "
|
1433 |
msgstr "Selecciona los medios de pago disponibles en tu tienda."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
# This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Mercado Pago payments for WooCommerce 4.2.0\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
|
7 |
"Language-Team: \n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
11 |
"POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
|
12 |
+
"PO-Revision-Date: 2020-05-08 14:43-0300\n"
|
13 |
+
"X-Generator: Poedit 2.3\n"
|
14 |
"X-Domain: woocommerce-mercadopago\n"
|
15 |
"Last-Translator: \n"
|
16 |
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
62 |
msgstr "Descuento proporcionado por la tienda"
|
63 |
|
64 |
#: includes/module/WC_WooMercadoPago_Configs.php:112
|
65 |
+
msgid "The store should have HTTPS in order to activate both Checkout Personalizado and Ticket Checkout."
|
66 |
+
msgstr "La tienda debe tener HTTPS para activar el Checkout Personalizado y el Ticket Checkout."
|
67 |
|
68 |
#: includes/module/WC_WooMercadoPago_Configs.php:118 includes/module/WC_WooMercadoPago_Module.php:250
|
69 |
msgid "Discard"
|
70 |
msgstr "Descartar"
|
71 |
|
72 |
#: includes/module/WC_WooMercadoPago_Module.php:244
|
73 |
+
msgid "Fill in your credentials to enable payment methods."
|
74 |
+
msgstr "Completa tus credenciales para habilitar los medios de pago."
|
75 |
|
76 |
#: includes/module/WC_WooMercadoPago_Module.php:263
|
77 |
+
msgid "The Mercado Pago module needs an active version of %s in order to work!"
|
78 |
+
msgstr "¡El módulo de Mercado Pago necesita una versión de %s activa para funcionar!"
|
79 |
|
80 |
#: includes/module/WC_WooMercadoPago_Module.php:273
|
81 |
msgid "Set up"
|
319 |
msgid "fee of"
|
320 |
msgstr "comisión de"
|
321 |
|
322 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:361
|
323 |
+
msgid "<b>Public Key</b> production credential is invalid. Review the field to receive real payments."
|
324 |
+
msgstr "La credencial para producción <b>Public Key</b> es inválida. Revísala para poder recibir pagos reales."
|
325 |
|
326 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:371
|
327 |
+
msgid "<b>Public Key</b> test credential is invalid. Review the field to perform tests in your store."
|
328 |
+
msgstr "La credencial de prueba <b>Public Key</b> es inválida. Revísala para poder realizar pruebas en tu tienda."
|
329 |
+
|
330 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:381
|
331 |
+
msgid "<b>Access Token</b> production credential is invalid. Remember that it must be complete to receive real payments."
|
332 |
+
msgstr "La credencial para producción <b>Access Token</b> es inválida. Revísala para poder recibir pagos reales."
|
333 |
+
|
334 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:391
|
335 |
+
msgid "<b>Access Token</b> test credential is invalid. Review the field to perform tests in your store."
|
336 |
+
msgstr "La credencial de prueba <b>Access Token</b> es inválida. Revísala para poder realizar pruebas en tu tienda."
|
337 |
|
338 |
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Basic.php:74
|
339 |
msgid "Thanks for your purchase. Please continue to the payment page by clicking on the button below."
|
477 |
msgstr "Configura las preferencias de pago en tu tienda"
|
478 |
|
479 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
|
480 |
+
msgid "Advanced settings"
|
481 |
+
msgstr "Configuración avanzada"
|
482 |
|
483 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
|
484 |
msgid "Payment experience"
|
541 |
msgstr "Medios de"
|
542 |
|
543 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:468 includes/payments/WC_WooMercadoPago_TicketGateway.php:325
|
544 |
+
msgid "Activate the available payment methods to your clients."
|
545 |
msgstr "Habilita los medios de pago disponibles para tus clientes."
|
546 |
|
547 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:486
|
697 |
msgstr "<b>Sigue estos pasos para activar Mercado Pago en tu tienda:</b>"
|
698 |
|
699 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:395
|
700 |
+
msgid "<b>Upload your credentials</b> depending on the country in which you are registered."
|
701 |
+
msgstr "<b>Carga tus credenciales</b> según el país en el que estés registrado."
|
702 |
|
703 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
|
704 |
+
msgid "<b>Approve your account</b> to be able to charge."
|
705 |
+
msgstr "<b>Homologa tu cuenta</b> para poder cobrar."
|
706 |
|
707 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:409
|
708 |
+
msgid "<b>Add the basic information of your business</b> in the plugin configuration."
|
709 |
+
msgstr "<b>Añade la información básica de tu negocio</b> en la configuración del plugin"
|
710 |
|
711 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:416
|
712 |
+
msgid "<b>Configure the payment preferences</b> for your customers."
|
713 |
+
msgstr "<b>Configura las preferencias de pago</b> para tus clientes."
|
714 |
|
715 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:423
|
716 |
msgid "<b>Go to advanced settings</b> only when you want to change the presets."
|
717 |
+
msgstr "<b>Ve a configuraciones avanzadas</b> sólo cuando quieras modificar los ajustes preestablecidos."
|
718 |
|
719 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
|
720 |
msgid ""
|
780 |
msgstr "Producción"
|
781 |
|
782 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
|
783 |
+
msgid "Choose “Yes” only when you’re ready to sell. Switch to “No” to activate Testing mode."
|
784 |
+
msgstr "Elige “Sí” sólo cuando estés listo para vender. Cambia a “No” para activar el modo Pruebas."
|
785 |
|
786 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
|
787 |
msgid "Load credentials"
|
808 |
msgstr "Access token"
|
809 |
|
810 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:729
|
811 |
+
msgid "Production credentials"
|
812 |
+
msgstr "Credenciales para producción"
|
813 |
|
814 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:741
|
815 |
msgid "With these keys you can receive real payments from your customers."
|
828 |
msgstr "Homologar cuenta en Mercado Pago"
|
829 |
|
830 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:830
|
831 |
+
msgid "Store name"
|
832 |
+
msgstr "Nombre de la tienda"
|
833 |
|
834 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:832
|
835 |
msgid "This name will appear on your customers invoice."
|
860 |
msgstr "WC-"
|
861 |
|
862 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:878
|
863 |
+
msgid "Advanced adjustment"
|
864 |
msgstr "Ajustes avanzados"
|
865 |
|
866 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:891
|
1224 |
msgid "Invalid Expiration Date"
|
1225 |
msgstr "Fecha de expiracion inválida"
|
1226 |
|
1227 |
+
#: templates/checkout/custom_checkout.php:103
|
1228 |
+
msgid "Security code"
|
1229 |
msgstr "Código de seguridad"
|
1230 |
|
1231 |
+
#: templates/checkout/custom_checkout.php:105
|
1232 |
+
msgid "Last 3 numbers on the back"
|
1233 |
+
msgstr "Últimos 3 números en el reverso"
|
1234 |
+
|
1235 |
#: templates/checkout/custom_checkout.php:148
|
1236 |
msgid "In how many installments do you want to pay"
|
1237 |
msgstr "En cuántas cuotas quieres pagar"
|
1441 |
msgstr "Acepta pagos con tarjeta en tu sitio web con la mejor financiación posible y maximiza la conversión de tu negocio. Con el checkout personalizado tus clientes pagan ¡sin salir de tu tienda!"
|
1442 |
|
1443 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:471 includes/payments/WC_WooMercadoPago_TicketGateway.php:331
|
1444 |
+
msgid "Choose the available payment methods in your store."
|
1445 |
msgstr "Selecciona los medios de pago disponibles en tu tienda."
|
1446 |
+
|
1447 |
+
#: includes/admin/notices/WC_WooMercadoPago_Notices.php:94
|
1448 |
+
msgid "Activate WooCommerce"
|
1449 |
+
msgstr "Activar WooCommerce"
|
1450 |
+
|
1451 |
+
#: includes/admin/notices/WC_WooMercadoPago_Notices.php:97
|
1452 |
+
msgid "Install WooCommerce"
|
1453 |
+
msgstr "Instalar WooCommerce"
|
1454 |
+
|
1455 |
+
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:898
|
1456 |
+
msgid "Integrator ID"
|
1457 |
+
msgstr "Integrator ID"
|
1458 |
+
|
1459 |
+
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:900
|
1460 |
+
msgid "Do not forget to enter your integrator_id as a certified Mercado Pago Partner. If you don`t have it, you can %s"
|
1461 |
+
msgstr "No olvides ingresar tu integrator_id como Partner certificado de Mercado Pago. Si no lo tienes, puedes %s"
|
1462 |
+
|
1463 |
+
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:903
|
1464 |
+
msgid "request it now."
|
1465 |
+
msgstr "solicitarlo ahora."
|
i18n/languages/woocommerce-mercadopago-es_VE.mo
CHANGED
Binary file
|
i18n/languages/woocommerce-mercadopago-es_VE.po
CHANGED
@@ -2,15 +2,15 @@
|
|
2 |
# This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Mercado Pago payments for WooCommerce 4.
|
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-
|
13 |
-
"X-Generator: Poedit 2.
|
14 |
"X-Domain: woocommerce-mercadopago\n"
|
15 |
"Last-Translator: \n"
|
16 |
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
@@ -62,20 +62,20 @@ msgid "Discount provided by store"
|
|
62 |
msgstr "Descuento proporcionado por la tienda"
|
63 |
|
64 |
#: includes/module/WC_WooMercadoPago_Configs.php:112
|
65 |
-
msgid "The store
|
66 |
-
msgstr "La tienda debe tener HTTPS para
|
67 |
|
68 |
#: includes/module/WC_WooMercadoPago_Configs.php:118 includes/module/WC_WooMercadoPago_Module.php:250
|
69 |
msgid "Discard"
|
70 |
msgstr "Descartar"
|
71 |
|
72 |
#: includes/module/WC_WooMercadoPago_Module.php:244
|
73 |
-
msgid "
|
74 |
-
msgstr "
|
75 |
|
76 |
#: includes/module/WC_WooMercadoPago_Module.php:263
|
77 |
-
msgid "The
|
78 |
-
msgstr "¡El módulo de
|
79 |
|
80 |
#: includes/module/WC_WooMercadoPago_Module.php:273
|
81 |
msgid "Set up"
|
@@ -319,13 +319,21 @@ msgstr " y comisión de"
|
|
319 |
msgid "fee of"
|
320 |
msgstr "comisión de"
|
321 |
|
322 |
-
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:
|
323 |
-
msgid "
|
324 |
-
msgstr "
|
325 |
|
326 |
-
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:
|
327 |
-
msgid "
|
328 |
-
msgstr "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
329 |
|
330 |
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Basic.php:74
|
331 |
msgid "Thanks for your purchase. Please continue to the payment page by clicking on the button below."
|
@@ -469,8 +477,8 @@ msgid "Set payment preferences in your store"
|
|
469 |
msgstr "Configura las preferencias de pago en tu tienda"
|
470 |
|
471 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
|
472 |
-
msgid "
|
473 |
-
msgstr "
|
474 |
|
475 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
|
476 |
msgid "Payment experience"
|
@@ -533,7 +541,7 @@ msgid "Payment methods"
|
|
533 |
msgstr "Medios de"
|
534 |
|
535 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:468 includes/payments/WC_WooMercadoPago_TicketGateway.php:325
|
536 |
-
msgid "
|
537 |
msgstr "Habilita los medios de pago disponibles para tus clientes."
|
538 |
|
539 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:486
|
@@ -689,24 +697,24 @@ msgid "<b>Follow these steps to activate Mercado Pago in your store:</b>"
|
|
689 |
msgstr "<b>Sigue estos pasos para activar Mercado Pago en tu tienda:</b>"
|
690 |
|
691 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:395
|
692 |
-
msgid "Upload your
|
693 |
-
msgstr "Carga tus
|
694 |
|
695 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
|
696 |
-
msgid "Approve your account to be able to charge."
|
697 |
-
msgstr "Homologa tu cuenta para poder cobrar."
|
698 |
|
699 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:409
|
700 |
-
msgid "Add the basic information of your business in the plugin configuration."
|
701 |
-
msgstr "Añade la información básica de tu negocio en la configuración del plugin
|
702 |
|
703 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:416
|
704 |
-
msgid "Configure the
|
705 |
-
msgstr "Configura las preferencias de pago para tus clientes."
|
706 |
|
707 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:423
|
708 |
msgid "<b>Go to advanced settings</b> only when you want to change the presets."
|
709 |
-
msgstr "<b>Ve a configuraciones avanzadas</b>
|
710 |
|
711 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
|
712 |
msgid ""
|
@@ -772,8 +780,8 @@ msgid "Production"
|
|
772 |
msgstr "Producción"
|
773 |
|
774 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
|
775 |
-
msgid "Choose
|
776 |
-
msgstr "Elige
|
777 |
|
778 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
|
779 |
msgid "Load credentials"
|
@@ -800,8 +808,8 @@ msgid "Access token"
|
|
800 |
msgstr "Access token"
|
801 |
|
802 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:729
|
803 |
-
msgid "Production credentials
|
804 |
-
msgstr "Credenciales para producción
|
805 |
|
806 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:741
|
807 |
msgid "With these keys you can receive real payments from your customers."
|
@@ -820,8 +828,8 @@ msgid "Homologate account in Mercado Pago"
|
|
820 |
msgstr "Homologar cuenta en Mercado Pago"
|
821 |
|
822 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:830
|
823 |
-
msgid "Store
|
824 |
-
msgstr "
|
825 |
|
826 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:832
|
827 |
msgid "This name will appear on your customers invoice."
|
@@ -852,7 +860,7 @@ msgid "WC-"
|
|
852 |
msgstr "WC-"
|
853 |
|
854 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:878
|
855 |
-
msgid "Advanced
|
856 |
msgstr "Ajustes avanzados"
|
857 |
|
858 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:891
|
@@ -1216,10 +1224,14 @@ msgstr "Fecha de vencimiento"
|
|
1216 |
msgid "Invalid Expiration Date"
|
1217 |
msgstr "Fecha de expiracion inválida"
|
1218 |
|
1219 |
-
#: templates/checkout/custom_checkout.php:
|
1220 |
-
msgid "
|
1221 |
msgstr "Código de seguridad"
|
1222 |
|
|
|
|
|
|
|
|
|
1223 |
#: templates/checkout/custom_checkout.php:148
|
1224 |
msgid "In how many installments do you want to pay"
|
1225 |
msgstr "En cuántas cuotas quieres pagar"
|
@@ -1429,5 +1441,25 @@ msgid "Accept card payments on your website with the best possible financing and
|
|
1429 |
msgstr "Acepta pagos con tarjeta en tu sitio web con la mejor financiación posible y maximiza la conversión de tu negocio. Con el checkout personalizado tus clientes pagan ¡sin salir de tu tienda!"
|
1430 |
|
1431 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:471 includes/payments/WC_WooMercadoPago_TicketGateway.php:331
|
1432 |
-
msgid "
|
1433 |
msgstr "Selecciona los medios de pago disponibles en tu tienda."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
# This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Mercado Pago payments for WooCommerce 4.2.0\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
|
7 |
"Language-Team: \n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
11 |
"POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
|
12 |
+
"PO-Revision-Date: 2020-05-08 14:43-0300\n"
|
13 |
+
"X-Generator: Poedit 2.3\n"
|
14 |
"X-Domain: woocommerce-mercadopago\n"
|
15 |
"Last-Translator: \n"
|
16 |
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
62 |
msgstr "Descuento proporcionado por la tienda"
|
63 |
|
64 |
#: includes/module/WC_WooMercadoPago_Configs.php:112
|
65 |
+
msgid "The store should have HTTPS in order to activate both Checkout Personalizado and Ticket Checkout."
|
66 |
+
msgstr "La tienda debe tener HTTPS para activar el Checkout Personalizado y el Ticket Checkout."
|
67 |
|
68 |
#: includes/module/WC_WooMercadoPago_Configs.php:118 includes/module/WC_WooMercadoPago_Module.php:250
|
69 |
msgid "Discard"
|
70 |
msgstr "Descartar"
|
71 |
|
72 |
#: includes/module/WC_WooMercadoPago_Module.php:244
|
73 |
+
msgid "Fill in your credentials to enable payment methods."
|
74 |
+
msgstr "Completa tus credenciales para habilitar los medios de pago."
|
75 |
|
76 |
#: includes/module/WC_WooMercadoPago_Module.php:263
|
77 |
+
msgid "The Mercado Pago module needs an active version of %s in order to work!"
|
78 |
+
msgstr "¡El módulo de Mercado Pago necesita una versión de %s activa para funcionar!"
|
79 |
|
80 |
#: includes/module/WC_WooMercadoPago_Module.php:273
|
81 |
msgid "Set up"
|
319 |
msgid "fee of"
|
320 |
msgstr "comisión de"
|
321 |
|
322 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:361
|
323 |
+
msgid "<b>Public Key</b> production credential is invalid. Review the field to receive real payments."
|
324 |
+
msgstr "La credencial para producción <b>Public Key</b> es inválida. Revísala para poder recibir pagos reales."
|
325 |
|
326 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:371
|
327 |
+
msgid "<b>Public Key</b> test credential is invalid. Review the field to perform tests in your store."
|
328 |
+
msgstr "La credencial de prueba <b>Public Key</b> es inválida. Revísala para poder realizar pruebas en tu tienda."
|
329 |
+
|
330 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:381
|
331 |
+
msgid "<b>Access Token</b> production credential is invalid. Remember that it must be complete to receive real payments."
|
332 |
+
msgstr "La credencial para producción <b>Access Token</b> es inválida. Revísala para poder recibir pagos reales."
|
333 |
+
|
334 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:391
|
335 |
+
msgid "<b>Access Token</b> test credential is invalid. Review the field to perform tests in your store."
|
336 |
+
msgstr "La credencial de prueba <b>Access Token</b> es inválida. Revísala para poder realizar pruebas en tu tienda."
|
337 |
|
338 |
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Basic.php:74
|
339 |
msgid "Thanks for your purchase. Please continue to the payment page by clicking on the button below."
|
477 |
msgstr "Configura las preferencias de pago en tu tienda"
|
478 |
|
479 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
|
480 |
+
msgid "Advanced settings"
|
481 |
+
msgstr "Configuración avanzada"
|
482 |
|
483 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
|
484 |
msgid "Payment experience"
|
541 |
msgstr "Medios de"
|
542 |
|
543 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:468 includes/payments/WC_WooMercadoPago_TicketGateway.php:325
|
544 |
+
msgid "Activate the available payment methods to your clients."
|
545 |
msgstr "Habilita los medios de pago disponibles para tus clientes."
|
546 |
|
547 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:486
|
697 |
msgstr "<b>Sigue estos pasos para activar Mercado Pago en tu tienda:</b>"
|
698 |
|
699 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:395
|
700 |
+
msgid "<b>Upload your credentials</b> depending on the country in which you are registered."
|
701 |
+
msgstr "<b>Carga tus credenciales</b> según el país en el que estés registrado."
|
702 |
|
703 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
|
704 |
+
msgid "<b>Approve your account</b> to be able to charge."
|
705 |
+
msgstr "<b>Homologa tu cuenta</b> para poder cobrar."
|
706 |
|
707 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:409
|
708 |
+
msgid "<b>Add the basic information of your business</b> in the plugin configuration."
|
709 |
+
msgstr "<b>Añade la información básica de tu negocio</b> en la configuración del plugin"
|
710 |
|
711 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:416
|
712 |
+
msgid "<b>Configure the payment preferences</b> for your customers."
|
713 |
+
msgstr "<b>Configura las preferencias de pago</b> para tus clientes."
|
714 |
|
715 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:423
|
716 |
msgid "<b>Go to advanced settings</b> only when you want to change the presets."
|
717 |
+
msgstr "<b>Ve a configuraciones avanzadas</b> sólo cuando quieras modificar los ajustes preestablecidos."
|
718 |
|
719 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
|
720 |
msgid ""
|
780 |
msgstr "Producción"
|
781 |
|
782 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
|
783 |
+
msgid "Choose “Yes” only when you’re ready to sell. Switch to “No” to activate Testing mode."
|
784 |
+
msgstr "Elige “Sí” sólo cuando estés listo para vender. Cambia a “No” para activar el modo Pruebas."
|
785 |
|
786 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
|
787 |
msgid "Load credentials"
|
808 |
msgstr "Access token"
|
809 |
|
810 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:729
|
811 |
+
msgid "Production credentials"
|
812 |
+
msgstr "Credenciales para producción"
|
813 |
|
814 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:741
|
815 |
msgid "With these keys you can receive real payments from your customers."
|
828 |
msgstr "Homologar cuenta en Mercado Pago"
|
829 |
|
830 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:830
|
831 |
+
msgid "Store name"
|
832 |
+
msgstr "Nombre de la tienda"
|
833 |
|
834 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:832
|
835 |
msgid "This name will appear on your customers invoice."
|
860 |
msgstr "WC-"
|
861 |
|
862 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:878
|
863 |
+
msgid "Advanced adjustment"
|
864 |
msgstr "Ajustes avanzados"
|
865 |
|
866 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:891
|
1224 |
msgid "Invalid Expiration Date"
|
1225 |
msgstr "Fecha de expiracion inválida"
|
1226 |
|
1227 |
+
#: templates/checkout/custom_checkout.php:103
|
1228 |
+
msgid "Security code"
|
1229 |
msgstr "Código de seguridad"
|
1230 |
|
1231 |
+
#: templates/checkout/custom_checkout.php:105
|
1232 |
+
msgid "Last 3 numbers on the back"
|
1233 |
+
msgstr "Últimos 3 números en el reverso"
|
1234 |
+
|
1235 |
#: templates/checkout/custom_checkout.php:148
|
1236 |
msgid "In how many installments do you want to pay"
|
1237 |
msgstr "En cuántas cuotas quieres pagar"
|
1441 |
msgstr "Acepta pagos con tarjeta en tu sitio web con la mejor financiación posible y maximiza la conversión de tu negocio. Con el checkout personalizado tus clientes pagan ¡sin salir de tu tienda!"
|
1442 |
|
1443 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:471 includes/payments/WC_WooMercadoPago_TicketGateway.php:331
|
1444 |
+
msgid "Choose the available payment methods in your store."
|
1445 |
msgstr "Selecciona los medios de pago disponibles en tu tienda."
|
1446 |
+
|
1447 |
+
#: includes/admin/notices/WC_WooMercadoPago_Notices.php:94
|
1448 |
+
msgid "Activate WooCommerce"
|
1449 |
+
msgstr "Activar WooCommerce"
|
1450 |
+
|
1451 |
+
#: includes/admin/notices/WC_WooMercadoPago_Notices.php:97
|
1452 |
+
msgid "Install WooCommerce"
|
1453 |
+
msgstr "Instalar WooCommerce"
|
1454 |
+
|
1455 |
+
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:898
|
1456 |
+
msgid "Integrator ID"
|
1457 |
+
msgstr "Integrator ID"
|
1458 |
+
|
1459 |
+
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:900
|
1460 |
+
msgid "Do not forget to enter your integrator_id as a certified Mercado Pago Partner. If you don`t have it, you can %s"
|
1461 |
+
msgstr "No olvides ingresar tu integrator_id como Partner certificado de Mercado Pago. Si no lo tienes, puedes %s"
|
1462 |
+
|
1463 |
+
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:903
|
1464 |
+
msgid "request it now."
|
1465 |
+
msgstr "solicitarlo ahora."
|
i18n/languages/woocommerce-mercadopago-pt_BR.mo
CHANGED
Binary file
|
i18n/languages/woocommerce-mercadopago-pt_BR.po
CHANGED
@@ -2,15 +2,15 @@
|
|
2 |
# This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Mercado Pago payments for WooCommerce 4.
|
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-
|
13 |
-
"X-Generator: Poedit 2.
|
14 |
"X-Domain: woocommerce-mercadopago\n"
|
15 |
"Last-Translator: \n"
|
16 |
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
@@ -62,20 +62,20 @@ msgid "Discount provided by store"
|
|
62 |
msgstr "Desconto dado pela loja"
|
63 |
|
64 |
#: includes/module/WC_WooMercadoPago_Configs.php:112
|
65 |
-
msgid "The store
|
66 |
-
msgstr "A loja deve ter HTTPS para
|
67 |
|
68 |
#: includes/module/WC_WooMercadoPago_Configs.php:118 includes/module/WC_WooMercadoPago_Module.php:250
|
69 |
msgid "Discard"
|
70 |
msgstr "Descartar"
|
71 |
|
72 |
#: includes/module/WC_WooMercadoPago_Module.php:244
|
73 |
-
msgid "
|
74 |
-
msgstr "
|
75 |
|
76 |
#: includes/module/WC_WooMercadoPago_Module.php:263
|
77 |
-
msgid "The
|
78 |
-
msgstr "O módulo
|
79 |
|
80 |
#: includes/module/WC_WooMercadoPago_Module.php:273
|
81 |
msgid "Set up"
|
@@ -319,13 +319,21 @@ msgstr " e taxa de"
|
|
319 |
msgid "fee of"
|
320 |
msgstr "taxa de"
|
321 |
|
322 |
-
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:
|
323 |
-
msgid "
|
324 |
-
msgstr "
|
325 |
|
326 |
-
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:
|
327 |
-
msgid "
|
328 |
-
msgstr "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
329 |
|
330 |
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Basic.php:74
|
331 |
msgid "Thanks for your purchase. Please continue to the payment page by clicking on the button below."
|
@@ -469,8 +477,8 @@ msgid "Set payment preferences in your store"
|
|
469 |
msgstr "Configure as preferências de pagamento na sua loja"
|
470 |
|
471 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
|
472 |
-
msgid "
|
473 |
-
msgstr "
|
474 |
|
475 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
|
476 |
msgid "Payment experience"
|
@@ -533,7 +541,7 @@ msgid "Payment methods"
|
|
533 |
msgstr "Meios de pagamento"
|
534 |
|
535 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:468 includes/payments/WC_WooMercadoPago_TicketGateway.php:325
|
536 |
-
msgid "
|
537 |
msgstr "Habilite os meios de pagamento disponíveis para seus clientes."
|
538 |
|
539 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:486
|
@@ -689,24 +697,24 @@ msgid "<b>Follow these steps to activate Mercado Pago in your store:</b>"
|
|
689 |
msgstr "<b>Siga estas etapas para ativar o Mercado Pago na sua loja:</b>"
|
690 |
|
691 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:395
|
692 |
-
msgid "Upload your
|
693 |
-
msgstr "Adicione suas
|
694 |
|
695 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
|
696 |
-
msgid "Approve your account to be able to charge."
|
697 |
-
msgstr "Homologue sua conta do Mercado Pago."
|
698 |
|
699 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:409
|
700 |
-
msgid "Add the basic information of your business in the plugin configuration."
|
701 |
-
msgstr "Adicione as informações básicas do seu negócio na configuração do plugin."
|
702 |
|
703 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:416
|
704 |
-
msgid "Configure the
|
705 |
-
msgstr "Configure as
|
706 |
|
707 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:423
|
708 |
msgid "<b>Go to advanced settings</b> only when you want to change the presets."
|
709 |
-
msgstr "Faça as
|
710 |
|
711 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
|
712 |
msgid ""
|
@@ -772,8 +780,8 @@ msgid "Production"
|
|
772 |
msgstr "Produção"
|
773 |
|
774 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
|
775 |
-
msgid "Choose
|
776 |
-
msgstr "Escolha
|
777 |
|
778 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
|
779 |
msgid "Load credentials"
|
@@ -800,8 +808,8 @@ msgid "Access token"
|
|
800 |
msgstr "Access token"
|
801 |
|
802 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:729
|
803 |
-
msgid "Production credentials
|
804 |
-
msgstr "Credenciais de Produção
|
805 |
|
806 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:741
|
807 |
msgid "With these keys you can receive real payments from your customers."
|
@@ -820,7 +828,7 @@ msgid "Homologate account in Mercado Pago"
|
|
820 |
msgstr "Homologar minha conta"
|
821 |
|
822 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:830
|
823 |
-
msgid "Store
|
824 |
msgstr "Nome da loja"
|
825 |
|
826 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:832
|
@@ -852,7 +860,7 @@ msgid "WC-"
|
|
852 |
msgstr "WC-"
|
853 |
|
854 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:878
|
855 |
-
msgid "Advanced
|
856 |
msgstr "Ajustes Avançados"
|
857 |
|
858 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:891
|
@@ -973,7 +981,7 @@ msgstr "Descontos por comprar com Mercado Pago"
|
|
973 |
|
974 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1066
|
975 |
msgid "Choose a percentage value that you want to discount your customers for paying with Mercado Pago."
|
976 |
-
msgstr "Selecione um valor percentual que
|
977 |
|
978 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1083
|
979 |
msgid "Commission for purchase with Mercado Pago"
|
@@ -981,7 +989,7 @@ msgstr "Comissão por compra com Mercado Pago"
|
|
981 |
|
982 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1085
|
983 |
msgid "Choose an additional percentage value that you want to charge as commission to your customers for paying with Mercado Pago."
|
984 |
-
msgstr "Selecione um valor percentual adicional que
|
985 |
|
986 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1103
|
987 |
msgid "Everything ready for the takeoff of your sales?"
|
@@ -1216,10 +1224,14 @@ msgstr "Data de vencimento"
|
|
1216 |
msgid "Invalid Expiration Date"
|
1217 |
msgstr "Data de vencimento inválida"
|
1218 |
|
1219 |
-
#: templates/checkout/custom_checkout.php:
|
1220 |
-
msgid "
|
1221 |
msgstr "Código de segurança"
|
1222 |
|
|
|
|
|
|
|
|
|
1223 |
#: templates/checkout/custom_checkout.php:148
|
1224 |
msgid "In how many installments do you want to pay"
|
1225 |
msgstr "Em quantas parcelas você quer pagar"
|
@@ -1449,5 +1461,25 @@ msgid "<b>Attention:</b> The currency settings you have in WooCommerce are not c
|
|
1449 |
msgstr "<b>Atenção:</b> a configuração de moeda que você tem no WooCommerce não é compatível com a moeda que você usa na sua conta do Mercado Pago. Por favor, ative a conversão de moeda."
|
1450 |
|
1451 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:471 includes/payments/WC_WooMercadoPago_TicketGateway.php:331
|
1452 |
-
msgid "
|
1453 |
-
msgstr "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
# This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Mercado Pago payments for WooCommerce 4.2.0\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
|
7 |
"Language-Team: \n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
11 |
"POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
|
12 |
+
"PO-Revision-Date: 2020-05-08 14:43-0300\n"
|
13 |
+
"X-Generator: Poedit 2.3\n"
|
14 |
"X-Domain: woocommerce-mercadopago\n"
|
15 |
"Last-Translator: \n"
|
16 |
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
62 |
msgstr "Desconto dado pela loja"
|
63 |
|
64 |
#: includes/module/WC_WooMercadoPago_Configs.php:112
|
65 |
+
msgid "The store should have HTTPS in order to activate both Checkout Personalizado and Ticket Checkout."
|
66 |
+
msgstr "A loja deve ter HTTPS para ativar o Checkout Personalizado e o Ticket Checkout."
|
67 |
|
68 |
#: includes/module/WC_WooMercadoPago_Configs.php:118 includes/module/WC_WooMercadoPago_Module.php:250
|
69 |
msgid "Discard"
|
70 |
msgstr "Descartar"
|
71 |
|
72 |
#: includes/module/WC_WooMercadoPago_Module.php:244
|
73 |
+
msgid "Fill in your credentials to enable payment methods."
|
74 |
+
msgstr "Complete suas credenciais para habilitar os meios de pagamento."
|
75 |
|
76 |
#: includes/module/WC_WooMercadoPago_Module.php:263
|
77 |
+
msgid "The Mercado Pago module needs an active version of %s in order to work!"
|
78 |
+
msgstr "O módulo do Mercado Pago necessita de uma versão ativa de %s para funcionar!"
|
79 |
|
80 |
#: includes/module/WC_WooMercadoPago_Module.php:273
|
81 |
msgid "Set up"
|
319 |
msgid "fee of"
|
320 |
msgstr "taxa de"
|
321 |
|
322 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:361
|
323 |
+
msgid "<b>Public Key</b> production credential is invalid. Review the field to receive real payments."
|
324 |
+
msgstr "A credencial de produção <b>Public Key</b> é inválida. Revise o campo para poder receber pagamentos reais."
|
325 |
|
326 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:371
|
327 |
+
msgid "<b>Public Key</b> test credential is invalid. Review the field to perform tests in your store."
|
328 |
+
msgstr "A credencial de teste <b>Public Key</b> é inválida. Revise o campo para poder realizar testes em sua loja."
|
329 |
+
|
330 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:381
|
331 |
+
msgid "<b>Access Token</b> production credential is invalid. Remember that it must be complete to receive real payments."
|
332 |
+
msgstr "A credencial de produção <b>Access Token</b> é inválida. Revise o campo para poder receber pagamentos reais."
|
333 |
+
|
334 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:391
|
335 |
+
msgid "<b>Access Token</b> test credential is invalid. Review the field to perform tests in your store."
|
336 |
+
msgstr "A credencial de teste <b>Access Token</b> é inválida. Revise o campo para poder realizar testes em sua loja."
|
337 |
|
338 |
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Basic.php:74
|
339 |
msgid "Thanks for your purchase. Please continue to the payment page by clicking on the button below."
|
477 |
msgstr "Configure as preferências de pagamento na sua loja"
|
478 |
|
479 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
|
480 |
+
msgid "Advanced settings"
|
481 |
+
msgstr "Configuração avançada"
|
482 |
|
483 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
|
484 |
msgid "Payment experience"
|
541 |
msgstr "Meios de pagamento"
|
542 |
|
543 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:468 includes/payments/WC_WooMercadoPago_TicketGateway.php:325
|
544 |
+
msgid "Activate the available payment methods to your clients."
|
545 |
msgstr "Habilite os meios de pagamento disponíveis para seus clientes."
|
546 |
|
547 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:486
|
697 |
msgstr "<b>Siga estas etapas para ativar o Mercado Pago na sua loja:</b>"
|
698 |
|
699 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:395
|
700 |
+
msgid "<b>Upload your credentials</b> depending on the country in which you are registered."
|
701 |
+
msgstr "<b>Adicione suas credenciais</b> conforme o país onde você está cadastrado."
|
702 |
|
703 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
|
704 |
+
msgid "<b>Approve your account</b> to be able to charge."
|
705 |
+
msgstr "<b>Homologue sua conta</b> do Mercado Pago."
|
706 |
|
707 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:409
|
708 |
+
msgid "<b>Add the basic information of your business</b> in the plugin configuration."
|
709 |
+
msgstr "<b>Adicione as informações básicas do seu negócio</b> na configuração do plugin."
|
710 |
|
711 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:416
|
712 |
+
msgid "<b>Configure the payment preferences</b> for your customers."
|
713 |
+
msgstr "<b>Configure as preferências de pagamento</b> para seus clientes."
|
714 |
|
715 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:423
|
716 |
msgid "<b>Go to advanced settings</b> only when you want to change the presets."
|
717 |
+
msgstr "<b>Faça as configurações avançadas</b> somente quando quiser alterar os ajustes pré-definidos."
|
718 |
|
719 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
|
720 |
msgid ""
|
780 |
msgstr "Produção"
|
781 |
|
782 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
|
783 |
+
msgid "Choose “Yes” only when you’re ready to sell. Switch to “No” to activate Testing mode."
|
784 |
+
msgstr "Escolha “Sim” só quando estiver pronto para vender. Mude para “Não” para ativar o modo de Testes."
|
785 |
|
786 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
|
787 |
msgid "Load credentials"
|
808 |
msgstr "Access token"
|
809 |
|
810 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:729
|
811 |
+
msgid "Production credentials"
|
812 |
+
msgstr "Credenciais de Produção"
|
813 |
|
814 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:741
|
815 |
msgid "With these keys you can receive real payments from your customers."
|
828 |
msgstr "Homologar minha conta"
|
829 |
|
830 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:830
|
831 |
+
msgid "Store name"
|
832 |
msgstr "Nome da loja"
|
833 |
|
834 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:832
|
860 |
msgstr "WC-"
|
861 |
|
862 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:878
|
863 |
+
msgid "Advanced adjustment"
|
864 |
msgstr "Ajustes Avançados"
|
865 |
|
866 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:891
|
981 |
|
982 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1066
|
983 |
msgid "Choose a percentage value that you want to discount your customers for paying with Mercado Pago."
|
984 |
+
msgstr "Selecione um valor percentual que quiser descontar para seus clientes por pagar com Mercado Pago"
|
985 |
|
986 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1083
|
987 |
msgid "Commission for purchase with Mercado Pago"
|
989 |
|
990 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1085
|
991 |
msgid "Choose an additional percentage value that you want to charge as commission to your customers for paying with Mercado Pago."
|
992 |
+
msgstr "Selecione um valor percentual adicional que quiser cobrar como tarifa dos seus clientes por pagar com Mercado Pago."
|
993 |
|
994 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1103
|
995 |
msgid "Everything ready for the takeoff of your sales?"
|
1224 |
msgid "Invalid Expiration Date"
|
1225 |
msgstr "Data de vencimento inválida"
|
1226 |
|
1227 |
+
#: templates/checkout/custom_checkout.php:103
|
1228 |
+
msgid "Security code"
|
1229 |
msgstr "Código de segurança"
|
1230 |
|
1231 |
+
#: templates/checkout/custom_checkout.php:105
|
1232 |
+
msgid "Last 3 numbers on the back"
|
1233 |
+
msgstr "Últimos 3 números do verso"
|
1234 |
+
|
1235 |
#: templates/checkout/custom_checkout.php:148
|
1236 |
msgid "In how many installments do you want to pay"
|
1237 |
msgstr "Em quantas parcelas você quer pagar"
|
1461 |
msgstr "<b>Atenção:</b> a configuração de moeda que você tem no WooCommerce não é compatível com a moeda que você usa na sua conta do Mercado Pago. Por favor, ative a conversão de moeda."
|
1462 |
|
1463 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:471 includes/payments/WC_WooMercadoPago_TicketGateway.php:331
|
1464 |
+
msgid "Choose the available payment methods in your store."
|
1465 |
+
msgstr "Habilite os meios de pagamento disponíveis para seus clientes."
|
1466 |
+
|
1467 |
+
#: includes/admin/notices/WC_WooMercadoPago_Notices.php:94
|
1468 |
+
msgid "Activate WooCommerce"
|
1469 |
+
msgstr "Ativar WooCommerce"
|
1470 |
+
|
1471 |
+
#: includes/admin/notices/WC_WooMercadoPago_Notices.php:97
|
1472 |
+
msgid "Install WooCommerce"
|
1473 |
+
msgstr "Instalar WooCommerce"
|
1474 |
+
|
1475 |
+
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:898
|
1476 |
+
msgid "Integrator ID"
|
1477 |
+
msgstr "Integrator ID"
|
1478 |
+
|
1479 |
+
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:900
|
1480 |
+
msgid "Do not forget to enter your integrator_id as a certified Mercado Pago Partner. If you don`t have it, you can %s"
|
1481 |
+
msgstr "Não esqueça de inserir seu integrator_id como Parceiro certificado do Mercado Pago. Se você não o possui, pode %s"
|
1482 |
+
|
1483 |
+
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:903
|
1484 |
+
msgid "request it now."
|
1485 |
+
msgstr "solicitá-lo agora."
|
i18n/languages/woocommerce-mercadopago.pot
CHANGED
@@ -3,16 +3,16 @@
|
|
3 |
#, fuzzy
|
4 |
msgid ""
|
5 |
msgstr ""
|
6 |
-
"Project-Id-Version: Mercado Pago payments for WooCommerce 4.
|
7 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
|
8 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
9 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
10 |
"MIME-Version: 1.0\n"
|
11 |
"Content-Type: text/plain; charset=UTF-8\n"
|
12 |
"Content-Transfer-Encoding: 8bit\n"
|
13 |
-
"POT-Creation-Date:
|
14 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
15 |
-
"X-Generator: Poedit 2.
|
16 |
"X-Domain: woocommerce-mercadopago\n"
|
17 |
|
18 |
#. Plugin Name of the plugin
|
@@ -62,7 +62,7 @@ msgid "Discount provided by store"
|
|
62 |
msgstr ""
|
63 |
|
64 |
#: includes/module/WC_WooMercadoPago_Configs.php:112
|
65 |
-
msgid "The store
|
66 |
msgstr ""
|
67 |
|
68 |
#: includes/module/WC_WooMercadoPago_Configs.php:118
|
@@ -71,11 +71,11 @@ msgid "Discard"
|
|
71 |
msgstr ""
|
72 |
|
73 |
#: includes/module/WC_WooMercadoPago_Module.php:244
|
74 |
-
msgid "
|
75 |
msgstr ""
|
76 |
|
77 |
#: includes/module/WC_WooMercadoPago_Module.php:263
|
78 |
-
msgid "The
|
79 |
msgstr ""
|
80 |
|
81 |
#: includes/module/WC_WooMercadoPago_Module.php:273
|
@@ -340,12 +340,20 @@ msgstr ""
|
|
340 |
msgid "fee of"
|
341 |
msgstr ""
|
342 |
|
343 |
-
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:
|
344 |
-
msgid "
|
345 |
msgstr ""
|
346 |
|
347 |
-
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:
|
348 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
349 |
msgstr ""
|
350 |
|
351 |
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Basic.php:74
|
@@ -495,7 +503,7 @@ msgid "Set payment preferences in your store"
|
|
495 |
msgstr ""
|
496 |
|
497 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
|
498 |
-
msgid "
|
499 |
msgstr ""
|
500 |
|
501 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
|
@@ -563,7 +571,7 @@ msgstr ""
|
|
563 |
|
564 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:468
|
565 |
#: includes/payments/WC_WooMercadoPago_TicketGateway.php:325
|
566 |
-
msgid "
|
567 |
msgstr ""
|
568 |
|
569 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:486
|
@@ -730,19 +738,19 @@ msgid "<b>Follow these steps to activate Mercado Pago in your store:</b>"
|
|
730 |
msgstr ""
|
731 |
|
732 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:395
|
733 |
-
msgid "Upload your
|
734 |
msgstr ""
|
735 |
|
736 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
|
737 |
-
msgid "Approve your account to be able to charge."
|
738 |
msgstr ""
|
739 |
|
740 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:409
|
741 |
-
msgid "Add the basic information of your business in the plugin configuration."
|
742 |
msgstr ""
|
743 |
|
744 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:416
|
745 |
-
msgid "Configure the
|
746 |
msgstr ""
|
747 |
|
748 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:423
|
@@ -812,7 +820,7 @@ msgid "Production"
|
|
812 |
msgstr ""
|
813 |
|
814 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
|
815 |
-
msgid "Choose
|
816 |
msgstr ""
|
817 |
|
818 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
|
@@ -842,7 +850,7 @@ msgid "Access token"
|
|
842 |
msgstr ""
|
843 |
|
844 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:729
|
845 |
-
msgid "Production credentials
|
846 |
msgstr ""
|
847 |
|
848 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:741
|
@@ -862,7 +870,7 @@ msgid "Homologate account in Mercado Pago"
|
|
862 |
msgstr ""
|
863 |
|
864 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:830
|
865 |
-
msgid "Store
|
866 |
msgstr ""
|
867 |
|
868 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:832
|
@@ -894,7 +902,7 @@ msgid "WC-"
|
|
894 |
msgstr ""
|
895 |
|
896 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:878
|
897 |
-
msgid "Advanced
|
898 |
msgstr ""
|
899 |
|
900 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:891
|
@@ -1276,8 +1284,11 @@ msgstr ""
|
|
1276 |
msgid "Invalid Expiration Date"
|
1277 |
msgstr ""
|
1278 |
|
1279 |
-
#: templates/checkout/custom_checkout.php:
|
1280 |
-
|
|
|
|
|
|
|
1281 |
msgid "Last 3 numbers on the back"
|
1282 |
msgstr ""
|
1283 |
|
@@ -1521,5 +1532,25 @@ msgstr ""
|
|
1521 |
|
1522 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:471
|
1523 |
#: includes/payments/WC_WooMercadoPago_TicketGateway.php:331
|
1524 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1525 |
msgstr ""
|
3 |
#, fuzzy
|
4 |
msgid ""
|
5 |
msgstr ""
|
6 |
+
"Project-Id-Version: Mercado Pago payments for WooCommerce 4.2.0\n"
|
7 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
|
8 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
9 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
10 |
"MIME-Version: 1.0\n"
|
11 |
"Content-Type: text/plain; charset=UTF-8\n"
|
12 |
"Content-Transfer-Encoding: 8bit\n"
|
13 |
+
"POT-Creation-Date: 2020-05-06 12:15-0300\n"
|
14 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
15 |
+
"X-Generator: Poedit 2.3\n"
|
16 |
"X-Domain: woocommerce-mercadopago\n"
|
17 |
|
18 |
#. Plugin Name of the plugin
|
62 |
msgstr ""
|
63 |
|
64 |
#: includes/module/WC_WooMercadoPago_Configs.php:112
|
65 |
+
msgid "The store should have HTTPS in order to activate both Checkout Personalizado and Ticket Checkout."
|
66 |
msgstr ""
|
67 |
|
68 |
#: includes/module/WC_WooMercadoPago_Configs.php:118
|
71 |
msgstr ""
|
72 |
|
73 |
#: includes/module/WC_WooMercadoPago_Module.php:244
|
74 |
+
msgid "Fill in your credentials to enable payment methods."
|
75 |
msgstr ""
|
76 |
|
77 |
#: includes/module/WC_WooMercadoPago_Module.php:263
|
78 |
+
msgid "The Mercado Pago module needs an active version of %s in order to work!"
|
79 |
msgstr ""
|
80 |
|
81 |
#: includes/module/WC_WooMercadoPago_Module.php:273
|
340 |
msgid "fee of"
|
341 |
msgstr ""
|
342 |
|
343 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:361
|
344 |
+
msgid "<b>Public Key</b> production credential is invalid. Review the field to receive real payments."
|
345 |
msgstr ""
|
346 |
|
347 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:371
|
348 |
+
msgid "<b>Public Key</b> test credential is invalid. Review the field to perform tests in your store."
|
349 |
+
msgstr ""
|
350 |
+
|
351 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:381
|
352 |
+
msgid "<b>Access Token</b> production credential is invalid. Remember that it must be complete to receive real payments."
|
353 |
+
msgstr ""
|
354 |
+
|
355 |
+
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:391
|
356 |
+
msgid "<b>Access Token</b> test credential is invalid. Review the field to perform tests in your store."
|
357 |
msgstr ""
|
358 |
|
359 |
#: includes/payments/hooks/WC_WooMercadoPago_Hook_Basic.php:74
|
503 |
msgstr ""
|
504 |
|
505 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
|
506 |
+
msgid "Advanced settings"
|
507 |
msgstr ""
|
508 |
|
509 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
|
571 |
|
572 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:468
|
573 |
#: includes/payments/WC_WooMercadoPago_TicketGateway.php:325
|
574 |
+
msgid "Activate the available payment methods to your clients."
|
575 |
msgstr ""
|
576 |
|
577 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:486
|
738 |
msgstr ""
|
739 |
|
740 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:395
|
741 |
+
msgid "<b>Upload your credentials</b> depending on the country in which you are registered."
|
742 |
msgstr ""
|
743 |
|
744 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
|
745 |
+
msgid "<b>Approve your account</b> to be able to charge."
|
746 |
msgstr ""
|
747 |
|
748 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:409
|
749 |
+
msgid "<b>Add the basic information of your business</b> in the plugin configuration."
|
750 |
msgstr ""
|
751 |
|
752 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:416
|
753 |
+
msgid "<b>Configure the payment preferences</b> for your customers."
|
754 |
msgstr ""
|
755 |
|
756 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:423
|
820 |
msgstr ""
|
821 |
|
822 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
|
823 |
+
msgid "Choose “Yes” only when you’re ready to sell. Switch to “No” to activate Testing mode."
|
824 |
msgstr ""
|
825 |
|
826 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
|
850 |
msgstr ""
|
851 |
|
852 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:729
|
853 |
+
msgid "Production credentials"
|
854 |
msgstr ""
|
855 |
|
856 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:741
|
870 |
msgstr ""
|
871 |
|
872 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:830
|
873 |
+
msgid "Store name"
|
874 |
msgstr ""
|
875 |
|
876 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:832
|
902 |
msgstr ""
|
903 |
|
904 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:878
|
905 |
+
msgid "Advanced adjustment"
|
906 |
msgstr ""
|
907 |
|
908 |
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:891
|
1284 |
msgid "Invalid Expiration Date"
|
1285 |
msgstr ""
|
1286 |
|
1287 |
+
#: templates/checkout/custom_checkout.php:103
|
1288 |
+
msgid "Security code"
|
1289 |
+
msgstr ""
|
1290 |
+
|
1291 |
+
#: templates/checkout/custom_checkout.php:105
|
1292 |
msgid "Last 3 numbers on the back"
|
1293 |
msgstr ""
|
1294 |
|
1532 |
|
1533 |
#: includes/payments/WC_WooMercadoPago_BasicGateway.php:471
|
1534 |
#: includes/payments/WC_WooMercadoPago_TicketGateway.php:331
|
1535 |
+
msgid "Choose the available payment methods in your store."
|
1536 |
+
msgstr ""
|
1537 |
+
|
1538 |
+
#: includes/admin/notices/WC_WooMercadoPago_Notices.php:94
|
1539 |
+
msgid "Activate WooCommerce"
|
1540 |
+
msgstr ""
|
1541 |
+
|
1542 |
+
#: includes/admin/notices/WC_WooMercadoPago_Notices.php:97
|
1543 |
+
msgid "Install WooCommerce"
|
1544 |
+
msgstr ""
|
1545 |
+
|
1546 |
+
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:898
|
1547 |
+
msgid "Integrator ID"
|
1548 |
+
msgstr ""
|
1549 |
+
|
1550 |
+
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:900
|
1551 |
+
msgid "Do not forget to enter your integrator_id as a certified Mercado Pago Partner. If you don`t have it, you can %s"
|
1552 |
+
msgstr ""
|
1553 |
+
|
1554 |
+
#: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:903
|
1555 |
+
msgid "request it now."
|
1556 |
msgstr ""
|
includes/admin/notices/WC_WooMercadoPago_Notices.php
ADDED
@@ -0,0 +1,142 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Part of Woo Mercado Pago Module
|
5 |
+
* Author - Mercado Pago
|
6 |
+
* Developer
|
7 |
+
* Copyright - Copyright(c) MercadoPago [https://www.mercadopago.com]
|
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 |
+
/**
|
16 |
+
* Class WC_WooMercadoPago_Notification
|
17 |
+
*/
|
18 |
+
class WC_WooMercadoPago_Notices
|
19 |
+
{
|
20 |
+
public static $instance = null;
|
21 |
+
|
22 |
+
private function __construct()
|
23 |
+
{
|
24 |
+
add_action('admin_enqueue_scripts', [$this, 'loadAdminNoticeCss']);
|
25 |
+
}
|
26 |
+
|
27 |
+
/**
|
28 |
+
* @return WC_WooMercadoPago_Module|null
|
29 |
+
* Singleton
|
30 |
+
*/
|
31 |
+
public static function initMercadopagoNnotice()
|
32 |
+
{
|
33 |
+
if (self::$instance === null) {
|
34 |
+
self::$instance = new self;
|
35 |
+
}
|
36 |
+
return self::$instance;
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
*
|
41 |
+
*/
|
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 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* @param $message
|
54 |
+
* @param $type
|
55 |
+
* @return string
|
56 |
+
*/
|
57 |
+
public static function getAlertFrame($message, $type)
|
58 |
+
{
|
59 |
+
$inline = null;
|
60 |
+
if (
|
61 |
+
(class_exists('WC_WooMercadoPago_Module') && WC_WooMercadoPago_Module::isWcNewVersion())
|
62 |
+
&&
|
63 |
+
(isset($_GET['page']) && $_GET['page'] == "wc-settings")
|
64 |
+
) {
|
65 |
+
$inline = "inline";
|
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>
|
73 |
+
<div class="mp-right-alert">
|
74 |
+
<p>' . $message . '</p>
|
75 |
+
</div>
|
76 |
+
</div>
|
77 |
+
<button type="button" class="notice-dismiss">
|
78 |
+
<span class="screen-reader-text">' . __('Discard', 'woocommerce-mercadopago') . '</span>
|
79 |
+
</button>
|
80 |
+
</div>';
|
81 |
+
if (class_exists('WC_WooMercadoPago_Module')) {
|
82 |
+
WC_WooMercadoPago_Module::$notices[] = $notice;
|
83 |
+
}
|
84 |
+
|
85 |
+
return $notice;
|
86 |
+
}
|
87 |
+
|
88 |
+
/**
|
89 |
+
* @param $message
|
90 |
+
* @param $type
|
91 |
+
* @return string
|
92 |
+
*/
|
93 |
+
public static function getAlertWocommerceMiss($message, $type)
|
94 |
+
{
|
95 |
+
|
96 |
+
$is_installed = false;
|
97 |
+
|
98 |
+
if (function_exists('get_plugins')) {
|
99 |
+
$all_plugins = get_plugins();
|
100 |
+
$is_installed = !empty($all_plugins['woocommerce/woocommerce.php']);
|
101 |
+
}
|
102 |
+
|
103 |
+
if ($is_installed && current_user_can('install_plugins')) {
|
104 |
+
$buttonUrl = '<a href="' . wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=woocommerce/woocommerce.php&plugin_status=active'), 'activate-plugin_woocommerce/woocommerce.php') . '" class="button button-primary">' . __('Activate WooCommerce', 'woocommerce-mercadopago') . '</a>';
|
105 |
+
} else {
|
106 |
+
if (current_user_can('install_plugins')) {
|
107 |
+
$buttonUrl = '<a href="' . wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=woocommerce'), 'install-plugin_woocommerce') . '" class="button button-primary">' . __('Install WooCommerce', 'woocommerce-mercadopago') . '</a>';
|
108 |
+
} else {
|
109 |
+
$buttonUrl = '<a href="http://wordpress.org/plugins/woocommerce/" class="button button-primary">' . __('See WooCommerce', 'woocommerce-mercadopago') . '</a>';
|
110 |
+
}
|
111 |
+
}
|
112 |
+
|
113 |
+
$inline = null;
|
114 |
+
if (
|
115 |
+
(class_exists('WC_WooMercadoPago_Module') && WC_WooMercadoPago_Module::isWcNewVersion())
|
116 |
+
&&
|
117 |
+
(isset($_GET['page']) && $_GET['page'] == "wc-settings")
|
118 |
+
) {
|
119 |
+
$inline = "inline";
|
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>
|
127 |
+
<div class="mp-right-alert">
|
128 |
+
<p>' . $message . '</p>
|
129 |
+
<p>' . $buttonUrl . '</p>
|
130 |
+
</div>
|
131 |
+
</div>
|
132 |
+
<button type="button" class="notice-dismiss">
|
133 |
+
<span class="screen-reader-text">' . __('Discard', 'woocommerce-mercadopago') . '</span>
|
134 |
+
</button>
|
135 |
+
</div>';
|
136 |
+
|
137 |
+
if (class_exists('WC_WooMercadoPago_Module')) {
|
138 |
+
WC_WooMercadoPago_Module::$notices[] = $notice;
|
139 |
+
}
|
140 |
+
return $notice;
|
141 |
+
}
|
142 |
+
}
|
includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php
CHANGED
@@ -142,7 +142,7 @@ class WC_WooMercadoPago_Helpers_CurrencyConverter
|
|
142 |
*/
|
143 |
private function getAccessToken(WC_WooMercadoPago_PaymentAbstract $method)
|
144 |
{
|
145 |
-
$type = $method->getOption('
|
146 |
? '_mp_access_token_test'
|
147 |
: '_mp_access_token_prod';
|
148 |
|
@@ -401,7 +401,7 @@ class WC_WooMercadoPago_Helpers_CurrencyConverter
|
|
401 |
$type = 'notice-error';
|
402 |
$message = $this->__(self::NOTICE_WARNING);
|
403 |
|
404 |
-
return
|
405 |
}
|
406 |
|
407 |
return '';
|
142 |
*/
|
143 |
private function getAccessToken(WC_WooMercadoPago_PaymentAbstract $method)
|
144 |
{
|
145 |
+
$type = $method->getOption('checkout_credential_prod') == 'no'
|
146 |
? '_mp_access_token_test'
|
147 |
: '_mp_access_token_prod';
|
148 |
|
401 |
$type = 'notice-error';
|
402 |
$message = $this->__(self::NOTICE_WARNING);
|
403 |
|
404 |
+
return WC_WooMercadoPago_Notices::getAlertFrame($message, $type);
|
405 |
}
|
406 |
|
407 |
return '';
|
includes/module/WC_WooMercadoPago_Configs.php
CHANGED
@@ -99,7 +99,7 @@ class WC_WooMercadoPago_Configs
|
|
99 |
{
|
100 |
$type = 'error';
|
101 |
$message = __('Actualizá tus credenciales con las claves Access Token y Public Key ¡las necesitás para seguir recibiendo pagos!', 'woocommerce-mercadopado');
|
102 |
-
echo
|
103 |
}
|
104 |
|
105 |
/**
|
@@ -108,8 +108,8 @@ class WC_WooMercadoPago_Configs
|
|
108 |
public function noticeHttps()
|
109 |
{
|
110 |
$type = 'notice-warning';
|
111 |
-
$message = __('The store
|
112 |
-
echo
|
113 |
}
|
114 |
|
115 |
/**
|
@@ -120,7 +120,7 @@ class WC_WooMercadoPago_Configs
|
|
120 |
if (strpos(get_option('_mp_public_key'), 'TEST') === 0 && strpos(get_option('_mp_access_token'), 'TEST') === 0) {
|
121 |
update_option('_mp_public_key_test', get_option('_mp_public_key'), true);
|
122 |
update_option('_mp_access_token_test', get_option('_mp_access_token'), true);
|
123 |
-
update_option('
|
124 |
}
|
125 |
|
126 |
if (strpos(get_option('_mp_public_key'), 'APP_USR') === 0 && strpos(get_option('_mp_access_token'), 'APP_USR') === 0) {
|
@@ -130,7 +130,7 @@ class WC_WooMercadoPago_Configs
|
|
130 |
update_option('_mp_public_key', '');
|
131 |
update_option('_mp_access_token', '');
|
132 |
}
|
133 |
-
update_option('
|
134 |
}
|
135 |
}
|
136 |
|
@@ -256,28 +256,4 @@ class WC_WooMercadoPago_Configs
|
|
256 |
$methods[] = 'WC_WooMercadoPago_TicketGateway';
|
257 |
return $methods;
|
258 |
}
|
259 |
-
|
260 |
-
/**
|
261 |
-
* Get MP alert frame for notfications
|
262 |
-
*
|
263 |
-
* @param string $message
|
264 |
-
* @param string $type
|
265 |
-
* @return void
|
266 |
-
*/
|
267 |
-
public static function getAlertFrame($message, $type)
|
268 |
-
{
|
269 |
-
return '<div class="notice '.$type.' is-dismissible">
|
270 |
-
<div class="mp-alert-frame">
|
271 |
-
<div class="mp-left-alert">
|
272 |
-
<img src="' . plugins_url('../assets/images/minilogo.png', plugin_dir_path(__FILE__)) . '">
|
273 |
-
</div>
|
274 |
-
<div class="mp-right-alert">
|
275 |
-
<p>' . $message . '</p>
|
276 |
-
</div>
|
277 |
-
</div>
|
278 |
-
<button type="button" class="notice-dismiss">
|
279 |
-
<span class="screen-reader-text">' . __('Discard', 'woocommerce-mercadopago') . '</span>
|
280 |
-
</button>
|
281 |
-
</div>';
|
282 |
-
}
|
283 |
}
|
99 |
{
|
100 |
$type = 'error';
|
101 |
$message = __('Actualizá tus credenciales con las claves Access Token y Public Key ¡las necesitás para seguir recibiendo pagos!', 'woocommerce-mercadopado');
|
102 |
+
echo WC_WooMercadoPago_Notices::getAlertFrame($message, $type);
|
103 |
}
|
104 |
|
105 |
/**
|
108 |
public function noticeHttps()
|
109 |
{
|
110 |
$type = 'notice-warning';
|
111 |
+
$message = __('The store should have HTTPS in order to activate both Checkout Personalizado and Ticket Checkout.', 'woocommerce-mercadopago');
|
112 |
+
echo WC_WooMercadoPago_Notices::getAlertFrame($message, $type);
|
113 |
}
|
114 |
|
115 |
/**
|
120 |
if (strpos(get_option('_mp_public_key'), 'TEST') === 0 && strpos(get_option('_mp_access_token'), 'TEST') === 0) {
|
121 |
update_option('_mp_public_key_test', get_option('_mp_public_key'), true);
|
122 |
update_option('_mp_access_token_test', get_option('_mp_access_token'), true);
|
123 |
+
update_option('checkout_credential_prod', 'no', true);
|
124 |
}
|
125 |
|
126 |
if (strpos(get_option('_mp_public_key'), 'APP_USR') === 0 && strpos(get_option('_mp_access_token'), 'APP_USR') === 0) {
|
130 |
update_option('_mp_public_key', '');
|
131 |
update_option('_mp_access_token', '');
|
132 |
}
|
133 |
+
update_option('checkout_credential_prod', 'yes', true);
|
134 |
}
|
135 |
}
|
136 |
|
256 |
$methods[] = 'WC_WooMercadoPago_TicketGateway';
|
257 |
return $methods;
|
258 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
259 |
}
|
includes/module/WC_WooMercadoPago_Credentials.php
CHANGED
@@ -28,7 +28,7 @@ class WC_WooMercadoPago_Credentials
|
|
28 |
|
29 |
if (!is_null($this->payment)) {
|
30 |
$this->sandbox = $payment->isTestUser();
|
31 |
-
if ($this->payment->getOption('
|
32 |
$publicKey = get_option('_mp_public_key_test', '');
|
33 |
$accessToken = get_option('_mp_access_token_test', '');
|
34 |
}
|
@@ -53,7 +53,7 @@ class WC_WooMercadoPago_Credentials
|
|
53 |
$basicIsEnabled = self::basicIsEnabled();
|
54 |
if (!$this->tokenIsValid() && ($this->payment instanceof WC_WooMercadoPago_BasicGateway || $basicIsEnabled == 'yes')) {
|
55 |
if (!$this->clientIsValid()) {
|
56 |
-
return
|
57 |
}
|
58 |
return self::TYPE_ACCESS_CLIENT;
|
59 |
}
|
@@ -130,6 +130,35 @@ class WC_WooMercadoPago_Credentials
|
|
130 |
return true;
|
131 |
}
|
132 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
/**
|
134 |
* @return bool
|
135 |
*/
|
@@ -214,16 +243,19 @@ class WC_WooMercadoPago_Credentials
|
|
214 |
$paymentsResponse = self::getPaymentResponse($mpInstance, $accessToken);
|
215 |
}
|
216 |
|
217 |
-
if (empty($paymentsResponse) || (isset($paymentsResponse['status']) && $paymentsResponse['status'] != 200 &&
|
|
|
218 |
return;
|
219 |
}
|
220 |
|
221 |
$arr = array();
|
222 |
$cho = array();
|
223 |
-
$excluded = array('consumer_credits');
|
224 |
|
225 |
foreach ($paymentsResponse as $payment) {
|
226 |
-
if(in_array($payment['id'], $excluded)){
|
|
|
|
|
227 |
|
228 |
$arr[] = $payment['id'];
|
229 |
|
@@ -255,27 +287,27 @@ class WC_WooMercadoPago_Credentials
|
|
255 |
$paymentsResponse = self::getPaymentResponse($mpInstance, $accessToken);
|
256 |
}
|
257 |
|
258 |
-
if (empty($paymentsResponse) || (isset($paymentsResponse['status']) && $paymentsResponse['status'] != 200 &&
|
|
|
259 |
return;
|
260 |
}
|
261 |
|
262 |
$payment_methods_ticket = array();
|
263 |
-
$excluded = array('consumer_credits');
|
264 |
|
265 |
foreach ($paymentsResponse as $payment) {
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
}
|
279 |
}
|
280 |
|
281 |
update_option('_all_payment_methods_ticket', $payment_methods_ticket, true);
|
28 |
|
29 |
if (!is_null($this->payment)) {
|
30 |
$this->sandbox = $payment->isTestUser();
|
31 |
+
if ($this->payment->getOption('checkout_credential_prod', '') == 'no' || empty($this->payment->getOption('checkout_credential_prod', ''))) {
|
32 |
$publicKey = get_option('_mp_public_key_test', '');
|
33 |
$accessToken = get_option('_mp_access_token_test', '');
|
34 |
}
|
53 |
$basicIsEnabled = self::basicIsEnabled();
|
54 |
if (!$this->tokenIsValid() && ($this->payment instanceof WC_WooMercadoPago_BasicGateway || $basicIsEnabled == 'yes')) {
|
55 |
if (!$this->clientIsValid()) {
|
56 |
+
return self::TYPE_ACCESS_TOKEN;
|
57 |
}
|
58 |
return self::TYPE_ACCESS_CLIENT;
|
59 |
}
|
130 |
return true;
|
131 |
}
|
132 |
|
133 |
+
/**
|
134 |
+
* @param $public_key
|
135 |
+
* @return bool
|
136 |
+
* @throws WC_WooMercadoPago_Exception
|
137 |
+
*/
|
138 |
+
public static function public_key_is_valid($public_key)
|
139 |
+
{
|
140 |
+
$mp_v1 = WC_WooMercadoPago_Module::getMpInstanceSingleton();
|
141 |
+
if (empty($mp_v1)) {
|
142 |
+
return false;
|
143 |
+
}
|
144 |
+
$request = array(
|
145 |
+
'uri' => '/v1/card_tokens',
|
146 |
+
'data' => null,
|
147 |
+
'params' => array(
|
148 |
+
'public_key' => $public_key
|
149 |
+
),
|
150 |
+
'authenticate' => false
|
151 |
+
);
|
152 |
+
$get_request = $mp_v1->post($request);
|
153 |
+
if ($get_request['status'] > 202) {
|
154 |
+
$log = WC_WooMercadoPago_Log::init_mercado_pago_log('WC_WooMercadoPago_Credentials');
|
155 |
+
$log->write_log('API public_key_is_valid error: ', $get_request['response']['message']);
|
156 |
+
return false;
|
157 |
+
}
|
158 |
+
|
159 |
+
return true;
|
160 |
+
}
|
161 |
+
|
162 |
/**
|
163 |
* @return bool
|
164 |
*/
|
243 |
$paymentsResponse = self::getPaymentResponse($mpInstance, $accessToken);
|
244 |
}
|
245 |
|
246 |
+
if (empty($paymentsResponse) || (isset($paymentsResponse['status']) && $paymentsResponse['status'] != 200 &&
|
247 |
+
$paymentsResponse['status'] != 201)) {
|
248 |
return;
|
249 |
}
|
250 |
|
251 |
$arr = array();
|
252 |
$cho = array();
|
253 |
+
$excluded = array('consumer_credits', 'paypal');
|
254 |
|
255 |
foreach ($paymentsResponse as $payment) {
|
256 |
+
if (in_array($payment['id'], $excluded)) {
|
257 |
+
continue;
|
258 |
+
}
|
259 |
|
260 |
$arr[] = $payment['id'];
|
261 |
|
287 |
$paymentsResponse = self::getPaymentResponse($mpInstance, $accessToken);
|
288 |
}
|
289 |
|
290 |
+
if (empty($paymentsResponse) || (isset($paymentsResponse['status']) && $paymentsResponse['status'] != 200 &&
|
291 |
+
$paymentsResponse['status'] != 201)) {
|
292 |
return;
|
293 |
}
|
294 |
|
295 |
$payment_methods_ticket = array();
|
296 |
+
$excluded = array('consumer_credits', 'paypal', 'pse');
|
297 |
|
298 |
foreach ($paymentsResponse as $payment) {
|
299 |
+
if (!in_array($payment['id'], $excluded) &&
|
300 |
+
$payment['payment_type_id'] != 'account_money' &&
|
301 |
+
$payment['payment_type_id'] != 'credit_card' &&
|
302 |
+
$payment['payment_type_id'] != 'debit_card' &&
|
303 |
+
$payment['payment_type_id'] != 'prepaid_card'
|
304 |
+
) {
|
305 |
+
$payment_methods_ticket[] = array(
|
306 |
+
"id" => $payment['id'],
|
307 |
+
"name" => $payment['name'],
|
308 |
+
"secure_thumbnail" => $payment['secure_thumbnail'],
|
309 |
+
);
|
310 |
+
}
|
|
|
311 |
}
|
312 |
|
313 |
update_option('_all_payment_methods_ticket', $payment_methods_ticket, true);
|
includes/module/WC_WooMercadoPago_Module.php
CHANGED
@@ -15,6 +15,7 @@ class WC_WooMercadoPago_Module extends WC_WooMercadoPago_Configs
|
|
15 |
public static $mpInstancePayment = array();
|
16 |
public static $mpInstance = null;
|
17 |
public static $payments_name = null;
|
|
|
18 |
|
19 |
/**
|
20 |
* WC_WooMercadoPago_Module constructor.
|
@@ -129,9 +130,9 @@ class WC_WooMercadoPago_Module extends WC_WooMercadoPago_Configs
|
|
129 |
*/
|
130 |
public function loadConfigs()
|
131 |
{
|
|
|
132 |
$configs = new parent();
|
133 |
self::$categories = $configs->getCategories();
|
134 |
-
self::$country_configs = self::getCountryConfigs();
|
135 |
self::$site_data = self::get_site_data();
|
136 |
self::$payments_name = self::setPaymentGateway();
|
137 |
}
|
@@ -197,7 +198,7 @@ class WC_WooMercadoPago_Module extends WC_WooMercadoPago_Configs
|
|
197 |
}
|
198 |
|
199 |
/**
|
200 |
-
*
|
201 |
*/
|
202 |
public function loadAdminCss()
|
203 |
{
|
@@ -239,21 +240,79 @@ class WC_WooMercadoPago_Module extends WC_WooMercadoPago_Configs
|
|
239 |
public function enablePaymentNotice()
|
240 |
{
|
241 |
$type = 'notice-warning';
|
242 |
-
$message = __('
|
243 |
-
echo
|
244 |
}
|
245 |
|
246 |
// Add settings link on plugin page.
|
247 |
public function woomercadopago_settings_link($links)
|
248 |
{
|
|
|
249 |
$plugin_links = array();
|
250 |
$plugin_links[] = '<a href="' . admin_url('admin.php?page=wc-settings&tab=checkout') . '">' . __('Set up', 'woocommerce-mercadopago') . '</a>';
|
251 |
$plugin_links[] = '<a target="_blank" href="' . 'https://wordpress.org/support/plugin/woocommerce-mercadopago/reviews/?rate=5#new-post' . '">' . __('Your opinion helps us get better', 'woocommerce-mercadopago') . '</a>';
|
252 |
-
$plugin_links[] = '<br><a target="_blank" href="' . 'https://www.mercadopago.
|
253 |
-
$plugin_links[] = '<a target="_blank" href="' . 'https://www.mercadopago.
|
254 |
return array_merge($plugin_links, $links);
|
255 |
}
|
256 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
257 |
/**
|
258 |
* Show row meta on the plugin screen.
|
259 |
* @param mixed $links Plugin Row Meta.
|
@@ -270,7 +329,7 @@ class WC_WooMercadoPago_Module extends WC_WooMercadoPago_Configs
|
|
270 |
return $new_link;
|
271 |
}
|
272 |
|
273 |
-
return (array)
|
274 |
}
|
275 |
|
276 |
// ============================================================
|
@@ -394,12 +453,7 @@ class WC_WooMercadoPago_Module extends WC_WooMercadoPago_Configs
|
|
394 |
public static function get_sponsor_id()
|
395 |
{
|
396 |
$site_data = WC_WooMercadoPago_Module::get_site_data();
|
397 |
-
$sponsor_id
|
398 |
-
if ($sponsor_id == '' || empty($sponsor_id)) {
|
399 |
-
return $site_data['sponsor_id'];
|
400 |
-
} else {
|
401 |
-
return $sponsor_id;
|
402 |
-
}
|
403 |
}
|
404 |
|
405 |
/**
|
@@ -526,38 +580,38 @@ class WC_WooMercadoPago_Module extends WC_WooMercadoPago_Configs
|
|
526 |
public static function build_log_path_string($gateway_id, $gateway_name)
|
527 |
{
|
528 |
return '<a href="' . esc_url(admin_url('admin.php?page=wc-status&tab=logs&log_file=' .
|
529 |
-
|
530 |
$gateway_name . '</a>';
|
531 |
}
|
532 |
|
533 |
-
public static function get_map($selector_id)
|
534 |
-
{
|
535 |
-
$html = '';
|
536 |
-
$arr = explode('_', $selector_id);
|
537 |
-
$defaults = array(
|
538 |
-
'pending' => 'pending',
|
539 |
-
'approved' => 'processing',
|
540 |
-
'inprocess' => 'on_hold',
|
541 |
-
'inmediation' => 'on_hold',
|
542 |
-
'rejected' => 'failed',
|
543 |
-
'cancelled' => 'cancelled',
|
544 |
-
'refunded' => 'refunded',
|
545 |
-
'chargedback' => 'refunded'
|
546 |
-
);
|
547 |
-
$selection = get_option('_mp_' . $selector_id, $defaults[$arr[2]]);
|
548 |
-
|
549 |
-
foreach (wc_get_order_statuses() as $slug => $status) {
|
550 |
-
$slug = str_replace(array('wc-', '-'), array('', '_'), $slug);
|
551 |
-
$html .= sprintf(
|
552 |
-
'<option value="%s"%s>%s %s</option>',
|
553 |
-
$slug,
|
554 |
-
selected($selection, $slug, false),
|
555 |
-
__('Update the WooCommerce order to ', 'woocommerce-mercadopago'),
|
556 |
-
$status
|
557 |
-
);
|
558 |
-
}
|
559 |
-
|
560 |
-
return $html;
|
561 |
}
|
562 |
|
563 |
public static function generate_refund_cancel_subscription($domain, $success_msg, $fail_msg, $options, $str1, $str2, $str3, $str4)
|
@@ -740,4 +794,16 @@ class WC_WooMercadoPago_Module extends WC_WooMercadoPago_Configs
|
|
740 |
}
|
741 |
return true;
|
742 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
743 |
}
|
15 |
public static $mpInstancePayment = array();
|
16 |
public static $mpInstance = null;
|
17 |
public static $payments_name = null;
|
18 |
+
public static $notices = array();
|
19 |
|
20 |
/**
|
21 |
* WC_WooMercadoPago_Module constructor.
|
130 |
*/
|
131 |
public function loadConfigs()
|
132 |
{
|
133 |
+
self::$country_configs = self::getCountryConfigs();
|
134 |
$configs = new parent();
|
135 |
self::$categories = $configs->getCategories();
|
|
|
136 |
self::$site_data = self::get_site_data();
|
137 |
self::$payments_name = self::setPaymentGateway();
|
138 |
}
|
198 |
}
|
199 |
|
200 |
/**
|
201 |
+
*
|
202 |
*/
|
203 |
public function loadAdminCss()
|
204 |
{
|
240 |
public function enablePaymentNotice()
|
241 |
{
|
242 |
$type = 'notice-warning';
|
243 |
+
$message = __('Fill in your credentials to enable payment methods.', 'woocommerce-mercadopago');
|
244 |
+
echo WC_WooMercadoPago_Notices::getAlertFrame($message, $type);
|
245 |
}
|
246 |
|
247 |
// Add settings link on plugin page.
|
248 |
public function woomercadopago_settings_link($links)
|
249 |
{
|
250 |
+
$links_mp = $this->define_link_country();
|
251 |
$plugin_links = array();
|
252 |
$plugin_links[] = '<a href="' . admin_url('admin.php?page=wc-settings&tab=checkout') . '">' . __('Set up', 'woocommerce-mercadopago') . '</a>';
|
253 |
$plugin_links[] = '<a target="_blank" href="' . 'https://wordpress.org/support/plugin/woocommerce-mercadopago/reviews/?rate=5#new-post' . '">' . __('Your opinion helps us get better', 'woocommerce-mercadopago') . '</a>';
|
254 |
+
$plugin_links[] = '<br><a target="_blank" href="' . 'https://www.mercadopago.' . $links_mp['sufix_url'] . 'developers/' . $links_mp['translate'] . '/guides/plugins/woocommerce/introduction/' . '">' . __('Guides and Documentation', 'woocommerce-mercadopago') . '</a>';
|
255 |
+
$plugin_links[] = '<a target="_blank" href="' . 'https://www.mercadopago.' . $links_mp['sufix_url'] . $links_mp['help'] . '">' . __('Report Problem', 'woocommerce-mercadopago') . '</a>';
|
256 |
return array_merge($plugin_links, $links);
|
257 |
}
|
258 |
|
259 |
+
/**
|
260 |
+
* Construct link
|
261 |
+
* @return array
|
262 |
+
*/
|
263 |
+
public static function define_link_country()
|
264 |
+
{
|
265 |
+
$wc_country = get_option('woocommerce_default_country', '');
|
266 |
+
$sufix_country = 'AR';
|
267 |
+
$country = array(
|
268 |
+
'AR' => array( // Argentinian
|
269 |
+
'help' => 'ayuda',
|
270 |
+
'sufix_url' => 'com.ar/',
|
271 |
+
'translate' => 'es',
|
272 |
+
),
|
273 |
+
'BR' => array( // Brazil
|
274 |
+
'help' => 'ajuda',
|
275 |
+
'sufix_url' => 'com.br/',
|
276 |
+
'translate' => 'pt',
|
277 |
+
),
|
278 |
+
'CL' => array( // Chile
|
279 |
+
'help' => 'ayuda',
|
280 |
+
'sufix_url' => 'cl/',
|
281 |
+
'translate' => 'es',
|
282 |
+
),
|
283 |
+
'CO' => array( // Colombia
|
284 |
+
'help' => 'ayuda',
|
285 |
+
'sufix_url' => 'com.co/',
|
286 |
+
'translate' => 'es',
|
287 |
+
),
|
288 |
+
'MX' => array( // Mexico
|
289 |
+
'help' => 'ayuda',
|
290 |
+
'sufix_url' => 'com.mx/',
|
291 |
+
'translate' => 'es',
|
292 |
+
),
|
293 |
+
'PE' => array( // Peru
|
294 |
+
'help' => 'ayuda',
|
295 |
+
'sufix_url' => 'com.pe/',
|
296 |
+
'translate' => 'es',
|
297 |
+
),
|
298 |
+
'UY' => array( // Uruguay
|
299 |
+
'help' => 'ayuda',
|
300 |
+
'sufix_url' => 'com.uy/',
|
301 |
+
'translate' => 'es',
|
302 |
+
),
|
303 |
+
);
|
304 |
+
if ($wc_country != '') {
|
305 |
+
|
306 |
+
$sufix_country = strlen($wc_country) > 2 ? substr($wc_country, 0, 2) : $wc_country;
|
307 |
+
|
308 |
+
}
|
309 |
+
|
310 |
+
$sufix_country = strtoupper($sufix_country);
|
311 |
+
$links_country = array_key_exists($sufix_country, $country) ? $country[$sufix_country] : $country['AR'];
|
312 |
+
|
313 |
+
return $links_country;
|
314 |
+
}
|
315 |
+
|
316 |
/**
|
317 |
* Show row meta on the plugin screen.
|
318 |
* @param mixed $links Plugin Row Meta.
|
329 |
return $new_link;
|
330 |
}
|
331 |
|
332 |
+
return (array)$links;
|
333 |
}
|
334 |
|
335 |
// ============================================================
|
453 |
public static function get_sponsor_id()
|
454 |
{
|
455 |
$site_data = WC_WooMercadoPago_Module::get_site_data();
|
456 |
+
return $site_data['sponsor_id'];
|
|
|
|
|
|
|
|
|
|
|
457 |
}
|
458 |
|
459 |
/**
|
580 |
public static function build_log_path_string($gateway_id, $gateway_name)
|
581 |
{
|
582 |
return '<a href="' . esc_url(admin_url('admin.php?page=wc-status&tab=logs&log_file=' .
|
583 |
+
esc_attr($gateway_id) . '-' . sanitize_file_name(wp_hash($gateway_id)) . '.log')) . '">' .
|
584 |
$gateway_name . '</a>';
|
585 |
}
|
586 |
|
587 |
+
public static function get_map($selector_id)
|
588 |
+
{
|
589 |
+
$html = '';
|
590 |
+
$arr = explode('_', $selector_id);
|
591 |
+
$defaults = array(
|
592 |
+
'pending' => 'pending',
|
593 |
+
'approved' => 'processing',
|
594 |
+
'inprocess' => 'on_hold',
|
595 |
+
'inmediation' => 'on_hold',
|
596 |
+
'rejected' => 'failed',
|
597 |
+
'cancelled' => 'cancelled',
|
598 |
+
'refunded' => 'refunded',
|
599 |
+
'chargedback' => 'refunded'
|
600 |
+
);
|
601 |
+
$selection = get_option('_mp_' . $selector_id, $defaults[$arr[2]]);
|
602 |
+
|
603 |
+
foreach (wc_get_order_statuses() as $slug => $status) {
|
604 |
+
$slug = str_replace(array('wc-', '-'), array('', '_'), $slug);
|
605 |
+
$html .= sprintf(
|
606 |
+
'<option value="%s"%s>%s %s</option>',
|
607 |
+
$slug,
|
608 |
+
selected($selection, $slug, false),
|
609 |
+
__('Update the WooCommerce order to ', 'woocommerce-mercadopago'),
|
610 |
+
$status
|
611 |
+
);
|
612 |
+
}
|
613 |
+
|
614 |
+
return $html;
|
615 |
}
|
616 |
|
617 |
public static function generate_refund_cancel_subscription($domain, $success_msg, $fail_msg, $options, $str1, $str2, $str3, $str4)
|
794 |
}
|
795 |
return true;
|
796 |
}
|
797 |
+
|
798 |
+
/**
|
799 |
+
* @return bool
|
800 |
+
*/
|
801 |
+
public static function isWcNewVersion()
|
802 |
+
{
|
803 |
+
$wooCommerceVersion = WC()->version;
|
804 |
+
if ($wooCommerceVersion <= "4.0.0") {
|
805 |
+
return false;
|
806 |
+
}
|
807 |
+
return true;
|
808 |
+
}
|
809 |
}
|
includes/module/config/WC_WooMercadoPago_Constants.php
CHANGED
@@ -11,7 +11,7 @@ class WC_WooMercadoPago_Constants
|
|
11 |
{
|
12 |
const PRODUCT_ID = 'BC32CPFTRPP001U8NHRG';
|
13 |
const PLATAFORM_ID = 'bo2hnr2ic4p001kbgpt0';
|
14 |
-
const VERSION = '4.
|
15 |
const MIN_PHP = 5.6;
|
16 |
const API_MP_BASE_URL = 'https://api.mercadopago.com';
|
17 |
}
|
11 |
{
|
12 |
const PRODUCT_ID = 'BC32CPFTRPP001U8NHRG';
|
13 |
const PLATAFORM_ID = 'bo2hnr2ic4p001kbgpt0';
|
14 |
+
const VERSION = '4.2.0';
|
15 |
const MIN_PHP = 5.6;
|
16 |
const API_MP_BASE_URL = 'https://api.mercadopago.com';
|
17 |
}
|
includes/module/preference/WC_WooMercadoPago_PreferenceAbstract.php
CHANGED
@@ -69,6 +69,19 @@ abstract class WC_WooMercadoPago_PreferenceAbstract extends WC_Payment_Gateway
|
|
69 |
|
70 |
//shipping is added to items
|
71 |
$this->items = array_merge($this->items, $this->prepare_shipping());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
}
|
73 |
|
74 |
protected function prepare_shipping()
|
@@ -161,10 +174,10 @@ abstract class WC_WooMercadoPago_PreferenceAbstract extends WC_Payment_Gateway
|
|
161 |
$product_content = method_exists($product, 'get_description') ? $product->get_description() : $product->post->post_content;
|
162 |
// Calculates line amount and discounts.
|
163 |
$line_amount = $item['line_total'] + $item['line_tax'];
|
164 |
-
$discount_by_gateway = (float)$line_amount * ($this->gateway_discount / 100);
|
165 |
-
$commission_by_gateway = (float)$line_amount * ($this->commission / 100);
|
166 |
$item_amount = $this->calculate_price($line_amount - $discount_by_gateway + $commission_by_gateway);
|
167 |
-
$this->order_total += $item_amount;
|
168 |
|
169 |
// Add the item.
|
170 |
array_push($this->list_of_items, $product_title . ' x ' . $item['qty']);
|
@@ -179,7 +192,7 @@ abstract class WC_WooMercadoPago_PreferenceAbstract extends WC_Payment_Gateway
|
|
179 |
plugins_url('assets/images/cart.png', plugin_dir_path(__FILE__)) : wp_get_attachment_url($product->get_image_id()),
|
180 |
'category_id' => get_option('_mp_category_id', 'others'),
|
181 |
'quantity' => 1,
|
182 |
-
'unit_price' => $item_amount,
|
183 |
'currency_id' => $this->site_data[$this->site_id]['currency']
|
184 |
));
|
185 |
}
|
@@ -193,17 +206,48 @@ abstract class WC_WooMercadoPago_PreferenceAbstract extends WC_Payment_Gateway
|
|
193 |
public function ship_cost_item()
|
194 |
{
|
195 |
$ship_cost = $this->calculate_price($this->ship_cost);
|
196 |
-
$this->order_total += $ship_cost;
|
197 |
-
|
198 |
return array(
|
199 |
'title' => method_exists($this->order, 'get_id') ? $this->order->get_shipping_method() : $this->order->shipping_method,
|
200 |
'description' => __('Shipping service used by the store.', 'woocommerce-mercadopago'),
|
201 |
'category_id' => get_option('_mp_category_id', 'others'),
|
202 |
'quantity' => 1,
|
203 |
-
'unit_price' => $ship_cost,
|
204 |
);
|
205 |
}
|
206 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
207 |
/**
|
208 |
* @return array
|
209 |
*/
|
@@ -281,7 +325,7 @@ abstract class WC_WooMercadoPago_PreferenceAbstract extends WC_Payment_Gateway
|
|
281 |
*/
|
282 |
public function get_external_reference($payment = null)
|
283 |
{
|
284 |
-
$store_identificator =
|
285 |
|
286 |
if (method_exists($this->order, 'get_id')) {
|
287 |
return $store_identificator . $this->order->get_id();
|
@@ -304,7 +348,7 @@ abstract class WC_WooMercadoPago_PreferenceAbstract extends WC_Payment_Gateway
|
|
304 |
*/
|
305 |
public function get_transaction_amount()
|
306 |
{
|
307 |
-
return $this->order_total;
|
308 |
}
|
309 |
|
310 |
/**
|
@@ -349,7 +393,7 @@ abstract class WC_WooMercadoPago_PreferenceAbstract extends WC_Payment_Gateway
|
|
349 |
}
|
350 |
|
351 |
$test_mode = false;
|
352 |
-
if ($this->payment->getOption('
|
353 |
$test_mode = true;
|
354 |
}
|
355 |
|
@@ -373,7 +417,8 @@ abstract class WC_WooMercadoPago_PreferenceAbstract extends WC_Payment_Gateway
|
|
373 |
* @param $amount
|
374 |
* @return float
|
375 |
*/
|
376 |
-
private function calculate_price($amount)
|
|
|
377 |
if ($this->site_data[$this->site_id]['currency'] == 'COP' || $this->site_data[$this->site_id]['currency'] == 'CLP') {
|
378 |
return floor($amount * $this->currency_ratio);
|
379 |
}
|
69 |
|
70 |
//shipping is added to items
|
71 |
$this->items = array_merge($this->items, $this->prepare_shipping());
|
72 |
+
|
73 |
+
//fees is added to items
|
74 |
+
if (0 < count($this->order->get_fees())) {
|
75 |
+
$this->items = array_merge($this->items, $this->fees_cost_item());
|
76 |
+
}
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* @return float
|
81 |
+
*/
|
82 |
+
protected function number_format_value($value)
|
83 |
+
{
|
84 |
+
return (float) number_format($value, 2, '.', '');
|
85 |
}
|
86 |
|
87 |
protected function prepare_shipping()
|
174 |
$product_content = method_exists($product, 'get_description') ? $product->get_description() : $product->post->post_content;
|
175 |
// Calculates line amount and discounts.
|
176 |
$line_amount = $item['line_total'] + $item['line_tax'];
|
177 |
+
$discount_by_gateway = (float) $line_amount * ($this->gateway_discount / 100);
|
178 |
+
$commission_by_gateway = (float) $line_amount * ($this->commission / 100);
|
179 |
$item_amount = $this->calculate_price($line_amount - $discount_by_gateway + $commission_by_gateway);
|
180 |
+
$this->order_total += $this->number_format_value($item_amount);
|
181 |
|
182 |
// Add the item.
|
183 |
array_push($this->list_of_items, $product_title . ' x ' . $item['qty']);
|
192 |
plugins_url('assets/images/cart.png', plugin_dir_path(__FILE__)) : wp_get_attachment_url($product->get_image_id()),
|
193 |
'category_id' => get_option('_mp_category_id', 'others'),
|
194 |
'quantity' => 1,
|
195 |
+
'unit_price' => $this->number_format_value($item_amount),
|
196 |
'currency_id' => $this->site_data[$this->site_id]['currency']
|
197 |
));
|
198 |
}
|
206 |
public function ship_cost_item()
|
207 |
{
|
208 |
$ship_cost = $this->calculate_price($this->ship_cost);
|
209 |
+
$this->order_total += $this->number_format_value($ship_cost);
|
210 |
+
|
211 |
return array(
|
212 |
'title' => method_exists($this->order, 'get_id') ? $this->order->get_shipping_method() : $this->order->shipping_method,
|
213 |
'description' => __('Shipping service used by the store.', 'woocommerce-mercadopago'),
|
214 |
'category_id' => get_option('_mp_category_id', 'others'),
|
215 |
'quantity' => 1,
|
216 |
+
'unit_price' => $this->number_format_value($ship_cost),
|
217 |
);
|
218 |
}
|
219 |
|
220 |
+
/**
|
221 |
+
* @return array
|
222 |
+
*/
|
223 |
+
public function fees_cost_item()
|
224 |
+
{
|
225 |
+
$items = array();
|
226 |
+
foreach ($this->order->get_fees() as $fee) {
|
227 |
+
if ((float) $fee['total'] >= 0) {
|
228 |
+
continue;
|
229 |
+
}
|
230 |
+
|
231 |
+
$final = ($fee['total'] + $fee['total_tax']) * $this->currency_ratio;
|
232 |
+
|
233 |
+
$this->order_total += $this->number_format_value($final);
|
234 |
+
array_push($items, array(
|
235 |
+
'title' => sanitize_file_name(html_entity_decode(
|
236 |
+
strlen($fee['name']) > 230 ?
|
237 |
+
substr($fee['name'], 0, 230) . '...' : $fee['name']
|
238 |
+
)),
|
239 |
+
'description' => sanitize_file_name(html_entity_decode(
|
240 |
+
strlen($fee['name']) > 230 ?
|
241 |
+
substr($fee['name'], 0, 230) . '...' : $fee['name']
|
242 |
+
)),
|
243 |
+
'category_id' => get_option('_mp_category_id', 'others'),
|
244 |
+
'quantity' => 1,
|
245 |
+
'unit_price' => $this->number_format_value($final)
|
246 |
+
));
|
247 |
+
}
|
248 |
+
return $items;
|
249 |
+
}
|
250 |
+
|
251 |
/**
|
252 |
* @return array
|
253 |
*/
|
325 |
*/
|
326 |
public function get_external_reference($payment = null)
|
327 |
{
|
328 |
+
$store_identificator = get_option('_mp_store_identificator', 'WC-');
|
329 |
|
330 |
if (method_exists($this->order, 'get_id')) {
|
331 |
return $store_identificator . $this->order->get_id();
|
348 |
*/
|
349 |
public function get_transaction_amount()
|
350 |
{
|
351 |
+
return $this->number_format_value($this->order_total);
|
352 |
}
|
353 |
|
354 |
/**
|
393 |
}
|
394 |
|
395 |
$test_mode = false;
|
396 |
+
if ($this->payment->getOption('checkout_credential_prod', '') == 'no') {
|
397 |
$test_mode = true;
|
398 |
}
|
399 |
|
417 |
* @param $amount
|
418 |
* @return float
|
419 |
*/
|
420 |
+
private function calculate_price($amount)
|
421 |
+
{
|
422 |
if ($this->site_data[$this->site_id]['currency'] == 'COP' || $this->site_data[$this->site_id]['currency'] == 'CLP') {
|
423 |
return floor($amount * $this->currency_ratio);
|
424 |
}
|
includes/module/preference/WC_WooMercadoPago_PreferenceBasic.php
CHANGED
@@ -67,14 +67,14 @@ class WC_WooMercadoPago_PreferenceBasic extends WC_WooMercadoPago_PreferenceAbst
|
|
67 |
*/
|
68 |
public function get_back_urls()
|
69 |
{
|
70 |
-
$success_url =
|
71 |
-
$failure_url =
|
72 |
-
$pending_url =
|
73 |
$back_urls = array(
|
74 |
'success' => empty($success_url) ?
|
75 |
WC_WooMercadoPago_Module::fix_url_ampersand(
|
76 |
esc_url($this->get_return_url($this->order))
|
77 |
-
) : $
|
78 |
'failure' => empty($failure_url) ?
|
79 |
WC_WooMercadoPago_Module::fix_url_ampersand(
|
80 |
esc_url($this->order->get_cancel_order_url())
|
@@ -129,7 +129,7 @@ class WC_WooMercadoPago_PreferenceBasic extends WC_WooMercadoPago_PreferenceAbst
|
|
129 |
{
|
130 |
$internal_metadata = array(
|
131 |
"checkout" => "smart",
|
132 |
-
"checkout_type" =>
|
133 |
);
|
134 |
|
135 |
return $internal_metadata;
|
67 |
*/
|
68 |
public function get_back_urls()
|
69 |
{
|
70 |
+
$success_url = $this->payment->getOption('success_url', '');
|
71 |
+
$failure_url = $this->payment->getOption('failure_url', '');
|
72 |
+
$pending_url = $this->payment->getOption('pending_url', '');
|
73 |
$back_urls = array(
|
74 |
'success' => empty($success_url) ?
|
75 |
WC_WooMercadoPago_Module::fix_url_ampersand(
|
76 |
esc_url($this->get_return_url($this->order))
|
77 |
+
) : $success_url,
|
78 |
'failure' => empty($failure_url) ?
|
79 |
WC_WooMercadoPago_Module::fix_url_ampersand(
|
80 |
esc_url($this->order->get_cancel_order_url())
|
129 |
{
|
130 |
$internal_metadata = array(
|
131 |
"checkout" => "smart",
|
132 |
+
"checkout_type" => $this->payment->getOption('method', 'redirect'),
|
133 |
);
|
134 |
|
135 |
return $internal_metadata;
|
includes/module/preference/WC_WooMercadoPago_PreferenceTicket.php
CHANGED
@@ -38,6 +38,21 @@ class WC_WooMercadoPago_PreferenceTicket extends WC_WooMercadoPago_PreferenceAbs
|
|
38 |
$this->preference['payer']['address']['federal_unit'] = $this->checkout['state'];
|
39 |
$this->preference['payer']['address']['zip_code'] = $this->checkout['zipcode'];
|
40 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
$this->preference['external_reference'] = $this->get_external_reference();
|
42 |
$this->preference['additional_info']['items'] = $this->items;
|
43 |
$this->preference['additional_info']['payer'] = $this->get_payer_custom();
|
38 |
$this->preference['payer']['address']['federal_unit'] = $this->checkout['state'];
|
39 |
$this->preference['payer']['address']['zip_code'] = $this->checkout['zipcode'];
|
40 |
}
|
41 |
+
|
42 |
+
if ($this->site_data[$this->site_id]['currency'] == 'UYU') {
|
43 |
+
$this->preference['payer']['identification']['type'] = $ticket_checkout['docType'];
|
44 |
+
$this->preference['payer']['identification']['number'] = $ticket_checkout['docNumber'];
|
45 |
+
}
|
46 |
+
|
47 |
+
if($ticket_checkout['paymentMethodId'] == 'webpay'){
|
48 |
+
$this->preference['callback_url'] = get_site_url();
|
49 |
+
$this->preference['transaction_details']['financial_institution'] = "1234";
|
50 |
+
$this->preference['additional_info']['ip_address'] = "127.0.0.1";
|
51 |
+
$this->preference['payer']['identification']['type'] = "RUT";
|
52 |
+
$this->preference['payer']['identification']['number'] = "0";
|
53 |
+
$this->preference['payer']['entity_type'] = "individual";
|
54 |
+
}
|
55 |
+
|
56 |
$this->preference['external_reference'] = $this->get_external_reference();
|
57 |
$this->preference['additional_info']['items'] = $this->items;
|
58 |
$this->preference['additional_info']['payer'] = $this->get_payer_custom();
|
includes/module/sdk/lib/MP.php
CHANGED
@@ -554,7 +554,7 @@ class MP
|
|
554 |
);
|
555 |
|
556 |
$response = MPRestClient::get($request);
|
557 |
-
|
558 |
return $response;
|
559 |
}
|
560 |
|
554 |
);
|
555 |
|
556 |
$response = MPRestClient::get($request);
|
557 |
+
asort($result);
|
558 |
return $response;
|
559 |
}
|
560 |
|
includes/module/sdk/lib/RestClient/AbstractRestClient.php
CHANGED
@@ -47,8 +47,9 @@ class AbstractRestClient
|
|
47 |
if ($request['method'] == 'POST' ) {
|
48 |
$headers[] = 'x-product-id:' . WC_WooMercadoPago_Constants::PRODUCT_ID;
|
49 |
$headers[] = 'x-platform-id:' . WC_WooMercadoPago_Constants::PLATAFORM_ID;
|
50 |
-
$headers[] = 'x-integrator-id:' .
|
51 |
}
|
|
|
52 |
$json_content = true;
|
53 |
$form_content = false;
|
54 |
$default_content_type = true;
|
47 |
if ($request['method'] == 'POST' ) {
|
48 |
$headers[] = 'x-product-id:' . WC_WooMercadoPago_Constants::PRODUCT_ID;
|
49 |
$headers[] = 'x-platform-id:' . WC_WooMercadoPago_Constants::PLATAFORM_ID;
|
50 |
+
$headers[] = 'x-integrator-id:' . get_option('_mp_integrator_id', null);
|
51 |
}
|
52 |
+
|
53 |
$json_content = true;
|
54 |
$form_content = false;
|
55 |
$default_content_type = true;
|
includes/notification/WC_WooMercadoPago_Notification_Abstract.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
if (
|
4 |
exit;
|
5 |
}
|
6 |
|
@@ -60,29 +60,33 @@ abstract class WC_WooMercadoPago_Notification_Abstract
|
|
60 |
$this->log->write_log(__FUNCTION__, 'received _get content: ' . json_encode($_GET, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
|
61 |
}
|
62 |
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
*/
|
68 |
public function successful_request($data)
|
69 |
{
|
70 |
-
$this->log->write_log(__FUNCTION__, 'starting to process
|
71 |
$order_key = $data['external_reference'];
|
|
|
72 |
if (empty($order_key)) {
|
73 |
-
|
|
|
74 |
}
|
75 |
$invoice_prefix = get_option('_mp_store_identificator', 'WC-');
|
76 |
$id = (int)str_replace($invoice_prefix, '', $order_key);
|
77 |
$order = wc_get_order($id);
|
78 |
if (!$order) {
|
79 |
-
|
|
|
80 |
}
|
81 |
|
82 |
$order_id = (method_exists($order, 'get_id') ? $order->get_id() : $order->get_id());
|
83 |
if ($order_id !== $id) {
|
84 |
-
|
|
|
85 |
}
|
|
|
86 |
$this->log->write_log(__FUNCTION__, 'updating metadata and status with data: ' . json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
|
87 |
|
88 |
return $order;
|
@@ -119,7 +123,7 @@ abstract class WC_WooMercadoPago_Notification_Abstract
|
|
119 |
case 'in_mediation':
|
120 |
$this->mp_rule_in_mediation($order);
|
121 |
break;
|
122 |
-
case '
|
123 |
$this->mp_rule_charged_back($order);
|
124 |
break;
|
125 |
default:
|
@@ -171,19 +175,19 @@ abstract class WC_WooMercadoPago_Notification_Abstract
|
|
171 |
case 'WC_WooMercadoPago_TicketGateway':
|
172 |
$notes = $order->get_customer_order_notes();
|
173 |
$has_note = false;
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
break;
|
188 |
default:
|
189 |
$order->add_order_note('Mercado Pago: ' . __('The customer has not made the payment yet.', 'woocommerce-mercadopago'));
|
@@ -197,7 +201,7 @@ abstract class WC_WooMercadoPago_Notification_Abstract
|
|
197 |
*/
|
198 |
public function mp_rule_in_process($order)
|
199 |
{
|
200 |
-
$order->update_status(self::get_wc_status_for_mp_status('
|
201 |
return;
|
202 |
}
|
203 |
|
@@ -309,4 +313,15 @@ abstract class WC_WooMercadoPago_Notification_Abstract
|
|
309 |
}
|
310 |
}
|
311 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
312 |
}
|
1 |
<?php
|
2 |
|
3 |
+
if (!defined('ABSPATH')) {
|
4 |
exit;
|
5 |
}
|
6 |
|
60 |
$this->log->write_log(__FUNCTION__, 'received _get content: ' . json_encode($_GET, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
|
61 |
}
|
62 |
|
63 |
+
/**
|
64 |
+
* @param $data
|
65 |
+
* @return bool|WC_Order|WC_Order_Refund
|
66 |
+
*/
|
|
|
67 |
public function successful_request($data)
|
68 |
{
|
69 |
+
$this->log->write_log(__FUNCTION__, 'starting to process update...');
|
70 |
$order_key = $data['external_reference'];
|
71 |
+
|
72 |
if (empty($order_key)) {
|
73 |
+
$this->log->write_log(__FUNCTION__, 'External Reference not found');
|
74 |
+
$this->setResponse(422, null, "External Reference not found");
|
75 |
}
|
76 |
$invoice_prefix = get_option('_mp_store_identificator', 'WC-');
|
77 |
$id = (int)str_replace($invoice_prefix, '', $order_key);
|
78 |
$order = wc_get_order($id);
|
79 |
if (!$order) {
|
80 |
+
$this->log->write_log(__FUNCTION__, 'Order is invalid');
|
81 |
+
$this->setResponse(422, null, "Order is invalid");
|
82 |
}
|
83 |
|
84 |
$order_id = (method_exists($order, 'get_id') ? $order->get_id() : $order->get_id());
|
85 |
if ($order_id !== $id) {
|
86 |
+
$this->log->write_log(__FUNCTION__, 'Order error');
|
87 |
+
$this->setResponse(422, null, "Order error");
|
88 |
}
|
89 |
+
|
90 |
$this->log->write_log(__FUNCTION__, 'updating metadata and status with data: ' . json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
|
91 |
|
92 |
return $order;
|
123 |
case 'in_mediation':
|
124 |
$this->mp_rule_in_mediation($order);
|
125 |
break;
|
126 |
+
case 'charged_back':
|
127 |
$this->mp_rule_charged_back($order);
|
128 |
break;
|
129 |
default:
|
175 |
case 'WC_WooMercadoPago_TicketGateway':
|
176 |
$notes = $order->get_customer_order_notes();
|
177 |
$has_note = false;
|
178 |
+
if (sizeof($notes) > 1) {
|
179 |
+
$has_note = true;
|
180 |
+
break;
|
181 |
+
}
|
182 |
+
if (!$has_note) {
|
183 |
+
$order->add_order_note(
|
184 |
+
'Mercado Pago: ' . __('Waiting for the ticket payment.', 'woocommerce-mercadopago')
|
185 |
+
);
|
186 |
+
$order->add_order_note(
|
187 |
+
'Mercado Pago: ' . __('Waiting for the ticket payment.', 'woocommerce-mercadopago'),
|
188 |
+
1, false
|
189 |
+
);
|
190 |
+
}
|
191 |
break;
|
192 |
default:
|
193 |
$order->add_order_note('Mercado Pago: ' . __('The customer has not made the payment yet.', 'woocommerce-mercadopago'));
|
201 |
*/
|
202 |
public function mp_rule_in_process($order)
|
203 |
{
|
204 |
+
$order->update_status(self::get_wc_status_for_mp_status('inprocess'), 'Mercado Pago: ' . __('Payment is pending review.', 'woocommerce-mercadopago'));
|
205 |
return;
|
206 |
}
|
207 |
|
313 |
}
|
314 |
}
|
315 |
|
316 |
+
/**
|
317 |
+
* @param $code
|
318 |
+
* @param $code_message
|
319 |
+
* @param $body
|
320 |
+
*/
|
321 |
+
public function setResponse($code, $code_message, $body)
|
322 |
+
{
|
323 |
+
status_header($code, $code_message);
|
324 |
+
die($body);
|
325 |
+
}
|
326 |
+
|
327 |
}
|
includes/notification/WC_WooMercadoPago_Notification_IPN.php
CHANGED
@@ -27,17 +27,17 @@ class WC_WooMercadoPago_Notification_IPN extends WC_WooMercadoPago_Notification_
|
|
27 |
$data = $_GET;
|
28 |
|
29 |
if (isset($data['data_id']) && isset($data['type'])) {
|
30 |
-
|
31 |
}
|
32 |
|
33 |
if (!isset($data['id']) || !isset($data['topic'])) {
|
34 |
-
$this->log->write_log(__FUNCTION__, '
|
35 |
-
|
36 |
}
|
37 |
|
38 |
if ($data['topic'] == 'payment' || $data['topic'] != 'merchant_order') {
|
39 |
-
$this->log->write_log(__FUNCTION__, '
|
40 |
-
|
41 |
}
|
42 |
|
43 |
$access_token = array('access_token' => $this->mp->get_access_token());
|
@@ -45,17 +45,19 @@ class WC_WooMercadoPago_Notification_IPN extends WC_WooMercadoPago_Notification_
|
|
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__, '
|
|
|
49 |
}
|
50 |
|
51 |
$payments = $ipn_info['response']['payments'];
|
52 |
-
if (sizeof($payments)
|
53 |
-
$
|
54 |
-
|
55 |
-
} else {
|
56 |
-
$this->log->write_log(__FUNCTION__, 'order received but has no payment.');
|
57 |
}
|
58 |
-
|
|
|
|
|
|
|
59 |
}
|
60 |
}
|
61 |
|
@@ -72,6 +74,7 @@ class WC_WooMercadoPago_Notification_IPN extends WC_WooMercadoPago_Notification_
|
|
72 |
$this->log->write_log(__FUNCTION__, 'Changing order status to: ' . parent::get_wc_status_for_mp_status(str_replace('_', '', $processed_status)));
|
73 |
$this->proccessStatus($processed_status, $data, $order);
|
74 |
} catch (Exception $e) {
|
|
|
75 |
$this->log->write_log(__FUNCTION__, $e->getMessage());
|
76 |
}
|
77 |
}
|
27 |
$data = $_GET;
|
28 |
|
29 |
if (isset($data['data_id']) && isset($data['type'])) {
|
30 |
+
status_header(200, "OK");
|
31 |
}
|
32 |
|
33 |
if (!isset($data['id']) || !isset($data['topic'])) {
|
34 |
+
$this->log->write_log(__FUNCTION__, 'No ID or TOPIC param in Request IPN.');
|
35 |
+
$this->setResponse(422, null, __('No ID or TOPIC param in Request IPN', 'woocommerce-mercadopago'));
|
36 |
}
|
37 |
|
38 |
if ($data['topic'] == 'payment' || $data['topic'] != 'merchant_order') {
|
39 |
+
$this->log->write_log(__FUNCTION__, 'Type of topic IPN invalid, need to be merchant_order');
|
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());
|
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));
|
49 |
+
$this->setResponse(422, null, __('IPN merchant_order not found', 'woocommerce-mercadopago'));
|
50 |
}
|
51 |
|
52 |
$payments = $ipn_info['response']['payments'];
|
53 |
+
if (sizeof($payments) < 1) {
|
54 |
+
$this->log->write_log(__FUNCTION__, 'Not found Payments into Merchant_Order');
|
55 |
+
$this->setResponse(422, null, __('Not found Payments into Merchant_Order', 'woocommerce-mercadopago'));
|
|
|
|
|
56 |
}
|
57 |
+
|
58 |
+
$ipn_info['response']['ipn_type'] = 'merchant_order';
|
59 |
+
do_action('valid_mercadopago_ipn_request', $ipn_info['response']);
|
60 |
+
$this->setResponse(200, "OK", "Notification IPN Successfull");
|
61 |
}
|
62 |
}
|
63 |
|
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 |
}
|
includes/notification/WC_WooMercadoPago_Notification_Webhook.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
if (
|
4 |
exit;
|
5 |
}
|
6 |
|
@@ -25,10 +25,11 @@ class WC_WooMercadoPago_Notification_Webhook extends WC_WooMercadoPago_Notificat
|
|
25 |
{
|
26 |
parent::check_ipn_response();
|
27 |
$data = $_GET;
|
|
|
|
|
28 |
if (isset($data['coupon_id']) && !empty($data['coupon_id'])) {
|
29 |
if (isset($data['payer']) && !empty($data['payer'])) {
|
30 |
$response = $this->mp->check_discount_campaigns($data['amount'], $data['payer'], $data['coupon_id']);
|
31 |
-
header('HTTP/1.1 200 OK');
|
32 |
header('Content-Type: application/json');
|
33 |
echo json_encode($response);
|
34 |
} else {
|
@@ -46,12 +47,12 @@ class WC_WooMercadoPago_Notification_Webhook extends WC_WooMercadoPago_Notificat
|
|
46 |
}
|
47 |
exit(0);
|
48 |
} else if (!isset($data['data_id']) || !isset($data['type'])) {
|
49 |
-
$this->log->write_log(__FUNCTION__, 'data_id or type not set: ' .
|
|
|
50 |
if (!isset($data['id']) || !isset($data['topic'])) {
|
51 |
-
$this->log->write_log(__FUNCTION__, 'Mercado Pago Request failure: ' .
|
52 |
-
|
53 |
-
|
54 |
-
header('HTTP/1.1 200 OK');
|
55 |
}
|
56 |
} else {
|
57 |
if ($data['type'] == 'payment') {
|
@@ -59,14 +60,15 @@ class WC_WooMercadoPago_Notification_Webhook extends WC_WooMercadoPago_Notificat
|
|
59 |
$payment_info = $this->mp->get('/v1/payments/' . $data['data_id'], $access_token, false);
|
60 |
if (!is_wp_error($payment_info) && ($payment_info['status'] == 200 || $payment_info['status'] == 201)) {
|
61 |
if ($payment_info['response']) {
|
62 |
-
header('HTTP/1.1 200 OK');
|
63 |
do_action('valid_mercadopago_ipn_request', $payment_info['response']);
|
|
|
64 |
}
|
65 |
} else {
|
66 |
$this->log->write_log(__FUNCTION__, 'error when processing received data: ' . json_encode($payment_info, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
|
67 |
}
|
68 |
}
|
69 |
}
|
|
|
70 |
}
|
71 |
|
72 |
/**
|
@@ -74,14 +76,15 @@ class WC_WooMercadoPago_Notification_Webhook extends WC_WooMercadoPago_Notificat
|
|
74 |
*/
|
75 |
public function successful_request($data)
|
76 |
{
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
|
|
85 |
|
86 |
}
|
87 |
|
1 |
<?php
|
2 |
|
3 |
+
if (!defined('ABSPATH')) {
|
4 |
exit;
|
5 |
}
|
6 |
|
25 |
{
|
26 |
parent::check_ipn_response();
|
27 |
$data = $_GET;
|
28 |
+
header('HTTP/1.1 200 OK');
|
29 |
+
|
30 |
if (isset($data['coupon_id']) && !empty($data['coupon_id'])) {
|
31 |
if (isset($data['payer']) && !empty($data['payer'])) {
|
32 |
$response = $this->mp->check_discount_campaigns($data['amount'], $data['payer'], $data['coupon_id']);
|
|
|
33 |
header('Content-Type: application/json');
|
34 |
echo json_encode($response);
|
35 |
} else {
|
47 |
}
|
48 |
exit(0);
|
49 |
} else if (!isset($data['data_id']) || !isset($data['type'])) {
|
50 |
+
$this->log->write_log(__FUNCTION__, 'data_id or type not set: ' .
|
51 |
+
json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
|
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') {
|
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 |
/**
|
76 |
*/
|
77 |
public function successful_request($data)
|
78 |
{
|
79 |
+
try {
|
80 |
+
$order = parent::successful_request($data);
|
81 |
+
$status = $this->process_status_mp_business($data, $order);
|
82 |
+
$this->log->write_log(__FUNCTION__, 'Changing order status to: ' .
|
83 |
+
parent::get_wc_status_for_mp_status(str_replace('_', '', $status)));
|
84 |
+
$this->proccessStatus($status, $data, $order);
|
85 |
+
} catch (Exception $e) {
|
86 |
+
$this->log->write_log(__FUNCTION__, $e->getMessage());
|
87 |
+
}
|
88 |
|
89 |
}
|
90 |
|
includes/payments/WC_WooMercadoPago_BasicGateway.php
CHANGED
@@ -53,9 +53,12 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
|
|
53 |
public function getFormFields($label)
|
54 |
{
|
55 |
if (is_admin() && $this->isManageSection()) {
|
|
|
56 |
wp_enqueue_script(
|
57 |
'woocommerce-mercadopago-basic-config-script',
|
58 |
-
plugins_url('../assets/js/basic_config_mercadopago.js', plugin_dir_path(__FILE__))
|
|
|
|
|
59 |
);
|
60 |
}
|
61 |
|
@@ -63,7 +66,7 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
|
|
63 |
$this->field_forms_order = array_slice($this->field_forms_order, 0, 7);
|
64 |
}
|
65 |
|
66 |
-
if (!empty($this->checkout_country) && empty($this->getAccessToken())) {
|
67 |
$this->field_forms_order = array_slice($this->field_forms_order, 0, 22);
|
68 |
}
|
69 |
|
@@ -71,7 +74,7 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
|
|
71 |
|
72 |
$form_fields['checkout_header'] = $this->field_checkout_header();
|
73 |
|
74 |
-
if (!empty($this->checkout_country) && !empty($this->getAccessToken())) {
|
75 |
$form_fields['checkout_options_title'] = $this->field_checkout_options_title();
|
76 |
$form_fields['checkout_options_subtitle'] = $this->field_checkout_options_subtitle();
|
77 |
$form_fields['checkout_payments_title'] = $this->field_checkout_payments_title();
|
@@ -123,7 +126,7 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
|
|
123 |
'checkout_credential_mod_test_description',
|
124 |
'checkout_credential_mod_prod_title',
|
125 |
'checkout_credential_mod_prod_description',
|
126 |
-
'
|
127 |
'checkout_credential_link',
|
128 |
'checkout_credential_title_test',
|
129 |
'checkout_credential_description_test',
|
@@ -143,6 +146,7 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
|
|
143 |
'mp_statement_descriptor',
|
144 |
'_mp_category_id',
|
145 |
'_mp_store_identificator',
|
|
|
146 |
// Advanced settings
|
147 |
'checkout_advanced_settings',
|
148 |
'_mp_debug_mode',
|
@@ -150,8 +154,8 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
|
|
150 |
// Set up the payment experience in your store
|
151 |
'checkout_payments_title',
|
152 |
'checkout_payments_subtitle',
|
153 |
-
'checkout_payments_description',
|
154 |
'enabled',
|
|
|
155 |
WC_WooMercadoPago_Helpers_CurrencyConverter::CONFIG_KEY,
|
156 |
'installments',
|
157 |
// advanced settings
|
@@ -186,6 +190,14 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
|
|
186 |
$accessToken = $this->mp->get_access_token();
|
187 |
if (strpos($accessToken, 'APP_USR') === false && strpos($accessToken, 'TEST') === false) {
|
188 |
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
189 |
}
|
190 |
return true;
|
191 |
}
|
@@ -204,7 +216,7 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
|
|
204 |
}
|
205 |
return false;
|
206 |
}
|
207 |
-
|
208 |
|
209 |
/**
|
210 |
* @return array
|
@@ -232,7 +244,7 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
|
|
232 |
'title' => sprintf(
|
233 |
__('Mercado Pago checkout %s', 'woocommerce-mercadopago'),
|
234 |
'<div class="row">
|
235 |
-
<div class="mp-col-md-12 mp_subtitle_header">
|
236 |
' . __('Accept all method of payment and take your charges to another level', 'woocommerce-mercadopago') . '
|
237 |
</div>
|
238 |
<div class="mp-col-md-12">
|
@@ -402,11 +414,11 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
|
|
402 |
$ex_payments_sort = array();
|
403 |
|
404 |
$all_payments = get_option('_checkout_payments_methods', '');
|
405 |
-
|
406 |
if (empty($all_payments)) {
|
407 |
return $ex_payments;
|
408 |
}
|
409 |
-
|
410 |
$get_payment_methods = get_option('_all_payment_methods_v0', '');
|
411 |
|
412 |
if (!empty($get_payment_methods)) {
|
@@ -431,8 +443,9 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
|
|
431 |
$count_payment = 0;
|
432 |
|
433 |
foreach ($all_payments as $payment_method) {
|
434 |
-
if ($payment_method['type'] == 'account_money') {
|
435 |
-
|
|
|
436 |
} else {
|
437 |
if ($payment_method['type'] == 'credit_card') {
|
438 |
$element = array(
|
@@ -474,10 +487,10 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
|
|
474 |
|
475 |
if ($count_payment == 1) {
|
476 |
$element['title'] = __('Payment methods', 'woocommerce-mercadopago');
|
477 |
-
$element['desc_tip'] = __('
|
478 |
}
|
479 |
if ($count_payment == count($get_payment_methods)) {
|
480 |
-
$element['description'] = __('
|
481 |
}
|
482 |
|
483 |
$ex_payments["ex_payments_" . $payment_method['id']] = $element;
|
@@ -512,6 +525,8 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
|
|
512 |
*/
|
513 |
public function payment_fields()
|
514 |
{
|
|
|
|
|
515 |
//add css
|
516 |
wp_enqueue_style(
|
517 |
'woocommerce-mercadopago-basic-checkout-styles',
|
@@ -562,8 +577,9 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
|
|
562 |
"method" => $method,
|
563 |
"str_cuotas" => $str_cuotas,
|
564 |
"installments" => $installments,
|
|
|
565 |
"cho_image" => plugins_url('../assets/images/redirect_checkout.png', plugin_dir_path(__FILE__)),
|
566 |
-
"path_to_javascript" => plugins_url('../assets/js/basic-cho.js', plugin_dir_path(__FILE__))
|
567 |
);
|
568 |
|
569 |
wc_get_template('checkout/basic_checkout.php', $parameters, 'woo/mercado/pago/module/', WC_WooMercadoPago_Module::get_templates_path());
|
53 |
public function getFormFields($label)
|
54 |
{
|
55 |
if (is_admin() && $this->isManageSection()) {
|
56 |
+
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
|
57 |
wp_enqueue_script(
|
58 |
'woocommerce-mercadopago-basic-config-script',
|
59 |
+
plugins_url('../assets/js/basic_config_mercadopago'.$suffix.'.js', plugin_dir_path(__FILE__)),
|
60 |
+
array(),
|
61 |
+
WC_WooMercadoPago_Constants::VERSION
|
62 |
);
|
63 |
}
|
64 |
|
66 |
$this->field_forms_order = array_slice($this->field_forms_order, 0, 7);
|
67 |
}
|
68 |
|
69 |
+
if (!empty($this->checkout_country) && empty($this->getAccessToken()) && empty($this->getPublicKey())) {
|
70 |
$this->field_forms_order = array_slice($this->field_forms_order, 0, 22);
|
71 |
}
|
72 |
|
74 |
|
75 |
$form_fields['checkout_header'] = $this->field_checkout_header();
|
76 |
|
77 |
+
if (!empty($this->checkout_country) && !empty($this->getAccessToken()) && !empty($this->getPublicKey())) {
|
78 |
$form_fields['checkout_options_title'] = $this->field_checkout_options_title();
|
79 |
$form_fields['checkout_options_subtitle'] = $this->field_checkout_options_subtitle();
|
80 |
$form_fields['checkout_payments_title'] = $this->field_checkout_payments_title();
|
126 |
'checkout_credential_mod_test_description',
|
127 |
'checkout_credential_mod_prod_title',
|
128 |
'checkout_credential_mod_prod_description',
|
129 |
+
'checkout_credential_prod',
|
130 |
'checkout_credential_link',
|
131 |
'checkout_credential_title_test',
|
132 |
'checkout_credential_description_test',
|
146 |
'mp_statement_descriptor',
|
147 |
'_mp_category_id',
|
148 |
'_mp_store_identificator',
|
149 |
+
'_mp_integrator_id',
|
150 |
// Advanced settings
|
151 |
'checkout_advanced_settings',
|
152 |
'_mp_debug_mode',
|
154 |
// Set up the payment experience in your store
|
155 |
'checkout_payments_title',
|
156 |
'checkout_payments_subtitle',
|
|
|
157 |
'enabled',
|
158 |
+
'checkout_payments_description',
|
159 |
WC_WooMercadoPago_Helpers_CurrencyConverter::CONFIG_KEY,
|
160 |
'installments',
|
161 |
// advanced settings
|
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 |
}
|
216 |
}
|
217 |
return false;
|
218 |
}
|
219 |
+
|
220 |
|
221 |
/**
|
222 |
* @return array
|
244 |
'title' => sprintf(
|
245 |
__('Mercado Pago checkout %s', 'woocommerce-mercadopago'),
|
246 |
'<div class="row">
|
247 |
+
<div class="mp-col-md-12 mp_subtitle_header">
|
248 |
' . __('Accept all method of payment and take your charges to another level', 'woocommerce-mercadopago') . '
|
249 |
</div>
|
250 |
<div class="mp-col-md-12">
|
414 |
$ex_payments_sort = array();
|
415 |
|
416 |
$all_payments = get_option('_checkout_payments_methods', '');
|
417 |
+
|
418 |
if (empty($all_payments)) {
|
419 |
return $ex_payments;
|
420 |
}
|
421 |
+
|
422 |
$get_payment_methods = get_option('_all_payment_methods_v0', '');
|
423 |
|
424 |
if (!empty($get_payment_methods)) {
|
443 |
$count_payment = 0;
|
444 |
|
445 |
foreach ($all_payments as $payment_method) {
|
446 |
+
if ($payment_method['type'] == 'account_money') {
|
447 |
+
$count_payment++;
|
448 |
+
continue;
|
449 |
} else {
|
450 |
if ($payment_method['type'] == 'credit_card') {
|
451 |
$element = array(
|
487 |
|
488 |
if ($count_payment == 1) {
|
489 |
$element['title'] = __('Payment methods', 'woocommerce-mercadopago');
|
490 |
+
$element['desc_tip'] = __('Choose the available payment methods in your store.', 'woocommerce-mercadopago');
|
491 |
}
|
492 |
if ($count_payment == count($get_payment_methods)) {
|
493 |
+
$element['description'] = __('Activate the available payment methods to your clients.', 'woocommerce-mercadopago');
|
494 |
}
|
495 |
|
496 |
$ex_payments["ex_payments_" . $payment_method['id']] = $element;
|
525 |
*/
|
526 |
public function payment_fields()
|
527 |
{
|
528 |
+
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
|
529 |
+
|
530 |
//add css
|
531 |
wp_enqueue_style(
|
532 |
'woocommerce-mercadopago-basic-checkout-styles',
|
577 |
"method" => $method,
|
578 |
"str_cuotas" => $str_cuotas,
|
579 |
"installments" => $installments,
|
580 |
+
"plugin_version" => WC_WooMercadoPago_Constants::VERSION,
|
581 |
"cho_image" => plugins_url('../assets/images/redirect_checkout.png', plugin_dir_path(__FILE__)),
|
582 |
+
"path_to_javascript" => plugins_url('../assets/js/basic-cho'.$suffix.'.js', plugin_dir_path(__FILE__))
|
583 |
);
|
584 |
|
585 |
wc_get_template('checkout/basic_checkout.php', $parameters, 'woo/mercado/pago/module/', WC_WooMercadoPago_Module::get_templates_path());
|
includes/payments/WC_WooMercadoPago_CustomGateway.php
CHANGED
@@ -22,7 +22,7 @@ class WC_WooMercadoPago_CustomGateway extends WC_WooMercadoPago_PaymentAbstract
|
|
22 |
if (!$this->validateSection()) {
|
23 |
return;
|
24 |
}
|
25 |
-
|
26 |
$this->description = __('Accept card payments on your website with the best possible financing and maximize the conversion of your business. With personalized checkout your customers pay without leaving your store!', 'woocommerce-mercadopago');
|
27 |
$this->form_fields = array();
|
28 |
$this->method_title = __('Mercado Pago - Custom Checkout', 'woocommerce-mercadopago');
|
@@ -45,20 +45,26 @@ class WC_WooMercadoPago_CustomGateway extends WC_WooMercadoPago_PaymentAbstract
|
|
45 |
public function getFormFields($label)
|
46 |
{
|
47 |
if (is_admin() && $this->isManageSection()) {
|
48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
}
|
50 |
|
51 |
if (empty($this->checkout_country)) {
|
52 |
$this->field_forms_order = array_slice($this->field_forms_order, 0, 7);
|
53 |
}
|
54 |
|
55 |
-
if (!empty($this->checkout_country) && empty($this->getAccessToken())) {
|
56 |
$this->field_forms_order = array_slice($this->field_forms_order, 0, 22);
|
57 |
}
|
58 |
|
59 |
$form_fields = array();
|
60 |
$form_fields['checkout_custom_header'] = $this->field_checkout_custom_header();
|
61 |
-
if (!empty($this->checkout_country) && !empty($this->getAccessToken())) {
|
62 |
$form_fields['checkout_custom_options_title'] = $this->field_checkout_custom_options_title();
|
63 |
$form_fields['checkout_custom_options_subtitle'] = $this->field_checkout_custom_options_subtitle();
|
64 |
$form_fields['checkout_custom_payments_title'] = $this->field_checkout_custom_payments_title();
|
@@ -100,7 +106,7 @@ class WC_WooMercadoPago_CustomGateway extends WC_WooMercadoPago_PaymentAbstract
|
|
100 |
'checkout_credential_mod_test_description',
|
101 |
'checkout_credential_mod_prod_title',
|
102 |
'checkout_credential_mod_prod_description',
|
103 |
-
'
|
104 |
'checkout_credential_link',
|
105 |
'checkout_credential_title_test',
|
106 |
'checkout_credential_description_test',
|
@@ -120,6 +126,7 @@ class WC_WooMercadoPago_CustomGateway extends WC_WooMercadoPago_PaymentAbstract
|
|
120 |
'mp_statement_descriptor',
|
121 |
'_mp_category_id',
|
122 |
'_mp_store_identificator',
|
|
|
123 |
// Advanced settings
|
124 |
'checkout_advanced_settings',
|
125 |
'_mp_debug_mode',
|
@@ -153,7 +160,7 @@ class WC_WooMercadoPago_CustomGateway extends WC_WooMercadoPago_PaymentAbstract
|
|
153 |
'title' => sprintf(
|
154 |
__('Checkout of payments with debit and credit cards %s', 'woocommerce-mercadopago'),
|
155 |
'<div class="mp-row">
|
156 |
-
<div class="mp-col-md-12 mp_subtitle_header">
|
157 |
' . __('Accept payments instantly and maximize the conversion of your business', 'woocommerce-mercadopago') . '
|
158 |
</div>
|
159 |
<div class="mp-col-md-12">
|
@@ -424,8 +431,8 @@ class WC_WooMercadoPago_CustomGateway extends WC_WooMercadoPago_PaymentAbstract
|
|
424 |
break;
|
425 |
case 'cancelled':
|
426 |
case 'in_mediation':
|
427 |
-
case '
|
428 |
-
// If we enter here (an order generating a direct [cancelled, in_mediation, or
|
429 |
// them there must be something very wrong!
|
430 |
break;
|
431 |
default:
|
22 |
if (!$this->validateSection()) {
|
23 |
return;
|
24 |
}
|
25 |
+
|
26 |
$this->description = __('Accept card payments on your website with the best possible financing and maximize the conversion of your business. With personalized checkout your customers pay without leaving your store!', 'woocommerce-mercadopago');
|
27 |
$this->form_fields = array();
|
28 |
$this->method_title = __('Mercado Pago - Custom Checkout', 'woocommerce-mercadopago');
|
45 |
public function getFormFields($label)
|
46 |
{
|
47 |
if (is_admin() && $this->isManageSection()) {
|
48 |
+
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
|
49 |
+
wp_enqueue_script(
|
50 |
+
'woocommerce-mercadopago-custom-config-script',
|
51 |
+
plugins_url('../assets/js/custom_config_mercadopago'.$suffix.'.js', plugin_dir_path(__FILE__)),
|
52 |
+
array(),
|
53 |
+
WC_WooMercadoPago_Constants::VERSION
|
54 |
+
);
|
55 |
}
|
56 |
|
57 |
if (empty($this->checkout_country)) {
|
58 |
$this->field_forms_order = array_slice($this->field_forms_order, 0, 7);
|
59 |
}
|
60 |
|
61 |
+
if (!empty($this->checkout_country) && empty($this->getAccessToken()) && empty($this->getPublicKey())) {
|
62 |
$this->field_forms_order = array_slice($this->field_forms_order, 0, 22);
|
63 |
}
|
64 |
|
65 |
$form_fields = array();
|
66 |
$form_fields['checkout_custom_header'] = $this->field_checkout_custom_header();
|
67 |
+
if (!empty($this->checkout_country) && !empty($this->getAccessToken()) && !empty($this->getPublicKey())) {
|
68 |
$form_fields['checkout_custom_options_title'] = $this->field_checkout_custom_options_title();
|
69 |
$form_fields['checkout_custom_options_subtitle'] = $this->field_checkout_custom_options_subtitle();
|
70 |
$form_fields['checkout_custom_payments_title'] = $this->field_checkout_custom_payments_title();
|
106 |
'checkout_credential_mod_test_description',
|
107 |
'checkout_credential_mod_prod_title',
|
108 |
'checkout_credential_mod_prod_description',
|
109 |
+
'checkout_credential_prod',
|
110 |
'checkout_credential_link',
|
111 |
'checkout_credential_title_test',
|
112 |
'checkout_credential_description_test',
|
126 |
'mp_statement_descriptor',
|
127 |
'_mp_category_id',
|
128 |
'_mp_store_identificator',
|
129 |
+
'_mp_integrator_id',
|
130 |
// Advanced settings
|
131 |
'checkout_advanced_settings',
|
132 |
'_mp_debug_mode',
|
160 |
'title' => sprintf(
|
161 |
__('Checkout of payments with debit and credit cards %s', 'woocommerce-mercadopago'),
|
162 |
'<div class="mp-row">
|
163 |
+
<div class="mp-col-md-12 mp_subtitle_header">
|
164 |
' . __('Accept payments instantly and maximize the conversion of your business', 'woocommerce-mercadopago') . '
|
165 |
</div>
|
166 |
<div class="mp-col-md-12">
|
431 |
break;
|
432 |
case 'cancelled':
|
433 |
case 'in_mediation':
|
434 |
+
case 'charged_back':
|
435 |
+
// If we enter here (an order generating a direct [cancelled, in_mediation, or charged_back] status),
|
436 |
// them there must be something very wrong!
|
437 |
break;
|
438 |
default:
|
includes/payments/WC_WooMercadoPago_PaymentAbstract.php
CHANGED
@@ -19,6 +19,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
|
|
19 |
'mp_statement_descriptor',
|
20 |
'_mp_category_id',
|
21 |
'_mp_store_identificator',
|
|
|
22 |
'_mp_custom_domain',
|
23 |
'installments',
|
24 |
'auto_return'
|
@@ -55,6 +56,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
|
|
55 |
public $icon;
|
56 |
public $mp_category_id;
|
57 |
public $store_identificator;
|
|
|
58 |
public $debug_mode;
|
59 |
public $custom_domain;
|
60 |
public $binary_mode;
|
@@ -94,6 +96,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
|
|
94 |
$this->wc_country = get_option('woocommerce_default_country', '');
|
95 |
$this->mp_category_id = $this->getOption('_mp_category_id', 0);
|
96 |
$this->store_identificator = $this->getOption('_mp_store_identificator', 'WC-');
|
|
|
97 |
$this->debug_mode = $this->getOption('_mp_debug_mode', 'no');
|
98 |
$this->custom_domain = $this->getOption('_mp_custom_domain', '');
|
99 |
$this->binary_mode = $this->getOption('binary_mode', 'no');
|
@@ -276,7 +279,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
|
|
276 |
{
|
277 |
$type = 'notice-warning';
|
278 |
$message = sprintf(__('%s, it only takes a few minutes', 'woocommerce-mercadopago'), '<a class="homologScroll mp-mouse_pointer"><b><u>' . __('Approve your account', 'woocommerce-mercadopago') . '</u></b></a>');
|
279 |
-
echo
|
280 |
}
|
281 |
|
282 |
/**
|
@@ -301,7 +304,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
|
|
301 |
$form_fields['checkout_credential_mod_test_description'] = $this->field_checkout_credential_mod_test_description();
|
302 |
$form_fields['checkout_credential_mod_prod_title'] = $this->field_checkout_credential_mod_prod_title();
|
303 |
$form_fields['checkout_credential_mod_prod_description'] = $this->field_checkout_credential_mod_prod_description();
|
304 |
-
$form_fields['
|
305 |
$form_fields['checkout_credential_link'] = $this->field_checkout_credential_link($this->checkout_country);
|
306 |
$form_fields['checkout_credential_title_test'] = $this->field_checkout_credential_title_test();
|
307 |
$form_fields['checkout_credential_description_test'] = $this->field_checkout_credential_description_test();
|
@@ -312,7 +315,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
|
|
312 |
$form_fields['_mp_public_key_prod'] = $this->field_checkout_credential_publickey_prod();
|
313 |
$form_fields['_mp_access_token_prod'] = $this->field_checkout_credential_accesstoken_prod();
|
314 |
$form_fields['_mp_category_id'] = $this->field_category_store();
|
315 |
-
if (!empty($this->getAccessToken())) {
|
316 |
if ($this->homolog_validate == 0) {
|
317 |
if (isset($_GET['section']) && $_GET['section'] == $this->id && !has_action('woocommerce_update_options_payment_gateways_' . $this->id)) {
|
318 |
add_action('admin_notices', array($this, 'noticeHomologValidate'));
|
@@ -324,6 +327,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
|
|
324 |
}
|
325 |
$form_fields['mp_statement_descriptor'] = $this->field_mp_statement_descriptor();
|
326 |
$form_fields['_mp_store_identificator'] = $this->field_mp_store_identificator();
|
|
|
327 |
$form_fields['checkout_payments_description'] = $this->field_checkout_options_description();
|
328 |
$form_fields['checkout_advanced_settings'] = $this->field_checkout_advanced_settings();
|
329 |
$form_fields['_mp_debug_mode'] = $this->field_debug_mode();
|
@@ -407,28 +411,28 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
|
|
407 |
<div class="mp-col-md-2 mp-text-center mp-pb-10">
|
408 |
<p class="mp-number-checkout-body">1</p>
|
409 |
<p class="mp-text-steps mp-text-center mp-px-20">
|
410 |
-
' . __('Upload your
|
411 |
</p>
|
412 |
</div>
|
413 |
|
414 |
<div class="mp-col-md-2 mp-text-center mp-pb-10">
|
415 |
<p class="mp-number-checkout-body">2</p>
|
416 |
<p class="mp-text-steps mp-text-center mp-px-20">
|
417 |
-
' . __('Approve your account to be able to charge.', 'woocommerce-mercadopago') . '
|
418 |
</p>
|
419 |
</div>
|
420 |
|
421 |
<div class="mp-col-md-2 mp-text-center mp-pb-10">
|
422 |
<p class="mp-number-checkout-body">3</p>
|
423 |
<p class="mp-text-steps mp-text-center mp-px-20">
|
424 |
-
' . __('Add the basic information of your business in the plugin configuration.', 'woocommerce-mercadopago') . '
|
425 |
</p>
|
426 |
</div>
|
427 |
|
428 |
<div class="mp-col-md-2 mp-text-center mp-pb-10">
|
429 |
<p class="mp-number-checkout-body">4</p>
|
430 |
<p class="mp-text-steps mp-text-center mp-px-20">
|
431 |
-
' . __('Configure the
|
432 |
</p>
|
433 |
</div>
|
434 |
|
@@ -640,7 +644,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
|
|
640 |
$checkout_credential_production = array(
|
641 |
'title' => __('Production', 'woocommerce-mercadopago'),
|
642 |
'type' => 'select',
|
643 |
-
'description' => __('Choose
|
644 |
'default' => $this->id == 'woo-mercado-pago-basic' && $this->clientid_old_version ? 'yes' : $production_mode,
|
645 |
'options' => array(
|
646 |
'no' => __('No', 'woocommerce-mercadopago'),
|
@@ -843,10 +847,10 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
|
|
843 |
public function field_mp_statement_descriptor()
|
844 |
{
|
845 |
$mp_statement_descriptor = array(
|
846 |
-
'title' => __('Store
|
847 |
'type' => 'text',
|
848 |
'description' => __('This name will appear on your customers invoice.', 'woocommerce-mercadopago'),
|
849 |
-
'default' => __('Mercado Pago', 'woocommerce-mercadopago'),
|
850 |
);
|
851 |
return $mp_statement_descriptor;
|
852 |
}
|
@@ -865,7 +869,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
|
|
865 |
'title' => __('Store Category', 'woocommerce-mercadopago'),
|
866 |
'type' => 'select',
|
867 |
'description' => __('What category do your products belong to? Choose the one that best characterizes them (choose "other" if your product is too specific).', 'woocommerce-mercadopago'),
|
868 |
-
'default' => __('Categories', 'woocommerce-mercadopago'),
|
869 |
'options' => $option_category
|
870 |
);
|
871 |
return $field_category_store;
|
@@ -880,18 +884,37 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
|
|
880 |
'title' => __('Store ID', 'woocommerce-mercadopago'),
|
881 |
'type' => 'text',
|
882 |
'description' => __('Use a number or prefix to identify orders and payments from this store.', 'woocommerce-mercadopago'),
|
883 |
-
'default' =>
|
884 |
);
|
885 |
return $store_identificator;
|
886 |
}
|
887 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
888 |
/**
|
889 |
* @return array
|
890 |
*/
|
891 |
public function field_checkout_advanced_settings()
|
892 |
{
|
893 |
$checkout_options_explanation = array(
|
894 |
-
'title' => __('Advanced
|
895 |
'type' => 'title',
|
896 |
'class' => 'mp_subtitle_bd'
|
897 |
);
|
@@ -1260,11 +1283,11 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
|
|
1260 |
$key = 'woocommerce_' . $gateway::getId() . '_settings';
|
1261 |
$options = get_option($key);
|
1262 |
if (!empty($options)) {
|
1263 |
-
if (isset($options['
|
1264 |
continue;
|
1265 |
}
|
1266 |
|
1267 |
-
if (isset($options['
|
1268 |
continue;
|
1269 |
}
|
1270 |
|
@@ -1285,7 +1308,36 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
|
|
1285 |
/**
|
1286 |
* @return bool
|
1287 |
*/
|
1288 |
-
public function isProductionMode()
|
1289 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1290 |
}
|
1291 |
}
|
19 |
'mp_statement_descriptor',
|
20 |
'_mp_category_id',
|
21 |
'_mp_store_identificator',
|
22 |
+
'_mp_integrator_id',
|
23 |
'_mp_custom_domain',
|
24 |
'installments',
|
25 |
'auto_return'
|
56 |
public $icon;
|
57 |
public $mp_category_id;
|
58 |
public $store_identificator;
|
59 |
+
public $integrator_id;
|
60 |
public $debug_mode;
|
61 |
public $custom_domain;
|
62 |
public $binary_mode;
|
96 |
$this->wc_country = get_option('woocommerce_default_country', '');
|
97 |
$this->mp_category_id = $this->getOption('_mp_category_id', 0);
|
98 |
$this->store_identificator = $this->getOption('_mp_store_identificator', 'WC-');
|
99 |
+
$this->integrator_id = $this->getOption('_mp_integrator_id', '');
|
100 |
$this->debug_mode = $this->getOption('_mp_debug_mode', 'no');
|
101 |
$this->custom_domain = $this->getOption('_mp_custom_domain', '');
|
102 |
$this->binary_mode = $this->getOption('binary_mode', 'no');
|
279 |
{
|
280 |
$type = 'notice-warning';
|
281 |
$message = sprintf(__('%s, it only takes a few minutes', 'woocommerce-mercadopago'), '<a class="homologScroll mp-mouse_pointer"><b><u>' . __('Approve your account', 'woocommerce-mercadopago') . '</u></b></a>');
|
282 |
+
echo WC_WooMercadoPago_Notices::getAlertFrame($message, $type);
|
283 |
}
|
284 |
|
285 |
/**
|
304 |
$form_fields['checkout_credential_mod_test_description'] = $this->field_checkout_credential_mod_test_description();
|
305 |
$form_fields['checkout_credential_mod_prod_title'] = $this->field_checkout_credential_mod_prod_title();
|
306 |
$form_fields['checkout_credential_mod_prod_description'] = $this->field_checkout_credential_mod_prod_description();
|
307 |
+
$form_fields['checkout_credential_prod'] = $this->field_checkout_credential_production();
|
308 |
$form_fields['checkout_credential_link'] = $this->field_checkout_credential_link($this->checkout_country);
|
309 |
$form_fields['checkout_credential_title_test'] = $this->field_checkout_credential_title_test();
|
310 |
$form_fields['checkout_credential_description_test'] = $this->field_checkout_credential_description_test();
|
315 |
$form_fields['_mp_public_key_prod'] = $this->field_checkout_credential_publickey_prod();
|
316 |
$form_fields['_mp_access_token_prod'] = $this->field_checkout_credential_accesstoken_prod();
|
317 |
$form_fields['_mp_category_id'] = $this->field_category_store();
|
318 |
+
if (!empty($this->getAccessToken()) && !empty($this->getPublicKey())) {
|
319 |
if ($this->homolog_validate == 0) {
|
320 |
if (isset($_GET['section']) && $_GET['section'] == $this->id && !has_action('woocommerce_update_options_payment_gateways_' . $this->id)) {
|
321 |
add_action('admin_notices', array($this, 'noticeHomologValidate'));
|
327 |
}
|
328 |
$form_fields['mp_statement_descriptor'] = $this->field_mp_statement_descriptor();
|
329 |
$form_fields['_mp_store_identificator'] = $this->field_mp_store_identificator();
|
330 |
+
$form_fields['_mp_integrator_id'] = $this->field_mp_integrator_id();
|
331 |
$form_fields['checkout_payments_description'] = $this->field_checkout_options_description();
|
332 |
$form_fields['checkout_advanced_settings'] = $this->field_checkout_advanced_settings();
|
333 |
$form_fields['_mp_debug_mode'] = $this->field_debug_mode();
|
411 |
<div class="mp-col-md-2 mp-text-center mp-pb-10">
|
412 |
<p class="mp-number-checkout-body">1</p>
|
413 |
<p class="mp-text-steps mp-text-center mp-px-20">
|
414 |
+
' . __('<b>Upload your credentials</b> depending on the country in which you are registered.', 'woocommerce-mercadopago') . '
|
415 |
</p>
|
416 |
</div>
|
417 |
|
418 |
<div class="mp-col-md-2 mp-text-center mp-pb-10">
|
419 |
<p class="mp-number-checkout-body">2</p>
|
420 |
<p class="mp-text-steps mp-text-center mp-px-20">
|
421 |
+
' . __('<b>Approve your account</b> to be able to charge.', 'woocommerce-mercadopago') . '
|
422 |
</p>
|
423 |
</div>
|
424 |
|
425 |
<div class="mp-col-md-2 mp-text-center mp-pb-10">
|
426 |
<p class="mp-number-checkout-body">3</p>
|
427 |
<p class="mp-text-steps mp-text-center mp-px-20">
|
428 |
+
' . __('<b>Add the basic information of your business</b> in the plugin configuration.', 'woocommerce-mercadopago') . '
|
429 |
</p>
|
430 |
</div>
|
431 |
|
432 |
<div class="mp-col-md-2 mp-text-center mp-pb-10">
|
433 |
<p class="mp-number-checkout-body">4</p>
|
434 |
<p class="mp-text-steps mp-text-center mp-px-20">
|
435 |
+
' . __('<b>Configure the payment preferences</b> for your customers.', 'woocommerce-mercadopago') . '
|
436 |
</p>
|
437 |
</div>
|
438 |
|
644 |
$checkout_credential_production = array(
|
645 |
'title' => __('Production', 'woocommerce-mercadopago'),
|
646 |
'type' => 'select',
|
647 |
+
'description' => __('Choose “Yes” only when you’re ready to sell. Switch to “No” to activate Testing mode.', 'woocommerce-mercadopago'),
|
648 |
'default' => $this->id == 'woo-mercado-pago-basic' && $this->clientid_old_version ? 'yes' : $production_mode,
|
649 |
'options' => array(
|
650 |
'no' => __('No', 'woocommerce-mercadopago'),
|
847 |
public function field_mp_statement_descriptor()
|
848 |
{
|
849 |
$mp_statement_descriptor = array(
|
850 |
+
'title' => __('Store name', 'woocommerce-mercadopago'),
|
851 |
'type' => 'text',
|
852 |
'description' => __('This name will appear on your customers invoice.', 'woocommerce-mercadopago'),
|
853 |
+
'default' => $this->getOption('mp_statement_descriptor', __('Mercado Pago', 'woocommerce-mercadopago')),
|
854 |
);
|
855 |
return $mp_statement_descriptor;
|
856 |
}
|
869 |
'title' => __('Store Category', 'woocommerce-mercadopago'),
|
870 |
'type' => 'select',
|
871 |
'description' => __('What category do your products belong to? Choose the one that best characterizes them (choose "other" if your product is too specific).', 'woocommerce-mercadopago'),
|
872 |
+
'default' => $this->getOption('_mp_category_id', __('Categories', 'woocommerce-mercadopago')),
|
873 |
'options' => $option_category
|
874 |
);
|
875 |
return $field_category_store;
|
884 |
'title' => __('Store ID', 'woocommerce-mercadopago'),
|
885 |
'type' => 'text',
|
886 |
'description' => __('Use a number or prefix to identify orders and payments from this store.', 'woocommerce-mercadopago'),
|
887 |
+
'default' => $this->getOption('_mp_store_identificator', 'WC-'),
|
888 |
);
|
889 |
return $store_identificator;
|
890 |
}
|
891 |
|
892 |
+
/**
|
893 |
+
* @return array
|
894 |
+
*/
|
895 |
+
public function field_mp_integrator_id()
|
896 |
+
{
|
897 |
+
$links_mp = WC_WooMercadoPago_Module::define_link_country();
|
898 |
+
$integrator_id = array(
|
899 |
+
'title' => __('Integrator ID', 'woocommerce-mercadopago'),
|
900 |
+
'type' => 'text',
|
901 |
+
'description' =>sprintf(
|
902 |
+
__('Do not forget to enter your integrator_id as a certified Mercado Pago Partner. If you don`t have it, you can %s', 'woocommerce-mercadopago'),
|
903 |
+
'<a target="_blank" href="https://www.mercadopago.' . $links_mp['sufix_url'] . 'developers/' . $links_mp['translate'] . '/guides/plugins/woocommerce/preferences/#bookmark_informações_do_negócio">' . __('request it now.', 'woocommerce-mercadopago') .
|
904 |
+
'</a>'
|
905 |
+
),
|
906 |
+
'default' => $this->getOption('_mp_integrator_id', '')
|
907 |
+
);
|
908 |
+
return $integrator_id;
|
909 |
+
}
|
910 |
+
|
911 |
/**
|
912 |
* @return array
|
913 |
*/
|
914 |
public function field_checkout_advanced_settings()
|
915 |
{
|
916 |
$checkout_options_explanation = array(
|
917 |
+
'title' => __('Advanced adjustment', 'woocommerce-mercadopago'),
|
918 |
'type' => 'title',
|
919 |
'class' => 'mp_subtitle_bd'
|
920 |
);
|
1283 |
$key = 'woocommerce_' . $gateway::getId() . '_settings';
|
1284 |
$options = get_option($key);
|
1285 |
if (!empty($options)) {
|
1286 |
+
if (isset($options['checkout_credential_prod']) && $options['checkout_credential_prod'] == 'yes' && !empty($this->mp_access_token_prod)) {
|
1287 |
continue;
|
1288 |
}
|
1289 |
|
1290 |
+
if (isset($options['checkout_credential_prod']) && $options['checkout_credential_prod'] == 'no' && !empty($this->mp_access_token_test)) {
|
1291 |
continue;
|
1292 |
}
|
1293 |
|
1308 |
/**
|
1309 |
* @return bool
|
1310 |
*/
|
1311 |
+
public function isProductionMode()
|
1312 |
+
{
|
1313 |
+
$this->updateCredentialProduction();
|
1314 |
+
return $this->getOption('checkout_credential_prod', get_option('checkout_credential_prod', 'no')) === 'yes';
|
1315 |
+
}
|
1316 |
+
|
1317 |
+
/**
|
1318 |
+
*
|
1319 |
+
*/
|
1320 |
+
public function updateCredentialProduction()
|
1321 |
+
{
|
1322 |
+
if(!empty($this->getOption('checkout_credential_prod', null))){
|
1323 |
+
return;
|
1324 |
+
}
|
1325 |
+
|
1326 |
+
$gateways = apply_filters('woocommerce_payment_gateways', array());
|
1327 |
+
foreach ($gateways as $gateway) {
|
1328 |
+
if (!strpos($gateway, "MercadoPago")) {
|
1329 |
+
continue;
|
1330 |
+
}
|
1331 |
+
|
1332 |
+
$key = 'woocommerce_' . $gateway::getId() . '_settings';
|
1333 |
+
$options = get_option($key);
|
1334 |
+
if (!empty($options)) {
|
1335 |
+
if (!isset($options['checkout_credential_production']) || empty($options['checkout_credential_production']) ){
|
1336 |
+
continue;
|
1337 |
+
}
|
1338 |
+
$options['checkout_credential_prod'] = $options['checkout_credential_production'];
|
1339 |
+
update_option($key, apply_filters('woocommerce_settings_api_sanitized_fields_' . $gateway::getId(), $options));
|
1340 |
+
}
|
1341 |
+
}
|
1342 |
}
|
1343 |
}
|
includes/payments/WC_WooMercadoPago_TicketGateway.php
CHANGED
@@ -50,20 +50,26 @@ class WC_WooMercadoPago_TicketGateway extends WC_WooMercadoPago_PaymentAbstract
|
|
50 |
public function getFormFields($label)
|
51 |
{
|
52 |
if (is_admin() && $this->isManageSection()) {
|
53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
}
|
55 |
|
56 |
if (empty($this->checkout_country)) {
|
57 |
$this->field_forms_order = array_slice($this->field_forms_order, 0, 7);
|
58 |
}
|
59 |
|
60 |
-
if (!empty($this->checkout_country) && empty($this->
|
61 |
$this->field_forms_order = array_slice($this->field_forms_order, 0, 22);
|
62 |
}
|
63 |
|
64 |
$form_fields = array();
|
65 |
$form_fields['checkout_ticket_header'] = $this->field_checkout_ticket_header();
|
66 |
-
if (!empty($this->checkout_country) && !empty($this->getAccessToken())) {
|
67 |
$form_fields['checkout_ticket_options_title'] = $this->field_checkout_ticket_options_title();
|
68 |
$form_fields['checkout_ticket_options_subtitle'] = $this->field_checkout_ticket_options_subtitle();
|
69 |
$form_fields['checkout_ticket_payments_title'] = $this->field_checkout_ticket_payments_title();
|
@@ -109,7 +115,7 @@ class WC_WooMercadoPago_TicketGateway extends WC_WooMercadoPago_PaymentAbstract
|
|
109 |
'checkout_credential_mod_test_description',
|
110 |
'checkout_credential_mod_prod_title',
|
111 |
'checkout_credential_mod_prod_description',
|
112 |
-
'
|
113 |
'checkout_credential_link',
|
114 |
'checkout_credential_title_test',
|
115 |
'checkout_credential_description_test',
|
@@ -129,6 +135,7 @@ class WC_WooMercadoPago_TicketGateway extends WC_WooMercadoPago_PaymentAbstract
|
|
129 |
'mp_statement_descriptor',
|
130 |
'_mp_category_id',
|
131 |
'_mp_store_identificator',
|
|
|
132 |
// Advanced settings
|
133 |
'checkout_advanced_settings',
|
134 |
'_mp_debug_mode',
|
@@ -188,7 +195,7 @@ class WC_WooMercadoPago_TicketGateway extends WC_WooMercadoPago_PaymentAbstract
|
|
188 |
'title' => sprintf(
|
189 |
__('Checkout of payments with cash %s', 'woocommerce-mercadopago'),
|
190 |
'<div class="mp-row">
|
191 |
-
<div class="mp-col-md-12 mp_subtitle_header">
|
192 |
' . __('Accept face-to-face payments, do not leave anyone out!', 'woocommerce-mercadopago') . '
|
193 |
</div>
|
194 |
<div class="mp-col-md-12">
|
@@ -331,10 +338,10 @@ class WC_WooMercadoPago_TicketGateway extends WC_WooMercadoPago_PaymentAbstract
|
|
331 |
|
332 |
if ($count_payment == 1) {
|
333 |
$element['title'] = __('Payment methods', 'woocommerce-mercadopago');
|
334 |
-
$element['desc_tip'] = __('
|
335 |
}
|
336 |
if ($count_payment == count($get_payment_methods_ticket)) {
|
337 |
-
$element['description'] = __('
|
338 |
}
|
339 |
|
340 |
$ticket_payments["ticket_payment_" . $payment_method_ticket['id']] = $element;
|
@@ -475,13 +482,31 @@ class WC_WooMercadoPago_TicketGateway extends WC_WooMercadoPago_PaymentAbstract
|
|
475 |
}
|
476 |
}
|
477 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
478 |
if (isset($ticket_checkout['amount']) && !empty($ticket_checkout['amount']) &&
|
479 |
isset($ticket_checkout['paymentMethodId']) && !empty($ticket_checkout['paymentMethodId'])) {
|
480 |
$response = $this->create_preference($order, $ticket_checkout);
|
481 |
|
482 |
if (is_array($response) && array_key_exists('status', $response)) {
|
483 |
if ($response['status'] == 'pending') {
|
484 |
-
if ($response['status_detail'] == 'pending_waiting_payment') {
|
485 |
WC()->cart->empty_cart();
|
486 |
if ($this->stock_reduce_mode == 'yes') {
|
487 |
$order->reduce_order_stock();
|
@@ -498,14 +523,17 @@ class WC_WooMercadoPago_TicketGateway extends WC_WooMercadoPago_PaymentAbstract
|
|
498 |
'Mercado Pago: ' .
|
499 |
__('The customer has not paid yet.', 'woocommerce-mercadopago')
|
500 |
);
|
501 |
-
$
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
|
|
|
|
|
|
509 |
return array(
|
510 |
'result' => 'success',
|
511 |
'redirect' => $order->get_checkout_order_received_url()
|
50 |
public function getFormFields($label)
|
51 |
{
|
52 |
if (is_admin() && $this->isManageSection()) {
|
53 |
+
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
|
54 |
+
wp_enqueue_script(
|
55 |
+
'woocommerce-mercadopago-ticket-config-script',
|
56 |
+
plugins_url('../assets/js/ticket_config_mercadopago'.$suffix.'.js', plugin_dir_path(__FILE__)),
|
57 |
+
array(),
|
58 |
+
WC_WooMercadoPago_Constants::VERSION
|
59 |
+
);
|
60 |
}
|
61 |
|
62 |
if (empty($this->checkout_country)) {
|
63 |
$this->field_forms_order = array_slice($this->field_forms_order, 0, 7);
|
64 |
}
|
65 |
|
66 |
+
if (!empty($this->checkout_country) && empty($this->getAccessToken()) && empty($this->getPublicKey())) {
|
67 |
$this->field_forms_order = array_slice($this->field_forms_order, 0, 22);
|
68 |
}
|
69 |
|
70 |
$form_fields = array();
|
71 |
$form_fields['checkout_ticket_header'] = $this->field_checkout_ticket_header();
|
72 |
+
if (!empty($this->checkout_country) && !empty($this->getAccessToken()) && !empty($this->getPublicKey())) {
|
73 |
$form_fields['checkout_ticket_options_title'] = $this->field_checkout_ticket_options_title();
|
74 |
$form_fields['checkout_ticket_options_subtitle'] = $this->field_checkout_ticket_options_subtitle();
|
75 |
$form_fields['checkout_ticket_payments_title'] = $this->field_checkout_ticket_payments_title();
|
115 |
'checkout_credential_mod_test_description',
|
116 |
'checkout_credential_mod_prod_title',
|
117 |
'checkout_credential_mod_prod_description',
|
118 |
+
'checkout_credential_prod',
|
119 |
'checkout_credential_link',
|
120 |
'checkout_credential_title_test',
|
121 |
'checkout_credential_description_test',
|
135 |
'mp_statement_descriptor',
|
136 |
'_mp_category_id',
|
137 |
'_mp_store_identificator',
|
138 |
+
'_mp_integrator_id',
|
139 |
// Advanced settings
|
140 |
'checkout_advanced_settings',
|
141 |
'_mp_debug_mode',
|
195 |
'title' => sprintf(
|
196 |
__('Checkout of payments with cash %s', 'woocommerce-mercadopago'),
|
197 |
'<div class="mp-row">
|
198 |
+
<div class="mp-col-md-12 mp_subtitle_header">
|
199 |
' . __('Accept face-to-face payments, do not leave anyone out!', 'woocommerce-mercadopago') . '
|
200 |
</div>
|
201 |
<div class="mp-col-md-12">
|
338 |
|
339 |
if ($count_payment == 1) {
|
340 |
$element['title'] = __('Payment methods', 'woocommerce-mercadopago');
|
341 |
+
$element['desc_tip'] = __('Choose the available payment methods in your store.', 'woocommerce-mercadopago');
|
342 |
}
|
343 |
if ($count_payment == count($get_payment_methods_ticket)) {
|
344 |
+
$element['description'] = __('Activate the available payment methods to your clients.', 'woocommerce-mercadopago');
|
345 |
}
|
346 |
|
347 |
$ticket_payments["ticket_payment_" . $payment_method_ticket['id']] = $element;
|
482 |
}
|
483 |
}
|
484 |
|
485 |
+
if ($this->getOption('_site_id_v1') == 'MLU') {
|
486 |
+
if (
|
487 |
+
!isset($ticket_checkout['docNumber']) || empty($ticket_checkout['docNumber']) ||
|
488 |
+
!isset($ticket_checkout['docType']) || empty($ticket_checkout['docType'])
|
489 |
+
) {
|
490 |
+
wc_add_notice(
|
491 |
+
'<p>' .
|
492 |
+
__('There was a problem processing your payment. Are you sure you have correctly filled out all the information on the payment form?', 'woocommerce-mercadopago') .
|
493 |
+
'</p>',
|
494 |
+
'error'
|
495 |
+
);
|
496 |
+
return array(
|
497 |
+
'result' => 'fail',
|
498 |
+
'redirect' => '',
|
499 |
+
);
|
500 |
+
}
|
501 |
+
}
|
502 |
+
|
503 |
if (isset($ticket_checkout['amount']) && !empty($ticket_checkout['amount']) &&
|
504 |
isset($ticket_checkout['paymentMethodId']) && !empty($ticket_checkout['paymentMethodId'])) {
|
505 |
$response = $this->create_preference($order, $ticket_checkout);
|
506 |
|
507 |
if (is_array($response) && array_key_exists('status', $response)) {
|
508 |
if ($response['status'] == 'pending') {
|
509 |
+
if ($response['status_detail'] == 'pending_waiting_payment' || $response['status_detail'] == 'pending_waiting_transfer') {
|
510 |
WC()->cart->empty_cart();
|
511 |
if ($this->stock_reduce_mode == 'yes') {
|
512 |
$order->reduce_order_stock();
|
523 |
'Mercado Pago: ' .
|
524 |
__('The customer has not paid yet.', 'woocommerce-mercadopago')
|
525 |
);
|
526 |
+
if($response['payment_type_id'] != 'bank_transfer'){
|
527 |
+
$order->add_order_note(
|
528 |
+
'Mercado Pago: ' .
|
529 |
+
__('To print the ticket again click', 'woocommerce-mercadopago') .
|
530 |
+
'<a target="_blank" href="' .
|
531 |
+
$response['transaction_details']['external_resource_url'] . '">' .
|
532 |
+
__('here', 'woocommerce-mercadopago') .
|
533 |
+
'</a>', 1, false
|
534 |
+
);
|
535 |
+
}
|
536 |
+
|
537 |
return array(
|
538 |
'result' => 'success',
|
539 |
'redirect' => $order->get_checkout_order_received_url()
|
includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php
CHANGED
@@ -192,7 +192,7 @@ abstract class WC_WooMercadoPago_Hook_Abstract
|
|
192 |
if ('title' !== $this->payment->get_field_type($field)) {
|
193 |
$value = $this->payment->get_field_value($key, $field, $post_data);
|
194 |
$oldData[$key] = isset($this->payment->settings[$key]) ? $this->payment->settings[$key] : null;
|
195 |
-
if ($key == '
|
196 |
$valueCredentialProduction = $value;
|
197 |
}
|
198 |
$commonConfigs = $this->payment->getCommonConfigs();
|
@@ -278,6 +278,17 @@ abstract class WC_WooMercadoPago_Hook_Abstract
|
|
278 |
return true;
|
279 |
}
|
280 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
281 |
return false;
|
282 |
}
|
283 |
|
@@ -341,14 +352,34 @@ abstract class WC_WooMercadoPago_Hook_Abstract
|
|
341 |
return true;
|
342 |
}
|
343 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
344 |
/**
|
345 |
* ADMIN NOTICE
|
346 |
*/
|
347 |
public function noticeInvalidProdCredentials()
|
348 |
{
|
349 |
$type = 'error';
|
350 |
-
$message = __('
|
351 |
-
echo
|
352 |
}
|
353 |
|
354 |
/**
|
@@ -357,8 +388,8 @@ abstract class WC_WooMercadoPago_Hook_Abstract
|
|
357 |
public function noticeInvalidTestCredentials()
|
358 |
{
|
359 |
$type = 'error';
|
360 |
-
$message = __('
|
361 |
-
echo
|
362 |
}
|
363 |
|
364 |
/**
|
@@ -367,8 +398,8 @@ abstract class WC_WooMercadoPago_Hook_Abstract
|
|
367 |
public function enablePaymentNotice()
|
368 |
{
|
369 |
$type = 'notice-warning';
|
370 |
-
$message = __('
|
371 |
-
echo
|
372 |
}
|
373 |
|
374 |
|
192 |
if ('title' !== $this->payment->get_field_type($field)) {
|
193 |
$value = $this->payment->get_field_value($key, $field, $post_data);
|
194 |
$oldData[$key] = isset($this->payment->settings[$key]) ? $this->payment->settings[$key] : null;
|
195 |
+
if ($key == 'checkout_credential_prod') {
|
196 |
$valueCredentialProduction = $value;
|
197 |
}
|
198 |
$commonConfigs = $this->payment->getCommonConfigs();
|
278 |
return true;
|
279 |
}
|
280 |
|
281 |
+
if (WC_WooMercadoPago_Credentials::public_key_is_valid($value) === false) {
|
282 |
+
update_option($key, '', true);
|
283 |
+
|
284 |
+
if ($key == '_mp_public_key_prod') {
|
285 |
+
add_action('admin_notices', array($this, 'noticeInvalidPublicKeyProd'));
|
286 |
+
} else {
|
287 |
+
add_action('admin_notices', array($this, 'noticeInvalidPublicKeyTest'));
|
288 |
+
}
|
289 |
+
return true;
|
290 |
+
}
|
291 |
+
|
292 |
return false;
|
293 |
}
|
294 |
|
352 |
return true;
|
353 |
}
|
354 |
|
355 |
+
/**
|
356 |
+
* ADMIN NOTICE
|
357 |
+
*/
|
358 |
+
public function noticeInvalidPublicKeyProd()
|
359 |
+
{
|
360 |
+
$type = 'error';
|
361 |
+
$message = __('<b>Public Key</b> production credential is invalid. Review the field to receive real payments.', 'woocommerce-mercadopago');
|
362 |
+
echo WC_WooMercadoPago_Notices::getAlertFrame($message, $type);
|
363 |
+
}
|
364 |
+
|
365 |
+
/**
|
366 |
+
* ADMIN NOTICE
|
367 |
+
*/
|
368 |
+
public function noticeInvalidPublicKeyTest()
|
369 |
+
{
|
370 |
+
$type = 'error';
|
371 |
+
$message = __('<b>Public Key</b> test credential is invalid. Review the field to perform tests in your store.', 'woocommerce-mercadopago');
|
372 |
+
echo WC_WooMercadoPago_Notices::getAlertFrame($message, $type);
|
373 |
+
}
|
374 |
+
|
375 |
/**
|
376 |
* ADMIN NOTICE
|
377 |
*/
|
378 |
public function noticeInvalidProdCredentials()
|
379 |
{
|
380 |
$type = 'error';
|
381 |
+
$message = __('<b>Access Token</b> production credential is invalid. Remember that it must be complete to receive real payments.', 'woocommerce-mercadopago');
|
382 |
+
echo WC_WooMercadoPago_Notices::getAlertFrame($message, $type);
|
383 |
}
|
384 |
|
385 |
/**
|
388 |
public function noticeInvalidTestCredentials()
|
389 |
{
|
390 |
$type = 'error';
|
391 |
+
$message = __('<b>Access Token</b> test credential is invalid. Review the field to perform tests in your store.', 'woocommerce-mercadopago');
|
392 |
+
echo WC_WooMercadoPago_Notices::getAlertFrame($message, $type);
|
393 |
}
|
394 |
|
395 |
/**
|
398 |
public function enablePaymentNotice()
|
399 |
{
|
400 |
$type = 'notice-warning';
|
401 |
+
$message = __('Fill in your credentials to enable payment methods.', 'woocommerce-mercadopago');
|
402 |
+
echo WC_WooMercadoPago_Notices::getAlertFrame($message, $type);
|
403 |
}
|
404 |
|
405 |
|
includes/payments/hooks/WC_WooMercadoPago_Hook_Custom.php
CHANGED
@@ -55,8 +55,14 @@ class WC_WooMercadoPago_Hook_Custom extends WC_WooMercadoPago_Hook_Abstract
|
|
55 |
public function add_checkout_scripts_custom()
|
56 |
{
|
57 |
if (is_checkout() && $this->payment->is_available() && !get_query_var('order-received')) {
|
58 |
-
|
59 |
-
wp_enqueue_script(
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
|
61 |
wp_localize_script(
|
62 |
'woocommerce-mercadopago-checkout',
|
55 |
public function add_checkout_scripts_custom()
|
56 |
{
|
57 |
if (is_checkout() && $this->payment->is_available() && !get_query_var('order-received')) {
|
58 |
+
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
|
59 |
+
wp_enqueue_script(
|
60 |
+
'woocommerce-mercadopago-checkout',
|
61 |
+
plugins_url('../../assets/js/credit-card'.$suffix.'.js', plugin_dir_path(__FILE__)),
|
62 |
+
array('jquery'),
|
63 |
+
WC_WooMercadoPago_Constants::VERSION,
|
64 |
+
true
|
65 |
+
);
|
66 |
|
67 |
wp_localize_script(
|
68 |
'woocommerce-mercadopago-checkout',
|
includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php
CHANGED
@@ -58,7 +58,14 @@ class WC_WooMercadoPago_Hook_Ticket extends WC_WooMercadoPago_Hook_Abstract
|
|
58 |
public function add_checkout_scripts_ticket()
|
59 |
{
|
60 |
if (is_checkout() && $this->payment->is_available() && !get_query_var('order-received')) {
|
61 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
|
63 |
wp_localize_script(
|
64 |
'woocommerce-mercadopago-ticket-checkout',
|
58 |
public function add_checkout_scripts_ticket()
|
59 |
{
|
60 |
if (is_checkout() && $this->payment->is_available() && !get_query_var('order-received')) {
|
61 |
+
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
|
62 |
+
wp_enqueue_script(
|
63 |
+
'woocommerce-mercadopago-ticket-checkout',
|
64 |
+
plugins_url('../../assets/js/ticket' . $suffix . '.js', plugin_dir_path(__FILE__)),
|
65 |
+
array('jquery'),
|
66 |
+
WC_WooMercadoPago_Constants::VERSION,
|
67 |
+
true
|
68 |
+
);
|
69 |
|
70 |
wp_localize_script(
|
71 |
'woocommerce-mercadopago-ticket-checkout',
|
readme.txt
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
Contributors: mercadopago, mercadolivre, claudiosanches, marcelohama
|
3 |
Tags: ecommerce, mercadopago, woocommerce
|
4 |
Requires at least: 4.9.10
|
5 |
-
Tested up to: 5.
|
6 |
Requires PHP: 5.6
|
7 |
-
Stable tag: 4.
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -34,7 +34,6 @@ You can trust us as you trust a strategic partner. Use the money from your sales
|
|
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 |
-
* Subscriptions;
|
38 |
* Seller Protection Program.
|
39 |
|
40 |
= Compatibility =
|
@@ -116,6 +115,38 @@ Set up both the plugin and the checkouts you want to activate on your payment av
|
|
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.1.1 (10/01/2020) =
|
120 |
* Feature
|
121 |
- Currency Conversion in Checkout Mercado Pago added
|
2 |
Contributors: mercadopago, mercadolivre, claudiosanches, marcelohama
|
3 |
Tags: ecommerce, mercadopago, woocommerce
|
4 |
Requires at least: 4.9.10
|
5 |
+
Tested up to: 5.4
|
6 |
Requires PHP: 5.6
|
7 |
+
Stable tag: 4.2.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
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 =
|
115 |
Check out our <a href="https://www.mercadopago.com.br/developers/pt/plugins_sdks/plugins/official/woo-commerce/">official documentation</a> for more information on the specific fields to configure.
|
116 |
|
117 |
== Changelog ==
|
118 |
+
= v4.2.0 (13/05/2020) =
|
119 |
+
* Features
|
120 |
+
- Added compatibility with WooCommerce version 4.1.0
|
121 |
+
- Added Integrator ID field on checkouts’ configuration screens
|
122 |
+
- Added validation for Public Keys
|
123 |
+
- Added alert to activate the WooCommerce plugin whenever it is inactive
|
124 |
+
- Added alert to install the WooCommerce plugin whenever it is uninstalled
|
125 |
+
- Added assets versioning
|
126 |
+
- Added minification of JS files
|
127 |
+
- Added debug mode for JS in order to use files without minification
|
128 |
+
- Added payment flow for WebPay in Colombia for Checkout Custom Offline
|
129 |
+
- Updated documentation and regionalized links
|
130 |
+
|
131 |
+
* Bug fixes
|
132 |
+
- Corrected notification status on charged_back
|
133 |
+
- Corrected issue when invalid credentials were switched
|
134 |
+
- Corrected checkout options for Store Name, Store Category and Store ID
|
135 |
+
- Corrected validation on the cardNumber field whenever card number is removed
|
136 |
+
- Corrected input masks on CPNJ and CPF; CNPJ validation and translation in Brazil for Custom Checkout Offline;
|
137 |
+
- Corrected mercadopago.js loading
|
138 |
+
- Corrected processing of payment status notifications
|
139 |
+
- Corrected personalized URLs for successful, refused and pending payments on Checkout Mercado Pago
|
140 |
+
- Added success and error messages on received payment notifications
|
141 |
+
- Added alphabetical order on offline payment methods for Checkout Custom
|
142 |
+
- Added CI document input on Custom Checkout OFF in Uruguay
|
143 |
+
- Added compatibility with third-party discount plugins which attribute value on order->fees (computation of fees_cost upon purchase)
|
144 |
+
- Added validation, focus and error messages on all JS inputs on Checkout Custom Online and Offline
|
145 |
+
- Usability improvements for Checkout Custom - Credit Card on mobile devices
|
146 |
+
- Adjusted error messages on online Checkout Custom Online
|
147 |
+
- Adjusted status updates on Checkout Custom Offline orders
|
148 |
+
- Updated documentation and guide links
|
149 |
+
|
150 |
= v4.1.1 (10/01/2020) =
|
151 |
* Feature
|
152 |
- Currency Conversion in Checkout Mercado Pago added
|
templates/checkout/basic_checkout.php
CHANGED
@@ -12,7 +12,7 @@ if (!defined('ABSPATH')) {
|
|
12 |
<?= __('Credit cards', 'woocommerce-mercadopago') ?>
|
13 |
<span class="mp-badge-checkout"><?=__('Until', 'woocommerce-mercadopago')?> <?= $installments ?> <?=__($str_cuotas, 'woocommerce-mercadopago')?></span>
|
14 |
</p>
|
15 |
-
|
16 |
<?php foreach($tarjetas as $tarjeta): ?>
|
17 |
<?php if ($tarjeta['type'] == 'credit_card'): ?>
|
18 |
<img src="<?= $tarjeta['image'] ?>" class="mp-img-fluid mp-img-tarjetas" alt=""/>
|
@@ -21,12 +21,12 @@ if (!defined('ABSPATH')) {
|
|
21 |
</div>
|
22 |
</div>
|
23 |
<?php endif; ?>
|
24 |
-
|
25 |
<?php if($debito != 0): ?>
|
26 |
<div id="framePayments" class="mp-col-md-6 mp-pr-15">
|
27 |
<div class="frame-tarjetas">
|
28 |
<p class="submp-title-checkout"><?=__('Debit card', 'woocommerce-mercadopago')?></p>
|
29 |
-
|
30 |
<?php foreach($tarjetas as $tarjeta): ?>
|
31 |
<?php if ($tarjeta['type'] == 'debit_card' || $tarjeta['type'] == 'prepaid_card'): ?>
|
32 |
<img src="<?= $tarjeta['image'] ?>" class="mp-img-fluid mp-img-tarjetas" alt="" />
|
@@ -35,12 +35,12 @@ if (!defined('ABSPATH')) {
|
|
35 |
</div>
|
36 |
</div>
|
37 |
<?php endif; ?>
|
38 |
-
|
39 |
<?php if($efectivo != 0): ?>
|
40 |
<div id="framePayments" class="mp-col-md-6">
|
41 |
<div class="frame-tarjetas">
|
42 |
<p class="submp-title-checkout"><?=__('Payments in cash', 'woocommerce-mercadopago')?></p>
|
43 |
-
|
44 |
<?php foreach($tarjetas as $tarjeta): ?>
|
45 |
<?php if ($tarjeta['type'] != 'credit_card' && $tarjeta['type'] != 'debit_card' && $tarjeta['type'] != 'prepaid_card'): ?>
|
46 |
<img src="<?= $tarjeta['image'] ?>" class="mp-img-fluid mp-img-tarjetas" alt=""/>
|
@@ -49,7 +49,7 @@ if (!defined('ABSPATH')) {
|
|
49 |
</div>
|
50 |
</div>
|
51 |
<?php endif; ?>
|
52 |
-
|
53 |
<?php if($method == 'redirect'): ?>
|
54 |
<div class="mp-col-md-12 mp-pt-20">
|
55 |
<div class="mp-redirect-frame">
|
@@ -58,8 +58,8 @@ if (!defined('ABSPATH')) {
|
|
58 |
</div>
|
59 |
</div>
|
60 |
<?php endif; ?>
|
61 |
-
|
62 |
</div>
|
63 |
</div>
|
64 |
|
65 |
-
<script type="text/javascript" src="<?php echo $path_to_javascript; ?>"></script>
|
12 |
<?= __('Credit cards', 'woocommerce-mercadopago') ?>
|
13 |
<span class="mp-badge-checkout"><?=__('Until', 'woocommerce-mercadopago')?> <?= $installments ?> <?=__($str_cuotas, 'woocommerce-mercadopago')?></span>
|
14 |
</p>
|
15 |
+
|
16 |
<?php foreach($tarjetas as $tarjeta): ?>
|
17 |
<?php if ($tarjeta['type'] == 'credit_card'): ?>
|
18 |
<img src="<?= $tarjeta['image'] ?>" class="mp-img-fluid mp-img-tarjetas" alt=""/>
|
21 |
</div>
|
22 |
</div>
|
23 |
<?php endif; ?>
|
24 |
+
|
25 |
<?php if($debito != 0): ?>
|
26 |
<div id="framePayments" class="mp-col-md-6 mp-pr-15">
|
27 |
<div class="frame-tarjetas">
|
28 |
<p class="submp-title-checkout"><?=__('Debit card', 'woocommerce-mercadopago')?></p>
|
29 |
+
|
30 |
<?php foreach($tarjetas as $tarjeta): ?>
|
31 |
<?php if ($tarjeta['type'] == 'debit_card' || $tarjeta['type'] == 'prepaid_card'): ?>
|
32 |
<img src="<?= $tarjeta['image'] ?>" class="mp-img-fluid mp-img-tarjetas" alt="" />
|
35 |
</div>
|
36 |
</div>
|
37 |
<?php endif; ?>
|
38 |
+
|
39 |
<?php if($efectivo != 0): ?>
|
40 |
<div id="framePayments" class="mp-col-md-6">
|
41 |
<div class="frame-tarjetas">
|
42 |
<p class="submp-title-checkout"><?=__('Payments in cash', 'woocommerce-mercadopago')?></p>
|
43 |
+
|
44 |
<?php foreach($tarjetas as $tarjeta): ?>
|
45 |
<?php if ($tarjeta['type'] != 'credit_card' && $tarjeta['type'] != 'debit_card' && $tarjeta['type'] != 'prepaid_card'): ?>
|
46 |
<img src="<?= $tarjeta['image'] ?>" class="mp-img-fluid mp-img-tarjetas" alt=""/>
|
49 |
</div>
|
50 |
</div>
|
51 |
<?php endif; ?>
|
52 |
+
|
53 |
<?php if($method == 'redirect'): ?>
|
54 |
<div class="mp-col-md-12 mp-pt-20">
|
55 |
<div class="mp-redirect-frame">
|
58 |
</div>
|
59 |
</div>
|
60 |
<?php endif; ?>
|
61 |
+
|
62 |
</div>
|
63 |
</div>
|
64 |
|
65 |
+
<script type="text/javascript" src="<?php echo $path_to_javascript; ?>?ver=<?php echo $plugin_version; ?>"></script>
|
templates/checkout/custom_checkout.php
CHANGED
@@ -72,14 +72,14 @@ if (!defined('ABSPATH')) {
|
|
72 |
<div class="mp-row-checkout mp-pt-10">
|
73 |
<div class="mp-col-md-12">
|
74 |
<label for="mp-card-number" class="mp-label-form"><?= esc_html__('Card number', 'woocommerce-mercadopago'); ?> <em>*</em></label>
|
75 |
-
<input type="text" onkeyup="
|
76 |
|
77 |
<span class="mp-error mp-mt-5" id="mp-error-205" data-main="#mp-card-number"><?= esc_html__('Card number', 'woocommerce-mercadopago'); ?></span>
|
78 |
<span class="mp-error mp-mt-5" id="mp-error-E301" data-main="#mp-card-number"><?= esc_html__('Invalid Card Number', 'woocommerce-mercadopago'); ?></span>
|
79 |
</div>
|
80 |
</div>
|
81 |
<!-- Input Name and Surname -->
|
82 |
-
<div class="mp-row-checkout mp-pt-10">
|
83 |
<div class="mp-col-md-12">
|
84 |
<label for="mp-card-holder-name" class="mp-label-form"><?= esc_html__('Name and surname of the cardholder', 'woocommerce-mercadopago'); ?> <em>*</em></label>
|
85 |
<input type="text" class="mp-form-control mp-mt-5" id="mp-card-holder-name" data-checkout="cardholderName" autocomplete="off" />
|
@@ -93,18 +93,15 @@ if (!defined('ABSPATH')) {
|
|
93 |
<!-- Input expiration date -->
|
94 |
<div class="mp-col-md-6 mp-pr-15">
|
95 |
<label for="mp-card-expiration-date" class="mp-label-form"><?= esc_html__('Expiration date', 'woocommerce-mercadopago'); ?> <em>*</em></label>
|
96 |
-
<input type="text" onkeyup="
|
97 |
<input type="hidden" id="cardExpirationMonth" data-checkout="cardExpirationMonth">
|
98 |
<input type="hidden" id="cardExpirationYear" data-checkout="cardExpirationYear">
|
99 |
<span class="mp-error mp-mt-5" id="mp-error-208" data-main="#mp-card-expiration-date"><?= esc_html__('Invalid Expiration Date', 'woocommerce-mercadopago'); ?></span>
|
100 |
-
<span class="mp-error mp-mt-5" id="mp-error-209" data-main="#mp-card-expiration-date"><?= esc_html__('Invalid Expiration Date', 'woocommerce-mercadopago'); ?></span>
|
101 |
-
<span class="mp-error mp-mt-5" id="mp-error-325" data-main="#mp-card-expiration-date"><?= esc_html__('Invalid Expiration Date', 'woocommerce-mercadopago'); ?></span>
|
102 |
-
<span class="mp-error mp-mt-5" id="mp-error-326" data-main="#mp-card-expiration-date"><?= esc_html__('Invalid Expiration Date', 'woocommerce-mercadopago'); ?></span>
|
103 |
</div>
|
104 |
<!-- Input Security Code -->
|
105 |
<div class="mp-col-md-6">
|
106 |
-
<label for="mp-security-code" class="mp-label-form"><?= esc_html__('
|
107 |
-
<input type="text" onkeyup="
|
108 |
<p class="mp-desc mp-mt-5 mp-mb-0" data-main="#mp-security-code"><?= esc_html__('Last 3 numbers on the back', 'woocommerce-mercadopago'); ?></p>
|
109 |
<span class="mp-error mp-mt-5" id="mp-error-224" data-main="#mp-security-code"><?= esc_html__('Check the informed security code.', 'woocommerce-mercadopago'); ?></span>
|
110 |
<span class="mp-error mp-mt-5" id="mp-error-E302" data-main="#mp-security-code"><?= esc_html__('Check the informed security code.', 'woocommerce-mercadopago'); ?></span>
|
@@ -166,14 +163,16 @@ if (!defined('ABSPATH')) {
|
|
166 |
<div id="mp-doc-type-div" class="mp-row-checkout mp-pt-10">
|
167 |
<!-- Select Doc Type -->
|
168 |
<div class="mp-col-md-4 mp-pr-15">
|
169 |
-
<label for="docType" class="mp-label-form
|
|
|
|
|
170 |
<select id="docType" class="mp-form-control mp-pointer mp-mt-04rem" data-checkout="docType"></select>
|
171 |
</div>
|
172 |
|
173 |
<!-- Input Doc Number -->
|
174 |
<div id="mp-doc-number-div" class="mp-col-md-8">
|
175 |
<label for="docNumber" class="mp-label-form"><?= esc_html__('Document number', 'woocommerce-mercadopago'); ?> <em>*</em></label>
|
176 |
-
<input type="text" class="mp-form-control mp-mt-
|
177 |
<p class="mp-desc mp-mt-5 mp-mb-0" data-main="#mp-security-code"><?= esc_html__('Only numbers', 'woocommerce-mercadopago'); ?></p>
|
178 |
<span class="mp-error mp-mt-5" id="mp-error-324" data-main="#docNumber"><?= esc_html__('Invalid Document Number', 'woocommerce-mercadopago'); ?></span>
|
179 |
<span class="mp-error mp-mt-5" id="mp-error-E301" data-main="#docNumber"><?= esc_html__('Invalid Document Number', 'woocommerce-mercadopago'); ?></span>
|
@@ -213,18 +212,21 @@ if (!defined('ABSPATH')) {
|
|
213 |
</div>
|
214 |
|
215 |
<script type="text/javascript">
|
216 |
-
function
|
217 |
v_obj.value = v_fun(v_obj.value)
|
218 |
}
|
219 |
|
220 |
//Card mask date input
|
221 |
-
function
|
222 |
v_obj = o
|
223 |
v_fun = f
|
224 |
-
setTimeout("
|
225 |
}
|
226 |
|
227 |
-
function
|
|
|
|
|
|
|
228 |
value = value.replace(/\D/g, "");
|
229 |
value = value.replace(/^(\d{4})(\d)/g, "$1 $2");
|
230 |
value = value.replace(/^(\d{4})\s(\d{4})(\d)/g, "$1 $2 $3");
|
@@ -232,7 +234,7 @@ if (!defined('ABSPATH')) {
|
|
232 |
return value;
|
233 |
}
|
234 |
|
235 |
-
function
|
236 |
v = v.replace(/\D/g, "");
|
237 |
v = v.replace(/(\d{2})(\d)/, "$1/$2");
|
238 |
v = v.replace(/(\d{2})(\d{2})$/, "$1$2");
|
@@ -240,13 +242,22 @@ if (!defined('ABSPATH')) {
|
|
240 |
}
|
241 |
|
242 |
// Explode date to month and year
|
243 |
-
function
|
244 |
var date = document.getElementById('mp-card-expiration-date').value.split('/');
|
245 |
document.getElementById('cardExpirationMonth').value = date[0];
|
246 |
document.getElementById('cardExpirationYear').value = date[1];
|
247 |
}
|
248 |
|
249 |
-
function
|
250 |
-
return v.replace(/\D/g, "")
|
251 |
}
|
252 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
<div class="mp-row-checkout mp-pt-10">
|
73 |
<div class="mp-col-md-12">
|
74 |
<label for="mp-card-number" class="mp-label-form"><?= esc_html__('Card number', 'woocommerce-mercadopago'); ?> <em>*</em></label>
|
75 |
+
<input type="text" onkeyup="mpCreditMaskDate(this, mpMcc);" class="mp-form-control mp-mt-5" id="mp-card-number" data-checkout="cardNumber" autocomplete="off" maxlength="23" />
|
76 |
|
77 |
<span class="mp-error mp-mt-5" id="mp-error-205" data-main="#mp-card-number"><?= esc_html__('Card number', 'woocommerce-mercadopago'); ?></span>
|
78 |
<span class="mp-error mp-mt-5" id="mp-error-E301" data-main="#mp-card-number"><?= esc_html__('Invalid Card Number', 'woocommerce-mercadopago'); ?></span>
|
79 |
</div>
|
80 |
</div>
|
81 |
<!-- Input Name and Surname -->
|
82 |
+
<div class="mp-row-checkout mp-pt-10" id="mp-card-holder-div">
|
83 |
<div class="mp-col-md-12">
|
84 |
<label for="mp-card-holder-name" class="mp-label-form"><?= esc_html__('Name and surname of the cardholder', 'woocommerce-mercadopago'); ?> <em>*</em></label>
|
85 |
<input type="text" class="mp-form-control mp-mt-5" id="mp-card-holder-name" data-checkout="cardholderName" autocomplete="off" />
|
93 |
<!-- Input expiration date -->
|
94 |
<div class="mp-col-md-6 mp-pr-15">
|
95 |
<label for="mp-card-expiration-date" class="mp-label-form"><?= esc_html__('Expiration date', 'woocommerce-mercadopago'); ?> <em>*</em></label>
|
96 |
+
<input type="text" onkeyup="mpCreditMaskDate(this, mpDate);" onblur="mpValidateMonthYear()" class="mp-form-control mp-mt-5" id="mp-card-expiration-date" data-checkout="cardExpirationDate" autocomplete="off" placeholder="MM/AAAA" maxlength="7" />
|
97 |
<input type="hidden" id="cardExpirationMonth" data-checkout="cardExpirationMonth">
|
98 |
<input type="hidden" id="cardExpirationYear" data-checkout="cardExpirationYear">
|
99 |
<span class="mp-error mp-mt-5" id="mp-error-208" data-main="#mp-card-expiration-date"><?= esc_html__('Invalid Expiration Date', 'woocommerce-mercadopago'); ?></span>
|
|
|
|
|
|
|
100 |
</div>
|
101 |
<!-- Input Security Code -->
|
102 |
<div class="mp-col-md-6">
|
103 |
+
<label for="mp-security-code" class="mp-label-form"><?= esc_html__('Security code', 'woocommerce-mercadopago'); ?> <em>*</em></label>
|
104 |
+
<input type="text" onkeyup="mpCreditMaskDate(this, mpInteger);" class="mp-form-control mp-mt-5" id="mp-security-code" data-checkout="securityCode" autocomplete="off" maxlength="4" />
|
105 |
<p class="mp-desc mp-mt-5 mp-mb-0" data-main="#mp-security-code"><?= esc_html__('Last 3 numbers on the back', 'woocommerce-mercadopago'); ?></p>
|
106 |
<span class="mp-error mp-mt-5" id="mp-error-224" data-main="#mp-security-code"><?= esc_html__('Check the informed security code.', 'woocommerce-mercadopago'); ?></span>
|
107 |
<span class="mp-error mp-mt-5" id="mp-error-E302" data-main="#mp-security-code"><?= esc_html__('Check the informed security code.', 'woocommerce-mercadopago'); ?></span>
|
163 |
<div id="mp-doc-type-div" class="mp-row-checkout mp-pt-10">
|
164 |
<!-- Select Doc Type -->
|
165 |
<div class="mp-col-md-4 mp-pr-15">
|
166 |
+
<label for="docType" class="mp-label-form">
|
167 |
+
<?= esc_html__('Type', 'woocommerce-mercadopago'); ?>
|
168 |
+
</label>
|
169 |
<select id="docType" class="mp-form-control mp-pointer mp-mt-04rem" data-checkout="docType"></select>
|
170 |
</div>
|
171 |
|
172 |
<!-- Input Doc Number -->
|
173 |
<div id="mp-doc-number-div" class="mp-col-md-8">
|
174 |
<label for="docNumber" class="mp-label-form"><?= esc_html__('Document number', 'woocommerce-mercadopago'); ?> <em>*</em></label>
|
175 |
+
<input type="text" class="mp-form-control mp-mt-04rem" id="docNumber" data-checkout="docNumber" autocomplete="off" />
|
176 |
<p class="mp-desc mp-mt-5 mp-mb-0" data-main="#mp-security-code"><?= esc_html__('Only numbers', 'woocommerce-mercadopago'); ?></p>
|
177 |
<span class="mp-error mp-mt-5" id="mp-error-324" data-main="#docNumber"><?= esc_html__('Invalid Document Number', 'woocommerce-mercadopago'); ?></span>
|
178 |
<span class="mp-error mp-mt-5" id="mp-error-E301" data-main="#docNumber"><?= esc_html__('Invalid Document Number', 'woocommerce-mercadopago'); ?></span>
|
212 |
</div>
|
213 |
|
214 |
<script type="text/javascript">
|
215 |
+
function mpCreditExecmascara() {
|
216 |
v_obj.value = v_fun(v_obj.value)
|
217 |
}
|
218 |
|
219 |
//Card mask date input
|
220 |
+
function mpCreditMaskDate(o, f) {
|
221 |
v_obj = o
|
222 |
v_fun = f
|
223 |
+
setTimeout("mpCreditExecmascara()", 1);
|
224 |
}
|
225 |
|
226 |
+
function mpMcc(value) {
|
227 |
+
if(mpIsMobile()){
|
228 |
+
return value;
|
229 |
+
}
|
230 |
value = value.replace(/\D/g, "");
|
231 |
value = value.replace(/^(\d{4})(\d)/g, "$1 $2");
|
232 |
value = value.replace(/^(\d{4})\s(\d{4})(\d)/g, "$1 $2 $3");
|
234 |
return value;
|
235 |
}
|
236 |
|
237 |
+
function mpDate(v) {
|
238 |
v = v.replace(/\D/g, "");
|
239 |
v = v.replace(/(\d{2})(\d)/, "$1/$2");
|
240 |
v = v.replace(/(\d{2})(\d{2})$/, "$1$2");
|
242 |
}
|
243 |
|
244 |
// Explode date to month and year
|
245 |
+
function mpValidateMonthYear() {
|
246 |
var date = document.getElementById('mp-card-expiration-date').value.split('/');
|
247 |
document.getElementById('cardExpirationMonth').value = date[0];
|
248 |
document.getElementById('cardExpirationYear').value = date[1];
|
249 |
}
|
250 |
|
251 |
+
function mpInteger(v) {
|
252 |
+
return v.replace(/\D/g, "");
|
253 |
}
|
254 |
+
|
255 |
+
function mpIsMobile() {
|
256 |
+
try{
|
257 |
+
document.createEvent("TouchEvent");
|
258 |
+
return true;
|
259 |
+
}catch(e){
|
260 |
+
return false;
|
261 |
+
}
|
262 |
+
}
|
263 |
+
</script>
|
templates/checkout/ticket_checkout.php
CHANGED
@@ -9,7 +9,7 @@ if (!defined('ABSPATH')) {
|
|
9 |
|
10 |
<!-- Cupom mode, creat a campaign on mercado pago -->
|
11 |
<?php if ($coupon_mode == 'yes') : ?>
|
12 |
-
<div id="mercadopago-form-coupon-ticket" class="mp-col-md-12">
|
13 |
<div class="frame-tarjetas mp-text-justify">
|
14 |
<p class="mp-subtitle-ticket-checkout"><?=__('Enter your discount coupon', 'woocommerce-mercadopago')?></p>
|
15 |
|
@@ -32,6 +32,33 @@ if (!defined('ABSPATH')) {
|
|
32 |
<div class="frame-tarjetas">
|
33 |
<div id="mercadopago-form-ticket">
|
34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
<?php if($site_id == "MLB"): ?>
|
36 |
<div id="form-ticket">
|
37 |
<div class="mp-row-checkout">
|
@@ -67,9 +94,9 @@ if (!defined('ABSPATH')) {
|
|
67 |
<div class="mp-col-md-4" id="box-docnumber">
|
68 |
<label for="cpfcnpj" id="mp_cpf_label" class="mp-label-form title-cpf"><?= esc_html__('CPF', 'woocommerce-mercadopago'); ?> <em>*</em></label>
|
69 |
<label for="cpfcnpj" id="mp_cnpj_label" class="title-cnpj mp-label-form"><?= esc_html__('CNPJ', 'woocommerce-mercadopago'); ?><em>*</em></label>
|
70 |
-
<input type="text" class="mp-form-control" value="<?= $febraban['docNumber']; ?>" id="mp_doc_number" data-checkout="mp_doc_number" name="mercadopago_ticket[docNumber]" onkeyup="
|
71 |
<span class="mp-erro_febraban" data-main="#mp_doc_number"><?= esc_html__('You must provide your document number', 'woocommerce-mercadopago'); ?></span>
|
72 |
-
<span class="mp_error_docnumber" id="mp_error_docnumber"><?= esc_html__('
|
73 |
</div>
|
74 |
</div>
|
75 |
|
@@ -82,7 +109,7 @@ if (!defined('ABSPATH')) {
|
|
82 |
|
83 |
<div class="mp-col-md-4">
|
84 |
<label for="number" class="mp-label-form"><?= esc_html__('Number', 'woocommerce-mercadopago'); ?> <em>*</em></label>
|
85 |
-
<input type="text" value="<?= $febraban['number']; ?>" class="mp-form-control" id="mp_number" data-checkout="mp_number" name="mercadopago_ticket[number]" onkeyup="
|
86 |
<span class="mp-erro_febraban" data-main="#mp_number" id="error_number"><?= esc_html__('You must provide your address number', 'woocommerce-mercadopago'); ?></span>
|
87 |
</div>
|
88 |
</div>
|
@@ -133,7 +160,7 @@ if (!defined('ABSPATH')) {
|
|
133 |
|
134 |
<div class="mp-col-md-4">
|
135 |
<label for="zipcode" class="mp-label-form"><?= esc_html__('Postal Code', 'woocommerce-mercadopago'); ?> <em>*</em></label>
|
136 |
-
<input type="text" value="<?= $febraban['zipcode']; ?>" id="mp_zipcode" data-checkout="mp_zipcode" class="mp-form-control" name="mercadopago_ticket[zipcode]" maxlength="9" onkeyup="
|
137 |
<span class="mp-erro_febraban" data-main="#mp_zipcode" id="error_zipcode"><?= esc_html__('You must provide your zip code', 'woocommerce-mercadopago'); ?></span>
|
138 |
</div>
|
139 |
</div>
|
@@ -191,40 +218,40 @@ if (!defined('ABSPATH')) {
|
|
191 |
|
192 |
<script type="text/javascript">
|
193 |
//Card mask date input
|
194 |
-
function
|
195 |
v_obj = o
|
196 |
v_fun = f
|
197 |
-
setTimeout("
|
198 |
}
|
199 |
|
200 |
-
function
|
201 |
v_obj.value = v_fun(v_obj.value)
|
202 |
}
|
203 |
|
204 |
-
function
|
205 |
return v.replace(/\D/g, "")
|
206 |
}
|
207 |
-
|
208 |
-
function
|
209 |
-
v=v.replace(/\D/g,"")
|
210 |
-
v=v.replace(/(\d{3})(\d)/,"$1.$2")
|
211 |
-
v=v.replace(/(\d{3})(\d)/,"$1.$2")
|
212 |
-
v=v.replace(/(\d{3})(\d{1,2})$/,"$1-$2")
|
213 |
return v
|
214 |
}
|
215 |
|
216 |
-
function
|
217 |
-
v=v.replace(/\D/g,"")
|
218 |
-
v=v.replace(/^(\d{2})(\d)/,"$1.$2")
|
219 |
-
v=v.replace(/^(\d{2})\.(\d{3})(\d)/,"$1.$2.$3")
|
220 |
-
v=v.replace(/\.(\d{3})(\d)/,".$1/$2")
|
221 |
-
v=v.replace(/(\d{4})(\d)/,"$1-$2")
|
222 |
return v
|
223 |
}
|
224 |
|
225 |
-
function
|
226 |
-
v=v.replace(/D/g,"")
|
227 |
-
v=v.replace(/^(\d{5})(\d)/,"$1-$2")
|
228 |
return v
|
229 |
}
|
230 |
-
</script>
|
9 |
|
10 |
<!-- Cupom mode, creat a campaign on mercado pago -->
|
11 |
<?php if ($coupon_mode == 'yes') : ?>
|
12 |
+
<div id="mercadopago-form-coupon-ticket" class="mp-col-md-12 mp-pb-20">
|
13 |
<div class="frame-tarjetas mp-text-justify">
|
14 |
<p class="mp-subtitle-ticket-checkout"><?=__('Enter your discount coupon', 'woocommerce-mercadopago')?></p>
|
15 |
|
32 |
<div class="frame-tarjetas">
|
33 |
<div id="mercadopago-form-ticket">
|
34 |
|
35 |
+
<?php if($site_id == "MLU"): ?>
|
36 |
+
<div id="form-ticket">
|
37 |
+
<div class="mp-row-checkout">
|
38 |
+
<p class="mp-subtitle-custom-checkout"><?= __('Enter your document number', 'woocommerce-mercadopago') ?></p>
|
39 |
+
<div class="mp-col-md-4 mp-pr-15">
|
40 |
+
<label for="mp-docType" class="mp-label-form mp-pt-5"><?= esc_html__('Type', 'woocommerce-mercadopago'); ?></label>
|
41 |
+
<select id="mp-docType" class="form-control mp-form-control mp-select mp-pointer" name="mercadopago_ticket[docType]">
|
42 |
+
<option value="CI" selected><?= esc_html__('CI', 'woocommerce-mercadopago'); ?></option>
|
43 |
+
</select>
|
44 |
+
</div>
|
45 |
+
<div class="mp-col-md-8" id="box-docnumber">
|
46 |
+
<label for="cpfcnpj" id="mp_cpf_label" class="mp-label-form title-cpf"><?= esc_html__('Document number', 'woocommerce-mercadopago'); ?> <em>*</em></label>
|
47 |
+
<input type="text" class="mp-form-control" id="mp_doc_number" data-checkout="mp_doc_number" name="mercadopago_ticket[docNumber]" onkeyup="mpMaskInput(this, mpTicketInteger);" autocomplete="off" maxlength="8">
|
48 |
+
<span class="mp-erro_febraban" data-main="#mp_doc_number"><?= esc_html__('You must provide your document number', 'woocommerce-mercadopago'); ?></span>
|
49 |
+
<span class="mp_error_docnumber" id="mp_error_docnumber"><?= esc_html__('Invalid Document Number', 'woocommerce-mercadopago'); ?></span>
|
50 |
+
</div>
|
51 |
+
</div>
|
52 |
+
<div class="mp-col-md-12 mp-pt-10">
|
53 |
+
<div class="frame-tarjetas">
|
54 |
+
<div class="mp-row-checkout">
|
55 |
+
<p class="mp-obrigatory"><?= esc_html__('Complete all fields, they are mandatory.', 'woocommerce-mercadopago'); ?></p>
|
56 |
+
</div>
|
57 |
+
</div>
|
58 |
+
</div>
|
59 |
+
</div>
|
60 |
+
<?php endif; ?>
|
61 |
+
|
62 |
<?php if($site_id == "MLB"): ?>
|
63 |
<div id="form-ticket">
|
64 |
<div class="mp-row-checkout">
|
94 |
<div class="mp-col-md-4" id="box-docnumber">
|
95 |
<label for="cpfcnpj" id="mp_cpf_label" class="mp-label-form title-cpf"><?= esc_html__('CPF', 'woocommerce-mercadopago'); ?> <em>*</em></label>
|
96 |
<label for="cpfcnpj" id="mp_cnpj_label" class="title-cnpj mp-label-form"><?= esc_html__('CNPJ', 'woocommerce-mercadopago'); ?><em>*</em></label>
|
97 |
+
<input type="text" class="mp-form-control" value="<?= $febraban['docNumber']; ?>" id="mp_doc_number" data-checkout="mp_doc_number" name="mercadopago_ticket[docNumber]" onkeyup="mpMaskInput(this, mpCpf);" maxlength="14">
|
98 |
<span class="mp-erro_febraban" data-main="#mp_doc_number"><?= esc_html__('You must provide your document number', 'woocommerce-mercadopago'); ?></span>
|
99 |
+
<span class="mp_error_docnumber" id="mp_error_docnumber"><?= esc_html__('Invalid Document Number', 'woocommerce-mercadopago'); ?></span>
|
100 |
</div>
|
101 |
</div>
|
102 |
|
109 |
|
110 |
<div class="mp-col-md-4">
|
111 |
<label for="number" class="mp-label-form"><?= esc_html__('Number', 'woocommerce-mercadopago'); ?> <em>*</em></label>
|
112 |
+
<input type="text" value="<?= $febraban['number']; ?>" class="mp-form-control" id="mp_number" data-checkout="mp_number" name="mercadopago_ticket[number]" onkeyup="mpMaskInput(this, mpTicketInteger);">
|
113 |
<span class="mp-erro_febraban" data-main="#mp_number" id="error_number"><?= esc_html__('You must provide your address number', 'woocommerce-mercadopago'); ?></span>
|
114 |
</div>
|
115 |
</div>
|
160 |
|
161 |
<div class="mp-col-md-4">
|
162 |
<label for="zipcode" class="mp-label-form"><?= esc_html__('Postal Code', 'woocommerce-mercadopago'); ?> <em>*</em></label>
|
163 |
+
<input type="text" value="<?= $febraban['zipcode']; ?>" id="mp_zipcode" data-checkout="mp_zipcode" class="mp-form-control" name="mercadopago_ticket[zipcode]" maxlength="9" onkeyup="mpMaskInput(this, mpCep);">
|
164 |
<span class="mp-erro_febraban" data-main="#mp_zipcode" id="error_zipcode"><?= esc_html__('You must provide your zip code', 'woocommerce-mercadopago'); ?></span>
|
165 |
</div>
|
166 |
</div>
|
218 |
|
219 |
<script type="text/javascript">
|
220 |
//Card mask date input
|
221 |
+
function mpMaskInput(o, f) {
|
222 |
v_obj = o
|
223 |
v_fun = f
|
224 |
+
setTimeout("mpTicketExecmascara()", 1);
|
225 |
}
|
226 |
|
227 |
+
function mpTicketExecmascara() {
|
228 |
v_obj.value = v_fun(v_obj.value)
|
229 |
}
|
230 |
|
231 |
+
function mpTicketInteger(v) {
|
232 |
return v.replace(/\D/g, "")
|
233 |
}
|
234 |
+
|
235 |
+
function mpCpf(v){
|
236 |
+
v=v.replace(/\D/g,"")
|
237 |
+
v=v.replace(/(\d{3})(\d)/,"$1.$2")
|
238 |
+
v=v.replace(/(\d{3})(\d)/,"$1.$2")
|
239 |
+
v=v.replace(/(\d{3})(\d{1,2})$/,"$1-$2")
|
240 |
return v
|
241 |
}
|
242 |
|
243 |
+
function mpCnpj(v){
|
244 |
+
v=v.replace(/\D/g,"")
|
245 |
+
v=v.replace(/^(\d{2})(\d)/,"$1.$2")
|
246 |
+
v=v.replace(/^(\d{2})\.(\d{3})(\d)/,"$1.$2.$3")
|
247 |
+
v=v.replace(/\.(\d{3})(\d)/,".$1/$2")
|
248 |
+
v=v.replace(/(\d{4})(\d)/,"$1-$2")
|
249 |
return v
|
250 |
}
|
251 |
|
252 |
+
function mpCep(v){
|
253 |
+
v=v.replace(/D/g,"")
|
254 |
+
v=v.replace(/^(\d{5})(\d)/,"$1-$2")
|
255 |
return v
|
256 |
}
|
257 |
+
</script>
|
woocommerce-mercadopago.php
CHANGED
@@ -1,28 +1,53 @@
|
|
1 |
<?php
|
|
|
2 |
/**
|
3 |
* Plugin Name: Mercado Pago payments for WooCommerce
|
4 |
* Plugin URI: https://github.com/mercadopago/cart-woocommerce
|
5 |
* Description: Configure the payment options and accept payments with cards, ticket and money of Mercado Pago account.
|
6 |
-
* Version: 4.
|
7 |
* Author: Mercado Pago
|
8 |
-
* Author URI: https://
|
9 |
* Text Domain: woocommerce-mercadopago
|
10 |
* Domain Path: /i18n/languages/
|
11 |
* WC requires at least: 3.0.0
|
12 |
-
* WC tested up to:
|
13 |
-
*
|
14 |
* @package MercadoPago
|
15 |
* @category Core
|
16 |
* @author Mercado Pago
|
17 |
*/
|
18 |
|
|
|
19 |
// Exit if accessed directly.
|
20 |
if (!defined('ABSPATH')) {
|
21 |
exit;
|
22 |
}
|
23 |
|
24 |
-
if (
|
25 |
-
define(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
}
|
27 |
|
28 |
/**
|
@@ -35,16 +60,17 @@ if ( ! defined( 'WC_MERCADOPAGO_BASENAME' ) ) {
|
|
35 |
function woocommerce_mercadopago_load_plugin_textdomain()
|
36 |
{
|
37 |
$text_domain = 'woocommerce-mercadopago';
|
38 |
-
$locale = apply_filters(
|
39 |
-
|
40 |
-
$original_language_file = dirname(__FILE__) . '/i18n/languages/woocommerce-mercadopago-'. $locale .'.mo';
|
41 |
-
|
42 |
// Unload the translation for the text domain of the plugin
|
43 |
unload_textdomain($text_domain);
|
44 |
// Load first the override file
|
45 |
-
load_textdomain($text_domain, $original_language_file
|
46 |
}
|
47 |
-
|
|
|
48 |
|
49 |
/**
|
50 |
* Notice about unsupported PHP version.
|
@@ -55,7 +81,7 @@ function wc_mercado_pago_unsupported_php_version_notice()
|
|
55 |
{
|
56 |
$type = 'error';
|
57 |
$message = esc_html__('Mercado Pago payments for WooCommerce requires PHP version 5.6 or later. Please update your PHP version.', 'woocommerce-mercadopago');
|
58 |
-
echo
|
59 |
}
|
60 |
|
61 |
// Check for PHP version and throw notice.
|
@@ -68,15 +94,15 @@ if (version_compare(PHP_VERSION, '5.6', '<=')) {
|
|
68 |
* Curl validation
|
69 |
*/
|
70 |
function wc_mercado_pago_notify_curl_error()
|
71 |
-
{
|
72 |
$type = 'error';
|
73 |
$message = __('Mercado Pago Error: PHP Extension CURL is not installed.', 'woocommerce-mercadopago');
|
74 |
-
echo
|
75 |
}
|
76 |
|
77 |
if (!in_array('curl', get_loaded_extensions())) {
|
78 |
-
|
79 |
-
|
80 |
}
|
81 |
|
82 |
/**
|
@@ -87,55 +113,55 @@ function notify_woocommerce_miss()
|
|
87 |
{
|
88 |
$type = 'error';
|
89 |
$message = sprintf(
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
echo
|
94 |
}
|
95 |
|
96 |
-
|
97 |
-
if (!stripos(implode($all_plugins), 'woocommerce.php')) {
|
98 |
-
add_action('admin_notices', 'notify_woocommerce_miss');
|
99 |
-
return;
|
100 |
-
}
|
101 |
|
102 |
-
|
103 |
-
* Summary: Places a warning error to notify user that other older versions are active.
|
104 |
-
* Description: Places a warning error to notify user that other older versions are active.
|
105 |
-
* @since 3.0.7
|
106 |
-
*/
|
107 |
-
function wc_mercado_pago_notify_deprecated_presence()
|
108 |
{
|
109 |
-
|
110 |
-
|
111 |
-
'</p></div>';
|
112 |
-
}
|
113 |
|
114 |
-
//
|
115 |
-
if (class_exists('
|
116 |
-
|
117 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
}
|
119 |
|
120 |
-
|
121 |
-
|
|
|
|
|
|
|
122 |
|
123 |
-
|
124 |
-
|
|
|
|
|
|
|
125 |
{
|
126 |
-
|
127 |
-
|
128 |
-
require_once dirname(__FILE__) . '/includes/module/WC_WooMercadoPago_Configs.php';
|
129 |
-
require_once dirname(__FILE__) . '/includes/module/log/WC_WooMercadoPago_Log.php';
|
130 |
-
require_once dirname(__FILE__) . '/includes/module/WC_WooMercadoPago_Module.php';
|
131 |
-
require_once dirname(__FILE__) . '/includes/module/WC_WooMercadoPago_Credentials.php';
|
132 |
-
|
133 |
-
add_action('woocommerce_order_actions', 'add_mp_order_meta_box_actions');
|
134 |
-
function add_mp_order_meta_box_actions($actions)
|
135 |
-
{
|
136 |
-
$actions['cancel_order'] = __('Cancel order', 'woocommerce-mercadopago');
|
137 |
-
return $actions;
|
138 |
}
|
139 |
|
140 |
-
|
|
|
|
|
|
|
|
|
141 |
}
|
1 |
<?php
|
2 |
+
|
3 |
/**
|
4 |
* Plugin Name: Mercado Pago payments for WooCommerce
|
5 |
* Plugin URI: https://github.com/mercadopago/cart-woocommerce
|
6 |
* Description: Configure the payment options and accept payments with cards, ticket and money of Mercado Pago account.
|
7 |
+
* Version: 4.2.0
|
8 |
* Author: Mercado Pago
|
9 |
+
* Author URI: https://developers.mercadopago.com/
|
10 |
* Text Domain: woocommerce-mercadopago
|
11 |
* Domain Path: /i18n/languages/
|
12 |
* WC requires at least: 3.0.0
|
13 |
+
* WC tested up to: 4.1.0
|
|
|
14 |
* @package MercadoPago
|
15 |
* @category Core
|
16 |
* @author Mercado Pago
|
17 |
*/
|
18 |
|
19 |
+
|
20 |
// Exit if accessed directly.
|
21 |
if (!defined('ABSPATH')) {
|
22 |
exit;
|
23 |
}
|
24 |
|
25 |
+
if (!defined('WC_MERCADOPAGO_BASENAME')) {
|
26 |
+
define('WC_MERCADOPAGO_BASENAME', plugin_basename(__FILE__));
|
27 |
+
}
|
28 |
+
|
29 |
+
if (!function_exists('is_plugin_active')) {
|
30 |
+
include_once ABSPATH . 'wp-admin/includes/plugin.php';
|
31 |
+
}
|
32 |
+
/**
|
33 |
+
* Summary: Places a warning error to notify user that other older versions are active.
|
34 |
+
* Description: Places a warning error to notify user that other older versions are active.
|
35 |
+
* @since 3.0.7
|
36 |
+
*/
|
37 |
+
function wc_mercado_pago_notify_deprecated_presence()
|
38 |
+
{
|
39 |
+
echo '<div class="error"><p>' .
|
40 |
+
__('It seems that you already have the Mercado Pago module installed. Please uninstall it before using this version.', 'woocommerce-mercadopago') .
|
41 |
+
'</p></div>';
|
42 |
+
}
|
43 |
+
|
44 |
+
// Check if previously versions are installed, as we can't let both operate.
|
45 |
+
if (class_exists('WC_WooMercadoPago_Module')) {
|
46 |
+
add_action('admin_notices', 'wc_mercado_pago_notify_deprecated_presence');
|
47 |
+
return;
|
48 |
+
} else {
|
49 |
+
require_once dirname(__FILE__) . '/includes/admin/notices/WC_WooMercadoPago_Notices.php';
|
50 |
+
WC_WooMercadoPago_Notices::initMercadopagoNnotice();
|
51 |
}
|
52 |
|
53 |
/**
|
60 |
function woocommerce_mercadopago_load_plugin_textdomain()
|
61 |
{
|
62 |
$text_domain = 'woocommerce-mercadopago';
|
63 |
+
$locale = apply_filters('plugin_locale', get_locale(), $text_domain);
|
64 |
+
|
65 |
+
$original_language_file = dirname(__FILE__) . '/i18n/languages/woocommerce-mercadopago-' . $locale . '.mo';
|
66 |
+
|
67 |
// Unload the translation for the text domain of the plugin
|
68 |
unload_textdomain($text_domain);
|
69 |
// Load first the override file
|
70 |
+
load_textdomain($text_domain, $original_language_file);
|
71 |
}
|
72 |
+
|
73 |
+
add_action('plugins_loaded', 'woocommerce_mercadopago_load_plugin_textdomain');
|
74 |
|
75 |
/**
|
76 |
* Notice about unsupported PHP version.
|
81 |
{
|
82 |
$type = 'error';
|
83 |
$message = esc_html__('Mercado Pago payments for WooCommerce requires PHP version 5.6 or later. Please update your PHP version.', 'woocommerce-mercadopago');
|
84 |
+
echo WC_WooMercadoPago_Notices::getAlertFrame($message, $type);
|
85 |
}
|
86 |
|
87 |
// Check for PHP version and throw notice.
|
94 |
* Curl validation
|
95 |
*/
|
96 |
function wc_mercado_pago_notify_curl_error()
|
97 |
+
{
|
98 |
$type = 'error';
|
99 |
$message = __('Mercado Pago Error: PHP Extension CURL is not installed.', 'woocommerce-mercadopago');
|
100 |
+
echo WC_WooMercadoPago_Notices::getAlertFrame($message, $type);
|
101 |
}
|
102 |
|
103 |
if (!in_array('curl', get_loaded_extensions())) {
|
104 |
+
add_action('admin_notices', 'wc_mercado_pago_notify_curl_error');
|
105 |
+
return;
|
106 |
}
|
107 |
|
108 |
/**
|
113 |
{
|
114 |
$type = 'error';
|
115 |
$message = sprintf(
|
116 |
+
__('The Mercado Pago module needs an active version of %s in order to work!', 'woocommerce-mercadopago'),
|
117 |
+
' <a href="https://wordpress.org/extend/plugins/woocommerce/">WooCommerce</a>'
|
118 |
+
);
|
119 |
+
echo WC_WooMercadoPago_Notices::getAlertWocommerceMiss($message, $type);
|
120 |
}
|
121 |
|
122 |
+
add_action('plugins_loaded', 'woocommerce_mercadopago_init');
|
|
|
|
|
|
|
|
|
123 |
|
124 |
+
function woocommerce_mercadopago_init()
|
|
|
|
|
|
|
|
|
|
|
125 |
{
|
126 |
+
// Load Mercado Pago SDK
|
127 |
+
require_once dirname(__FILE__) . '/includes/module/sdk/lib/MP.php';
|
|
|
|
|
128 |
|
129 |
+
// Checks with WooCommerce is installed.
|
130 |
+
if (class_exists('WC_Payment_Gateway')) {
|
131 |
+
require_once dirname(__FILE__) . '/includes/module/config/WC_WooMercadoPago_Constants.php';
|
132 |
+
require_once dirname(__FILE__) . '/includes/module/WC_WooMercadoPago_Exception.php';
|
133 |
+
require_once dirname(__FILE__) . '/includes/module/WC_WooMercadoPago_Configs.php';
|
134 |
+
require_once dirname(__FILE__) . '/includes/module/log/WC_WooMercadoPago_Log.php';
|
135 |
+
require_once dirname(__FILE__) . '/includes/module/WC_WooMercadoPago_Module.php';
|
136 |
+
require_once dirname(__FILE__) . '/includes/module/WC_WooMercadoPago_Credentials.php';
|
137 |
+
|
138 |
+
WC_WooMercadoPago_Module::init_mercado_pago_class();
|
139 |
+
|
140 |
+
add_action('woocommerce_order_actions', 'add_mp_order_meta_box_actions');
|
141 |
+
} else {
|
142 |
+
add_action('admin_notices', 'notify_woocommerce_miss');
|
143 |
+
}
|
144 |
}
|
145 |
|
146 |
+
function add_mp_order_meta_box_actions($actions)
|
147 |
+
{
|
148 |
+
$actions['cancel_order'] = __('Cancel order', 'woocommerce-mercadopago');
|
149 |
+
return $actions;
|
150 |
+
}
|
151 |
|
152 |
+
add_action('woocommerce_settings_checkout', 'mp_show_admin_notices');
|
153 |
+
/**
|
154 |
+
*
|
155 |
+
*/
|
156 |
+
function mp_show_admin_notices()
|
157 |
{
|
158 |
+
if (!WC_WooMercadoPago_Module::isWcNewVersion() || (isset($_GET['page']) && $_GET['page'] == "wc-settings") && is_plugin_active('woocommerce-admin/woocommerce-admin.php')) {
|
159 |
+
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
}
|
161 |
|
162 |
+
$noticesArray = WC_WooMercadoPago_Module::$notices;
|
163 |
+
$notices = array_unique($noticesArray, SORT_STRING);
|
164 |
+
foreach ($notices as $notice) {
|
165 |
+
echo $notice;
|
166 |
+
}
|
167 |
}
|