WooCommerce MercadoPago - Version 4.1.0

Version Description

Download this release

Release Info

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

Code changes from version 4.0.8 to 4.1.0

Files changed (64) hide show
  1. assets/css/basic_checkout_mercadopago.css +55 -1
  2. assets/css/config_mercadopago.css +112 -38
  3. assets/images/mercadopago.png +0 -0
  4. assets/images/minilogo.png +0 -0
  5. assets/images/mplogo.png +0 -0
  6. assets/js/basic_config_mercadopago.js +10 -4
  7. assets/js/credit-card.js +643 -986
  8. assets/js/custom_config_mercadopago.js +9 -4
  9. assets/js/ticket.js +395 -546
  10. assets/js/ticket_config_mercadopago.js +11 -6
  11. i18n/languages/woocommerce-mercadopago-es_AR.mo +0 -0
  12. i18n/languages/woocommerce-mercadopago-es_AR.po +95 -91
  13. i18n/languages/woocommerce-mercadopago-es_CL.mo +0 -0
  14. i18n/languages/woocommerce-mercadopago-es_CL.po +95 -91
  15. i18n/languages/woocommerce-mercadopago-es_CO.mo +0 -0
  16. i18n/languages/woocommerce-mercadopago-es_CO.po +95 -91
  17. i18n/languages/woocommerce-mercadopago-es_ES.mo +0 -0
  18. i18n/languages/woocommerce-mercadopago-es_ES.po +115 -91
  19. i18n/languages/woocommerce-mercadopago-es_MX.mo +0 -0
  20. i18n/languages/woocommerce-mercadopago-es_MX.po +95 -91
  21. i18n/languages/woocommerce-mercadopago-es_PE.mo +0 -0
  22. i18n/languages/woocommerce-mercadopago-es_PE.po +95 -91
  23. i18n/languages/woocommerce-mercadopago-es_UY.mo +0 -0
  24. i18n/languages/woocommerce-mercadopago-es_UY.po +95 -91
  25. i18n/languages/woocommerce-mercadopago-es_VE.mo +0 -0
  26. i18n/languages/woocommerce-mercadopago-es_VE.po +95 -91
  27. i18n/languages/woocommerce-mercadopago-pt_BR.mo +0 -0
  28. i18n/languages/woocommerce-mercadopago-pt_BR.po +108 -84
  29. i18n/languages/woocommerce-mercadopago.pot +72 -34
  30. includes/admin/WC_MercadoEnvios_Admin_Orders.php +0 -75
  31. includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php +425 -0
  32. includes/module/WC_WooMercadoPago_Configs.php +51 -36
  33. includes/module/WC_WooMercadoPago_Credentials.php +29 -16
  34. includes/module/WC_WooMercadoPago_Module.php +37 -80
  35. includes/module/config/WC_WooMercadoPago_Constants.php +3 -3
  36. includes/module/preference/WC_WooMercadoPago_PreferenceAbstract.php +78 -52
  37. includes/module/preference/WC_WooMercadoPago_PreferenceBasic.php +8 -16
  38. includes/module/preference/WC_WooMercadoPago_PreferenceCustom.php +8 -30
  39. includes/module/preference/WC_WooMercadoPago_PreferenceTicket.php +27 -22
  40. includes/module/sdk/lib/MP.php +733 -713
  41. includes/module/sdk/lib/RestClient/AbstractRestClient.php +8 -6
  42. includes/module/sdk/lib/RestClient/MeliRestClient.php +0 -4
  43. includes/notification/WC_WooMercadoPago_Notification_Abstract.php +8 -7
  44. includes/notification/WC_WooMercadoPago_Notification_IPN.php +11 -147
  45. includes/notification/WC_WooMercadoPago_Notification_Webhook.php +10 -5
  46. includes/payments/WC_WooMercadoPago_BasicGateway.php +51 -17
  47. includes/payments/WC_WooMercadoPago_CustomGateway.php +83 -66
  48. includes/payments/WC_WooMercadoPago_PaymentAbstract.php +157 -96
  49. includes/payments/WC_WooMercadoPago_TicketGateway.php +91 -39
  50. includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php +40 -25
  51. includes/payments/hooks/WC_WooMercadoPago_Hook_Basic.php +2 -12
  52. includes/payments/hooks/WC_WooMercadoPago_Hook_Custom.php +38 -3
  53. includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php +39 -4
  54. includes/payments/mercadoenvios/WC_WooMercadoPago_Product_Recurrent.php +0 -241
  55. includes/shipment/WC_MercadoEnvios_Package.php +0 -266
  56. includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php +0 -330
  57. includes/shipment/WC_MercadoEnvios_Shipping_Express.php +0 -35
  58. includes/shipment/WC_MercadoEnvios_Shipping_Normal.php +0 -35
  59. readme.txt +45 -12
  60. templates/checkout/basic_checkout.php +2 -0
  61. templates/checkout/custom_checkout.php +93 -1226
  62. templates/checkout/pse_checkout.php +0 -0
  63. templates/checkout/ticket_checkout.php +93 -73
  64. woocommerce-mercadopago.php +40 -3
assets/css/basic_checkout_mercadopago.css CHANGED
@@ -54,6 +54,14 @@
54
  margin-top: 0.3rem !important;
55
  }
56
 
 
 
 
 
 
 
 
 
57
  .mp-mt-06rem{
58
  margin-top: 0.6rem !important;
59
  }
@@ -210,6 +218,7 @@
210
  position: relative !important;
211
  right: 0px !important;
212
  border: inherit !important;
 
213
  }
214
 
215
  .mp-img-redirect{
@@ -221,6 +230,7 @@
221
  position: relative !important;
222
  right: 0px !important;
223
  border: inherit !important;
 
224
  }
225
 
226
  .mp-img-ticket {
@@ -342,6 +352,7 @@
342
  line-height: 1.29;
343
  letter-spacing: normal;
344
  color: #f04449 !important;
 
345
  }
346
 
347
  .mp-desc {
@@ -382,6 +393,8 @@
382
  font-size: 18px !important;
383
  color: #f04449 !important;
384
  font-family: "Merriweather, Georgia";
 
 
385
  }
386
 
387
  .mp-obrigatory {
@@ -469,7 +482,7 @@
469
  }
470
 
471
  /* ----- Ticket ----- */
472
- .mp-erro_febraban {
473
  font-family: sans-serif !important;
474
  font-size: 12px !important;
475
  font-weight: normal !important;
@@ -478,6 +491,8 @@
478
  line-height: 1.29;
479
  letter-spacing: normal;
480
  color: #f04449 !important;
 
 
481
  }
482
 
483
  .mp-subtitle-ticket-checkout {
@@ -524,4 +539,43 @@
524
  line-height: 1.25;
525
  letter-spacing: normal;
526
  color: #868686;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
527
  }
54
  margin-top: 0.3rem !important;
55
  }
56
 
57
+ .mp-mt-04rem{
58
+ margin-top: 0.4rem !important;
59
+ }
60
+
61
+ .mp-mt-05rem{
62
+ margin-top: 0.5rem !important;
63
+ }
64
+
65
  .mp-mt-06rem{
66
  margin-top: 0.6rem !important;
67
  }
218
  position: relative !important;
219
  right: 0px !important;
220
  border: inherit !important;
221
+ display: inline-block !important;
222
  }
223
 
224
  .mp-img-redirect{
230
  position: relative !important;
231
  right: 0px !important;
232
  border: inherit !important;
233
+ display: inline-block !important;
234
  }
235
 
236
  .mp-img-ticket {
352
  line-height: 1.29;
353
  letter-spacing: normal;
354
  color: #f04449 !important;
355
+ display: none;
356
  }
357
 
358
  .mp-desc {
393
  font-size: 18px !important;
394
  color: #f04449 !important;
395
  font-family: "Merriweather, Georgia";
396
+ position: absolute;
397
+ margin: -3px 0 0 3px;
398
  }
399
 
400
  .mp-obrigatory {
482
  }
483
 
484
  /* ----- Ticket ----- */
485
+ .mp-erro_febraban, .mp_error_docnumber {
486
  font-family: sans-serif !important;
487
  font-size: 12px !important;
488
  font-weight: normal !important;
491
  line-height: 1.29;
492
  letter-spacing: normal;
493
  color: #f04449 !important;
494
+ margin-top: 5px;
495
+ display: none;
496
  }
497
 
498
  .mp-subtitle-ticket-checkout {
539
  line-height: 1.25;
540
  letter-spacing: normal;
541
  color: #868686;
542
+ }
543
+
544
+ #mp_socialname_label{
545
+ display: none;
546
+ }
547
+
548
+ #mp_cnpj_label{
549
+ display: none;
550
+ }
551
+
552
+ #mp-doc-div {
553
+ display: none;
554
+ }
555
+
556
+ #mp-doc-type-div {
557
+ display: none;
558
+ }
559
+
560
+ #mp-doc-number-div {
561
+ display: none;
562
+ }
563
+
564
+ #mp-issuer-div {
565
+ display: none;
566
+ }
567
+
568
+ .mp-discount {
569
+ border-style: solid;
570
+ border-width: thin;
571
+ border-color: #009EE3;
572
+ padding: 8px 8px 8px 8px;
573
+ margin-top: 20px;
574
+ text-transform: uppercase;
575
+ font-size: 12px;
576
+ color: #333333;
577
+ display: none;
578
+ font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
579
+ clear: both;
580
+ float: left;
581
  }
assets/css/config_mercadopago.css CHANGED
@@ -19,14 +19,38 @@
19
  margin-top: -10px !important;
20
  }
21
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  .mp-mt-5 {
23
- margin-top: 5px;
 
 
 
 
24
  }
25
 
26
  .mp-mb-0 {
27
  margin-bottom: 0px !important;
28
  }
29
 
 
 
 
 
 
 
 
 
30
  .mp-mg-0 {
31
  margin: 0px !important;
32
  }
@@ -55,13 +79,13 @@
55
  float: left;
56
  }
57
 
58
- .col-md-2 {
59
  width: 20%;
60
  float: left;
61
  }
62
 
63
  .mp-mouse_pointer {
64
- cursor: pointer;
65
  }
66
 
67
  #mp_field_text {
@@ -104,7 +128,6 @@
104
 
105
  .mp_subtitle {
106
  font-size: 18px !important;
107
- margin-bottom: 0px !important;
108
  }
109
 
110
  .mp_subtitle_bd {
@@ -112,6 +135,7 @@
112
  padding-top: 20px;
113
  font-size: 20px !important;
114
  margin-top: 0 !important;
 
115
  }
116
 
117
  .mp_subtitle_bd_mb {
@@ -122,6 +146,17 @@
122
  }
123
 
124
  .mp_small_text {
 
 
 
 
 
 
 
 
 
 
 
125
  font-family: sans-serif;
126
  font-size: 14px !important;
127
  font-weight: normal;
@@ -130,6 +165,8 @@
130
  line-height: 16px !important;
131
  letter-spacing: normal;
132
  color: #555555;
 
 
133
  }
134
 
135
  .mp_title_bd {
@@ -144,6 +181,7 @@
144
  border-top: 1px solid #bbb;
145
  padding-top: 20px;
146
  margin-bottom: 5px !important;
 
147
  }
148
 
149
  .mp_title_checkout {
@@ -156,7 +194,7 @@
156
  letter-spacing: normal;
157
  color: #303030;
158
  margin-bottom: 5px !important;
159
- margin-top: 10px !important;
160
  }
161
 
162
  .mp_tienda_link {
@@ -217,7 +255,7 @@
217
  box-shadow: none;
218
  }
219
 
220
- .btn-collapsible {
221
  float: right;
222
  font-size: 25px;
223
  padding-right: 5px;
@@ -225,17 +263,27 @@
225
 
226
  .mp-title-checkout-body {
227
  font-family: sans-serif !important;
228
- margin: 5px 0 5px !important;
229
  font-size: 20px !important;
230
- font-weight: 300 !important;
 
231
  font-style: normal;
232
  font-stretch: normal;
233
- line-height: 1.25;
234
  letter-spacing: normal;
235
  color: rgba(0, 0, 0, 0.8);
236
  }
237
 
238
- .text-checkout-body {
 
 
 
 
 
 
 
 
 
 
239
  font-size: 14px !important;
240
  font-weight: 400 !important;
241
  font-style: normal;
@@ -245,14 +293,14 @@
245
  color: rgba(0, 0, 0, 0.8);
246
  }
247
 
248
- .number-checkout-body {
249
  border-radius: 100%;
250
  border: solid 1px #979797;
251
  display: block;
252
- width: 30px;
253
- height: 30px;
254
  margin: 0 auto 8px !important;
255
- font-size: 20px;
256
  font-weight: bold;
257
  }
258
 
@@ -260,41 +308,67 @@
260
  align-items: center;
261
  }
262
 
263
- .left-header {
264
  min-width: 120px;
265
  }
266
 
267
- .left-header img {
268
  max-width: 150px;
269
  }
270
 
271
- .right-header {
272
  padding-top: 20px;
273
  }
274
 
275
  .mp-save-button {
276
- display: inline-block;
277
- font-weight: 400;
278
- text-align: center;
279
- vertical-align: middle;
280
- cursor: pointer;
281
- white-space: nowrap;
282
- line-height: 1.42857;
283
- border-radius: 2px !important;
284
- border: solid 1px #c2c2c2 !important;
285
- padding: 12px 50px !important;
286
- font-size: 13px !important;
287
- background-color: #fafafa !important;
288
- text-decoration: none;
289
- color: #555;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
290
  font-family: sans-serif;
291
- margin-bottom: 10px !important;
 
 
 
 
 
 
292
  }
293
 
294
- .mp-save-button:hover {
295
- color: #fff !important;
296
- background-color: #00aff0 !important;
297
- border-color: #008abd !important;
298
- -webkit-box-shadow: none !important;
299
- box-shadow: none;
 
 
300
  }
 
 
 
 
19
  margin-top: -10px !important;
20
  }
21
 
22
+ .mp-mt--15 {
23
+ margin-top: -15px !important;
24
+ }
25
+
26
+ .mp-mt--12 {
27
+ margin-top: -12px !important;
28
+ }
29
+
30
+ .mp-mt--5 {
31
+ margin-top: -5px !important;
32
+ }
33
+
34
  .mp-mt-5 {
35
+ margin-top: 5px !important;
36
+ }
37
+
38
+ .mp-mt-0 {
39
+ margin-top: 0px !important;
40
  }
41
 
42
  .mp-mb-0 {
43
  margin-bottom: 0px !important;
44
  }
45
 
46
+ .mp-mb-20 {
47
+ margin-bottom: 20px !important;
48
+ }
49
+
50
+ .mp-mb-18 {
51
+ margin-bottom: 18px !important;
52
+ }
53
+
54
  .mp-mg-0 {
55
  margin: 0px !important;
56
  }
79
  float: left;
80
  }
81
 
82
+ .mp-col-md-2 {
83
  width: 20%;
84
  float: left;
85
  }
86
 
87
  .mp-mouse_pointer {
88
+ cursor: pointer !important;
89
  }
90
 
91
  #mp_field_text {
128
 
129
  .mp_subtitle {
130
  font-size: 18px !important;
 
131
  }
132
 
133
  .mp_subtitle_bd {
135
  padding-top: 20px;
136
  font-size: 20px !important;
137
  margin-top: 0 !important;
138
+ margin-bottom: 20px !important;
139
  }
140
 
141
  .mp_subtitle_bd_mb {
146
  }
147
 
148
  .mp_small_text {
149
+ font-family: sans-serif;
150
+ font-size: 15px !important;
151
+ font-weight: normal;
152
+ font-style: normal !important;
153
+ font-stretch: normal;
154
+ line-height: 16px !important;
155
+ letter-spacing: normal;
156
+ color: #555555;
157
+ }
158
+
159
+ .mp_homolog_text {
160
  font-family: sans-serif;
161
  font-size: 14px !important;
162
  font-weight: normal;
165
  line-height: 16px !important;
166
  letter-spacing: normal;
167
  color: #555555;
168
+ margin-top: 0 !important;
169
+ margin-bottom: 30px !important;
170
  }
171
 
172
  .mp_title_bd {
181
  border-top: 1px solid #bbb;
182
  padding-top: 20px;
183
  margin-bottom: 5px !important;
184
+ margin-top: 10px !important;
185
  }
186
 
187
  .mp_title_checkout {
194
  letter-spacing: normal;
195
  color: #303030;
196
  margin-bottom: 5px !important;
197
+ margin-top: 0px !important;
198
  }
199
 
200
  .mp_tienda_link {
255
  box-shadow: none;
256
  }
257
 
258
+ .mp-btn-collapsible {
259
  float: right;
260
  font-size: 25px;
261
  padding-right: 5px;
263
 
264
  .mp-title-checkout-body {
265
  font-family: sans-serif !important;
266
+ margin: 0px 0 13px !important;
267
  font-size: 20px !important;
268
+ font-weight: 200 !important;
269
+ line-height: 1.25;
270
  font-style: normal;
271
  font-stretch: normal;
 
272
  letter-spacing: normal;
273
  color: rgba(0, 0, 0, 0.8);
274
  }
275
 
276
+ .mp-text-checkout-body {
277
+ font-size: 18px !important;
278
+ font-weight: 400 !important;
279
+ margin-top: 10px !important;
280
+ line-height: 20px;font-style: normal;
281
+ font-stretch: normal;
282
+ letter-spacing: normal;
283
+ color: rgba(0, 0, 0, 0.8);
284
+ }
285
+
286
+ .mp-text-steps {
287
  font-size: 14px !important;
288
  font-weight: 400 !important;
289
  font-style: normal;
293
  color: rgba(0, 0, 0, 0.8);
294
  }
295
 
296
+ .mp-number-checkout-body {
297
  border-radius: 100%;
298
  border: solid 1px #979797;
299
  display: block;
300
+ width: 35px;
301
+ height: 35px;
302
  margin: 0 auto 8px !important;
303
+ font-size: 23px;
304
  font-weight: bold;
305
  }
306
 
308
  align-items: center;
309
  }
310
 
311
+ .mp-left-header {
312
  min-width: 120px;
313
  }
314
 
315
+ .mp-left-header img {
316
  max-width: 150px;
317
  }
318
 
319
+ .mp-right-header {
320
  padding-top: 20px;
321
  }
322
 
323
  .mp-save-button {
324
+ margin-bottom: 15px !important;
325
+ }
326
+
327
+ .mp-hidden-field {
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;
354
+ font-weight: 100;
355
+ line-height: 1.5;
356
+ margin-bottom: 5px !important;
357
+ font-style: normal;
358
+ font-stretch: normal;
359
+ letter-spacing: normal;
360
  }
361
 
362
+ .mp_subtitle_header {
363
+ font-family: sans-serif;
364
+ font-size: 28px !important;
365
+ font-weight: 600 !important;;
366
+ line-height: 35px;
367
+ font-style: normal;
368
+ font-stretch: normal;
369
+ letter-spacing: normal;
370
  }
371
+
372
+ .mp_subtitle_mt {
373
+ margin-top: 0px !important;
374
+ }
assets/images/mercadopago.png CHANGED
Binary file
assets/images/minilogo.png ADDED
Binary file
assets/images/mplogo.png CHANGED
Binary file
assets/js/basic_config_mercadopago.js CHANGED
@@ -4,6 +4,12 @@ window.onload = function () {
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
  //update form_fields label
9
  var label = document.querySelectorAll("th.titledesc");
@@ -46,8 +52,8 @@ window.onload = function () {
46
  collapse_table.style.display = "none";
47
  collapse_title.style.cursor = "pointer";
48
 
49
- collapse_title.innerHTML += "<span class='btn-collapsible' id='header_plus' style='display:block'>+</span>\
50
- <span class='btn-collapsible' id='header_less' style='display:none'>-</span>";
51
 
52
  var header_plus = document.querySelector("#header_plus");
53
  var header_less = document.querySelector("#header_less");
@@ -73,8 +79,8 @@ window.onload = function () {
73
  collapse_description_2.style.display = "none";
74
  collapse_title_2.style.cursor = "pointer";
75
 
76
- collapse_title_2.innerHTML += "<span class='btn-collapsible' id='header_plus_2' style='display:block'>+</span>\
77
- <span class='btn-collapsible' id='header_less_2' style='display:none'>-</span>";
78
 
79
  var header_plus_2 = document.querySelector("#header_plus_2");
80
  var header_less_2 = document.querySelector("#header_less_2");
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");
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");
79
  collapse_description_2.style.display = "none";
80
  collapse_title_2.style.cursor = "pointer";
81
 
82
+ collapse_title_2.innerHTML += "<span class='mp-btn-collapsible' id='header_plus_2' style='display:block'>+</span>\
83
+ <span class='mp-btn-collapsible' id='header_less_2' style='display:none'>-</span>";
84
 
85
  var header_plus_2 = document.querySelector("#header_plus_2");
86
  var header_less_2 = document.querySelector("#header_less_2");
assets/js/credit-card.js CHANGED
@@ -1,1087 +1,744 @@
1
- (function () {
2
-
3
- var MPv1 = {
4
- debug: true,
5
- add_truncated_card: true,
6
- site_id: "",
7
- public_key: "",
8
- coupon_of_discounts: {
9
- discount_action_url: "",
10
- payer_email: "",
11
- default: true,
12
- status: false
13
- },
14
- customer_and_card: {
15
- default: true,
16
- status: true
17
- },
18
- create_token_on: {
19
- event: true, //if true create token on event, if false create on click and ignore others
20
- keyup: false,
21
- paste: true
22
- },
23
- inputs_to_create_discount: [
24
- "couponCode",
25
- "applyCoupon"
26
- ],
27
- inputs_to_create_token: [
28
- "cardNumber",
29
- "cardExpirationMonth",
30
- "cardExpirationYear",
31
- "cardholderName",
32
- "securityCode",
33
- "docType",
34
- "docNumber"
35
- ],
36
- inputs_to_create_token_customer_and_card: [
37
- "paymentMethodSelector",
38
- "securityCode"
39
- ],
40
- selectors: {
41
- // others
42
- mp_doc_div: "#mp-doc-div",
43
- // currency
44
- currency_ratio: "#currency_ratio",
45
- // coupom
46
- couponCode: "#couponCode",
47
- applyCoupon: "#applyCoupon",
48
- mpCouponApplyed: "#mpCouponApplyed",
49
- mpCouponError: "#mpCouponError",
50
- campaign_id: "#campaign_id",
51
- campaign: "#campaign",
52
- discount: "#discount",
53
- // customer cards
54
- paymentMethodSelector: "#paymentMethodSelector",
55
- pmCustomerAndCards: "#payment-methods-for-customer-and-cards",
56
- pmListOtherCards: "#payment-methods-list-other-cards",
57
- // card data
58
- mpSecurityCodeCustomerAndCard: "#mp-securityCode-customer-and-card",
59
- cardNumber: "#cardNumber",
60
- cardExpirationMonth: "#cardExpirationMonth",
61
- cardExpirationYear: "#cardExpirationYear",
62
- cardholderName: "#cardholderName",
63
- securityCode: "#securityCode",
64
- docType: "#docType",
65
- docNumber: "#docNumber",
66
- issuer: "#issuer",
67
- installments: "#installments",
68
- // document
69
- mpDoc: ".mp-doc",
70
- mpIssuer: ".mp-issuer",
71
- mpDocType: ".mp-docType",
72
- mpDocNumber: ".mp-docNumber",
73
- // payment method and checkout
74
- paymentMethodId: "#paymentMethodId",
75
- amount: "#amount",
76
- token: "#token",
77
- cardTruncated: "#cardTruncated",
78
- site_id: "#site_id",
79
- CustomerAndCard: "#CustomerAndCard",
80
- box_loading: "#mp-box-loading",
81
- submit: "#submit",
82
- // tax resolution AG 51/2017
83
- boxInstallments: "#mp-box-installments",
84
- boxInstallmentsSelector: "#mp-box-installments-selector",
85
- taxCFT: "#mp-box-input-tax-cft",
86
- taxTEA: "#mp-box-input-tax-tea",
87
- taxTextCFT: "#mp-tax-cft-text",
88
- taxTextTEA: "#mp-tax-tea-text",
89
- // form
90
- form: "#mercadopago-form",
91
- formCoupon: "#mercadopago-form-coupon",
92
- formCustomerAndCard: "#mercadopago-form-customer-and-card",
93
- utilities_fields: "#mercadopago-utilities"
94
- },
95
- text: {
96
- choose: "Choose",
97
- other_bank: "Other Bank",
98
- discount_info1: "You will save",
99
- discount_info2: "with discount from",
100
- discount_info3: "Total of your purchase:",
101
- discount_info4: "Total of your purchase with discount:",
102
- discount_info5: "*Uppon payment approval",
103
- discount_info6: "Terms and Conditions of Use",
104
- coupon_empty: "Please, inform your coupon code",
105
- apply: "Apply",
106
- remove: "Remove"
107
- },
108
- paths: {
109
- loading: "images/loading.gif",
110
- check: "images/check.png",
111
- error: "images/error.png"
112
- }
113
- }
114
-
115
- // === Coupon of Discounts
116
-
117
- MPv1.currencyIdToCurrency = function (currency_id) {
118
- if (currency_id == "ARS") {
119
- return "$";
120
- } else if (currency_id == "BRL") {
121
- return "R$";
122
- } else if (currency_id == "COP") {
123
- return "$";
124
- } else if (currency_id == "CLP") {
125
- return "$";
126
- } else if (currency_id == "MXN") {
127
- return "$";
128
- } else if (currency_id == "VEF") {
129
- return "Bs";
130
- } else if (currency_id == "PEN") {
131
- return "S/";
132
- } else if (currency_id == "UYU") {
133
- return "$U";
134
- } else {
135
- return "$";
136
- }
137
- }
138
-
139
- MPv1.checkCouponEligibility = function () {
140
- if (document.querySelector(MPv1.selectors.couponCode).value == "") {
141
- // Coupon code is empty.
142
- document.querySelector(MPv1.selectors.mpCouponApplyed).style.display = "none";
143
- document.querySelector(MPv1.selectors.mpCouponError).style.display = "block";
144
- document.querySelector(MPv1.selectors.mpCouponError).innerHTML = MPv1.text.coupon_empty;
145
- MPv1.coupon_of_discounts.status = false;
146
- document.querySelector(MPv1.selectors.couponCode).style.background = null;
147
- document.querySelector(MPv1.selectors.applyCoupon).value = MPv1.text.apply;
148
- document.querySelector(MPv1.selectors.discount).value = 0;
149
- MPv1.cardsHandler();
150
- } else if (MPv1.coupon_of_discounts.status) {
151
- // We already have a coupon set, so we remove it.
152
- document.querySelector(MPv1.selectors.mpCouponApplyed).style.display = "none";
153
- document.querySelector(MPv1.selectors.mpCouponError).style.display = "none";
154
- MPv1.coupon_of_discounts.status = false;
155
- document.querySelector(MPv1.selectors.applyCoupon).style.background = null;
156
- document.querySelector(MPv1.selectors.applyCoupon).value = MPv1.text.apply;
157
- document.querySelector(MPv1.selectors.couponCode).value = "";
158
- document.querySelector(MPv1.selectors.couponCode).style.background = null;
159
- document.querySelector(MPv1.selectors.discount).value = 0;
160
- MPv1.cardsHandler();
161
- } else {
162
- // Set loading.
163
- document.querySelector(MPv1.selectors.mpCouponApplyed).style.display = "none";
164
- document.querySelector(MPv1.selectors.mpCouponError).style.display = "none";
165
- document.querySelector(MPv1.selectors.couponCode).style.background = "url(" + MPv1.paths.loading + ") 98% 50% no-repeat #fff";
166
- document.querySelector(MPv1.selectors.couponCode).style.border = "1px solid #cecece";
167
- document.querySelector(MPv1.selectors.applyCoupon).disabled = true;
168
-
169
- // Check if there are params in the url.
170
- var url = MPv1.coupon_of_discounts.discount_action_url;
171
- var sp = "?";
172
- if (url.indexOf("?") >= 0) {
173
- sp = "&";
174
- }
175
- url += sp + "site_id=" + MPv1.site_id;
176
- url += "&coupon_id=" + document.querySelector(MPv1.selectors.couponCode).value;
177
- url += "&amount=" + document.querySelector(MPv1.selectors.amount).value;
178
- url += "&payer=" + MPv1.coupon_of_discounts.payer_email;
179
- //url += "&payer=" + document.getElementById( "billing_email" ).value;
180
 
181
- MPv1.AJAX({
182
- url: url,
183
- method: "GET",
184
- timeout: 5000,
185
- error: function () {
186
- // Request failed.
187
- document.querySelector(MPv1.selectors.mpCouponApplyed).style.display = "none";
188
- document.querySelector(MPv1.selectors.mpCouponError).style.display = "none";
189
- MPv1.coupon_of_discounts.status = false;
190
- document.querySelector(MPv1.selectors.applyCoupon).style.background = null;
191
- document.querySelector(MPv1.selectors.applyCoupon).value = MPv1.text.apply;
192
- document.querySelector(MPv1.selectors.couponCode).value = "";
193
- document.querySelector(MPv1.selectors.couponCode).style.background = null;
194
- document.querySelector(MPv1.selectors.discount).value = 0;
195
- MPv1.cardsHandler();
196
- },
197
- success: function (status, response) {
198
- if (response.status == 200) {
199
- document.querySelector(MPv1.selectors.mpCouponApplyed).style.display =
200
- "block";
201
- document.querySelector(MPv1.selectors.discount).value =
202
- response.response.coupon_amount;
203
- document.querySelector(MPv1.selectors.mpCouponApplyed).innerHTML =
204
- //"<div style='border-style: solid; border-width:thin; " +
205
- //"border-color: #009EE3; padding: 8px 8px 8px 8px; margin-top: 4px;'>" +
206
- MPv1.text.discount_info1 + " <strong>" +
207
- MPv1.currencyIdToCurrency(response.response.currency_id) + " " +
208
- Math.round(response.response.coupon_amount * 100) / 100 +
209
- "</strong> " + MPv1.text.discount_info2 + " " +
210
- response.response.name + ".<br>" + MPv1.text.discount_info3 + " <strong>" +
211
- MPv1.currencyIdToCurrency(response.response.currency_id) + " " +
212
- Math.round(MPv1.getAmountWithoutDiscount() * 100) / 100 +
213
- "</strong><br>" + MPv1.text.discount_info4 + " <strong>" +
214
- MPv1.currencyIdToCurrency(response.response.currency_id) + " " +
215
- Math.round(MPv1.getAmount() * 100) / 100 + "*</strong><br>" +
216
- "<i>" + MPv1.text.discount_info5 + "</i><br>" +
217
- "<a href='https://api.mercadolibre.com/campaigns/" +
218
- response.response.id +
219
- "/terms_and_conditions?format_type=html' target='_blank'>" +
220
- MPv1.text.discount_info6 + "</a>";
221
- document.querySelector(MPv1.selectors.mpCouponError).style.display = "none";
222
- MPv1.coupon_of_discounts.status = true;
223
- document.querySelector(MPv1.selectors.couponCode).style.background =
224
- null;
225
- document.querySelector(MPv1.selectors.couponCode).style.background =
226
- "url(" + MPv1.paths.check + ") 94% 50% no-repeat #fff";
227
- document.querySelector(MPv1.selectors.couponCode).style.border = "1px solid #cecece";
228
- document.querySelector(MPv1.selectors.applyCoupon).value =
229
- MPv1.text.remove;
230
- MPv1.cardsHandler();
231
- document.querySelector(MPv1.selectors.campaign_id).value =
232
- response.response.id;
233
- document.querySelector(MPv1.selectors.campaign).value =
234
- response.response.name;
235
- } else {
236
- document.querySelector(MPv1.selectors.mpCouponApplyed).style.display = "none";
237
- document.querySelector(MPv1.selectors.mpCouponError).style.display = "block";
238
- document.querySelector(MPv1.selectors.mpCouponError).innerHTML = response.response.message;
239
- MPv1.coupon_of_discounts.status = false;
240
- document.querySelector(MPv1.selectors.couponCode).style.background = null;
241
- document.querySelector(MPv1.selectors.couponCode).style.background = "url(" + MPv1.paths.error + ") 94% 50% no-repeat #fff";
242
- document.querySelector(MPv1.selectors.applyCoupon).value = MPv1.text.apply;
243
- document.querySelector(MPv1.selectors.discount).value = 0;
244
- MPv1.cardsHandler();
245
- }
246
- document.querySelector(MPv1.selectors.applyCoupon).disabled = false;
247
- }
248
- });
249
- }
250
- }
251
 
252
- MPv1.getBin = function () {
253
 
254
- var cardSelector = document.querySelector(MPv1.selectors.paymentMethodSelector);
255
-
256
- if (cardSelector && cardSelector[cardSelector.options.selectedIndex].value != "-1") {
257
- return cardSelector[cardSelector.options.selectedIndex]
258
- .getAttribute("first_six_digits");
259
  }
260
 
261
- var ccNumber = document.querySelector(MPv1.selectors.cardNumber);
262
- return ccNumber.value.replace(/[ .-]/g, "").slice(0, 6);
 
 
 
 
263
 
264
- }
 
265
 
266
- MPv1.clearOptions = function () {
 
 
 
 
 
 
267
 
268
- var bin = MPv1.getBin();
 
269
 
270
- if (bin.length == 0) {
 
 
271
 
272
- MPv1.hideIssuer();
273
 
274
- var selectorInstallments = document.querySelector(MPv1.selectors.installments),
275
- fragment = document.createDocumentFragment(),
276
- option = new Option(MPv1.text.choose + "...", "-1");
277
 
278
- selectorInstallments.options.length = 0;
279
- fragment.appendChild(option);
280
- selectorInstallments.appendChild(fragment);
281
- selectorInstallments.setAttribute("disabled", "disabled");
 
 
 
 
 
 
 
 
 
 
 
282
 
 
 
 
 
 
 
 
 
283
  }
284
 
285
- }
 
 
 
 
 
 
286
 
287
- MPv1.guessingPaymentMethod = function (event) {
 
 
 
 
 
 
 
 
 
288
 
289
- var bin = MPv1.getBin();
290
- var amount = MPv1.getAmount();
291
 
292
- if (event.type == "keyup") {
293
- if (bin != null && bin.length == 6) {
294
- Mercadopago.getPaymentMethod({
295
- "bin": bin
296
- }, MPv1.setPaymentMethodInfo);
297
  }
298
- } else {
299
- setTimeout(function () {
300
  if (bin.length >= 6) {
301
  Mercadopago.getPaymentMethod({
302
  "bin": bin
303
- }, MPv1.setPaymentMethodInfo);
304
- }
305
- }, 100);
306
- }
307
-
308
- };
309
-
310
- MPv1.setPaymentMethodInfo = function (status, response) {
311
-
312
- if (status == 200) {
313
-
314
- if (MPv1.site_id != "MLM") {
315
- // Guessing...
316
- document.querySelector(MPv1.selectors.paymentMethodId).value = response[0].id;
317
- if (MPv1.customer_and_card.status) {
318
- document.querySelector(MPv1.selectors.paymentMethodSelector)
319
- .style.background = "url(" + response[0].secure_thumbnail + ") 90% 50% no-repeat #fff";
320
- } else {
321
- document.querySelector(MPv1.selectors.cardNumber).style.background = "url(" +
322
- response[0].secure_thumbnail + ") 94% 50% no-repeat #fff";
323
- }
324
- document.querySelector(MPv1.selectors.cardNumber).style.border = "1px solid #cecece";
325
- }
326
-
327
- // Check if the security code (ex: Tarshop) is required.
328
- var cardConfiguration = response[0].settings;
329
- var bin = MPv1.getBin();
330
- var amount = MPv1.getAmount();
331
-
332
- Mercadopago.getInstallments(
333
- {"bin": bin, "amount": amount},
334
- MPv1.setInstallmentInfo
335
- );
336
-
337
- // Check if the issuer is necessary to pay.
338
- var issuerMandatory = false, additionalInfo = response[0].additional_info_needed;
339
-
340
- for (var i = 0; i < additionalInfo.length; i++) {
341
- if (additionalInfo[i] == "issuer_id") {
342
- issuerMandatory = true;
343
  }
 
 
 
 
 
 
 
 
344
  }
345
- ;
346
-
347
- if (issuerMandatory && MPv1.site_id != "MLM") {
348
- var payment_method_id = response[0].id;
349
- MPv1.getIssuersPaymentMethod(payment_method_id);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
350
  } else {
351
- MPv1.hideIssuer();
352
  }
353
-
354
  }
355
 
356
- }
357
-
358
- MPv1.changePaymetMethodSelector = function () {
359
- var payment_method_id =
360
- document.querySelector(MPv1.selectors.paymentMethodSelector).value;
361
- MPv1.getIssuersPaymentMethod(payment_method_id);
362
- }
363
-
364
- // === Issuers
365
-
366
- MPv1.getIssuersPaymentMethod = function (payment_method_id) {
367
-
368
- var amount = MPv1.getAmount();
369
-
370
- // flow: MLM mercadopagocard
371
- if (payment_method_id == "mercadopagocard") {
372
- Mercadopago.getInstallments(
373
- {"payment_method_id": payment_method_id, "amount": amount},
374
- MPv1.setInstallmentInfo
375
- );
376
- }
377
-
378
- Mercadopago.getIssuers(payment_method_id, MPv1.showCardIssuers);
379
- MPv1.addListenerEvent(
380
- document.querySelector(MPv1.selectors.issuer),
381
- "change",
382
- MPv1.setInstallmentsByIssuerId
383
- );
384
-
385
- }
386
-
387
- MPv1.showCardIssuers = function (status, issuers) {
388
-
389
- // If the API does not return any bank.
390
- if (issuers.length > 0) {
391
- var issuersSelector = document.querySelector(MPv1.selectors.issuer);
392
- var fragment = document.createDocumentFragment();
393
-
394
- issuersSelector.options.length = 0;
395
- var option = new Option(MPv1.text.choose + "...", "-1");
396
- fragment.appendChild(option);
397
-
398
- for (var i = 0; i < issuers.length; i++) {
399
- if (issuers[i].name != "default") {
400
- option = new Option(issuers[i].name, issuers[i].id);
401
- } else {
402
- option = new Option("Otro", issuers[i].id);
403
- }
404
- fragment.appendChild(option);
405
  }
406
 
407
- issuersSelector.appendChild(fragment);
408
- issuersSelector.removeAttribute("disabled");
409
- } else {
410
- MPv1.hideIssuer();
 
 
 
 
 
 
 
 
 
 
411
  }
412
 
413
- }
414
-
415
- MPv1.setInstallmentsByIssuerId = function (status, response) {
416
-
417
- var issuerId = document.querySelector(MPv1.selectors.issuer).value;
418
- var amount = MPv1.getAmount();
 
 
 
 
 
 
 
419
 
420
- if (issuerId === "-1") {
421
- return;
422
- }
 
 
 
 
423
 
424
- var params_installments = {
425
- "bin": MPv1.getBin(),
426
- "amount": amount,
427
- "issuer_id": issuerId
428
- }
 
429
 
430
- if (MPv1.site_id == "MLM") {
431
- params_installments = {
432
- "payment_method_id": document.querySelector(
433
- MPv1.selectors.paymentMethodSelector
434
- ).value,
435
- "amount": amount,
436
- "issuer_id": issuerId
437
  }
438
  }
439
- Mercadopago.getInstallments(params_installments, MPv1.setInstallmentInfo);
440
-
441
- }
442
-
443
- MPv1.hideIssuer = function () {
444
- var $issuer = document.querySelector(MPv1.selectors.issuer);
445
- var opt = document.createElement("option");
446
- opt.value = "-1";
447
- opt.innerHTML = MPv1.text.other_bank;
448
- opt.style = "font-size: 12px;";
449
-
450
- $issuer.innerHTML = "";
451
- $issuer.appendChild(opt);
452
- $issuer.setAttribute("disabled", "disabled");
453
- }
454
-
455
- // === Installments
456
 
457
- MPv1.setInstallmentInfo = function (status, response) {
458
-
459
- var selectorInstallments = document.querySelector(MPv1.selectors.installments);
460
-
461
- if (response.length > 0) {
462
-
463
- var html_option = "<option value='-1'>" + MPv1.text.choose + "...</option>";
464
- payerCosts = response[0].payer_costs;
465
-
466
- // fragment.appendChild(option);
467
- for (var i = 0; i < payerCosts.length; i++) {
468
- // Resolution 51/2017
469
- var dataInput = "";
470
- if (MPv1.site_id == "MLA") {
471
- var tax = payerCosts[i].labels;
472
- if (tax.length > 0) {
473
- for (var l = 0; l < tax.length; l++) {
474
- if (tax[l].indexOf("CFT_") !== -1) {
475
- dataInput = "data-tax='" + tax[l] + "'";
476
- }
477
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
478
  }
479
  }
480
- html_option += "<option value='" + payerCosts[i].installments + "' " + dataInput + ">" +
481
- (payerCosts[i].recommended_message || payerCosts[i].installments) +
482
- "</option>";
483
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
484
 
485
- // Not take the user's selection if equal.
486
- if (selectorInstallments.innerHTML != html_option) {
487
  selectorInstallments.innerHTML = html_option;
 
 
 
 
 
 
 
488
  }
489
-
490
- selectorInstallments.removeAttribute("disabled");
491
- MPv1.showTaxes();
492
-
493
  }
494
 
495
- }
496
-
497
- MPv1.showTaxes = function () {
498
- var selectorIsntallments = document.querySelector(MPv1.selectors.installments);
499
- var tax = selectorIsntallments.options[selectorIsntallments.selectedIndex].getAttribute("data-tax");
500
- var cft = "";
501
- var tea = "";
502
- if (tax != null) {
503
- var tax_split = tax.split("|");
504
- cft = tax_split[0].replace("_", " ");
505
- tea = tax_split[1].replace("_", " ");
506
- if (cft == "CFT 0,00%" && tea == "TEA 0,00%") {
507
- cft = "";
508
- tea = "";
 
 
509
  }
510
- }
511
- document.querySelector(MPv1.selectors.taxTextCFT).innerHTML = cft;
512
- document.querySelector(MPv1.selectors.taxTextTEA).innerHTML = tea;
513
- }
514
-
515
- // === Customer & Cards
516
-
517
- MPv1.cardsHandler = function () {
518
-
519
- var cardSelector = document.querySelector(MPv1.selectors.paymentMethodSelector);
520
- var type_checkout =
521
- cardSelector[cardSelector.options.selectedIndex].getAttribute("type_checkout");
522
- var amount = MPv1.getAmount();
523
-
524
- if (MPv1.customer_and_card.default) {
525
-
526
- if (cardSelector &&
527
- cardSelector[cardSelector.options.selectedIndex].value != "-1" &&
528
- type_checkout == "customer_and_card") {
529
-
530
- document.querySelector(MPv1.selectors.paymentMethodId)
531
- .value = cardSelector[cardSelector.options.selectedIndex]
532
- .getAttribute("payment_method_id");
533
-
534
- MPv1.clearOptions();
535
-
536
- MPv1.customer_and_card.status = true;
537
-
538
- var _bin = cardSelector[cardSelector.options.selectedIndex]
539
- .getAttribute("first_six_digits");
540
-
541
- Mercadopago.getPaymentMethod(
542
- {"bin": _bin},
543
- MPv1.setPaymentMethodInfo
544
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
545
 
 
 
 
546
  } else {
547
-
548
- document.querySelector(MPv1.selectors.paymentMethodId)
549
- .value = cardSelector.value != -1 ? cardSelector.value : "";
550
- MPv1.customer_and_card.status = false;
551
- MPv1.resetBackgroundCard();
552
- MPv1.guessingPaymentMethod(
553
- {type: "keyup"}
554
- );
555
-
556
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
557
 
558
- MPv1.setForm();
559
-
560
- }
561
-
562
- }
563
-
564
- // === Payment Methods
565
-
566
- MPv1.getPaymentMethods = function () {
567
-
568
- var fragment = document.createDocumentFragment();
569
- var paymentMethodsSelector =
570
- document.querySelector(MPv1.selectors.paymentMethodSelector)
571
- var mainPaymentMethodSelector =
572
- document.querySelector(MPv1.selectors.paymentMethodSelector)
573
-
574
- // Set loading.
575
- mainPaymentMethodSelector.style.background =
576
- "url(" + MPv1.paths.loading + ") 95% 50% no-repeat #fff";
577
- mainPaymentMethodSelector.style.border = "1px solid #cecece";
578
 
579
- // If customer and card.
580
- if (MPv1.customer_and_card.status) {
581
- paymentMethodsSelector = document.querySelector(MPv1.selectors.pmListOtherCards)
582
- // Clean payment methods.
583
- paymentMethodsSelector.innerHTML = "";
584
- } else {
585
- paymentMethodsSelector.innerHTML = "";
586
- option = new Option(MPv1.text.choose + "...", "-1");
587
- fragment.appendChild(option);
588
  }
589
 
590
- Mercadopago.getAllPaymentMethods(function (code, payment_methods) {
591
-
592
- for (var x = 0; x < payment_methods.length; x++) {
593
-
594
- var pm = payment_methods[x];
595
-
596
- if ((pm.payment_type_id == "credit_card" || pm.payment_type_id == "debit_card" ||
597
- pm.payment_type_id == "prepaid_card") && pm.status == "active") {
598
-
599
- option = new Option(pm.name, pm.id);
600
- option.setAttribute("type_checkout", "custom");
601
- fragment.appendChild(option);
602
-
603
- } // end if
604
-
605
- } // end for
606
-
607
- paymentMethodsSelector.appendChild(fragment);
608
- mainPaymentMethodSelector.style.background = "#fff";
609
-
610
- });
611
-
612
- }
613
-
614
- // === Functions related to Create Tokens
615
-
616
- MPv1.createTokenByEvent = function () {
617
-
618
- var $inputs = MPv1.getForm().querySelectorAll("[data-checkout]");
619
- var $inputs_to_create_token = MPv1.getInputsToCreateToken();
620
-
621
- for (var x = 0; x < $inputs.length; x++) {
622
-
623
- var element = $inputs[x];
624
-
625
- // Add events only in the required fields.
626
- if ($inputs_to_create_token
627
- .indexOf(element.getAttribute("data-checkout")) > -1) {
628
-
629
- var event = "focusout";
630
-
631
- if (element.nodeName == "SELECT") {
632
- event = "change";
633
  }
634
-
635
- MPv1.addListenerEvent(element, event, MPv1.validateInputsCreateToken);
636
-
637
- // For firefox.
638
- MPv1.addListenerEvent(element, "blur", MPv1.validateInputsCreateToken);
639
-
640
- if (MPv1.create_token_on.keyup) {
641
- MPv1.addListenerEvent(element, "keyup", MPv1.validateInputsCreateToken);
642
  }
643
-
644
- if (MPv1.create_token_on.paste) {
645
- MPv1.addListenerEvent(element, "paste", MPv1.validateInputsCreateToken);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
646
  }
647
-
648
  }
649
 
650
- }
651
-
652
- }
653
-
654
- MPv1.createTokenBySubmit = function () {
655
- MPv1.addListenerEvent(document.querySelector(MPv1.selectors.form), "submit", MPv1.doPay);
656
- }
657
-
658
- var doSubmit = false;
659
-
660
- MPv1.doPay = function (event) {
661
- event.preventDefault();
662
- if (!doSubmit) {
663
- MPv1.createToken();
664
- return false;
665
- }
666
- }
667
-
668
- MPv1.validateInputsCreateToken = function () {
669
- var valid_to_create_token = true;
670
- var $inputs = MPv1.getForm().querySelectorAll("[data-checkout]");
671
- var $inputs_to_create_token = MPv1.getInputsToCreateToken();
672
-
673
- for (var x = 0; x < $inputs.length; x++) {
674
-
675
- var element = $inputs[x];
676
-
677
- // Check is a input to create token.
678
- if ($inputs_to_create_token
679
- .indexOf(element.getAttribute("data-checkout")) > -1) {
680
 
681
- if (element.value == -1 || element.value == "") {
682
- valid_to_create_token = false;
683
- } // end if check values
684
- } // end if check data-checkout
685
- } // end for
686
 
687
- if (valid_to_create_token) {
688
- MPv1.createToken();
689
  }
690
 
691
- }
692
-
693
- MPv1.createToken = function () {
694
- MPv1.hideErrors();
695
-
696
- // Show loading.
697
- document.querySelector(MPv1.selectors.box_loading).style.background =
698
- "url(" + MPv1.paths.loading + ") 0 50% no-repeat #fff";
699
-
700
- // Form.
701
- var $form = MPv1.getForm();
702
- Mercadopago.createToken($form, MPv1.sdkResponseHandler);
703
-
704
- return false;
705
- }
706
-
707
- MPv1.sdkResponseHandler = function (status, response) {
708
-
709
- // Hide loading.
710
- document.querySelector(MPv1.selectors.box_loading).style.background = "";
711
-
712
- if (status != 200 && status != 201) {
713
- MPv1.showErrors(response);
714
- } else {
715
- var token = document.querySelector(MPv1.selectors.token);
716
- token.value = response.id;
717
-
718
- if (MPv1.add_truncated_card) {
719
- var card = MPv1.truncateCard(response);
720
- document.querySelector(MPv1.selectors.cardTruncated).value = card;
721
  }
722
 
723
- if (!MPv1.create_token_on.event) {
724
- doSubmit = true;
725
- btn = document.querySelector(MPv1.selectors.form);
726
- btn.submit();
727
  }
728
  }
729
 
730
- }
731
-
732
- // === Useful functions
733
-
734
- MPv1.resetBackgroundCard = function () {
735
- document.querySelector(MPv1.selectors.paymentMethodSelector).style.background =
736
- "no-repeat #fff";
737
- document.querySelector(MPv1.selectors.paymentMethodSelector).style.border =
738
- "1px solid #cecece";
739
- document.querySelector(MPv1.selectors.cardNumber).style.background =
740
- "no-repeat #fff";
741
- document.querySelector(MPv1.selectors.cardNumber).style.border =
742
- "1px solid #cecece";
743
- }
744
-
745
- MPv1.setForm = function () {
746
- if (MPv1.customer_and_card.status) {
747
- document.querySelector(MPv1.selectors.formDiv).style.display = "none";
748
- document.querySelector(MPv1.selectors.mpSecurityCodeCustomerAndCard).removeAttribute("style");
749
- } else {
750
- document.querySelector(MPv1.selectors.mpSecurityCodeCustomerAndCard).style.display = "none";
751
- document.querySelector(MPv1.selectors.formDiv).removeAttribute("style");
752
- }
753
 
754
- Mercadopago.clearSession();
 
 
755
 
756
- if (MPv1.create_token_on.event) {
757
- MPv1.createTokenByEvent();
758
- MPv1.validateInputsCreateToken();
759
- }
760
 
761
- document.querySelector(MPv1.selectors.CustomerAndCard).value =
762
- MPv1.customer_and_card.status;
763
- }
764
 
765
- MPv1.getForm = function () {
766
- if (MPv1.customer_and_card.status) {
767
- return document.querySelector(MPv1.selectors.formCustomerAndCard);
768
- } else {
769
- return document.querySelector(MPv1.selectors.form);
770
  }
771
- }
772
 
773
- MPv1.getInputsToCreateToken = function () {
774
- if (MPv1.customer_and_card.status) {
775
- return MPv1.inputs_to_create_token_customer_and_card;
776
- } else {
777
- return MPv1.inputs_to_create_token;
778
- }
779
- }
780
-
781
- MPv1.truncateCard = function (response_card_token) {
782
-
783
- var first_six_digits;
784
- var last_four_digits;
785
-
786
- if (MPv1.customer_and_card.status) {
787
- var cardSelector = document.querySelector(MPv1.selectors.paymentMethodSelector);
788
- first_six_digits = cardSelector[cardSelector.options.selectedIndex]
789
- .getAttribute("first_six_digits").match(/.{1,4}/g)
790
- last_four_digits = cardSelector[cardSelector.options.selectedIndex]
791
- .getAttribute("last_four_digits")
792
- } else {
793
- first_six_digits = response_card_token.first_six_digits.match(/.{1,4}/g)
794
- last_four_digits = response_card_token.last_four_digits
795
  }
796
 
797
- var card = first_six_digits[0] + " " +
798
- first_six_digits[1] + "** **** " + last_four_digits;
 
 
 
 
 
 
799
 
800
- return card;
801
-
802
- }
803
-
804
- MPv1.getAmount = function () {
805
- return document.querySelector(MPv1.selectors.amount).value;
806
- }
807
-
808
- // === Show errors
809
-
810
- MPv1.showErrors = function (response) {
811
- var $form = MPv1.getForm();
812
-
813
- for (var x = 0; x < response.cause.length; x++) {
814
- var error = response.cause[x];
815
- var $span = $form.querySelector("#mp-error-" + error.code);
816
- var $input = $form.querySelector($span.getAttribute("data-main"));
817
-
818
- $span.style.display = "inline-block";
819
- $input.classList.add("mp-error-input");
820
  }
821
 
822
- return;
823
- }
 
 
 
 
 
 
824
 
825
- MPv1.hideErrors = function () {
826
-
827
- for (var x = 0; x < document.querySelectorAll("[data-checkout]").length; x++) {
828
- var $field = document.querySelectorAll("[data-checkout]")[x];
829
- $field.classList.remove("mp-error-input");
830
- } // end for
831
 
832
- for (var x = 0; x < document.querySelectorAll(".mp-error").length; x++) {
833
- var $span = document.querySelectorAll(".mp-error")[x];
834
- $span.style.display = "none";
 
 
 
 
835
  }
836
 
837
- return;
838
-
839
- }
840
-
841
- // === Add events to guessing
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
842
 
843
- MPv1.addListenerEvent = function (el, eventName, handler) {
844
- if (el.addEventListener) {
845
- el.addEventListener(eventName, handler);
846
- } else {
847
- el.attachEvent("on" + eventName, function () {
848
- handler.call(el);
849
- });
850
- }
851
- };
852
-
853
- MPv1.addListenerEvent(
854
- document.querySelector(MPv1.selectors.cardNumber),
855
- "keyup", MPv1.guessingPaymentMethod
856
- );
857
- MPv1.addListenerEvent(
858
- document.querySelector(MPv1.selectors.cardNumber),
859
- "keyup", MPv1.clearOptions
860
- );
861
- MPv1.addListenerEvent(
862
- document.querySelector(MPv1.selectors.cardNumber),
863
- "change", MPv1.guessingPaymentMethod
864
- );
865
-
866
- MPv1.referer = (function () {
867
- var referer = window.location.protocol + "//" +
868
- window.location.hostname + (window.location.port ? ":" + window.location.port : "");
869
- return referer;
870
- })();
871
-
872
- MPv1.AJAX = function (options) {
873
- var useXDomain = !!window.XDomainRequest;
874
- var req = useXDomain ? new XDomainRequest() : new XMLHttpRequest()
875
- var data;
876
- options.url += (options.url.indexOf("?") >= 0 ? "&" : "?") + "referer=" + escape(MPv1.referer);
877
- options.requestedMethod = options.method;
878
- if (useXDomain && options.method == "PUT") {
879
- options.method = "POST";
880
- options.url += "&_method=PUT";
881
- }
882
- req.open(options.method, options.url, true);
883
- req.timeout = options.timeout || 1000;
884
- if (window.XDomainRequest) {
885
- req.onload = function () {
886
- data = JSON.parse(req.responseText);
887
- if (typeof options.success === "function") {
888
- options.success(options.requestedMethod === "POST" ? 201 : 200, data);
889
- }
890
- };
891
- req.onerror = req.ontimeout = function () {
892
- if (typeof options.error === "function") {
893
- options.error(400, {
894
- user_agent: window.navigator.userAgent, error: "bad_request", cause: []
895
- });
896
- }
897
- };
898
- req.onprogress = function () {
899
- };
900
- } else {
901
- req.setRequestHeader("Accept", "application/json");
902
- if (options.contentType) {
903
- req.setRequestHeader("Content-Type", options.contentType);
904
  } else {
905
- req.setRequestHeader("Content-Type", "application/json");
 
 
 
 
906
  }
907
- req.onreadystatechange = function () {
908
- if (this.readyState === 4) {
909
- try {
910
- if (this.status >= 200 && this.status < 400) {
911
- // Success!
912
- data = JSON.parse(this.responseText);
913
- if (typeof options.success === "function") {
914
- options.success(this.status, data);
915
- }
916
- } else if (this.status >= 400) {
917
- data = JSON.parse(this.responseText);
918
- if (typeof options.error === "function") {
919
- options.error(this.status, data);
920
- }
921
- } else if (typeof options.error === "function") {
922
- options.error(503, {});
923
- }
924
- } catch (e) {
925
- options.error(503, {});
926
- }
927
- }
928
- };
929
- }
930
- if (options.method === "GET" || options.data == null || options.data == undefined) {
931
- req.send();
932
- } else {
933
- req.send(JSON.stringify(options.data));
934
- }
935
- }
936
-
937
- // === Initialization function
938
-
939
- MPv1.Initialize = function (site_id, public_key, coupon_mode, discount_action_url, payer_email) {
940
-
941
- // Sets
942
- MPv1.site_id = site_id;
943
- MPv1.public_key = public_key;
944
- MPv1.coupon_of_discounts.default = coupon_mode;
945
- MPv1.coupon_of_discounts.discount_action_url = discount_action_url;
946
- MPv1.coupon_of_discounts.payer_email = payer_email;
947
-
948
- Mercadopago.setPublishableKey(MPv1.public_key);
949
-
950
- // flow coupon of discounts
951
- if (MPv1.coupon_of_discounts.default) {
952
- MPv1.addListenerEvent(
953
- document.querySelector(MPv1.selectors.applyCoupon),
954
- "click",
955
- MPv1.checkCouponEligibility
956
- );
957
- } else {
958
- document.querySelector(MPv1.selectors.formCoupon).style.display = "none";
959
  }
960
 
961
- // Flow: customer & cards.
962
- var selectorPmCustomerAndCards = document.querySelector(MPv1.selectors.pmCustomerAndCards);
963
- if (MPv1.customer_and_card.default && selectorPmCustomerAndCards.childElementCount > 0) {
964
- MPv1.addListenerEvent(
965
- document.querySelector(MPv1.selectors.paymentMethodSelector),
966
- "change", MPv1.cardsHandler
967
- );
968
- MPv1.cardsHandler();
969
- } else {
970
- // If customer & cards is disabled or customer does not have cards.
971
- MPv1.customer_and_card.status = false;
972
- document.querySelector(MPv1.selectors.formCustomerAndCard).style.display = "none";
973
- }
974
 
975
- if (MPv1.create_token_on.event) {
976
- MPv1.createTokenByEvent();
977
- } else {
978
- MPv1.createTokenBySubmit()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
979
  }
980
 
981
- // flow: MLM
982
- if (MPv1.site_id != "MLM") {
983
- Mercadopago.getIdentificationTypes();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
984
  }
985
 
986
- if (MPv1.site_id == "MLM") {
987
-
988
- // Hide documento for mex.
989
- document.querySelector(MPv1.selectors.mpDoc).style.display = "none";
990
-
991
- document.querySelector(MPv1.selectors.formCustomerAndCard).removeAttribute("style");
992
- document.querySelector(MPv1.selectors.formCustomerAndCard).style.padding = "0px 12px 0px 12px";
993
- document.querySelector(MPv1.selectors.mpSecurityCodeCustomerAndCard).style.display = "none";
994
-
995
- // Removing not used fields for this country.
996
- MPv1.inputs_to_create_token.splice(
997
- MPv1.inputs_to_create_token.indexOf("docType"),
998
- 1);
999
- MPv1.inputs_to_create_token.splice(
1000
- MPv1.inputs_to_create_token.indexOf("docNumber"),
1001
- 1);
 
 
 
1002
 
1003
- MPv1.addListenerEvent(
1004
- document.querySelector(MPv1.selectors.paymentMethodSelector),
1005
- "change",
1006
- MPv1.changePaymetMethodSelector
1007
- );
1008
 
1009
- // Get payment methods and populate selector.
1010
- MPv1.getPaymentMethods();
 
1011
 
 
1012
  }
1013
 
1014
- // flow: MLB AND MCO
1015
- if (MPv1.site_id == "MLB") {
1016
-
1017
- document.querySelector(MPv1.selectors.mpDocType).style.display = "none";
1018
- document.querySelector(MPv1.selectors.mpIssuer).style.display = "none";
1019
- // Adjust css.
1020
- document.querySelector(MPv1.selectors.docNumber).classList.remove("mp-col-75");
1021
- //document.querySelector( MPv1.selectors.docNumber ).classList.add( "mp-col-100" );
1022
- document.querySelector(MPv1.selectors.mp_doc_div).style.display = "none";
1023
-
1024
- } else if (MPv1.site_id == "MCO") {
1025
- document.querySelector(MPv1.selectors.mpIssuer).style.display = "none";
1026
- } else if (MPv1.site_id == "MLA") {
1027
- document.querySelector(MPv1.selectors.boxInstallmentsSelector).classList.remove("mp-col-100");
1028
- document.querySelector(MPv1.selectors.boxInstallmentsSelector).classList.add("mp-col-70");
1029
- document.querySelector(MPv1.selectors.taxCFT).style.display = "block";
1030
- document.querySelector(MPv1.selectors.taxTEA).style.display = "block";
1031
- MPv1.addListenerEvent(document.querySelector(MPv1.selectors.installments), "change", MPv1.showTaxes);
1032
- } else if (MPv1.site_id == "MLC") {
1033
- document.querySelector(MPv1.selectors.mpIssuer).style.display = "none";
1034
- }
1035
 
1036
- if (MPv1.debug) {
1037
- document.querySelector(MPv1.selectors.utilities_fields).style.display = "inline-block";
1038
- }
 
1039
 
1040
- document.querySelector(MPv1.selectors.site_id).value = MPv1.site_id;
1041
-
1042
- return;
1043
-
1044
- }
1045
-
1046
- this.MPv1 = MPv1;
1047
-
1048
- }).call();
1049
-
1050
- // Overriding this function to give form padding attribute.
1051
- MPv1.setForm = function () {
1052
- if (MPv1.customer_and_card.status) {
1053
- document.querySelector(MPv1.selectors.form).style.display = "none";
1054
- document.querySelector(MPv1.selectors.mpSecurityCodeCustomerAndCard).removeAttribute("style");
1055
- } else {
1056
- document.querySelector(MPv1.selectors.mpSecurityCodeCustomerAndCard).style.display = "none";
1057
- document.querySelector(MPv1.selectors.form).removeAttribute("style");
1058
- document.querySelector(MPv1.selectors.form).style.padding = "0px 12px 0px 12px";
1059
- }
1060
- Mercadopago.clearSession();
1061
- if (MPv1.create_token_on.event) {
1062
- MPv1.createTokenByEvent();
1063
- MPv1.validateInputsCreateToken();
1064
- }
1065
- document.querySelector(MPv1.selectors.CustomerAndCard).value = MPv1.customer_and_card.status;
1066
- }
1067
-
1068
- MPv1.getAmount = function () {
1069
- return document.querySelector(MPv1.selectors.amount).value - document.querySelector(MPv1.selectors.discount).value;
1070
- }
1071
-
1072
- MPv1.getAmountWithoutDiscount = function () {
1073
- return document.querySelector(MPv1.selectors.amount).value;
1074
- }
1075
-
1076
- MPv1.showErrors = function (response) {
1077
- var $form = MPv1.getForm();
1078
- for (var x = 0; x < response.cause.length; x++) {
1079
- var error = response.cause[x];
1080
- var $span = $form.querySelector("#mp-error-" + error.code);
1081
- var $input = $form.querySelector($span.getAttribute("data-main"));
1082
- $span.style.display = "inline-block";
1083
- $input.classList.add("mp-error-input");
1084
- }
1085
- return;
1086
- }
1087
 
 
1
+ (function ($) {
2
+ 'use strict';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
+ $(function () {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
 
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 coupon_of_discounts = {
14
+ discount_action_url: wc_mercadopago_params.discount_action_url,
15
+ payer_email: wc_mercadopago_params.payer_email,
16
+ default: wc_mercadopago_params.coupon_mode,
17
+ status: false
18
+ }
19
 
20
+ var objPaymentMethod = {};
21
+ var additionalInfoNeeded = {}
22
 
23
+ if ($('form#order_review').length > 0) {
24
+ if (wc_mercadopago_params.coupon_mode == 'yes') {
25
+ $('#applyCoupon').on('click', discountCampaignsHandler);
26
+ }
27
+ showPaymentsLink();
28
+ Mercadopago.setPublishableKey(seller.public_key);
29
+ }
30
 
31
+ // Load woocommerce checkout form
32
+ $('body').on('updated_checkout', function () {
33
 
34
+ if (wc_mercadopago_params.coupon_mode == 'yes') {
35
+ $('#applyCoupon').on('click', discountCampaignsHandler);
36
+ }
37
 
38
+ clearCard();
39
 
40
+ Mercadopago.setPublishableKey(seller.public_key);
41
+ showPaymentsLink();
42
+ });
43
 
44
+ $('body').on('focusout', '#mp-card-number', guessingPaymentMethod);
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
+ if (event.type == "keyup") {
97
  if (bin.length >= 6) {
98
  Mercadopago.getPaymentMethod({
99
  "bin": bin
100
+ }, paymentMethodHandler);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  }
102
+ } else {
103
+ setTimeout(function () {
104
+ if (bin.length >= 6) {
105
+ Mercadopago.getPaymentMethod({
106
+ "bin": bin
107
+ }, paymentMethodHandler);
108
+ }
109
+ }, 100);
110
  }
111
+ };
112
+
113
+ /**
114
+ * Get Amount end calculate discount for hide inputs
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
+ * Remove Block Overlay from Order Review page
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));
assets/js/custom_config_mercadopago.js CHANGED
@@ -5,6 +5,11 @@ window.onload = function () {
5
  document.querySelector("#_wpnonce").parentElement.style.display = 'none';
6
  document.querySelectorAll("h2")[4].style.display = 'none';
7
 
 
 
 
 
 
8
  //update form_fields label
9
  var label = document.querySelectorAll("th.titledesc");
10
  for (var i = 0; i < label.length; i++) {
@@ -48,8 +53,8 @@ window.onload = function () {
48
  collapse_table.style.display = "none";
49
  collapse_title.style.cursor = "pointer";
50
 
51
- collapse_title.innerHTML += "<span class='btn-collapsible' id='header_plus' style='display:block'>+</span>\
52
- <span class='btn-collapsible' id='header_less' style='display:none'>-</span>";
53
 
54
  var header_plus = document.querySelector("#header_plus");
55
  var header_less = document.querySelector("#header_less");
@@ -81,8 +86,8 @@ window.onload = function () {
81
  // var text_advanced_config = document.querySelector("#woocommerce_woo-mercado-pago-custom_checkout_custom_payments_advanced_description");
82
  // text_advanced_config.style.display = "none";
83
 
84
- collapse_title_2.innerHTML += "<span class='btn-collapsible' id='header_plus_2' style='display:block'>+</span>\
85
- <span class='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");
5
  document.querySelector("#_wpnonce").parentElement.style.display = 'none';
6
  document.querySelectorAll("h2")[4].style.display = 'none';
7
 
8
+ var descriptionInput = document.querySelectorAll("p.description");
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("th.titledesc");
15
  for (var i = 0; i < label.length; i++) {
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");
86
  // var text_advanced_config = document.querySelector("#woocommerce_woo-mercado-pago-custom_checkout_custom_payments_advanced_description");
87
  // text_advanced_config.style.display = "none";
88
 
89
+ collapse_title_2.innerHTML += "<span class='mp-btn-collapsible' id='header_plus_2' style='display:block'>+</span>\
90
+ <span class='mp-btn-collapsible' id='header_less_2' style='display:none'>-</span>";
91
 
92
  var header_plus_2 = document.querySelector("#header_plus_2");
93
  var header_less_2 = document.querySelector("#header_less_2");
assets/js/ticket.js CHANGED
@@ -1,587 +1,436 @@
1
- (function () {
2
-
3
- var MPv1Ticket = {
4
- site_id: "",
5
- coupon_of_discounts: {
6
- discount_action_url: "",
7
- payer_email: "",
8
- default: true,
 
 
 
 
 
 
 
9
  status: false
10
- },
11
- inputs_to_create_discount: [
12
- "couponCodeTicket",
13
- "applyCouponTicket"
14
- ],
15
- inputs_to_validate_ticket: [
16
- "firstname",
17
- "lastname",
18
- "docNumber",
19
- "address",
20
- "number",
21
- "city",
22
- "state",
23
- "zipcode"
24
- ],
25
- selectors: {
26
- // currency
27
- currency_ratio: "#currency_ratioTicket",
28
- // coupom
29
- couponCode: "#couponCodeTicket",
30
- applyCoupon: "#applyCouponTicket",
31
- mpCouponApplyed: "#mpCouponApplyedTicket",
32
- mpCouponError: "#mpCouponErrorTicket",
33
- campaign_id: "#campaign_idTicket",
34
- campaign: "#campaignTicket",
35
- discount: "#discountTicket",
36
- // payment method and checkout
37
- paymentMethodId: "#paymentMethodIdTicket",
38
- amount: "#amountTicket",
39
- // other rules
40
- boxFirstName: "#box-firstname",
41
- boxLastName: "#box-lastname",
42
- boxDocNumber: "#box-docnumber",
43
- titleFirstName: ".title-name",
44
- titleFirstNameRazaoSocial: ".title-razao-social",
45
- titleDocNumber: ".title-cpf",
46
- titleDocNumberCNPJ: ".title-cnpj",
47
- radioTypeFisica: '#MPv1Ticket-docType-fisica',
48
- radioTypeJuridica: '#MPv1Ticket-docType-juridica',
49
- // febraban
50
- firstname: "#febrabanFirstname",
51
- lastname: "#febrabanLastname",
52
- cpfcnpj: "#cpfcnpj",
53
- address: "#febrabanAddress",
54
- number: "#febrabanNumber",
55
- city: "#febrabanCity",
56
- state: "#febrabanState",
57
- zipcode: "#febrabanZipcode",
58
- // form
59
- formCoupon: "#mercadopago-form-coupon-ticket",
60
- formTicket: "#form-ticket",
61
- box_loading: "#mp-box-loading",
62
- submit: "#btnSubmit",
63
- form: "#mercadopago-form-ticket"
64
- },
65
- text: {
66
- discount_info1: "You will save",
67
- discount_info2: "with discount from",
68
- discount_info3: "Total of your purchase:",
69
- discount_info4: "Total of your purchase with discount:",
70
- discount_info5: "*Uppon payment approval",
71
- discount_info6: "Terms and Conditions of Use",
72
- coupon_empty: "Please, inform your coupon code",
73
- apply: "Apply",
74
- remove: "Remove"
75
- },
76
- paths: {
77
- loading: "images/loading.gif",
78
- check: "images/check.png",
79
- error: "images/error.png"
80
  }
81
- }
82
-
83
- // === Coupon of Discounts
84
-
85
- MPv1Ticket.currencyIdToCurrency = function (currency_id) {
86
- if (currency_id == "ARS") {
87
- return "$";
88
- } else if (currency_id == "BRL") {
89
- return "R$";
90
- } else if (currency_id == "COP") {
91
- return "$";
92
- } else if (currency_id == "CLP") {
93
- return "$";
94
- } else if (currency_id == "MXN") {
95
- return "$";
96
- } else if (currency_id == "VEF") {
97
- return "Bs";
98
- } else if (currency_id == "PEN") {
99
- return "S/";
100
- } else if (currency_id == "UYU") {
101
- return "$U";
102
- } else {
103
- return "$";
104
  }
105
- }
106
-
107
- MPv1Ticket.checkCouponEligibility = function () {
108
- if (document.querySelector(MPv1Ticket.selectors.couponCode).value == "") {
109
- // Coupon code is empty.
110
- document.querySelector(MPv1Ticket.selectors.mpCouponApplyed).style.display = "none";
111
- document.querySelector(MPv1Ticket.selectors.mpCouponError).style.display = "block";
112
- document.querySelector(MPv1Ticket.selectors.mpCouponError).innerHTML = MPv1Ticket.text.coupon_empty;
113
- MPv1Ticket.coupon_of_discounts.status = false;
114
- document.querySelector(MPv1Ticket.selectors.couponCode).style.background = null;
115
- document.querySelector(MPv1Ticket.selectors.applyCoupon).value = MPv1Ticket.text.apply;
116
- document.querySelector(MPv1Ticket.selectors.discount).value = 0;
117
- // --- No cards handler ---
118
- } else if (MPv1Ticket.coupon_of_discounts.status) {
119
- // We already have a coupon set, so we remove it.
120
- document.querySelector(MPv1Ticket.selectors.mpCouponApplyed).style.display = "none";
121
- document.querySelector(MPv1Ticket.selectors.mpCouponError).style.display = "none";
122
- MPv1Ticket.coupon_of_discounts.status = false;
123
- document.querySelector(MPv1Ticket.selectors.applyCoupon).style.background = null;
124
- document.querySelector(MPv1Ticket.selectors.applyCoupon).value = MPv1Ticket.text.apply;
125
- document.querySelector(MPv1Ticket.selectors.couponCode).value = "";
126
- document.querySelector(MPv1Ticket.selectors.couponCode).style.background = null;
127
- document.querySelector(MPv1Ticket.selectors.discount).value = 0;
128
- // --- No cards handler ---
129
- } else {
130
- // Set loading.
131
- document.querySelector(MPv1Ticket.selectors.mpCouponApplyed).style.display = "none";
132
- document.querySelector(MPv1Ticket.selectors.mpCouponError).style.display = "none";
133
- document.querySelector(MPv1Ticket.selectors.couponCode).style.background = "url(" + MPv1Ticket.paths.loading + ") 98% 50% no-repeat #fff";
134
- document.querySelector(MPv1Ticket.selectors.applyCoupon).disabled = true;
135
-
136
- // Check if there are params in the url.
137
- var url = MPv1Ticket.coupon_of_discounts.discount_action_url;
138
- var sp = "?";
139
- if (url.indexOf("?") >= 0) {
140
- sp = "&";
141
  }
142
- url += sp + "site_id=" + MPv1Ticket.site_id;
143
- url += "&coupon_id=" + document.querySelector(MPv1Ticket.selectors.couponCode).value;
144
- url += "&amount=" + document.querySelector(MPv1Ticket.selectors.amount).value;
145
- url += "&payer=" + MPv1Ticket.coupon_of_discounts.payer_email;
146
 
147
- MPv1Ticket.AJAX({
148
- url: url,
149
- method: "GET",
150
- timeout: 5000,
151
- error: function () {
152
- // Request failed.
153
- document.querySelector(MPv1Ticket.selectors.mpCouponApplyed).style.display = "none";
154
- document.querySelector(MPv1Ticket.selectors.mpCouponError).style.display = "none";
155
- MPv1Ticket.coupon_of_discounts.status = false;
156
- document.querySelector(MPv1Ticket.selectors.applyCoupon).style.background = null;
157
- document.querySelector(MPv1Ticket.selectors.applyCoupon).value = MPv1Ticket.text.apply;
158
- document.querySelector(MPv1Ticket.selectors.couponCode).value = "";
159
- document.querySelector(MPv1Ticket.selectors.couponCode).style.background = null;
160
- document.querySelector(MPv1Ticket.selectors.discount).value = 0;
161
- // --- No cards handler ---
162
- },
163
- success: function (status, response) {
164
- if (response.status == 200) {
165
- document.querySelector(MPv1Ticket.selectors.mpCouponApplyed).style.display =
166
- "block";
167
- document.querySelector(MPv1Ticket.selectors.discount).value =
168
- response.response.coupon_amount;
169
- document.querySelector(MPv1Ticket.selectors.mpCouponApplyed).innerHTML =
170
- MPv1Ticket.text.discount_info1 + " <strong>" +
171
- MPv1Ticket.currencyIdToCurrency(response.response.currency_id) + " " +
172
- Math.round(response.response.coupon_amount * 100) / 100 +
173
- "</strong> " + MPv1Ticket.text.discount_info2 + " " +
174
- response.response.name + ".<br>" + MPv1Ticket.text.discount_info3 + " <strong>" +
175
- MPv1Ticket.currencyIdToCurrency(response.response.currency_id) + " " +
176
- Math.round(MPv1Ticket.getAmountWithoutDiscount() * 100) / 100 +
177
- "</strong><br>" + MPv1Ticket.text.discount_info4 + " <strong>" +
178
- MPv1Ticket.currencyIdToCurrency(response.response.currency_id) + " " +
179
- Math.round(MPv1Ticket.getAmount() * 100) / 100 + "*</strong><br>" +
180
- "<i>" + MPv1Ticket.text.discount_info5 + "</i><br>" +
181
- "<a href='https://api.mercadolibre.com/campaigns/" +
182
- response.response.id +
183
- "/terms_and_conditions?format_type=html' target='_blank'>" +
184
- MPv1Ticket.text.discount_info6 + "</a>";
185
- document.querySelector(MPv1Ticket.selectors.mpCouponError).style.display =
186
- "none";
187
- MPv1Ticket.coupon_of_discounts.status = true;
188
- document.querySelector(MPv1Ticket.selectors.couponCode).style.background =
189
- null;
190
- document.querySelector(MPv1Ticket.selectors.couponCode).style.background =
191
- "url(" + MPv1Ticket.paths.check + ") 98% 50% no-repeat #fff";
192
- document.querySelector(MPv1Ticket.selectors.applyCoupon).value =
193
- MPv1Ticket.text.remove;
194
- // --- No cards handler ---
195
- document.querySelector(MPv1Ticket.selectors.campaign_id).value =
196
- response.response.id;
197
- document.querySelector(MPv1Ticket.selectors.campaign).value =
198
- response.response.name;
199
- } else {
200
- document.querySelector(MPv1Ticket.selectors.mpCouponApplyed).style.display = "none";
201
- document.querySelector(MPv1Ticket.selectors.mpCouponError).style.display = "block";
202
- document.querySelector(MPv1Ticket.selectors.mpCouponError).innerHTML = response.response.message;
203
- MPv1Ticket.coupon_of_discounts.status = false;
204
- document.querySelector(MPv1Ticket.selectors.couponCode).style.background = null;
205
- document.querySelector(MPv1Ticket.selectors.couponCode).style.background = "url(" + MPv1Ticket.paths.error + ") 98% 50% no-repeat #fff";
206
- document.querySelector(MPv1Ticket.selectors.applyCoupon).value = MPv1Ticket.text.apply;
207
- document.querySelector(MPv1Ticket.selectors.discount).value = 0;
208
- // --- No cards handler ---
209
- }
210
- document.querySelector(MPv1Ticket.selectors.applyCoupon).disabled = false;
211
  }
212
  });
213
  }
214
- }
215
 
216
- // === Initialization function
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
217
 
218
- MPv1Ticket.addListenerEvent = function (el, eventName, handler) {
219
- if (el.addEventListener) {
220
- el.addEventListener(eventName, handler);
221
- } else {
222
- el.attachEvent("on" + eventName, function () {
223
- handler.call(el);
224
- });
225
  }
226
- };
227
-
228
- MPv1Ticket.referer = (function () {
229
- var referer = window.location.protocol + "//" +
230
- window.location.hostname + (window.location.port ? ":" + window.location.port : "");
231
- return referer;
232
- })();
233
-
234
- MPv1Ticket.AJAX = function (options) {
235
- var useXDomain = !!window.XDomainRequest;
236
- var req = useXDomain ? new XDomainRequest() : new XMLHttpRequest()
237
- var data;
238
- options.url += (options.url.indexOf("?") >= 0 ? "&" : "?") + "referer=" + escape(MPv1Ticket.referer);
239
- options.requestedMethod = options.method;
240
- if (useXDomain && options.method == "PUT") {
241
- options.method = "POST";
242
- options.url += "&_method=PUT";
243
  }
244
- req.open(options.method, options.url, true);
245
- req.timeout = options.timeout || 1000;
246
- if (window.XDomainRequest) {
247
- req.onload = function () {
248
- data = JSON.parse(req.responseText);
249
- if (typeof options.success === "function") {
250
- options.success(options.requestedMethod === "POST" ? 201 : 200, data);
251
- }
252
- };
253
- req.onerror = req.ontimeout = function () {
254
- if (typeof options.error === "function") {
255
- options.error(400, {
256
- user_agent: window.navigator.userAgent, error: "bad_request", cause: []
257
- });
 
 
 
 
 
 
258
  }
259
- };
260
- req.onprogress = function () {
261
- };
262
- } else {
263
- req.setRequestHeader("Accept", "application/json");
264
- if (options.contentType) {
265
- req.setRequestHeader("Content-Type", options.contentType);
266
- } else {
267
- req.setRequestHeader("Content-Type", "application/json");
268
  }
269
- req.onreadystatechange = function () {
270
- if (this.readyState === 4) {
271
- try {
272
- if (this.status >= 200 && this.status < 400) {
273
- // Success!
274
- data = JSON.parse(this.responseText);
275
- if (typeof options.success === "function") {
276
- options.success(this.status, data);
277
- }
278
- } else if (this.status >= 400) {
279
- data = JSON.parse(this.responseText);
280
- if (typeof options.error === "function") {
281
- options.error(this.status, data);
282
- }
283
- } else if (typeof options.error === "function") {
284
- options.error(503, {});
285
- }
286
- } catch (e) {
287
- options.error(503, {});
288
- }
289
  }
290
- };
291
- }
292
- if (options.method === "GET" || options.data == null || options.data == undefined) {
293
- req.send();
294
- } else {
295
- req.send(JSON.stringify(options.data));
296
  }
297
- }
298
 
299
- // Form validation
 
 
 
 
 
 
 
 
 
 
 
 
 
300
 
301
- var doSubmitTicket = false;
 
 
 
 
 
 
 
 
302
 
303
- MPv1Ticket.doPay = function (febraban) {
304
- if (!doSubmitTicket) {
305
- doSubmitTicket = true;
306
- document.querySelector(MPv1Ticket.selectors.box_loading).style.background = "url(" + MPv1Ticket.paths.loading + ") 0 50% no-repeat #fff";
307
- btn = document.querySelector(MPv1Ticket.selectors.form);
308
- btn.submit();
309
  }
310
- }
311
-
312
- MPv1Ticket.validateInputsTicket = function (event) {
313
- event.preventDefault();
314
- MPv1Ticket.hideErrors();
315
- var valid_to_ticket = true;
316
- var $inputs = MPv1Ticket.getForm().querySelectorAll("[data-checkout]");
317
- var $inputs_to_validate_ticket = MPv1Ticket.inputs_to_validate_ticket;
318
- var febraban = [];
319
- var arr = [];
320
- for (var x = 0; x < $inputs.length; x++) {
321
- var element = $inputs[x];
322
- if ($inputs_to_validate_ticket.indexOf(element.getAttribute("data-checkout")) > -1) {
323
- if (element.value == -1 || element.value == "") {
324
- arr.push(element.id);
325
- valid_to_ticket = false;
326
- } else {
327
- febraban[element.id] = element.value;
328
- }
329
  }
330
- }
331
- if (!valid_to_ticket) {
332
- MPv1Ticket.showErrors(arr);
333
- } else {
334
- MPv1Ticket.doPay(febraban);
335
- }
336
- }
337
-
338
- MPv1Ticket.getForm = function () {
339
- return document.querySelector(MPv1Ticket.selectors.form);
340
- }
341
-
342
- MPv1Ticket.addListenerEvent = function (el, eventName, handler) {
343
- if (el.addEventListener) {
344
- el.addEventListener(eventName, handler);
345
- } else {
346
- el.attachEvent("on" + eventName, function () {
347
- handler.call(el);
348
- });
349
- }
350
- };
351
-
352
- // Show/hide errors.
353
-
354
- MPv1Ticket.showErrors = function (fields) {
355
- var $form = MPv1Ticket.getForm();
356
- for (var x = 0; x < fields.length; x++) {
357
- var f = fields[x];
358
- var $span = $form.querySelector("#error_" + f);
359
- var $input = $form.querySelector($span.getAttribute("data-main"));
360
- $span.style.display = "inline-block";
361
- $input.classList.add("mp-error-input");
362
- }
363
- return;
364
- }
365
-
366
- MPv1Ticket.hideErrors = function () {
367
- for (var x = 0; x < document.querySelectorAll("[data-checkout]").length; x++) {
368
- var $field = document.querySelectorAll("[data-checkout]")[x];
369
- $field.classList.remove("mp-error-input");
370
- } //end for
371
- for (var x = 0; x < document.querySelectorAll(".mp-erro_febraban").length; x++) {
372
- var $span = document.querySelectorAll(".mp-erro_febraban")[x];
373
- $span.style.display = "none";
374
- }
375
- return;
376
- }
377
-
378
- MPv1Ticket.actionsMLB = function () {
379
- MPv1Ticket.initializeDocumentPessoaFisica();
380
- MPv1Ticket.addListenerEvent(document.querySelector(MPv1Ticket.selectors.cpfcnpj), 'keyup', MPv1Ticket.execFormatDocument);
381
- MPv1Ticket.addListenerEvent(document.querySelector(MPv1Ticket.selectors.radioTypeFisica), "change", MPv1Ticket.initializeDocumentPessoaFisica);
382
- MPv1Ticket.addListenerEvent(document.querySelector(MPv1Ticket.selectors.radioTypeJuridica), "change", MPv1Ticket.initializeDocumentPessoaJuridica);
383
- return;
384
- }
385
-
386
- MPv1Ticket.initializeDocumentPessoaFisica = function () {
387
- // show elements
388
- document.querySelector(MPv1Ticket.selectors.boxLastName).style.display = "block";
389
- document.querySelector(MPv1Ticket.selectors.titleFirstName).style.display = "inline-block";
390
- document.querySelector(MPv1Ticket.selectors.titleDocNumber).style.display = "inline-block";
391
- // adjustment css
392
- document.querySelector(MPv1Ticket.selectors.boxFirstName).classList.remove("mp-col-md-8");
393
- document.querySelector(MPv1Ticket.selectors.boxFirstName).classList.add("mp-col-md-4");
394
- // hide elements
395
- document.querySelector(MPv1Ticket.selectors.titleFirstNameRazaoSocial).style.display = "none";
396
- document.querySelector(MPv1Ticket.selectors.titleDocNumberCNPJ).style.display = "none";
397
- // force max length CPF
398
- document.querySelector(MPv1Ticket.selectors.cpfcnpj).maxLength = 14;
399
- }
400
-
401
- MPv1Ticket.initializeDocumentPessoaJuridica = function () {
402
- // show elements
403
- document.querySelector(MPv1Ticket.selectors.titleFirstNameRazaoSocial).style.display = "inline-block";
404
- document.querySelector(MPv1Ticket.selectors.titleDocNumberCNPJ).style.display = "inline-block";
405
- // adjustment css
406
- document.querySelector(MPv1Ticket.selectors.boxFirstName).classList.remove("mp-col-md-4");
407
- document.querySelector(MPv1Ticket.selectors.boxFirstName).classList.add("mp-col-md-8");
408
- // Hide Elements
409
- document.querySelector(MPv1Ticket.selectors.boxLastName).style.display = "none";
410
- document.querySelector(MPv1Ticket.selectors.titleFirstName).style.display = "none";
411
- document.querySelector(MPv1Ticket.selectors.titleDocNumber).style.display = "none";
412
- // force max length CNPJ
413
- document.querySelector(MPv1Ticket.selectors.cpfcnpj).maxLength = 18;
414
- }
415
-
416
- MPv1Ticket.validaCPF = function (strCPF) {
417
- var Soma;
418
- var Resto;
419
- strCPF = strCPF.replace(/[.-\s]/g, "")
420
- Soma = 0;
421
- if (strCPF == "00000000000") {
422
- return false;
423
- }
424
- for (i = 1; i <= 9; i++) {
425
- Soma = Soma + parseInt(strCPF.substring(i - 1, i)) * (11 - i);
426
- }
427
- Resto = (Soma * 10) % 11;
428
- if ((Resto == 10) || (Resto == 11)) {
429
- Resto = 0;
430
- }
431
- if (Resto != parseInt(strCPF.substring(9, 10))) {
432
- return false;
433
- }
434
- Soma = 0;
435
- for (i = 1; i <= 10; i++) {
436
- Soma = Soma + parseInt(strCPF.substring(i - 1, i)) * (12 - i);
437
- }
438
- Resto = (Soma * 10) % 11;
439
- if ((Resto == 10) || (Resto == 11)) {
440
- Resto = 0;
441
- }
442
- if (Resto != parseInt(strCPF.substring(10, 11))) {
443
- return false;
444
- }
445
- return true;
446
- }
447
-
448
- MPv1Ticket.validaCNPJ = function (strCNPJ) {
449
- strCNPJ = strCNPJ.replace(".", "");
450
- strCNPJ = strCNPJ.replace(".", "");
451
- strCNPJ = strCNPJ.replace(".", "");
452
- strCNPJ = strCNPJ.replace("-", "");
453
- strCNPJ = strCNPJ.replace("/", "");
454
- var numeros, digitos, soma, i, resultado, pos, tamanho, digitos_iguais;
455
- digitos_iguais = 1;
456
- if (strCNPJ.length < 14 && strCNPJ.length < 15) {
457
- return false;
458
- }
459
- for (i = 0; i < strCNPJ.length - 1; i++) {
460
- if (strCNPJ.charAt(i) != strCNPJ.charAt(i + 1)) {
461
- digitos_iguais = 0;
462
- break;
463
  }
464
- }
465
- if (!digitos_iguais) {
466
- tamanho = strCNPJ.length - 2
467
- numeros = strCNPJ.substring(0, tamanho);
468
- digitos = strCNPJ.substring(tamanho);
469
- soma = 0;
470
- pos = tamanho - 7;
471
- for (i = tamanho; i >= 1; i--) {
472
- soma += numeros.charAt(tamanho - i) * pos--;
473
- if (pos < 2) {
474
- pos = 9;
475
- }
476
  }
477
- resultado = soma % 11 < 2 ? 0 : 11 - soma % 11;
478
- if (resultado != digitos.charAt(0)) {
 
 
 
 
 
479
  return false;
480
  }
481
- tamanho = tamanho + 1;
482
- numeros = strCNPJ.substring(0, tamanho);
483
- soma = 0;
484
- pos = tamanho - 7;
485
- for (i = tamanho; i >= 1; i--) {
486
- soma += numeros.charAt(tamanho - i) * pos--;
487
- if (pos < 2) {
488
- pos = 9;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
489
  }
 
 
 
 
 
 
 
490
  }
491
- resultado = soma % 11 < 2 ? 0 : 11 - soma % 11;
492
- if (resultado != digitos.charAt(1)) {
493
  return false;
494
  }
495
- return true;
496
- } else {
497
- return false;
498
- }
499
- }
500
-
501
- MPv1Ticket.execFormatDocument = function () {
502
- v_obj = this;
503
- setTimeout(function () {
504
- v_obj.value = MPv1Ticket.formatDocument(v_obj.value)
505
- }, 1)
506
- }
507
-
508
- MPv1Ticket.formatDocument = function (v) {
509
- //Remove tudo o que não é dígito
510
- v = v.replace(/\D/g, "")
511
- if (document.querySelector(MPv1Ticket.selectors.radioTypeFisica).checked) { //CPF
512
- //Coloca um ponto entre o terceiro e o quarto dígitos
513
- v = v.replace(/(\d{3})(\d)/, "$1.$2")
514
- //Coloca um ponto entre o terceiro e o quarto dígitos
515
- //de novo (para o segundo bloco de números)
516
- v = v.replace(/(\d{3})(\d)/, "$1.$2")
517
- //Coloca um hífen entre o terceiro e o quarto dígitos
518
- v = v.replace(/(\d{3})(\d{1,2})$/, "$1-$2")
519
- } else { //CNPJ
520
- //Coloca ponto entre o segundo e o terceiro dígitos
521
- v = v.replace(/^(\d{2})(\d)/, "$1.$2")
522
- //Coloca ponto entre o quinto e o sexto dígitos
523
- v = v.replace(/^(\d{2})\.(\d{3})(\d)/, "$1.$2.$3")
524
- //Coloca uma barra entre o oitavo e o nono dígitos
525
- v = v.replace(/\.(\d{3})(\d)/, ".$1/$2")
526
- //Coloca um hífen depois do bloco de quatro dígitos
527
- v = v.replace(/(\d{4})(\d)/, "$1-$2")
528
  }
529
- return v
530
- }
531
-
532
- // ===
533
-
534
- MPv1Ticket.Initialize = function (site_id, coupon_mode, discount_action_url, payer_email) {
535
-
536
- // Sets.
537
- MPv1Ticket.site_id = site_id;
538
- MPv1Ticket.coupon_of_discounts.default = coupon_mode;
539
- MPv1Ticket.coupon_of_discounts.discount_action_url = discount_action_url;
540
- MPv1Ticket.coupon_of_discounts.payer_email = payer_email;
541
-
542
- //hide errors
543
- MPv1Ticket.hideErrors();
544
-
545
- // Flow coupon of discounts.
546
- if (MPv1Ticket.coupon_of_discounts.default) {
547
- MPv1Ticket.addListenerEvent(
548
- document.querySelector(MPv1Ticket.selectors.applyCoupon),
549
- "click",
550
- MPv1Ticket.checkCouponEligibility
551
- );
552
- document.querySelector(MPv1Ticket.selectors.formCoupon).style.marginBottom = "20px";
553
- } else {
554
- document.querySelector(MPv1Ticket.selectors.formCoupon).style.display = "none";
555
  }
556
 
557
- // flow: MLB
558
- if (MPv1Ticket.site_id == "MLB") {
559
- MPv1Ticket.actionsMLB();
560
- } else {
561
- document.querySelector(MPv1Ticket.selectors.formTicket).style.display = "none";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
562
  }
563
 
564
- return;
 
 
 
 
 
 
 
 
 
 
 
 
565
 
566
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
567
 
568
- this.MPv1Ticket = MPv1Ticket;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
569
 
570
- if (document.getElementById("payment") != undefined && document.getElementById("payment").offsetWidth <= 530) {
571
- var frameTicket = document.querySelectorAll('#frameTicket');
572
- for (var g = 0; g < frameTicket.length; g++) {
573
- frameTicket[g].classList.remove('mp-col-md-6');
574
- frameTicket[g].classList.add('mp-col-md-12');
 
 
575
  }
576
- }
577
 
578
- }).call();
 
 
 
 
 
579
 
580
- MPv1Ticket.getAmount = function () {
581
- return document.querySelector(MPv1Ticket.selectors.amount)
582
- .value - document.querySelector(MPv1Ticket.selectors.discount).value;
583
- }
584
 
585
- MPv1Ticket.getAmountWithoutDiscount = function () {
586
- return document.querySelector(MPv1Ticket.selectors.amount).value;
587
- }
1
+ (function ($) {
2
+ 'use strict';
3
+
4
+ $(function () {
5
+ var mercado_pago_submit_ticket = false;
6
+ var mercado_pago_docnumber = "CPF";
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
+ default: wc_mercadopago_ticket_params.coupon_mode,
16
  status: false
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  }
18
+
19
+ if ($('form#order_review').length > 0) {
20
+ if (wc_mercadopago_ticket_params.coupon_mode == 'yes') {
21
+ $('#applyCouponTicket').on('click', discountCampaignsHandler);
22
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  }
24
+
25
+ // Load woocommerce checkout form
26
+ $('body').on('updated_checkout', function () {
27
+ if (seller.site_id == "MLB") {
28
+ validateDocumentInputs();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  }
 
 
 
 
30
 
31
+ if (wc_mercadopago_ticket_params.coupon_mode == 'yes') {
32
+ $('#applyCouponTicket').on('click', discountCampaignsHandler);
33
+ }
34
+ });
35
+
36
+ /**
37
+ * Validate input depending on document type
38
+ */
39
+ function validateDocumentInputs() {
40
+ var mp_box_lastname = document.getElementById("mp_box_lastname");
41
+ var mp_box_firstname = document.getElementById("mp_box_firstname");
42
+ var mp_firstname_label = document.getElementById("mp_firstname_label");
43
+ var mp_socialname_label = document.getElementById("mp_socialname_label");
44
+ var mp_cpf_label = document.getElementById("mp_cpf_label");
45
+ var mp_cnpj_label = document.getElementById("mp_cnpj_label");
46
+ var mp_doc_number = document.getElementById("mp_doc_number");
47
+
48
+ $('input[type=radio][name="mercadopago_ticket[docType]"]').change(function () {
49
+ if (this.value == 'CPF') {
50
+ mp_cpf_label.style.display = "block";
51
+ mp_box_lastname.style.display = "block";
52
+ mp_firstname_label.style.display = "block";
53
+ mp_cnpj_label.style.display = "none";
54
+ mp_socialname_label.style.display = "none";
55
+ mp_box_firstname.classList.add("mp-col-md-4");
56
+ mp_box_firstname.classList.remove("mp-col-md-8");
57
+ mp_doc_number.setAttribute("maxlength", "14");
58
+ mp_doc_number.setAttribute("onkeyup", "maskinput(this, mcpf)");
59
+ mercado_pago_docnumber = "CPF";
60
+ } else {
61
+ mp_cpf_label.style.display = "none";
62
+ mp_box_lastname.style.display = "none";
63
+ mp_firstname_label.style.display = "none";
64
+ mp_cnpj_label.style.display = "block";
65
+ mp_socialname_label.style.display = "block";
66
+ mp_box_firstname.classList.add("mp-col-md-8");
67
+ mp_box_firstname.classList.remove("mp-col-md-4");
68
+ mp_doc_number.setAttribute("maxlength", "18");
69
+ mp_doc_number.setAttribute("onkeyup", "maskinput(this, mcnpj)");
70
+ mercado_pago_docnumber = "CNPJ";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  }
72
  });
73
  }
 
74
 
75
+ /**
76
+ * Handler form submit
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 == "MLB") {
86
+ if (validateInputs() && validateDocumentNumber()) {
87
+ mercado_pago_submit_ticket = true;
88
+ } else {
89
+ removeBlockOverlay();
90
+ }
91
 
92
+ return mercado_pago_submit_ticket;
93
+ }
 
 
 
 
 
94
  }
95
+
96
+ // Process when submit the checkout form.
97
+ $('form.checkout').on('checkout_place_order_woo-mercado-pago-ticket', function () {
98
+ return mercadoPagoFormHandlerTicket();
99
+ });
100
+
101
+ // If payment fail, retry on next checkout page
102
+ $('form#order_review').submit(function () {
103
+ return mercadoPagoFormHandlerTicket();
104
+ });
105
+
106
+ /**
107
+ * Get form
108
+ */
109
+ function getForm() {
110
+ return document.querySelector('#mercadopago-form-ticket');
 
111
  }
112
+
113
+ /**
114
+ * Validate if all inputs are valid
115
+ */
116
+ function validateInputs() {
117
+ var form = getForm();
118
+ var form_inputs = form.querySelectorAll("[data-checkout]");
119
+ var span = form.querySelectorAll(".mp-erro_febraban");
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("data-main"));
125
+
126
+ if (element.parentNode.style.display != "none" && (element.value == -1 || element.value == "")) {
127
+ span[i].style.display = "inline-block";
128
+ input.classList.add("mp-form-control-error");
129
+ } else {
130
+ span[i].style.display = "none";
131
+ input.classList.remove("mp-form-control-error");
132
  }
 
 
 
 
 
 
 
 
 
133
  }
134
+
135
+ //Focus on the element with error
136
+ for (var i = 0; i < form_inputs.length; i++) {
137
+ var element = form_inputs[i];
138
+ if (element.parentNode.style.display != "none" && (element.value == -1 || element.value == "")) {
139
+ element.focus();
140
+ return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
141
  }
142
+ }
143
+
144
+ return true;
 
 
 
145
  }
 
146
 
147
+ /**
148
+ * Validate document number
149
+ * @return {bool}
150
+ */
151
+ function validateDocumentNumber() {
152
+ var docnumber_input = document.getElementById("mp_doc_number");
153
+ var docnumber_error = document.getElementById("mp_error_docnumber");
154
+ var docnumber_validate = false;
155
+
156
+ if (mercado_pago_docnumber == "CPF") {
157
+ docnumber_validate = validateCPF(document.getElementById("mp_doc_number").value);
158
+ } else {
159
+ docnumber_validate = validateCNPJ(document.getElementById("mp_doc_number").value);
160
+ }
161
 
162
+ if (!docnumber_validate) {
163
+ docnumber_error.style.display = "block";
164
+ docnumber_input.classList.add("mp-form-control-error");
165
+ docnumber_input.focus();
166
+ } else {
167
+ docnumber_error.style.display = "none";
168
+ docnumber_input.classList.remove("mp-form-control-error");
169
+ docnumber_validate = true;
170
+ }
171
 
172
+ return docnumber_validate;
 
 
 
 
 
173
  }
174
+
175
+ /**
176
+ * Validate CPF
177
+ * @param {string} strCPF
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 == "00000000000") {
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 == 10) || (Resto == 11)) { Resto = 0; }
197
+ if (Resto != parseInt(strCPF.substring(9, 10))) {
198
+ return false;
 
 
 
 
 
 
 
199
  }
200
+
201
+ Soma = 0;
202
+ for (var i = 1; i <= 10; i++) { Soma = Soma + parseInt(strCPF.substring(i - 1, i)) * (12 - i); }
203
+
204
+ Resto = (Soma * 10) % 11;
205
+ if ((Resto == 10) || (Resto == 11)) { Resto = 0; }
206
+ if (Resto != parseInt(strCPF.substring(10, 11))) {
207
  return false;
208
  }
209
+
210
+ return true;
211
+ }
212
+
213
+ /**
214
+ * Validate CNPJ
215
+ * @param {string} strCNPJ
216
+ * @return {bool}
217
+ */
218
+ function validateCNPJ(strCNPJ) {
219
+ var numeros, digitos, soma, i, resultado, pos, tamanho, digitos_iguais;
220
+
221
+ strCNPJ = strCNPJ.replace(".", "");
222
+ strCNPJ = strCNPJ.replace(".", "");
223
+ strCNPJ = strCNPJ.replace(".", "");
224
+ strCNPJ = strCNPJ.replace("-", "");
225
+ strCNPJ = strCNPJ.replace("/", "");
226
+ digitos_iguais = 1;
227
+
228
+ if (strCNPJ.length < 14 && strCNPJ.length < 15) {
229
+ return false;
230
+ }
231
+ for (i = 0; i < strCNPJ.length - 1; i++) {
232
+ if (strCNPJ.charAt(i) != strCNPJ.charAt(i + 1)) {
233
+ digitos_iguais = 0;
234
+ break;
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
+ resultado = soma % 11 < 2 ? 0 : 11 - soma % 11;
252
+ if (resultado != digitos.charAt(0)) {
253
+ return false;
254
+ }
255
+
256
+ tamanho = tamanho + 1;
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
+ resultado = soma % 11 < 2 ? 0 : 11 - soma % 11;
268
+ if (resultado != digitos.charAt(1)) {
269
+ return false;
270
+ }
271
+
272
+ return true;
273
  }
274
+ else {
 
275
  return false;
276
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
277
  }
278
+
279
+ /**
280
+ * Remove Block Overlay from Order Review page
281
+ */
282
+ function removeBlockOverlay() {
283
+ if ($('form#order_review').length > 0) {
284
+ $('.blockOverlay').css('display', 'none');
285
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
286
  }
287
 
288
+ /**
289
+ * Discount Campaigns Handler
290
+ */
291
+ function discountCampaignsHandler() {
292
+ document.querySelector('#mpCouponApplyedTicket').style.display = "none";
293
+
294
+ if (document.querySelector('#couponCodeTicket').value == "") {
295
+ coupon_of_discounts.status = false;
296
+ document.querySelector('#mpCouponErrorTicket').style.display = "block";
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;
300
+ document.querySelector('#discountTicket').value = 0;
301
+
302
+ } else if (coupon_of_discounts.status) {
303
+ coupon_of_discounts.status = false;
304
+ document.querySelector('#mpCouponErrorTicket').style.display = "none";
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 = "none";
313
+ document.querySelector('#couponCodeTicket').style.background = "url(" + wc_mercadopago_ticket_params.loading + ") 98% 50% no-repeat #fff";
314
+ document.querySelector('#couponCodeTicket').style.border = "1px solid #cecece";
315
+ document.querySelector('#applyCouponTicket').disabled = true;
316
+ getDiscountCampaigns();
317
+ }
318
  }
319
 
320
+ /**
321
+ * Get Discount Campaigns
322
+ */
323
+ function getDiscountCampaigns() {
324
+ var url = coupon_of_discounts.discount_action_url;
325
+ var sp = "?";
326
+ if (url.indexOf("?") >= 0) {
327
+ sp = "&";
328
+ }
329
+ url += sp + "site_id=" + wc_mercadopago_ticket_params.site_id;
330
+ url += "&coupon_id=" + document.querySelector('#couponCodeTicket').value;
331
+ url += "&amount=" + document.querySelector('#amountTicket').value;
332
+ url += "&payer=" + coupon_of_discounts.payer_email;
333
 
334
+ $.ajax({
335
+ url: url,
336
+ method: "GET",
337
+ timeout: 5000,
338
+ error: function () {
339
+ coupon_of_discounts.status = false;
340
+ document.querySelector('#mpCouponApplyedTicket').style.display = "none";
341
+ document.querySelector('#mpCouponErrorTicket').style.display = "none";
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, status) {
349
+ if (response.status == 200) {
350
+ coupon_of_discounts.status = true;
351
+ document.querySelector('#mpCouponApplyedTicket').style.display = "block";
352
+ document.querySelector('#discountTicket').value = response.response.coupon_amount;
353
+ document.querySelector('#mpCouponApplyedTicket').innerHTML =
354
+ wc_mercadopago_ticket_params.discount_info1 + " <strong>" +
355
+ currencyIdToCurrency(response.response.currency_id) + " " +
356
+ Math.round(response.response.coupon_amount * 100) / 100 +
357
+ "</strong> " + wc_mercadopago_ticket_params.discount_info2 + " " +
358
+ response.response.name + ".<br>" + wc_mercadopago_ticket_params.discount_info3 + " <strong>" +
359
+ currencyIdToCurrency(response.response.currency_id) + " " +
360
+ Math.round(getAmountWithoutDiscount() * 100) / 100 +
361
+ "</strong><br>" + wc_mercadopago_ticket_params.discount_info4 + " <strong>" +
362
+ currencyIdToCurrency(response.response.currency_id) + " " +
363
+ Math.round(getAmount() * 100) / 100 + "*</strong><br>" +
364
+ "<i>" + wc_mercadopago_ticket_params.discount_info5 + "</i><br>" +
365
+ "<a href='https://api.mercadolibre.com/campaigns/" +
366
+ response.response.id +
367
+ "/terms_and_conditions?format_type=html' target='_blank'>" +
368
+ wc_mercadopago_ticket_params.discount_info6 + "</a>";
369
+ document.querySelector('#mpCouponErrorTicket').style.display = "none";
370
+ document.querySelector('#couponCodeTicket').style.background = null;
371
+ document.querySelector('#couponCodeTicket').style.background = "url(" + wc_mercadopago_ticket_params.check + ") 94% 50% no-repeat #fff";
372
+ document.querySelector('#couponCodeTicket').style.border = "1px solid #cecece";
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 = "none";
379
+ document.querySelector('#mpCouponErrorTicket').style.display = "block";
380
+ document.querySelector('#mpCouponErrorTicket').innerHTML = response.response.message;
381
+ document.querySelector('#couponCodeTicket').style.background = null;
382
+ document.querySelector('#couponCodeTicket').style.background = "url(" + wc_mercadopago_ticket_params.error + ") 94% 50% no-repeat #fff";
383
+ document.querySelector('#applyCouponTicket').value = wc_mercadopago_ticket_params.apply;
384
+ document.querySelector('#discountTicket').value = 0;
385
+ }
386
+ document.querySelector('#applyCouponTicket').disabled = false;
387
+ }
388
+ });
389
+ }
390
 
391
+ /**
392
+ * CurrencyId to Currency
393
+ *
394
+ * @param {string} currency_id
395
+ */
396
+ function currencyIdToCurrency(currency_id) {
397
+ if (currency_id == "ARS") {
398
+ return "$";
399
+ } else if (currency_id == "BRL") {
400
+ return "R$";
401
+ } else if (currency_id == "COP") {
402
+ return "$";
403
+ } else if (currency_id == "CLP") {
404
+ return "$";
405
+ } else if (currency_id == "MXN") {
406
+ return "$";
407
+ } else if (currency_id == "VEF") {
408
+ return "Bs";
409
+ } else if (currency_id == "PEN") {
410
+ return "S/";
411
+ } else if (currency_id == "UYU") {
412
+ return "$U";
413
+ } else {
414
+ return "$";
415
+ }
416
+ }
417
 
418
+ /**
419
+ * Get Amount Without Discount
420
+ *
421
+ * @return {string}
422
+ */
423
+ function getAmountWithoutDiscount() {
424
+ return document.querySelector('#amountTicket').value;
425
  }
 
426
 
427
+ /**
428
+ * Get Amount end calculate discount for hide inputs
429
+ */
430
+ function getAmount() {
431
+ return document.getElementById('amountTicket').value - document.getElementById('discountTicket').value;
432
+ }
433
 
434
+ });
 
 
 
435
 
436
+ }(jQuery));
 
 
assets/js/ticket_config_mercadopago.js CHANGED
@@ -5,6 +5,11 @@ window.onload = function () {
5
  document.querySelector("p.submit").style.display = 'none';
6
  document.querySelectorAll("h2")[4].style.display = 'none';
7
 
 
 
 
 
 
8
  //update form_fields label
9
  var label = document.querySelectorAll("th.titledesc");
10
  for (var i = 0; i < label.length; i++) {
@@ -30,8 +35,8 @@ window.onload = function () {
30
 
31
  //clone save button
32
  var cloneSaveButton = document.getElementById('woocommerce_woo-mercado-pago-ticket_checkout_btn_save');
33
- if (document.getElementById("'woocommerce_woo-mercado-pago-ticket_checkout_homolog_title") != undefined || document.getElementById("'woocommerce_woo-mercado-pago-ticket_checkout_credential_description_prod") != undefined) {
34
- document.getElementById("mp_table_15").append(cloneSaveButton.cloneNode(true));
35
  }
36
 
37
  if (document.getElementById("woocommerce_woo-mercado-pago-ticket_checkout_homolog_title") != undefined || document.getElementById("woocommerce_woo-mercado-pago-ticket_checkout_ticket_options_title") != undefined ) {
@@ -45,8 +50,8 @@ document.getElementById("woocommerce_woo-mercado-pago-ticket_checkout_payments_a
45
  collapse_table.style.display = "none";
46
  collapse_title.style.cursor = "pointer";
47
 
48
- collapse_title.innerHTML += "<span class='btn-collapsible' id='header_plus' style='display:block'>+</span>\
49
- <span class='btn-collapsible' id='header_less' style='display:none'>-</span>";
50
 
51
  var header_plus = document.querySelector("#header_plus");
52
  var header_less = document.querySelector("#header_less");
@@ -72,8 +77,8 @@ document.getElementById("woocommerce_woo-mercado-pago-ticket_checkout_payments_a
72
  collapse_description_2.style.display = "none";
73
  collapse_title_2.style.cursor = "pointer";
74
 
75
- collapse_title_2.innerHTML += "<span class='btn-collapsible' id='header_plus_2' style='display:block'>+</span>\
76
- <span class='btn-collapsible' id='header_less_2' style='display:none'>-</span>";
77
 
78
  var header_plus_2 = document.querySelector("#header_plus_2");
79
  var header_less_2 = document.querySelector("#header_less_2");
5
  document.querySelector("p.submit").style.display = 'none';
6
  document.querySelectorAll("h2")[4].style.display = 'none';
7
 
8
+ var descriptionInput = document.querySelectorAll("p.description");
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("th.titledesc");
15
  for (var i = 0; i < label.length; i++) {
35
 
36
  //clone save button
37
  var cloneSaveButton = document.getElementById('woocommerce_woo-mercado-pago-ticket_checkout_btn_save');
38
+ if (document.getElementById("woocommerce_woo-mercado-pago-ticket_checkout_homolog_title") != undefined || document.getElementById("woocommerce_woo-mercado-pago-ticket_checkout_credential_description_prod") != undefined) {
39
+ document.getElementById("woocommerce_woo-mercado-pago-ticket_checkout_credential_description_prod").nextElementSibling.append(cloneSaveButton.cloneNode(true));
40
  }
41
 
42
  if (document.getElementById("woocommerce_woo-mercado-pago-ticket_checkout_homolog_title") != undefined || document.getElementById("woocommerce_woo-mercado-pago-ticket_checkout_ticket_options_title") != undefined ) {
50
  collapse_table.style.display = "none";
51
  collapse_title.style.cursor = "pointer";
52
 
53
+ collapse_title.innerHTML += "<span class='mp-btn-collapsible' id='header_plus' style='display:block'>+</span>\
54
+ <span class='mp-btn-collapsible' id='header_less' style='display:none'>-</span>";
55
 
56
  var header_plus = document.querySelector("#header_plus");
57
  var header_less = document.querySelector("#header_less");
77
  collapse_description_2.style.display = "none";
78
  collapse_title_2.style.cursor = "pointer";
79
 
80
+ collapse_title_2.innerHTML += "<span class='mp-btn-collapsible' id='header_plus_2' style='display:block'>+</span>\
81
+ <span class='mp-btn-collapsible' id='header_less_2' style='display:none'>-</span>";
82
 
83
  var header_plus_2 = document.querySelector("#header_plus_2");
84
  var header_less_2 = document.querySelector("#header_less_2");
i18n/languages/woocommerce-mercadopago-es_AR.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_AR.po CHANGED
@@ -1,24 +1,24 @@
1
  # Copyright (C) 2019 Mercado Pago
2
- # This file is distributed under the same license as the WooCommerce Mercado Pago plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WooCommerce Mercado Pago 4.0.8\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: 2019-09-13 21:23-0300\n"
13
- "X-Generator: Poedit 2.2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
  "Language: es_AR\n"
18
 
19
  #. Plugin Name of the plugin
20
- msgid "WooCommerce Mercado Pago"
21
- msgstr "WooCommerce Mercado Pago"
22
 
23
  #. Plugin URI of the plugin
24
  msgid "https://github.com/mercadopago/cart-woocommerce"
@@ -79,7 +79,7 @@ msgstr "¡El módulo de pago de Woo Mercado depende de la última versión de %s
79
 
80
  #: includes/module/WC_WooMercadoPago_Module.php:273
81
  msgid "Set up"
82
- msgstr "Configurar"
83
 
84
  #: includes/module/WC_WooMercadoPago_Module.php:274
85
  msgid "Your opinion helps us get better"
@@ -87,11 +87,11 @@ msgstr "Tu opinión nos ayuda a mejorar"
87
 
88
  #: includes/module/WC_WooMercadoPago_Module.php:275
89
  msgid "Guides and Documentation"
90
- msgstr "Guías y Documentación"
91
 
92
  #: includes/module/WC_WooMercadoPago_Module.php:276
93
  msgid "Report Problem"
94
- msgstr "Informar Problema"
95
 
96
  #: includes/module/WC_WooMercadoPago_Module.php:293
97
  msgid "By Mercado Pago"
@@ -229,18 +229,17 @@ msgstr "El pago fue cancelado."
229
  msgid "The payment is in mediation or the purchase was unknown by the customer."
230
  msgstr "El pago esta en mediación o la compra fue desconocida por el cliente."
231
 
232
- #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:35 includes/notification/WC_WooMercadoPago_Notification_IPN.php:40
233
- #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:52
234
  msgid "The Mercado Pago request has failed"
235
  msgstr "La solicitud de Mercado Pago ha fallado"
236
 
237
- #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:116 includes/notification/WC_WooMercadoPago_Notification_IPN.php:141
238
- #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:152 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:170
239
  msgid "Buyer email"
240
  msgstr "Email del comprador"
241
 
242
- #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:119 includes/notification/WC_WooMercadoPago_Notification_IPN.php:144
243
- #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:155 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:173
244
  msgid "Payment method"
245
  msgstr "Medio de pago"
246
 
@@ -309,16 +308,16 @@ msgid "Discount for coupon %s"
309
  msgstr "Descuento para el cupón %s"
310
 
311
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126 includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:128
312
- msgid "Discount of"
313
- msgstr "Descuento de"
314
 
315
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126
316
- msgid " and Rate of"
317
- msgstr " y Tarifa de"
318
 
319
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:130
320
- msgid "Fee of"
321
- msgstr "Tarifa de"
322
 
323
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:355
324
  msgid "Credentials for invalid production!"
@@ -349,12 +348,12 @@ msgid "Click to try again"
349
  msgstr "Haga clic para intentarlo de nuevo"
350
 
351
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:77
352
- msgid "Thanks for your order. Please pay the ticket to have your order approved."
353
- msgstr "Gracias por su orden. Por favor, realice el pago del ticket para tener su orden aprobada."
354
 
355
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:82
356
- msgid "Print the ticket"
357
- msgstr "Imprimir el ticket"
358
 
359
  #: includes/payments/mercadoenvios/WC_WooMercadoPago_Product_Recurrent.php:40
360
  msgid "Subscription Mercado Pago"
@@ -434,32 +433,32 @@ msgid "Deadline to generate new charges. By default as never, if it is blank."
434
  msgstr "Fecha límite para generar nuevos cargos. De forma predeterminada es nunca, si está en blanco."
435
 
436
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:27
437
- msgid "Mercado Pago - Basic Checkout"
438
- msgstr "Mercado Pago - Checkout básico"
439
 
440
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:29
441
  msgid "Pay with the payment method you prefer"
442
  msgstr "Paga con el medio de pago que prefieras"
443
 
444
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:229
445
- msgid "Basic Checkout Accept all method of payment and take your charges to another level %s"
446
- msgstr "Checkout Básico. Acepta todos los medios de pago y lleva tus cobros a otro nivel %s"
447
 
448
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:233
 
 
 
 
449
  msgid "Turn your online store into your customers preferred payment gateway. Choose if the final payment experience will be inside or outside your store."
450
  msgstr "Convierte tu tienda online en la pasarela de pagos preferida de tus clientes. Elige si la experiencia de pago final será dentro o fuera de tu tienda."
451
 
452
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:250 includes/payments/WC_WooMercadoPago_TicketGateway.php:204
453
- msgid "Configure WooCommerce Mercado Pago"
454
- msgstr "Configura WooCommerce Mercado Pago"
455
 
456
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:263
457
- msgid ""
458
- "Enable the experience of the basic checkout of Mercado Pago in your online store, select the means of payment available to your customers and<br> define the maximum fees in which they can pay "
459
- "you."
460
- msgstr ""
461
- "Habilitá la experiencia del checkout básico de Mercado Pago en tu tienda online, seleccioná los medios de pago disponibles para tus clientes y<br> definí el máximo de cuotas en el que podrán "
462
- "pagarte."
463
 
464
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:276 includes/payments/WC_WooMercadoPago_CustomGateway.php:187 includes/payments/WC_WooMercadoPago_TicketGateway.php:217
465
  msgid "Go to the basics. Place your business information."
@@ -470,12 +469,12 @@ msgid "Set payment preferences in your store"
470
  msgstr "Configura las preferencias de pago en tu tienda"
471
 
472
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
473
- msgid "Advanced payment experience settings"
474
- msgstr "Configuración Avanzada de la experiencia de pago"
475
 
476
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
477
- msgid "Integration method"
478
- msgstr "Método de integración"
479
 
480
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:317
481
  msgid "Define what payment experience your customers will have, whether inside or outside your store."
@@ -502,10 +501,8 @@ msgid "Success URL"
502
  msgstr "URL de éxito"
503
 
504
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:357
505
- msgid ""
506
- "Choose the URL that we will show to your customers when we refuse their purchase. Make sure it includes a message appropriate to the situation and give them useful information so they can solve "
507
- "it."
508
- msgstr "Elige la URL que mostraremos a tus clientes cuando rechacemos su compra. Asegurate de que incluya un mensaje adecuado a la situación y dales información útil para que puedan solucionarlo."
509
 
510
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:360
511
  msgid "Payment URL rejected"
@@ -529,11 +526,11 @@ msgstr "Selecciona tarjetas de débito"
529
 
530
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:455
531
  msgid "Select offline payments"
532
- msgstr "Selecciona pagos offline"
533
 
534
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:464 includes/payments/WC_WooMercadoPago_TicketGateway.php:321
535
  msgid "Payment methods"
536
- msgstr "Medios de pago"
537
 
538
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:468 includes/payments/WC_WooMercadoPago_TicketGateway.php:325
539
  msgid "Enable the payment methods available to your customers."
@@ -544,8 +541,8 @@ msgid "Return to the store"
544
  msgstr "Volver a la tienda"
545
 
546
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:489
547
- msgid "Your customer automatically return to the store after payment."
548
- msgstr "Que tu cliente vuelva automáticamente a la tienda después del pago."
549
 
550
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:491 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:548 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:631
551
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:898 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1018 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1051
@@ -568,10 +565,14 @@ msgid "Pay with debit and credit cards"
568
  msgstr "Paga con tarjetas de débito y crédito"
569
 
570
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:153
571
- msgid "Checkout of payments with debit and credit cards<br> Accept payments instantly and maximize the conversion of your business %s"
572
- msgstr "Checkout de pagos con tarjetas de débito y crédito<br> Acepta pagos al instante y maximiza la conversión de tu negocio %s"
 
 
 
 
573
 
574
- #: includes/payments/WC_WooMercadoPago_CustomGateway.php:157
575
  msgid "Turn your online store into a secure and easy-to-use payment gateway for your customers. With personalized checkout your customers pay without leaving your store!"
576
  msgstr "Convierte tu tienda online en una pasarela de pagos segura y fácil de usar para tus clientes. Con el checkout personalizado tus clientes pagan ¡sin salir de tu tienda!"
577
 
@@ -588,8 +589,8 @@ msgid "Advanced configuration of the personalized payment experience\""
588
  msgstr "Configuración avanzada de la experiencia de pago personalizada"
589
 
590
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:228
591
- msgid "Ready, your payment has been accepted!"
592
- msgstr "Listo, su pago ha sido aceptado!"
593
 
594
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:230
595
  msgid "We are processing your payment. In less than an hour we will send you the result by email."
@@ -688,8 +689,8 @@ msgid "<b>Follow these steps to activate Mercado Pago in your store:</b>"
688
  msgstr "<b>Sigue estos pasos para activar Mercado Pago en tu tienda:</b>"
689
 
690
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:395
691
- msgid "Upload your <b>credentials</b> to test the store and charge with your Mercado Pago account <b>depending on the country</b> in which you are registered."
692
- msgstr "Carga tus <b>credenciales</b> para testear la tienda y cobrar con tu cuenta de Mercado Pago <b>según el país</b> en el que estés registrado."
693
 
694
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
695
  msgid "Approve your account to be able to charge."
@@ -704,16 +705,15 @@ msgid "Configure the <b>payment preferences</b> for your customers."
704
  msgstr "Configura las preferencias de pago para tus clientes."
705
 
706
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:423
707
- msgid "Go to advanced settings of both the plugin and checkout only when you want to change the presets."
708
- msgstr "Ve a configuraciones avanzadas tanto del plugin como del checkout solo cuando quieras modificar los ajustes preestablecidos."
709
 
710
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
711
  msgid ""
712
- "Credentials are the keys we provide you to integrate quickly <br>and securely. You must have a %s in Mercado Pago to obtain and collect them <br>on your website. You do not need to know how to "
713
- "design or program to do it"
714
  msgstr ""
715
- "Las credenciales son las claves que te proporcionamos para que integres de forma rápida <br>y segura. Debes tener una %s en Mercado Pago para obtenerlas y cobrar <br>en tu sitio web. No "
716
- "necesitas saber diseñar o programar para hacerlo."
717
 
718
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:443
719
  msgid "approved account"
@@ -765,15 +765,15 @@ msgstr "Modo Producción"
765
 
766
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:612
767
  msgid "When you see that everything is going well, deactivate Sandbox, turn on Production and make way for your online sales."
768
- msgstr "Cuando veas que todo va bien, desactivá Sandbox, prendé Producción y abrí paso a tus ventas online."
769
 
770
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:625
771
- msgid "Productio"
772
  msgstr "Producción"
773
 
774
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
775
- msgid "Choose \"YES\" only when you are ready to sell. Change to NO to activate the Tests mode."
776
- msgstr "Elige “SÍ” solo cuando estés listo para vender. Cambia a NO para activar el modo Pruebas."
777
 
778
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
779
  msgid "Load credentials"
@@ -832,8 +832,8 @@ msgid "Store Category"
832
  msgstr "Categoría de la tienda"
833
 
834
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:851
835
- msgid "What category do your products belong to? Choose the one that best characterizes them (choose <br>\"other\" if your product is too specific)."
836
- msgstr "¿A qué categoría pertenecen tus productos? Elige la que mejor los caracteriza (elige <br>“otro” si tu producto es demasiado específico)."
837
 
838
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:852
839
  msgid "Categories"
@@ -968,8 +968,8 @@ msgid "Accept and reject payments automatically. Do you want us to activate it?"
968
  msgstr "Acepta y rechaza pagos de forma automática. ¿Quieres que lo activemos?"
969
 
970
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1064
971
- msgid "Gateway Discounts"
972
- msgstr "Descuentos Gateway"
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."
@@ -992,16 +992,12 @@ msgid "Everything set up? Go to your store in Sandbox mode"
992
  msgstr "¿Todo configurado? Ve a tu tienda en modo Sandbox"
993
 
994
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1122
995
- msgid "You already went to Production. You just need your best customers <br> to arrive at your store to live the best online shopping experience with Mercado Pago."
996
- msgstr "Ya saliste a Producción. Solo falta que tus mejores clientes <br> lleguen a tu tienda para vivir la mejor experiencia de compra online com Mercado Pago."
997
 
998
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1124
999
- msgid ""
1000
- "Visit your store as if you were one of your customers and check that everything is fine. If you already went to Production,<br> bring your customers and increase your sales with the best online "
1001
- "shopping experience."
1002
- msgstr ""
1003
- "Visita tu tienda como si fueras uno de tus clientes y revisa que todo esté bien. Si ya saliste a Producción,<br> trae a tus clientes y aumenta tus ventas con la mejor experiencia de compra "
1004
- "online."
1005
 
1006
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1141
1007
  msgid "Visit my store"
@@ -1016,20 +1012,24 @@ msgid "Pay with cash"
1016
  msgstr "Paga con dinero en efectivo"
1017
 
1018
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:183
1019
- msgid "Checkout of payments with cash<br> Accept face-to-face payments, do not leave anyone out! %s"
1020
- msgstr "Checkout de pagos con dinero en efectivo<br> Acepta pagos presenciales ¡no dejes a nadie afuera! %s"
1021
 
1022
- #: includes/payments/WC_WooMercadoPago_TicketGateway.php:187
 
 
 
 
1023
  msgid "Include this preferred purchase option by some customers."
1024
  msgstr "Incluye esta opción de compra preferida por algunos clientes."
1025
 
1026
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:230
1027
  msgid "Enable Mercado Pago for cash payments in your store and <br> select the options available to your customers."
1028
- msgstr "Habilitá Mercado Pago para pagos en efectivo en tu tienda y <br> seleccioná las opciones disponibles para tus clientes."
1029
 
1030
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:243
1031
  msgid "Set payment preferences with cash"
1032
- msgstr "Configurá las preferencias de pago con dinero en efectivo"
1033
 
1034
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:256
1035
  msgid "Advanced configuration of the cash payment experience"
@@ -1104,7 +1104,7 @@ msgid "This controls the title that the user sees during the payment process."
1104
  msgstr "Esto controla el título que el usuario ve durante el proceso de pago."
1105
 
1106
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:236
1107
- msgid "nable free shipping for this shipping method"
1108
  msgstr "Habilitar envío gratis para este método de envío"
1109
 
1110
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:240
@@ -1191,8 +1191,8 @@ msgstr "Otra tarjeta"
1191
  msgid "CVV"
1192
  msgstr "CVV"
1193
 
1194
- #: templates/checkout/custom_checkout.php:94 templates/checkout/custom_checkout.php:108 templates/checkout/custom_checkout.php:111 templates/checkout/custom_checkout.php:121
1195
- #: templates/checkout/custom_checkout.php:141 templates/checkout/custom_checkout.php:205
1196
  msgid "Card number"
1197
  msgstr "Número de Tarjeta"
1198
 
@@ -1221,8 +1221,8 @@ msgid "Last 3 numbers on the back"
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?"
1226
 
1227
  #: templates/checkout/custom_checkout.php:153
1228
  msgid "Issuer"
@@ -1238,7 +1238,7 @@ msgstr "Seleccione el número de cotas"
1238
 
1239
  #: templates/checkout/custom_checkout.php:192
1240
  msgid "Enter your document number"
1241
- msgstr "Ingrese su número de documento"
1242
 
1243
  #: templates/checkout/custom_checkout.php:196
1244
  msgid "Type"
@@ -1393,7 +1393,7 @@ msgid "Select the issuer with whom you want to process the payment"
1393
  msgstr "Selecciona el emisor con el que quieras procesar el pago"
1394
 
1395
  #: woocommerce-mercadopago.php:48
1396
- msgid "WooCommerce Mercado Pago requires PHP version 5.6 or later. Please update your PHP version."
1397
  msgstr "El plugin de Mercado Pago requiere la versión de PHP 5.6 o posterior. Por favor actualice su versión de PHP."
1398
 
1399
  #: woocommerce-mercadopago.php:65
@@ -1427,3 +1427,7 @@ msgstr "Ofrece todos los medios de pago: tarjetas de crédito y débito, dinero
1427
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:28
1428
  msgid "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!"
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!"
 
 
 
 
1
  # Copyright (C) 2019 Mercado Pago
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.1.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: 2019-12-23 17:10-0300\n"
13
+ "X-Generator: Poedit 2.2.4\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
  "Language: es_AR\n"
18
 
19
  #. Plugin Name of the plugin
20
+ msgid "Mercado Pago payments for WooCommerce"
21
+ msgstr "Mercado Pago payments for WooCommerce"
22
 
23
  #. Plugin URI of the plugin
24
  msgid "https://github.com/mercadopago/cart-woocommerce"
79
 
80
  #: includes/module/WC_WooMercadoPago_Module.php:273
81
  msgid "Set up"
82
+ msgstr "Ajustes"
83
 
84
  #: includes/module/WC_WooMercadoPago_Module.php:274
85
  msgid "Your opinion helps us get better"
87
 
88
  #: includes/module/WC_WooMercadoPago_Module.php:275
89
  msgid "Guides and Documentation"
90
+ msgstr "Guías y documentación"
91
 
92
  #: includes/module/WC_WooMercadoPago_Module.php:276
93
  msgid "Report Problem"
94
+ msgstr "Informar problema"
95
 
96
  #: includes/module/WC_WooMercadoPago_Module.php:293
97
  msgid "By Mercado Pago"
229
  msgid "The payment is in mediation or the purchase was unknown by the customer."
230
  msgstr "El pago esta en mediación o la compra fue desconocida por el cliente."
231
 
232
+ #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:35 includes/notification/WC_WooMercadoPago_Notification_IPN.php:40 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:52
 
233
  msgid "The Mercado Pago request has failed"
234
  msgstr "La solicitud de Mercado Pago ha fallado"
235
 
236
+ #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:116 includes/notification/WC_WooMercadoPago_Notification_IPN.php:141 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:152
237
+ #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:170
238
  msgid "Buyer email"
239
  msgstr "Email del comprador"
240
 
241
+ #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:119 includes/notification/WC_WooMercadoPago_Notification_IPN.php:144 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:155
242
+ #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:173
243
  msgid "Payment method"
244
  msgstr "Medio de pago"
245
 
308
  msgstr "Descuento para el cupón %s"
309
 
310
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126 includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:128
311
+ msgid "discount of"
312
+ msgstr "descuento de"
313
 
314
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126
315
+ msgid " and fee of"
316
+ msgstr " y comisión de"
317
 
318
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:130
319
+ msgid "fee of"
320
+ msgstr "comisión de"
321
 
322
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:355
323
  msgid "Credentials for invalid production!"
348
  msgstr "Haga clic para intentarlo de nuevo"
349
 
350
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:77
351
+ msgid "Great, we processed your purchase order. Complete the payment with ticket so that we finish approving it."
352
+ msgstr "Excelente, procesamos tu orden de compra. Completa el pago con ticket para que terminemos de aprobarla."
353
 
354
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:82
355
+ msgid "Print ticket"
356
+ msgstr "Imprimir ticket"
357
 
358
  #: includes/payments/mercadoenvios/WC_WooMercadoPago_Product_Recurrent.php:40
359
  msgid "Subscription Mercado Pago"
433
  msgstr "Fecha límite para generar nuevos cargos. De forma predeterminada es nunca, si está en blanco."
434
 
435
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:27
436
+ msgid "Mercado Pago Checkout"
437
+ msgstr "Checkout de Mercado Pago"
438
 
439
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:29
440
  msgid "Pay with the payment method you prefer"
441
  msgstr "Paga con el medio de pago que prefieras"
442
 
443
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:229
444
+ msgid "Mercado Pago checkout %s"
445
+ msgstr "Checkout de Mercado Pago %s"
446
 
447
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:235
448
+ msgid "Accept all method of payment and take your charges to another level"
449
+ msgstr "Acepta todos los medios de pago y lleva tus cobros a otro nivel"
450
+
451
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:239
452
  msgid "Turn your online store into your customers preferred payment gateway. Choose if the final payment experience will be inside or outside your store."
453
  msgstr "Convierte tu tienda online en la pasarela de pagos preferida de tus clientes. Elige si la experiencia de pago final será dentro o fuera de tu tienda."
454
 
455
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:250 includes/payments/WC_WooMercadoPago_TicketGateway.php:204
456
+ msgid "Configure Mercado Pago for WooCommerce"
457
+ msgstr "Configura Mercado Pago para WooCommerce"
458
 
459
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:263
460
+ msgid "Enable the experience of the Mercado Pago Checkout in your online store, select the means of payment available to your customers and<br> define the maximum fees in which they can pay you."
461
+ msgstr "Habilita la experiencia del Checkout de Mercado Pago en tu tienda online, selecciona los medios de pago disponibles para tus clientes y<br> define el máximo de cuotas en el que podrán pagarte."
 
 
 
 
462
 
463
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:276 includes/payments/WC_WooMercadoPago_CustomGateway.php:187 includes/payments/WC_WooMercadoPago_TicketGateway.php:217
464
  msgid "Go to the basics. Place your business information."
469
  msgstr "Configura las preferencias de pago en tu tienda"
470
 
471
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
472
+ msgid "advanced settings"
473
+ msgstr "configuración avanzada"
474
 
475
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
476
+ msgid "Payment experience"
477
+ msgstr "Experiencia de pago"
478
 
479
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:317
480
  msgid "Define what payment experience your customers will have, whether inside or outside your store."
501
  msgstr "URL de éxito"
502
 
503
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:357
504
+ msgid "Choose the URL that we will show to your customers when we refuse their purchase. Make sure it includes a message appropriate to the situation and give them useful information so they can solve it."
505
+ msgstr "Elige la URL que mostraremos a tus clientes cuando rechacemos su compra. Asegúrate de incluir un mensaje adecuado a la situación y dales información útil para que puedan solucionarlo."
 
 
506
 
507
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:360
508
  msgid "Payment URL rejected"
526
 
527
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:455
528
  msgid "Select offline payments"
529
+ msgstr "Selecciona medios de pago presenciales"
530
 
531
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:464 includes/payments/WC_WooMercadoPago_TicketGateway.php:321
532
  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 "Enable the payment methods available to your customers."
541
  msgstr "Volver a la tienda"
542
 
543
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:489
544
+ msgid "Do you want your customer to automatically return to the store after payment?"
545
+ msgstr "¿Quieres que tu cliente vuelva automáticamente a la tienda después del pago?"
546
 
547
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:491 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:548 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:631
548
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:898 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1018 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1051
565
  msgstr "Paga con tarjetas de débito y crédito"
566
 
567
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:153
568
+ msgid "Checkout of payments with debit and credit cards %s"
569
+ msgstr "Checkout de pagos con tarjetas de débito y crédito %s"
570
+
571
+ #: includes/payments/WC_WooMercadoPago_CustomGateway.php:158
572
+ msgid "Accept payments instantly and maximize the conversion of your business"
573
+ msgstr "Acepta pagos al instante y maximiza la conversión de tu negocio"
574
 
575
+ #: includes/payments/WC_WooMercadoPago_CustomGateway.php:162
576
  msgid "Turn your online store into a secure and easy-to-use payment gateway for your customers. With personalized checkout your customers pay without leaving your store!"
577
  msgstr "Convierte tu tienda online en una pasarela de pagos segura y fácil de usar para tus clientes. Con el checkout personalizado tus clientes pagan ¡sin salir de tu tienda!"
578
 
589
  msgstr "Configuración avanzada de la experiencia de pago personalizada"
590
 
591
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:228
592
+ msgid "That’s it, payment accepted!"
593
+ msgstr "Listo, ¡aceptamos tu pago!"
594
 
595
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:230
596
  msgid "We are processing your payment. In less than an hour we will send you the result by email."
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 <b>credentials</b> depending on the country in which you are registered."
693
+ msgstr "Carga tus <b>credenciales</b> según el país en el que estés registrado."
694
 
695
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
696
  msgid "Approve your account to be able to charge."
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> solo cuando quieras modificar los ajustes preestablecidos."
710
 
711
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
712
  msgid ""
713
+ "Credentials are the keys we provide you to integrate quickly <br>and securely. You must have a %s in Mercado Pago to obtain and collect them <br>on your website. You do not need to know how to design or program to do it"
 
714
  msgstr ""
715
+ "Las credenciales son las claves que te proporcionamos para que integres de forma rápida <br>y segura. Debes tener una %s en Mercado Pago para obtenerlas y cobrar <br>en tu sitio web. No necesitas saber diseñar o "
716
+ "programar para hacerlo."
717
 
718
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:443
719
  msgid "approved account"
765
 
766
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:612
767
  msgid "When you see that everything is going well, deactivate Sandbox, turn on Production and make way for your online sales."
768
+ msgstr "Cuando veas que todo va bien, desactiva Sandbox para ir a Producción y abre paso a tus ventas online."
769
 
770
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:625
771
+ msgid "Production"
772
  msgstr "Producción"
773
 
774
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
775
+ msgid "Choose YES only when you are ready to sell. Change to NO to activate the Tests mode."
776
+ msgstr "Elige solo cuando estés listo para vender. Cambia a NO para activar el modo Pruebas."
777
 
778
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
779
  msgid "Load credentials"
832
  msgstr "Categoría de la tienda"
833
 
834
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:851
835
+ msgid "What category do your products belong to? Choose the one that best characterizes them (choose \"other\" if your product is too specific)."
836
+ msgstr "¿A qué categoría pertenecen tus productos? Elige la que mejor los caracteriza (elige otro” si tu producto es demasiado específico)."
837
 
838
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:852
839
  msgid "Categories"
968
  msgstr "Acepta y rechaza pagos de forma automática. ¿Quieres que lo activemos?"
969
 
970
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1064
971
+ msgid "Discounts per purchase with Mercado Pago"
972
+ msgstr "Descuentos por compra con 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."
992
  msgstr "¿Todo configurado? Ve a tu tienda en modo Sandbox"
993
 
994
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1122
995
+ msgid "Visit your store as if you were one of your customers and check that everything is fine. If you already went to Production,<br> bring your customers and increase your sales with the best online shopping experience."
996
+ msgstr "Visita tu tienda como si fueras uno de tus clientes y revisa que todo esté bien. Si ya saliste a Producción,<br> trae a tus clientes y aumenta tus ventas con la mejor experiencia de compra online."
997
 
998
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1124
999
+ msgid "Visit your store and simulate a payment to check that everything is fine."
1000
+ msgstr "Visita tu tienda y simula un pago para revisar que todo esté bien."
 
 
 
 
1001
 
1002
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1141
1003
  msgid "Visit my store"
1012
  msgstr "Paga con dinero en efectivo"
1013
 
1014
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:183
1015
+ msgid "Checkout of payments with cash %s"
1016
+ msgstr "Checkout de pagos con dinero en efectivo %s"
1017
 
1018
+ #: includes/payments/WC_WooMercadoPago_TicketGateway.php:192
1019
+ msgid "Accept face-to-face payments, do not leave anyone out!"
1020
+ msgstr "Acepta pagos presenciales ¡no dejes a nadie afuera!"
1021
+
1022
+ #: includes/payments/WC_WooMercadoPago_TicketGateway.php:197
1023
  msgid "Include this preferred purchase option by some customers."
1024
  msgstr "Incluye esta opción de compra preferida por algunos clientes."
1025
 
1026
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:230
1027
  msgid "Enable Mercado Pago for cash payments in your store and <br> select the options available to your customers."
1028
+ msgstr "Habilita Mercado Pago para pagos en efectivo en tu tienda y <br> selecciona las opciones disponibles para tus clientes."
1029
 
1030
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:243
1031
  msgid "Set payment preferences with cash"
1032
+ msgstr "Configura las preferencias de pago con dinero en efectivo"
1033
 
1034
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:256
1035
  msgid "Advanced configuration of the cash payment experience"
1104
  msgstr "Esto controla el título que el usuario ve durante el proceso de pago."
1105
 
1106
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:236
1107
+ msgid "Enable free shipping for this shipping method"
1108
  msgstr "Habilitar envío gratis para este método de envío"
1109
 
1110
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:240
1191
  msgid "CVV"
1192
  msgstr "CVV"
1193
 
1194
+ #: templates/checkout/custom_checkout.php:94 templates/checkout/custom_checkout.php:108 templates/checkout/custom_checkout.php:111 templates/checkout/custom_checkout.php:121 templates/checkout/custom_checkout.php:141
1195
+ #: templates/checkout/custom_checkout.php:205
1196
  msgid "Card number"
1197
  msgstr "Número de Tarjeta"
1198
 
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"
1226
 
1227
  #: templates/checkout/custom_checkout.php:153
1228
  msgid "Issuer"
1238
 
1239
  #: templates/checkout/custom_checkout.php:192
1240
  msgid "Enter your document number"
1241
+ msgstr "Ingresa tu número de documento"
1242
 
1243
  #: templates/checkout/custom_checkout.php:196
1244
  msgid "Type"
1393
  msgstr "Selecciona el emisor con el que quieras procesar el pago"
1394
 
1395
  #: woocommerce-mercadopago.php:48
1396
+ msgid "Mercado Pago payments for WooCommerce requires PHP version 5.6 or later. Please update your PHP version."
1397
  msgstr "El plugin de Mercado Pago requiere la versión de PHP 5.6 o posterior. Por favor actualice su versión de PHP."
1398
 
1399
  #: woocommerce-mercadopago.php:65
1427
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:28
1428
  msgid "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!"
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 "Select the payment methods available in your store."
1433
+ msgstr "Selecciona los medios de pago disponibles en tu tienda."
i18n/languages/woocommerce-mercadopago-es_CL.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_CL.po CHANGED
@@ -1,24 +1,24 @@
1
  # Copyright (C) 2019 Mercado Pago
2
- # This file is distributed under the same license as the WooCommerce Mercado Pago plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WooCommerce Mercado Pago 4.0.8\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: 2019-09-13 21:23-0300\n"
13
- "X-Generator: Poedit 2.2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
  "Language: es_CL\n"
18
 
19
  #. Plugin Name of the plugin
20
- msgid "WooCommerce Mercado Pago"
21
- msgstr "WooCommerce Mercado Pago"
22
 
23
  #. Plugin URI of the plugin
24
  msgid "https://github.com/mercadopago/cart-woocommerce"
@@ -79,7 +79,7 @@ msgstr "¡El módulo de pago de Woo Mercado depende de la última versión de %s
79
 
80
  #: includes/module/WC_WooMercadoPago_Module.php:273
81
  msgid "Set up"
82
- msgstr "Configurar"
83
 
84
  #: includes/module/WC_WooMercadoPago_Module.php:274
85
  msgid "Your opinion helps us get better"
@@ -87,11 +87,11 @@ msgstr "Tu opinión nos ayuda a mejorar"
87
 
88
  #: includes/module/WC_WooMercadoPago_Module.php:275
89
  msgid "Guides and Documentation"
90
- msgstr "Guías y Documentación"
91
 
92
  #: includes/module/WC_WooMercadoPago_Module.php:276
93
  msgid "Report Problem"
94
- msgstr "Informar Problema"
95
 
96
  #: includes/module/WC_WooMercadoPago_Module.php:293
97
  msgid "By Mercado Pago"
@@ -229,18 +229,17 @@ msgstr "El pago fue cancelado."
229
  msgid "The payment is in mediation or the purchase was unknown by the customer."
230
  msgstr "El pago esta en mediación o la compra fue desconocida por el cliente."
231
 
232
- #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:35 includes/notification/WC_WooMercadoPago_Notification_IPN.php:40
233
- #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:52
234
  msgid "The Mercado Pago request has failed"
235
  msgstr "La solicitud de Mercado Pago ha fallado"
236
 
237
- #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:116 includes/notification/WC_WooMercadoPago_Notification_IPN.php:141
238
- #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:152 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:170
239
  msgid "Buyer email"
240
  msgstr "Email del comprador"
241
 
242
- #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:119 includes/notification/WC_WooMercadoPago_Notification_IPN.php:144
243
- #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:155 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:173
244
  msgid "Payment method"
245
  msgstr "Medio de pago"
246
 
@@ -309,16 +308,16 @@ msgid "Discount for coupon %s"
309
  msgstr "Descuento para el cupón %s"
310
 
311
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126 includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:128
312
- msgid "Discount of"
313
- msgstr "Descuento de"
314
 
315
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126
316
- msgid " and Rate of"
317
- msgstr " y Tarifa de"
318
 
319
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:130
320
- msgid "Fee of"
321
- msgstr "Tarifa de"
322
 
323
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:355
324
  msgid "Credentials for invalid production!"
@@ -349,12 +348,12 @@ msgid "Click to try again"
349
  msgstr "Haga clic para intentarlo de nuevo"
350
 
351
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:77
352
- msgid "Thanks for your order. Please pay the ticket to have your order approved."
353
- msgstr "Gracias por su orden. Por favor, realice el pago del ticket para tener su orden aprobada."
354
 
355
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:82
356
- msgid "Print the ticket"
357
- msgstr "Imprimir el ticket"
358
 
359
  #: includes/payments/mercadoenvios/WC_WooMercadoPago_Product_Recurrent.php:40
360
  msgid "Subscription Mercado Pago"
@@ -434,32 +433,32 @@ msgid "Deadline to generate new charges. By default as never, if it is blank."
434
  msgstr "Fecha límite para generar nuevos cargos. De forma predeterminada es nunca, si está en blanco."
435
 
436
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:27
437
- msgid "Mercado Pago - Basic Checkout"
438
- msgstr "Mercado Pago - Checkout básico"
439
 
440
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:29
441
  msgid "Pay with the payment method you prefer"
442
  msgstr "Paga con el medio de pago que prefieras"
443
 
444
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:229
445
- msgid "Basic Checkout Accept all method of payment and take your charges to another level %s"
446
- msgstr "Checkout Básico. Acepta todos los medios de pago y lleva tus cobros a otro nivel %s"
447
 
448
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:233
 
 
 
 
449
  msgid "Turn your online store into your customers preferred payment gateway. Choose if the final payment experience will be inside or outside your store."
450
  msgstr "Convierte tu tienda online en la pasarela de pagos preferida de tus clientes. Elige si la experiencia de pago final será dentro o fuera de tu tienda."
451
 
452
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:250 includes/payments/WC_WooMercadoPago_TicketGateway.php:204
453
- msgid "Configure WooCommerce Mercado Pago"
454
- msgstr "Configura WooCommerce Mercado Pago"
455
 
456
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:263
457
- msgid ""
458
- "Enable the experience of the basic checkout of Mercado Pago in your online store, select the means of payment available to your customers and<br> define the maximum fees in which they can pay "
459
- "you."
460
- msgstr ""
461
- "Habilitá la experiencia del checkout básico de Mercado Pago en tu tienda online, seleccioná los medios de pago disponibles para tus clientes y<br> definí el máximo de cuotas en el que podrán "
462
- "pagarte."
463
 
464
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:276 includes/payments/WC_WooMercadoPago_CustomGateway.php:187 includes/payments/WC_WooMercadoPago_TicketGateway.php:217
465
  msgid "Go to the basics. Place your business information."
@@ -470,12 +469,12 @@ msgid "Set payment preferences in your store"
470
  msgstr "Configura las preferencias de pago en tu tienda"
471
 
472
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
473
- msgid "Advanced payment experience settings"
474
- msgstr "Configuración Avanzada de la experiencia de pago"
475
 
476
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
477
- msgid "Integration method"
478
- msgstr "Método de integración"
479
 
480
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:317
481
  msgid "Define what payment experience your customers will have, whether inside or outside your store."
@@ -502,10 +501,8 @@ msgid "Success URL"
502
  msgstr "URL de éxito"
503
 
504
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:357
505
- msgid ""
506
- "Choose the URL that we will show to your customers when we refuse their purchase. Make sure it includes a message appropriate to the situation and give them useful information so they can solve "
507
- "it."
508
- msgstr "Elige la URL que mostraremos a tus clientes cuando rechacemos su compra. Asegurate de que incluya un mensaje adecuado a la situación y dales información útil para que puedan solucionarlo."
509
 
510
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:360
511
  msgid "Payment URL rejected"
@@ -529,11 +526,11 @@ msgstr "Selecciona tarjetas de débito"
529
 
530
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:455
531
  msgid "Select offline payments"
532
- msgstr "Selecciona pagos offline"
533
 
534
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:464 includes/payments/WC_WooMercadoPago_TicketGateway.php:321
535
  msgid "Payment methods"
536
- msgstr "Medios de pago"
537
 
538
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:468 includes/payments/WC_WooMercadoPago_TicketGateway.php:325
539
  msgid "Enable the payment methods available to your customers."
@@ -544,8 +541,8 @@ msgid "Return to the store"
544
  msgstr "Volver a la tienda"
545
 
546
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:489
547
- msgid "Your customer automatically return to the store after payment."
548
- msgstr "Que tu cliente vuelva automáticamente a la tienda después del pago."
549
 
550
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:491 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:548 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:631
551
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:898 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1018 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1051
@@ -568,10 +565,14 @@ msgid "Pay with debit and credit cards"
568
  msgstr "Paga con tarjetas de débito y crédito"
569
 
570
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:153
571
- msgid "Checkout of payments with debit and credit cards<br> Accept payments instantly and maximize the conversion of your business %s"
572
- msgstr "Checkout de pagos con tarjetas de débito y crédito<br> Acepta pagos al instante y maximiza la conversión de tu negocio %s"
 
 
 
 
573
 
574
- #: includes/payments/WC_WooMercadoPago_CustomGateway.php:157
575
  msgid "Turn your online store into a secure and easy-to-use payment gateway for your customers. With personalized checkout your customers pay without leaving your store!"
576
  msgstr "Convierte tu tienda online en una pasarela de pagos segura y fácil de usar para tus clientes. Con el checkout personalizado tus clientes pagan ¡sin salir de tu tienda!"
577
 
@@ -588,8 +589,8 @@ msgid "Advanced configuration of the personalized payment experience\""
588
  msgstr "Configuración avanzada de la experiencia de pago personalizada"
589
 
590
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:228
591
- msgid "Ready, your payment has been accepted!"
592
- msgstr "Listo, su pago ha sido aceptado!"
593
 
594
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:230
595
  msgid "We are processing your payment. In less than an hour we will send you the result by email."
@@ -688,8 +689,8 @@ msgid "<b>Follow these steps to activate Mercado Pago in your store:</b>"
688
  msgstr "<b>Sigue estos pasos para activar Mercado Pago en tu tienda:</b>"
689
 
690
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:395
691
- msgid "Upload your <b>credentials</b> to test the store and charge with your Mercado Pago account <b>depending on the country</b> in which you are registered."
692
- msgstr "Carga tus <b>credenciales</b> para testear la tienda y cobrar con tu cuenta de Mercado Pago <b>según el país</b> en el que estés registrado."
693
 
694
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
695
  msgid "Approve your account to be able to charge."
@@ -704,16 +705,15 @@ msgid "Configure the <b>payment preferences</b> for your customers."
704
  msgstr "Configura las preferencias de pago para tus clientes."
705
 
706
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:423
707
- msgid "Go to advanced settings of both the plugin and checkout only when you want to change the presets."
708
- msgstr "Ve a configuraciones avanzadas tanto del plugin como del checkout solo cuando quieras modificar los ajustes preestablecidos."
709
 
710
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
711
  msgid ""
712
- "Credentials are the keys we provide you to integrate quickly <br>and securely. You must have a %s in Mercado Pago to obtain and collect them <br>on your website. You do not need to know how to "
713
- "design or program to do it"
714
  msgstr ""
715
- "Las credenciales son las claves que te proporcionamos para que integres de forma rápida <br>y segura. Debes tener una %s en Mercado Pago para obtenerlas y cobrar <br>en tu sitio web. No "
716
- "necesitas saber diseñar o programar para hacerlo."
717
 
718
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:443
719
  msgid "approved account"
@@ -765,15 +765,15 @@ msgstr "Modo Producción"
765
 
766
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:612
767
  msgid "When you see that everything is going well, deactivate Sandbox, turn on Production and make way for your online sales."
768
- msgstr "Cuando veas que todo va bien, desactivá Sandbox, prendé Producción y abrí paso a tus ventas online."
769
 
770
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:625
771
- msgid "Productio"
772
  msgstr "Producción"
773
 
774
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
775
- msgid "Choose \"YES\" only when you are ready to sell. Change to NO to activate the Tests mode."
776
- msgstr "Elige “SÍ” solo cuando estés listo para vender. Cambia a NO para activar el modo Pruebas."
777
 
778
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
779
  msgid "Load credentials"
@@ -832,8 +832,8 @@ msgid "Store Category"
832
  msgstr "Categoría de la tienda"
833
 
834
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:851
835
- msgid "What category do your products belong to? Choose the one that best characterizes them (choose <br>\"other\" if your product is too specific)."
836
- msgstr "¿A qué categoría pertenecen tus productos? Elige la que mejor los caracteriza (elige <br>“otro” si tu producto es demasiado específico)."
837
 
838
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:852
839
  msgid "Categories"
@@ -968,8 +968,8 @@ msgid "Accept and reject payments automatically. Do you want us to activate it?"
968
  msgstr "Acepta y rechaza pagos de forma automática. ¿Quieres que lo activemos?"
969
 
970
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1064
971
- msgid "Gateway Discounts"
972
- msgstr "Descuentos Gateway"
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."
@@ -992,16 +992,12 @@ msgid "Everything set up? Go to your store in Sandbox mode"
992
  msgstr "¿Todo configurado? Ve a tu tienda en modo Sandbox"
993
 
994
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1122
995
- msgid "You already went to Production. You just need your best customers <br> to arrive at your store to live the best online shopping experience with Mercado Pago."
996
- msgstr "Ya saliste a Producción. Solo falta que tus mejores clientes <br> lleguen a tu tienda para vivir la mejor experiencia de compra online com Mercado Pago."
997
 
998
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1124
999
- msgid ""
1000
- "Visit your store as if you were one of your customers and check that everything is fine. If you already went to Production,<br> bring your customers and increase your sales with the best online "
1001
- "shopping experience."
1002
- msgstr ""
1003
- "Visita tu tienda como si fueras uno de tus clientes y revisa que todo esté bien. Si ya saliste a Producción,<br> trae a tus clientes y aumenta tus ventas con la mejor experiencia de compra "
1004
- "online."
1005
 
1006
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1141
1007
  msgid "Visit my store"
@@ -1016,20 +1012,24 @@ msgid "Pay with cash"
1016
  msgstr "Paga con dinero en efectivo"
1017
 
1018
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:183
1019
- msgid "Checkout of payments with cash<br> Accept face-to-face payments, do not leave anyone out! %s"
1020
- msgstr "Checkout de pagos con dinero en efectivo<br> Acepta pagos presenciales ¡no dejes a nadie afuera! %s"
1021
 
1022
- #: includes/payments/WC_WooMercadoPago_TicketGateway.php:187
 
 
 
 
1023
  msgid "Include this preferred purchase option by some customers."
1024
  msgstr "Incluye esta opción de compra preferida por algunos clientes."
1025
 
1026
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:230
1027
  msgid "Enable Mercado Pago for cash payments in your store and <br> select the options available to your customers."
1028
- msgstr "Habilitá Mercado Pago para pagos en efectivo en tu tienda y <br> seleccioná las opciones disponibles para tus clientes."
1029
 
1030
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:243
1031
  msgid "Set payment preferences with cash"
1032
- msgstr "Configurá las preferencias de pago con dinero en efectivo"
1033
 
1034
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:256
1035
  msgid "Advanced configuration of the cash payment experience"
@@ -1104,7 +1104,7 @@ msgid "This controls the title that the user sees during the payment process."
1104
  msgstr "Esto controla el título que el usuario ve durante el proceso de pago."
1105
 
1106
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:236
1107
- msgid "nable free shipping for this shipping method"
1108
  msgstr "Habilitar envío gratis para este método de envío"
1109
 
1110
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:240
@@ -1191,8 +1191,8 @@ msgstr "Otra tarjeta"
1191
  msgid "CVV"
1192
  msgstr "CVV"
1193
 
1194
- #: templates/checkout/custom_checkout.php:94 templates/checkout/custom_checkout.php:108 templates/checkout/custom_checkout.php:111 templates/checkout/custom_checkout.php:121
1195
- #: templates/checkout/custom_checkout.php:141 templates/checkout/custom_checkout.php:205
1196
  msgid "Card number"
1197
  msgstr "Número de Tarjeta"
1198
 
@@ -1221,8 +1221,8 @@ msgid "Last 3 numbers on the back"
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?"
1226
 
1227
  #: templates/checkout/custom_checkout.php:153
1228
  msgid "Issuer"
@@ -1238,7 +1238,7 @@ msgstr "Seleccione el número de cotas"
1238
 
1239
  #: templates/checkout/custom_checkout.php:192
1240
  msgid "Enter your document number"
1241
- msgstr "Ingrese su número de documento"
1242
 
1243
  #: templates/checkout/custom_checkout.php:196
1244
  msgid "Type"
@@ -1393,7 +1393,7 @@ msgid "Select the issuer with whom you want to process the payment"
1393
  msgstr "Selecciona el emisor con el que quieras procesar el pago"
1394
 
1395
  #: woocommerce-mercadopago.php:48
1396
- msgid "WooCommerce Mercado Pago requires PHP version 5.6 or later. Please update your PHP version."
1397
  msgstr "El plugin de Mercado Pago requiere la versión de PHP 5.6 o posterior. Por favor actualice su versión de PHP."
1398
 
1399
  #: woocommerce-mercadopago.php:65
@@ -1427,3 +1427,7 @@ msgstr "Ofrece todos los medios de pago: tarjetas de crédito y débito, dinero
1427
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:28
1428
  msgid "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!"
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!"
 
 
 
 
1
  # Copyright (C) 2019 Mercado Pago
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.1.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: 2019-12-23 17:11-0300\n"
13
+ "X-Generator: Poedit 2.2.4\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
  "Language: es_CL\n"
18
 
19
  #. Plugin Name of the plugin
20
+ msgid "Mercado Pago payments for WooCommerce"
21
+ msgstr "Mercado Pago payments for WooCommerce"
22
 
23
  #. Plugin URI of the plugin
24
  msgid "https://github.com/mercadopago/cart-woocommerce"
79
 
80
  #: includes/module/WC_WooMercadoPago_Module.php:273
81
  msgid "Set up"
82
+ msgstr "Ajustes"
83
 
84
  #: includes/module/WC_WooMercadoPago_Module.php:274
85
  msgid "Your opinion helps us get better"
87
 
88
  #: includes/module/WC_WooMercadoPago_Module.php:275
89
  msgid "Guides and Documentation"
90
+ msgstr "Guías y documentación"
91
 
92
  #: includes/module/WC_WooMercadoPago_Module.php:276
93
  msgid "Report Problem"
94
+ msgstr "Informar problema"
95
 
96
  #: includes/module/WC_WooMercadoPago_Module.php:293
97
  msgid "By Mercado Pago"
229
  msgid "The payment is in mediation or the purchase was unknown by the customer."
230
  msgstr "El pago esta en mediación o la compra fue desconocida por el cliente."
231
 
232
+ #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:35 includes/notification/WC_WooMercadoPago_Notification_IPN.php:40 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:52
 
233
  msgid "The Mercado Pago request has failed"
234
  msgstr "La solicitud de Mercado Pago ha fallado"
235
 
236
+ #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:116 includes/notification/WC_WooMercadoPago_Notification_IPN.php:141 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:152
237
+ #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:170
238
  msgid "Buyer email"
239
  msgstr "Email del comprador"
240
 
241
+ #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:119 includes/notification/WC_WooMercadoPago_Notification_IPN.php:144 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:155
242
+ #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:173
243
  msgid "Payment method"
244
  msgstr "Medio de pago"
245
 
308
  msgstr "Descuento para el cupón %s"
309
 
310
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126 includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:128
311
+ msgid "discount of"
312
+ msgstr "descuento de"
313
 
314
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126
315
+ msgid " and fee of"
316
+ msgstr " y comisión de"
317
 
318
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:130
319
+ msgid "fee of"
320
+ msgstr "comisión de"
321
 
322
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:355
323
  msgid "Credentials for invalid production!"
348
  msgstr "Haga clic para intentarlo de nuevo"
349
 
350
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:77
351
+ msgid "Great, we processed your purchase order. Complete the payment with ticket so that we finish approving it."
352
+ msgstr "Excelente, procesamos tu orden de compra. Completa el pago con ticket para que terminemos de aprobarla."
353
 
354
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:82
355
+ msgid "Print ticket"
356
+ msgstr "Imprimir ticket"
357
 
358
  #: includes/payments/mercadoenvios/WC_WooMercadoPago_Product_Recurrent.php:40
359
  msgid "Subscription Mercado Pago"
433
  msgstr "Fecha límite para generar nuevos cargos. De forma predeterminada es nunca, si está en blanco."
434
 
435
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:27
436
+ msgid "Mercado Pago Checkout"
437
+ msgstr "Checkout de Mercado Pago"
438
 
439
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:29
440
  msgid "Pay with the payment method you prefer"
441
  msgstr "Paga con el medio de pago que prefieras"
442
 
443
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:229
444
+ msgid "Mercado Pago checkout %s"
445
+ msgstr "Checkout de Mercado Pago %s"
446
 
447
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:235
448
+ msgid "Accept all method of payment and take your charges to another level"
449
+ msgstr "Acepta todos los medios de pago y lleva tus cobros a otro nivel"
450
+
451
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:239
452
  msgid "Turn your online store into your customers preferred payment gateway. Choose if the final payment experience will be inside or outside your store."
453
  msgstr "Convierte tu tienda online en la pasarela de pagos preferida de tus clientes. Elige si la experiencia de pago final será dentro o fuera de tu tienda."
454
 
455
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:250 includes/payments/WC_WooMercadoPago_TicketGateway.php:204
456
+ msgid "Configure Mercado Pago for WooCommerce"
457
+ msgstr "Configura Mercado Pago para WooCommerce"
458
 
459
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:263
460
+ msgid "Enable the experience of the Mercado Pago Checkout in your online store, select the means of payment available to your customers and<br> define the maximum fees in which they can pay you."
461
+ msgstr "Habilita la experiencia del Checkout de Mercado Pago en tu tienda online, selecciona los medios de pago disponibles para tus clientes y<br> define el máximo de cuotas en el que podrán pagarte."
 
 
 
 
462
 
463
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:276 includes/payments/WC_WooMercadoPago_CustomGateway.php:187 includes/payments/WC_WooMercadoPago_TicketGateway.php:217
464
  msgid "Go to the basics. Place your business information."
469
  msgstr "Configura las preferencias de pago en tu tienda"
470
 
471
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
472
+ msgid "advanced settings"
473
+ msgstr "configuración avanzada"
474
 
475
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
476
+ msgid "Payment experience"
477
+ msgstr "Experiencia de pago"
478
 
479
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:317
480
  msgid "Define what payment experience your customers will have, whether inside or outside your store."
501
  msgstr "URL de éxito"
502
 
503
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:357
504
+ msgid "Choose the URL that we will show to your customers when we refuse their purchase. Make sure it includes a message appropriate to the situation and give them useful information so they can solve it."
505
+ msgstr "Elige la URL que mostraremos a tus clientes cuando rechacemos su compra. Asegúrate de incluir un mensaje adecuado a la situación y dales información útil para que puedan solucionarlo."
 
 
506
 
507
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:360
508
  msgid "Payment URL rejected"
526
 
527
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:455
528
  msgid "Select offline payments"
529
+ msgstr "Selecciona medios de pago presenciales"
530
 
531
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:464 includes/payments/WC_WooMercadoPago_TicketGateway.php:321
532
  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 "Enable the payment methods available to your customers."
541
  msgstr "Volver a la tienda"
542
 
543
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:489
544
+ msgid "Do you want your customer to automatically return to the store after payment?"
545
+ msgstr "¿Quieres que tu cliente vuelva automáticamente a la tienda después del pago?"
546
 
547
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:491 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:548 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:631
548
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:898 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1018 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1051
565
  msgstr "Paga con tarjetas de débito y crédito"
566
 
567
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:153
568
+ msgid "Checkout of payments with debit and credit cards %s"
569
+ msgstr "Checkout de pagos con tarjetas de débito y crédito %s"
570
+
571
+ #: includes/payments/WC_WooMercadoPago_CustomGateway.php:158
572
+ msgid "Accept payments instantly and maximize the conversion of your business"
573
+ msgstr "Acepta pagos al instante y maximiza la conversión de tu negocio"
574
 
575
+ #: includes/payments/WC_WooMercadoPago_CustomGateway.php:162
576
  msgid "Turn your online store into a secure and easy-to-use payment gateway for your customers. With personalized checkout your customers pay without leaving your store!"
577
  msgstr "Convierte tu tienda online en una pasarela de pagos segura y fácil de usar para tus clientes. Con el checkout personalizado tus clientes pagan ¡sin salir de tu tienda!"
578
 
589
  msgstr "Configuración avanzada de la experiencia de pago personalizada"
590
 
591
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:228
592
+ msgid "That’s it, payment accepted!"
593
+ msgstr "Listo, ¡aceptamos tu pago!"
594
 
595
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:230
596
  msgid "We are processing your payment. In less than an hour we will send you the result by email."
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 <b>credentials</b> depending on the country in which you are registered."
693
+ msgstr "Carga tus <b>credenciales</b> según el país en el que estés registrado."
694
 
695
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
696
  msgid "Approve your account to be able to charge."
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> solo cuando quieras modificar los ajustes preestablecidos."
710
 
711
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
712
  msgid ""
713
+ "Credentials are the keys we provide you to integrate quickly <br>and securely. You must have a %s in Mercado Pago to obtain and collect them <br>on your website. You do not need to know how to design or program to do it"
 
714
  msgstr ""
715
+ "Las credenciales son las claves que te proporcionamos para que integres de forma rápida <br>y segura. Debes tener una %s en Mercado Pago para obtenerlas y cobrar <br>en tu sitio web. No necesitas saber diseñar o "
716
+ "programar para hacerlo."
717
 
718
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:443
719
  msgid "approved account"
765
 
766
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:612
767
  msgid "When you see that everything is going well, deactivate Sandbox, turn on Production and make way for your online sales."
768
+ msgstr "Cuando veas que todo va bien, desactiva Sandbox para ir a Producción y abre paso a tus ventas online."
769
 
770
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:625
771
+ msgid "Production"
772
  msgstr "Producción"
773
 
774
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
775
+ msgid "Choose YES only when you are ready to sell. Change to NO to activate the Tests mode."
776
+ msgstr "Elige solo cuando estés listo para vender. Cambia a NO para activar el modo Pruebas."
777
 
778
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
779
  msgid "Load credentials"
832
  msgstr "Categoría de la tienda"
833
 
834
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:851
835
+ msgid "What category do your products belong to? Choose the one that best characterizes them (choose \"other\" if your product is too specific)."
836
+ msgstr "¿A qué categoría pertenecen tus productos? Elige la que mejor los caracteriza (elige otro” si tu producto es demasiado específico)."
837
 
838
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:852
839
  msgid "Categories"
968
  msgstr "Acepta y rechaza pagos de forma automática. ¿Quieres que lo activemos?"
969
 
970
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1064
971
+ msgid "Discounts per purchase with Mercado Pago"
972
+ msgstr "Descuentos por compra con 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."
992
  msgstr "¿Todo configurado? Ve a tu tienda en modo Sandbox"
993
 
994
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1122
995
+ msgid "Visit your store as if you were one of your customers and check that everything is fine. If you already went to Production,<br> bring your customers and increase your sales with the best online shopping experience."
996
+ msgstr "Visita tu tienda como si fueras uno de tus clientes y revisa que todo esté bien. Si ya saliste a Producción,<br> trae a tus clientes y aumenta tus ventas con la mejor experiencia de compra online."
997
 
998
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1124
999
+ msgid "Visit your store and simulate a payment to check that everything is fine."
1000
+ msgstr "Visita tu tienda y simula un pago para revisar que todo esté bien."
 
 
 
 
1001
 
1002
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1141
1003
  msgid "Visit my store"
1012
  msgstr "Paga con dinero en efectivo"
1013
 
1014
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:183
1015
+ msgid "Checkout of payments with cash %s"
1016
+ msgstr "Checkout de pagos con dinero en efectivo %s"
1017
 
1018
+ #: includes/payments/WC_WooMercadoPago_TicketGateway.php:192
1019
+ msgid "Accept face-to-face payments, do not leave anyone out!"
1020
+ msgstr "Acepta pagos presenciales ¡no dejes a nadie afuera!"
1021
+
1022
+ #: includes/payments/WC_WooMercadoPago_TicketGateway.php:197
1023
  msgid "Include this preferred purchase option by some customers."
1024
  msgstr "Incluye esta opción de compra preferida por algunos clientes."
1025
 
1026
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:230
1027
  msgid "Enable Mercado Pago for cash payments in your store and <br> select the options available to your customers."
1028
+ msgstr "Habilita Mercado Pago para pagos en efectivo en tu tienda y <br> selecciona las opciones disponibles para tus clientes."
1029
 
1030
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:243
1031
  msgid "Set payment preferences with cash"
1032
+ msgstr "Configura las preferencias de pago con dinero en efectivo"
1033
 
1034
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:256
1035
  msgid "Advanced configuration of the cash payment experience"
1104
  msgstr "Esto controla el título que el usuario ve durante el proceso de pago."
1105
 
1106
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:236
1107
+ msgid "Enable free shipping for this shipping method"
1108
  msgstr "Habilitar envío gratis para este método de envío"
1109
 
1110
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:240
1191
  msgid "CVV"
1192
  msgstr "CVV"
1193
 
1194
+ #: templates/checkout/custom_checkout.php:94 templates/checkout/custom_checkout.php:108 templates/checkout/custom_checkout.php:111 templates/checkout/custom_checkout.php:121 templates/checkout/custom_checkout.php:141
1195
+ #: templates/checkout/custom_checkout.php:205
1196
  msgid "Card number"
1197
  msgstr "Número de Tarjeta"
1198
 
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"
1226
 
1227
  #: templates/checkout/custom_checkout.php:153
1228
  msgid "Issuer"
1238
 
1239
  #: templates/checkout/custom_checkout.php:192
1240
  msgid "Enter your document number"
1241
+ msgstr "Ingresa tu número de documento"
1242
 
1243
  #: templates/checkout/custom_checkout.php:196
1244
  msgid "Type"
1393
  msgstr "Selecciona el emisor con el que quieras procesar el pago"
1394
 
1395
  #: woocommerce-mercadopago.php:48
1396
+ msgid "Mercado Pago payments for WooCommerce requires PHP version 5.6 or later. Please update your PHP version."
1397
  msgstr "El plugin de Mercado Pago requiere la versión de PHP 5.6 o posterior. Por favor actualice su versión de PHP."
1398
 
1399
  #: woocommerce-mercadopago.php:65
1427
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:28
1428
  msgid "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!"
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 "Select the payment methods available in your store."
1433
+ msgstr "Selecciona los medios de pago disponibles en tu tienda."
i18n/languages/woocommerce-mercadopago-es_CO.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_CO.po CHANGED
@@ -1,24 +1,24 @@
1
  # Copyright (C) 2019 Mercado Pago
2
- # This file is distributed under the same license as the WooCommerce Mercado Pago plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WooCommerce Mercado Pago 4.0.8\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: 2019-09-13 21:23-0300\n"
13
- "X-Generator: Poedit 2.2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
  "Language: es_CO\n"
18
 
19
  #. Plugin Name of the plugin
20
- msgid "WooCommerce Mercado Pago"
21
- msgstr "WooCommerce Mercado Pago"
22
 
23
  #. Plugin URI of the plugin
24
  msgid "https://github.com/mercadopago/cart-woocommerce"
@@ -79,7 +79,7 @@ msgstr "¡El módulo de pago de Woo Mercado depende de la última versión de %s
79
 
80
  #: includes/module/WC_WooMercadoPago_Module.php:273
81
  msgid "Set up"
82
- msgstr "Configurar"
83
 
84
  #: includes/module/WC_WooMercadoPago_Module.php:274
85
  msgid "Your opinion helps us get better"
@@ -87,11 +87,11 @@ msgstr "Tu opinión nos ayuda a mejorar"
87
 
88
  #: includes/module/WC_WooMercadoPago_Module.php:275
89
  msgid "Guides and Documentation"
90
- msgstr "Guías y Documentación"
91
 
92
  #: includes/module/WC_WooMercadoPago_Module.php:276
93
  msgid "Report Problem"
94
- msgstr "Informar Problema"
95
 
96
  #: includes/module/WC_WooMercadoPago_Module.php:293
97
  msgid "By Mercado Pago"
@@ -229,18 +229,17 @@ msgstr "El pago fue cancelado."
229
  msgid "The payment is in mediation or the purchase was unknown by the customer."
230
  msgstr "El pago esta en mediación o la compra fue desconocida por el cliente."
231
 
232
- #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:35 includes/notification/WC_WooMercadoPago_Notification_IPN.php:40
233
- #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:52
234
  msgid "The Mercado Pago request has failed"
235
  msgstr "La solicitud de Mercado Pago ha fallado"
236
 
237
- #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:116 includes/notification/WC_WooMercadoPago_Notification_IPN.php:141
238
- #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:152 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:170
239
  msgid "Buyer email"
240
  msgstr "Email del comprador"
241
 
242
- #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:119 includes/notification/WC_WooMercadoPago_Notification_IPN.php:144
243
- #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:155 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:173
244
  msgid "Payment method"
245
  msgstr "Medio de pago"
246
 
@@ -309,16 +308,16 @@ msgid "Discount for coupon %s"
309
  msgstr "Descuento para el cupón %s"
310
 
311
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126 includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:128
312
- msgid "Discount of"
313
- msgstr "Descuento de"
314
 
315
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126
316
- msgid " and Rate of"
317
- msgstr " y Tarifa de"
318
 
319
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:130
320
- msgid "Fee of"
321
- msgstr "Tarifa de"
322
 
323
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:355
324
  msgid "Credentials for invalid production!"
@@ -349,12 +348,12 @@ msgid "Click to try again"
349
  msgstr "Haga clic para intentarlo de nuevo"
350
 
351
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:77
352
- msgid "Thanks for your order. Please pay the ticket to have your order approved."
353
- msgstr "Gracias por su orden. Por favor, realice el pago del ticket para tener su orden aprobada."
354
 
355
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:82
356
- msgid "Print the ticket"
357
- msgstr "Imprimir el ticket"
358
 
359
  #: includes/payments/mercadoenvios/WC_WooMercadoPago_Product_Recurrent.php:40
360
  msgid "Subscription Mercado Pago"
@@ -434,32 +433,32 @@ msgid "Deadline to generate new charges. By default as never, if it is blank."
434
  msgstr "Fecha límite para generar nuevos cargos. De forma predeterminada es nunca, si está en blanco."
435
 
436
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:27
437
- msgid "Mercado Pago - Basic Checkout"
438
- msgstr "Mercado Pago - Checkout básico"
439
 
440
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:29
441
  msgid "Pay with the payment method you prefer"
442
  msgstr "Paga con el medio de pago que prefieras"
443
 
444
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:229
445
- msgid "Basic Checkout Accept all method of payment and take your charges to another level %s"
446
- msgstr "Checkout Básico. Acepta todos los medios de pago y lleva tus cobros a otro nivel %s"
447
 
448
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:233
 
 
 
 
449
  msgid "Turn your online store into your customers preferred payment gateway. Choose if the final payment experience will be inside or outside your store."
450
  msgstr "Convierte tu tienda online en la pasarela de pagos preferida de tus clientes. Elige si la experiencia de pago final será dentro o fuera de tu tienda."
451
 
452
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:250 includes/payments/WC_WooMercadoPago_TicketGateway.php:204
453
- msgid "Configure WooCommerce Mercado Pago"
454
- msgstr "Configura WooCommerce Mercado Pago"
455
 
456
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:263
457
- msgid ""
458
- "Enable the experience of the basic checkout of Mercado Pago in your online store, select the means of payment available to your customers and<br> define the maximum fees in which they can pay "
459
- "you."
460
- msgstr ""
461
- "Habilitá la experiencia del checkout básico de Mercado Pago en tu tienda online, seleccioná los medios de pago disponibles para tus clientes y<br> definí el máximo de cuotas en el que podrán "
462
- "pagarte."
463
 
464
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:276 includes/payments/WC_WooMercadoPago_CustomGateway.php:187 includes/payments/WC_WooMercadoPago_TicketGateway.php:217
465
  msgid "Go to the basics. Place your business information."
@@ -470,12 +469,12 @@ msgid "Set payment preferences in your store"
470
  msgstr "Configura las preferencias de pago en tu tienda"
471
 
472
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
473
- msgid "Advanced payment experience settings"
474
- msgstr "Configuración Avanzada de la experiencia de pago"
475
 
476
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
477
- msgid "Integration method"
478
- msgstr "Método de integración"
479
 
480
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:317
481
  msgid "Define what payment experience your customers will have, whether inside or outside your store."
@@ -502,10 +501,8 @@ msgid "Success URL"
502
  msgstr "URL de éxito"
503
 
504
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:357
505
- msgid ""
506
- "Choose the URL that we will show to your customers when we refuse their purchase. Make sure it includes a message appropriate to the situation and give them useful information so they can solve "
507
- "it."
508
- msgstr "Elige la URL que mostraremos a tus clientes cuando rechacemos su compra. Asegurate de que incluya un mensaje adecuado a la situación y dales información útil para que puedan solucionarlo."
509
 
510
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:360
511
  msgid "Payment URL rejected"
@@ -529,11 +526,11 @@ msgstr "Selecciona tarjetas de débito"
529
 
530
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:455
531
  msgid "Select offline payments"
532
- msgstr "Selecciona pagos offline"
533
 
534
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:464 includes/payments/WC_WooMercadoPago_TicketGateway.php:321
535
  msgid "Payment methods"
536
- msgstr "Medios de pago"
537
 
538
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:468 includes/payments/WC_WooMercadoPago_TicketGateway.php:325
539
  msgid "Enable the payment methods available to your customers."
@@ -544,8 +541,8 @@ msgid "Return to the store"
544
  msgstr "Volver a la tienda"
545
 
546
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:489
547
- msgid "Your customer automatically return to the store after payment."
548
- msgstr "Que tu cliente vuelva automáticamente a la tienda después del pago."
549
 
550
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:491 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:548 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:631
551
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:898 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1018 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1051
@@ -568,10 +565,14 @@ msgid "Pay with debit and credit cards"
568
  msgstr "Paga con tarjetas de débito y crédito"
569
 
570
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:153
571
- msgid "Checkout of payments with debit and credit cards<br> Accept payments instantly and maximize the conversion of your business %s"
572
- msgstr "Checkout de pagos con tarjetas de débito y crédito<br> Acepta pagos al instante y maximiza la conversión de tu negocio %s"
 
 
 
 
573
 
574
- #: includes/payments/WC_WooMercadoPago_CustomGateway.php:157
575
  msgid "Turn your online store into a secure and easy-to-use payment gateway for your customers. With personalized checkout your customers pay without leaving your store!"
576
  msgstr "Convierte tu tienda online en una pasarela de pagos segura y fácil de usar para tus clientes. Con el checkout personalizado tus clientes pagan ¡sin salir de tu tienda!"
577
 
@@ -588,8 +589,8 @@ msgid "Advanced configuration of the personalized payment experience\""
588
  msgstr "Configuración avanzada de la experiencia de pago personalizada"
589
 
590
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:228
591
- msgid "Ready, your payment has been accepted!"
592
- msgstr "Listo, su pago ha sido aceptado!"
593
 
594
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:230
595
  msgid "We are processing your payment. In less than an hour we will send you the result by email."
@@ -688,8 +689,8 @@ msgid "<b>Follow these steps to activate Mercado Pago in your store:</b>"
688
  msgstr "<b>Sigue estos pasos para activar Mercado Pago en tu tienda:</b>"
689
 
690
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:395
691
- msgid "Upload your <b>credentials</b> to test the store and charge with your Mercado Pago account <b>depending on the country</b> in which you are registered."
692
- msgstr "Carga tus <b>credenciales</b> para testear la tienda y cobrar con tu cuenta de Mercado Pago <b>según el país</b> en el que estés registrado."
693
 
694
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
695
  msgid "Approve your account to be able to charge."
@@ -704,16 +705,15 @@ msgid "Configure the <b>payment preferences</b> for your customers."
704
  msgstr "Configura las preferencias de pago para tus clientes."
705
 
706
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:423
707
- msgid "Go to advanced settings of both the plugin and checkout only when you want to change the presets."
708
- msgstr "Ve a configuraciones avanzadas tanto del plugin como del checkout solo cuando quieras modificar los ajustes preestablecidos."
709
 
710
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
711
  msgid ""
712
- "Credentials are the keys we provide you to integrate quickly <br>and securely. You must have a %s in Mercado Pago to obtain and collect them <br>on your website. You do not need to know how to "
713
- "design or program to do it"
714
  msgstr ""
715
- "Las credenciales son las claves que te proporcionamos para que integres de forma rápida <br>y segura. Debes tener una %s en Mercado Pago para obtenerlas y cobrar <br>en tu sitio web. No "
716
- "necesitas saber diseñar o programar para hacerlo."
717
 
718
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:443
719
  msgid "approved account"
@@ -765,15 +765,15 @@ msgstr "Modo Producción"
765
 
766
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:612
767
  msgid "When you see that everything is going well, deactivate Sandbox, turn on Production and make way for your online sales."
768
- msgstr "Cuando veas que todo va bien, desactivá Sandbox, prendé Producción y abrí paso a tus ventas online."
769
 
770
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:625
771
- msgid "Productio"
772
  msgstr "Producción"
773
 
774
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
775
- msgid "Choose \"YES\" only when you are ready to sell. Change to NO to activate the Tests mode."
776
- msgstr "Elige “SÍ” solo cuando estés listo para vender. Cambia a NO para activar el modo Pruebas."
777
 
778
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
779
  msgid "Load credentials"
@@ -832,8 +832,8 @@ msgid "Store Category"
832
  msgstr "Categoría de la tienda"
833
 
834
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:851
835
- msgid "What category do your products belong to? Choose the one that best characterizes them (choose <br>\"other\" if your product is too specific)."
836
- msgstr "¿A qué categoría pertenecen tus productos? Elige la que mejor los caracteriza (elige <br>“otro” si tu producto es demasiado específico)."
837
 
838
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:852
839
  msgid "Categories"
@@ -968,8 +968,8 @@ msgid "Accept and reject payments automatically. Do you want us to activate it?"
968
  msgstr "Acepta y rechaza pagos de forma automática. ¿Quieres que lo activemos?"
969
 
970
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1064
971
- msgid "Gateway Discounts"
972
- msgstr "Descuentos Gateway"
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."
@@ -992,16 +992,12 @@ msgid "Everything set up? Go to your store in Sandbox mode"
992
  msgstr "¿Todo configurado? Ve a tu tienda en modo Sandbox"
993
 
994
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1122
995
- msgid "You already went to Production. You just need your best customers <br> to arrive at your store to live the best online shopping experience with Mercado Pago."
996
- msgstr "Ya saliste a Producción. Solo falta que tus mejores clientes <br> lleguen a tu tienda para vivir la mejor experiencia de compra online com Mercado Pago."
997
 
998
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1124
999
- msgid ""
1000
- "Visit your store as if you were one of your customers and check that everything is fine. If you already went to Production,<br> bring your customers and increase your sales with the best online "
1001
- "shopping experience."
1002
- msgstr ""
1003
- "Visita tu tienda como si fueras uno de tus clientes y revisa que todo esté bien. Si ya saliste a Producción,<br> trae a tus clientes y aumenta tus ventas con la mejor experiencia de compra "
1004
- "online."
1005
 
1006
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1141
1007
  msgid "Visit my store"
@@ -1016,20 +1012,24 @@ msgid "Pay with cash"
1016
  msgstr "Paga con dinero en efectivo"
1017
 
1018
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:183
1019
- msgid "Checkout of payments with cash<br> Accept face-to-face payments, do not leave anyone out! %s"
1020
- msgstr "Checkout de pagos con dinero en efectivo<br> Acepta pagos presenciales ¡no dejes a nadie afuera! %s"
1021
 
1022
- #: includes/payments/WC_WooMercadoPago_TicketGateway.php:187
 
 
 
 
1023
  msgid "Include this preferred purchase option by some customers."
1024
  msgstr "Incluye esta opción de compra preferida por algunos clientes."
1025
 
1026
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:230
1027
  msgid "Enable Mercado Pago for cash payments in your store and <br> select the options available to your customers."
1028
- msgstr "Habilitá Mercado Pago para pagos en efectivo en tu tienda y <br> seleccioná las opciones disponibles para tus clientes."
1029
 
1030
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:243
1031
  msgid "Set payment preferences with cash"
1032
- msgstr "Configurá las preferencias de pago con dinero en efectivo"
1033
 
1034
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:256
1035
  msgid "Advanced configuration of the cash payment experience"
@@ -1104,7 +1104,7 @@ msgid "This controls the title that the user sees during the payment process."
1104
  msgstr "Esto controla el título que el usuario ve durante el proceso de pago."
1105
 
1106
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:236
1107
- msgid "nable free shipping for this shipping method"
1108
  msgstr "Habilitar envío gratis para este método de envío"
1109
 
1110
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:240
@@ -1191,8 +1191,8 @@ msgstr "Otra tarjeta"
1191
  msgid "CVV"
1192
  msgstr "CVV"
1193
 
1194
- #: templates/checkout/custom_checkout.php:94 templates/checkout/custom_checkout.php:108 templates/checkout/custom_checkout.php:111 templates/checkout/custom_checkout.php:121
1195
- #: templates/checkout/custom_checkout.php:141 templates/checkout/custom_checkout.php:205
1196
  msgid "Card number"
1197
  msgstr "Número de Tarjeta"
1198
 
@@ -1221,8 +1221,8 @@ msgid "Last 3 numbers on the back"
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?"
1226
 
1227
  #: templates/checkout/custom_checkout.php:153
1228
  msgid "Issuer"
@@ -1238,7 +1238,7 @@ msgstr "Seleccione el número de cotas"
1238
 
1239
  #: templates/checkout/custom_checkout.php:192
1240
  msgid "Enter your document number"
1241
- msgstr "Ingrese su número de documento"
1242
 
1243
  #: templates/checkout/custom_checkout.php:196
1244
  msgid "Type"
@@ -1393,7 +1393,7 @@ msgid "Select the issuer with whom you want to process the payment"
1393
  msgstr "Selecciona el emisor con el que quieras procesar el pago"
1394
 
1395
  #: woocommerce-mercadopago.php:48
1396
- msgid "WooCommerce Mercado Pago requires PHP version 5.6 or later. Please update your PHP version."
1397
  msgstr "El plugin de Mercado Pago requiere la versión de PHP 5.6 o posterior. Por favor actualice su versión de PHP."
1398
 
1399
  #: woocommerce-mercadopago.php:65
@@ -1427,3 +1427,7 @@ msgstr "Ofrece todos los medios de pago: tarjetas de crédito y débito, dinero
1427
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:28
1428
  msgid "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!"
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!"
 
 
 
 
1
  # Copyright (C) 2019 Mercado Pago
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.1.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: 2019-12-23 17:11-0300\n"
13
+ "X-Generator: Poedit 2.2.4\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
  "Language: es_CO\n"
18
 
19
  #. Plugin Name of the plugin
20
+ msgid "Mercado Pago payments for WooCommerce"
21
+ msgstr "Mercado Pago payments for WooCommerce"
22
 
23
  #. Plugin URI of the plugin
24
  msgid "https://github.com/mercadopago/cart-woocommerce"
79
 
80
  #: includes/module/WC_WooMercadoPago_Module.php:273
81
  msgid "Set up"
82
+ msgstr "Ajustes"
83
 
84
  #: includes/module/WC_WooMercadoPago_Module.php:274
85
  msgid "Your opinion helps us get better"
87
 
88
  #: includes/module/WC_WooMercadoPago_Module.php:275
89
  msgid "Guides and Documentation"
90
+ msgstr "Guías y documentación"
91
 
92
  #: includes/module/WC_WooMercadoPago_Module.php:276
93
  msgid "Report Problem"
94
+ msgstr "Informar problema"
95
 
96
  #: includes/module/WC_WooMercadoPago_Module.php:293
97
  msgid "By Mercado Pago"
229
  msgid "The payment is in mediation or the purchase was unknown by the customer."
230
  msgstr "El pago esta en mediación o la compra fue desconocida por el cliente."
231
 
232
+ #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:35 includes/notification/WC_WooMercadoPago_Notification_IPN.php:40 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:52
 
233
  msgid "The Mercado Pago request has failed"
234
  msgstr "La solicitud de Mercado Pago ha fallado"
235
 
236
+ #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:116 includes/notification/WC_WooMercadoPago_Notification_IPN.php:141 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:152
237
+ #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:170
238
  msgid "Buyer email"
239
  msgstr "Email del comprador"
240
 
241
+ #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:119 includes/notification/WC_WooMercadoPago_Notification_IPN.php:144 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:155
242
+ #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:173
243
  msgid "Payment method"
244
  msgstr "Medio de pago"
245
 
308
  msgstr "Descuento para el cupón %s"
309
 
310
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126 includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:128
311
+ msgid "discount of"
312
+ msgstr "descuento de"
313
 
314
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126
315
+ msgid " and fee of"
316
+ msgstr " y comisión de"
317
 
318
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:130
319
+ msgid "fee of"
320
+ msgstr "comisión de"
321
 
322
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:355
323
  msgid "Credentials for invalid production!"
348
  msgstr "Haga clic para intentarlo de nuevo"
349
 
350
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:77
351
+ msgid "Great, we processed your purchase order. Complete the payment with ticket so that we finish approving it."
352
+ msgstr "Excelente, procesamos tu orden de compra. Completa el pago con ticket para que terminemos de aprobarla."
353
 
354
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:82
355
+ msgid "Print ticket"
356
+ msgstr "Imprimir ticket"
357
 
358
  #: includes/payments/mercadoenvios/WC_WooMercadoPago_Product_Recurrent.php:40
359
  msgid "Subscription Mercado Pago"
433
  msgstr "Fecha límite para generar nuevos cargos. De forma predeterminada es nunca, si está en blanco."
434
 
435
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:27
436
+ msgid "Mercado Pago Checkout"
437
+ msgstr "Checkout de Mercado Pago"
438
 
439
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:29
440
  msgid "Pay with the payment method you prefer"
441
  msgstr "Paga con el medio de pago que prefieras"
442
 
443
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:229
444
+ msgid "Mercado Pago checkout %s"
445
+ msgstr "Checkout de Mercado Pago %s"
446
 
447
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:235
448
+ msgid "Accept all method of payment and take your charges to another level"
449
+ msgstr "Acepta todos los medios de pago y lleva tus cobros a otro nivel"
450
+
451
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:239
452
  msgid "Turn your online store into your customers preferred payment gateway. Choose if the final payment experience will be inside or outside your store."
453
  msgstr "Convierte tu tienda online en la pasarela de pagos preferida de tus clientes. Elige si la experiencia de pago final será dentro o fuera de tu tienda."
454
 
455
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:250 includes/payments/WC_WooMercadoPago_TicketGateway.php:204
456
+ msgid "Configure Mercado Pago for WooCommerce"
457
+ msgstr "Configura Mercado Pago para WooCommerce"
458
 
459
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:263
460
+ msgid "Enable the experience of the Mercado Pago Checkout in your online store, select the means of payment available to your customers and<br> define the maximum fees in which they can pay you."
461
+ msgstr "Habilita la experiencia del Checkout de Mercado Pago en tu tienda online, selecciona los medios de pago disponibles para tus clientes y<br> define el máximo de cuotas en el que podrán pagarte."
 
 
 
 
462
 
463
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:276 includes/payments/WC_WooMercadoPago_CustomGateway.php:187 includes/payments/WC_WooMercadoPago_TicketGateway.php:217
464
  msgid "Go to the basics. Place your business information."
469
  msgstr "Configura las preferencias de pago en tu tienda"
470
 
471
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
472
+ msgid "advanced settings"
473
+ msgstr "configuración avanzada"
474
 
475
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
476
+ msgid "Payment experience"
477
+ msgstr "Experiencia de pago"
478
 
479
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:317
480
  msgid "Define what payment experience your customers will have, whether inside or outside your store."
501
  msgstr "URL de éxito"
502
 
503
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:357
504
+ msgid "Choose the URL that we will show to your customers when we refuse their purchase. Make sure it includes a message appropriate to the situation and give them useful information so they can solve it."
505
+ msgstr "Elige la URL que mostraremos a tus clientes cuando rechacemos su compra. Asegúrate de incluir un mensaje adecuado a la situación y dales información útil para que puedan solucionarlo."
 
 
506
 
507
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:360
508
  msgid "Payment URL rejected"
526
 
527
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:455
528
  msgid "Select offline payments"
529
+ msgstr "Selecciona medios de pago presenciales"
530
 
531
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:464 includes/payments/WC_WooMercadoPago_TicketGateway.php:321
532
  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 "Enable the payment methods available to your customers."
541
  msgstr "Volver a la tienda"
542
 
543
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:489
544
+ msgid "Do you want your customer to automatically return to the store after payment?"
545
+ msgstr "¿Quieres que tu cliente vuelva automáticamente a la tienda después del pago?"
546
 
547
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:491 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:548 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:631
548
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:898 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1018 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1051
565
  msgstr "Paga con tarjetas de débito y crédito"
566
 
567
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:153
568
+ msgid "Checkout of payments with debit and credit cards %s"
569
+ msgstr "Checkout de pagos con tarjetas de débito y crédito %s"
570
+
571
+ #: includes/payments/WC_WooMercadoPago_CustomGateway.php:158
572
+ msgid "Accept payments instantly and maximize the conversion of your business"
573
+ msgstr "Acepta pagos al instante y maximiza la conversión de tu negocio"
574
 
575
+ #: includes/payments/WC_WooMercadoPago_CustomGateway.php:162
576
  msgid "Turn your online store into a secure and easy-to-use payment gateway for your customers. With personalized checkout your customers pay without leaving your store!"
577
  msgstr "Convierte tu tienda online en una pasarela de pagos segura y fácil de usar para tus clientes. Con el checkout personalizado tus clientes pagan ¡sin salir de tu tienda!"
578
 
589
  msgstr "Configuración avanzada de la experiencia de pago personalizada"
590
 
591
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:228
592
+ msgid "That’s it, payment accepted!"
593
+ msgstr "Listo, ¡aceptamos tu pago!"
594
 
595
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:230
596
  msgid "We are processing your payment. In less than an hour we will send you the result by email."
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 <b>credentials</b> depending on the country in which you are registered."
693
+ msgstr "Carga tus <b>credenciales</b> según el país en el que estés registrado."
694
 
695
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
696
  msgid "Approve your account to be able to charge."
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> solo cuando quieras modificar los ajustes preestablecidos."
710
 
711
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
712
  msgid ""
713
+ "Credentials are the keys we provide you to integrate quickly <br>and securely. You must have a %s in Mercado Pago to obtain and collect them <br>on your website. You do not need to know how to design or program to do it"
 
714
  msgstr ""
715
+ "Las credenciales son las claves que te proporcionamos para que integres de forma rápida <br>y segura. Debes tener una %s en Mercado Pago para obtenerlas y cobrar <br>en tu sitio web. No necesitas saber diseñar o "
716
+ "programar para hacerlo."
717
 
718
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:443
719
  msgid "approved account"
765
 
766
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:612
767
  msgid "When you see that everything is going well, deactivate Sandbox, turn on Production and make way for your online sales."
768
+ msgstr "Cuando veas que todo va bien, desactiva Sandbox para ir a Producción y abre paso a tus ventas online."
769
 
770
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:625
771
+ msgid "Production"
772
  msgstr "Producción"
773
 
774
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
775
+ msgid "Choose YES only when you are ready to sell. Change to NO to activate the Tests mode."
776
+ msgstr "Elige solo cuando estés listo para vender. Cambia a NO para activar el modo Pruebas."
777
 
778
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
779
  msgid "Load credentials"
832
  msgstr "Categoría de la tienda"
833
 
834
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:851
835
+ msgid "What category do your products belong to? Choose the one that best characterizes them (choose \"other\" if your product is too specific)."
836
+ msgstr "¿A qué categoría pertenecen tus productos? Elige la que mejor los caracteriza (elige otro” si tu producto es demasiado específico)."
837
 
838
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:852
839
  msgid "Categories"
968
  msgstr "Acepta y rechaza pagos de forma automática. ¿Quieres que lo activemos?"
969
 
970
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1064
971
+ msgid "Discounts per purchase with Mercado Pago"
972
+ msgstr "Descuentos por compra con 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."
992
  msgstr "¿Todo configurado? Ve a tu tienda en modo Sandbox"
993
 
994
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1122
995
+ msgid "Visit your store as if you were one of your customers and check that everything is fine. If you already went to Production,<br> bring your customers and increase your sales with the best online shopping experience."
996
+ msgstr "Visita tu tienda como si fueras uno de tus clientes y revisa que todo esté bien. Si ya saliste a Producción,<br> trae a tus clientes y aumenta tus ventas con la mejor experiencia de compra online."
997
 
998
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1124
999
+ msgid "Visit your store and simulate a payment to check that everything is fine."
1000
+ msgstr "Visita tu tienda y simula un pago para revisar que todo esté bien."
 
 
 
 
1001
 
1002
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1141
1003
  msgid "Visit my store"
1012
  msgstr "Paga con dinero en efectivo"
1013
 
1014
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:183
1015
+ msgid "Checkout of payments with cash %s"
1016
+ msgstr "Checkout de pagos con dinero en efectivo %s"
1017
 
1018
+ #: includes/payments/WC_WooMercadoPago_TicketGateway.php:192
1019
+ msgid "Accept face-to-face payments, do not leave anyone out!"
1020
+ msgstr "Acepta pagos presenciales ¡no dejes a nadie afuera!"
1021
+
1022
+ #: includes/payments/WC_WooMercadoPago_TicketGateway.php:197
1023
  msgid "Include this preferred purchase option by some customers."
1024
  msgstr "Incluye esta opción de compra preferida por algunos clientes."
1025
 
1026
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:230
1027
  msgid "Enable Mercado Pago for cash payments in your store and <br> select the options available to your customers."
1028
+ msgstr "Habilita Mercado Pago para pagos en efectivo en tu tienda y <br> selecciona las opciones disponibles para tus clientes."
1029
 
1030
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:243
1031
  msgid "Set payment preferences with cash"
1032
+ msgstr "Configura las preferencias de pago con dinero en efectivo"
1033
 
1034
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:256
1035
  msgid "Advanced configuration of the cash payment experience"
1104
  msgstr "Esto controla el título que el usuario ve durante el proceso de pago."
1105
 
1106
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:236
1107
+ msgid "Enable free shipping for this shipping method"
1108
  msgstr "Habilitar envío gratis para este método de envío"
1109
 
1110
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:240
1191
  msgid "CVV"
1192
  msgstr "CVV"
1193
 
1194
+ #: templates/checkout/custom_checkout.php:94 templates/checkout/custom_checkout.php:108 templates/checkout/custom_checkout.php:111 templates/checkout/custom_checkout.php:121 templates/checkout/custom_checkout.php:141
1195
+ #: templates/checkout/custom_checkout.php:205
1196
  msgid "Card number"
1197
  msgstr "Número de Tarjeta"
1198
 
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"
1226
 
1227
  #: templates/checkout/custom_checkout.php:153
1228
  msgid "Issuer"
1238
 
1239
  #: templates/checkout/custom_checkout.php:192
1240
  msgid "Enter your document number"
1241
+ msgstr "Ingresa tu número de documento"
1242
 
1243
  #: templates/checkout/custom_checkout.php:196
1244
  msgid "Type"
1393
  msgstr "Selecciona el emisor con el que quieras procesar el pago"
1394
 
1395
  #: woocommerce-mercadopago.php:48
1396
+ msgid "Mercado Pago payments for WooCommerce requires PHP version 5.6 or later. Please update your PHP version."
1397
  msgstr "El plugin de Mercado Pago requiere la versión de PHP 5.6 o posterior. Por favor actualice su versión de PHP."
1398
 
1399
  #: woocommerce-mercadopago.php:65
1427
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:28
1428
  msgid "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!"
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 "Select the payment methods available in your store."
1433
+ msgstr "Selecciona los medios de pago disponibles en tu tienda."
i18n/languages/woocommerce-mercadopago-es_ES.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_ES.po CHANGED
@@ -1,24 +1,24 @@
1
  # Copyright (C) 2019 Mercado Pago
2
- # This file is distributed under the same license as the WooCommerce Mercado Pago plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WooCommerce Mercado Pago 4.0.8\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: 2019-09-13 21:22-0300\n"
13
- "X-Generator: Poedit 2.2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
  "Language: es_ES\n"
18
 
19
  #. Plugin Name of the plugin
20
- msgid "WooCommerce Mercado Pago"
21
- msgstr "WooCommerce Mercado Pago"
22
 
23
  #. Plugin URI of the plugin
24
  msgid "https://github.com/mercadopago/cart-woocommerce"
@@ -79,7 +79,7 @@ msgstr "¡El módulo de pago de Woo Mercado depende de la última versión de %s
79
 
80
  #: includes/module/WC_WooMercadoPago_Module.php:273
81
  msgid "Set up"
82
- msgstr "Configurar"
83
 
84
  #: includes/module/WC_WooMercadoPago_Module.php:274
85
  msgid "Your opinion helps us get better"
@@ -87,11 +87,11 @@ msgstr "Tu opinión nos ayuda a mejorar"
87
 
88
  #: includes/module/WC_WooMercadoPago_Module.php:275
89
  msgid "Guides and Documentation"
90
- msgstr "Guías y Documentación"
91
 
92
  #: includes/module/WC_WooMercadoPago_Module.php:276
93
  msgid "Report Problem"
94
- msgstr "Informar Problema"
95
 
96
  #: includes/module/WC_WooMercadoPago_Module.php:293
97
  msgid "By Mercado Pago"
@@ -229,18 +229,17 @@ msgstr "El pago fue cancelado."
229
  msgid "The payment is in mediation or the purchase was unknown by the customer."
230
  msgstr "El pago esta en mediación o la compra fue desconocida por el cliente."
231
 
232
- #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:35 includes/notification/WC_WooMercadoPago_Notification_IPN.php:40
233
- #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:52
234
  msgid "The Mercado Pago request has failed"
235
  msgstr "La solicitud de Mercado Pago ha fallado"
236
 
237
- #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:116 includes/notification/WC_WooMercadoPago_Notification_IPN.php:141
238
- #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:152 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:170
239
  msgid "Buyer email"
240
  msgstr "Email del comprador"
241
 
242
- #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:119 includes/notification/WC_WooMercadoPago_Notification_IPN.php:144
243
- #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:155 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:173
244
  msgid "Payment method"
245
  msgstr "Medio de pago"
246
 
@@ -309,16 +308,16 @@ msgid "Discount for coupon %s"
309
  msgstr "Descuento para el cupón %s"
310
 
311
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126 includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:128
312
- msgid "Discount of"
313
- msgstr "Descuento de"
314
 
315
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126
316
- msgid " and Rate of"
317
- msgstr " y Tarifa de"
318
 
319
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:130
320
- msgid "Fee of"
321
- msgstr "Tarifa de"
322
 
323
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:355
324
  msgid "Credentials for invalid production!"
@@ -349,12 +348,12 @@ msgid "Click to try again"
349
  msgstr "Haga clic para intentarlo de nuevo"
350
 
351
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:77
352
- msgid "Thanks for your order. Please pay the ticket to have your order approved."
353
- msgstr "Gracias por su orden. Por favor, realice el pago del ticket para tener su orden aprobada."
354
 
355
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:82
356
- msgid "Print the ticket"
357
- msgstr "Imprimir el ticket"
358
 
359
  #: includes/payments/mercadoenvios/WC_WooMercadoPago_Product_Recurrent.php:40
360
  msgid "Subscription Mercado Pago"
@@ -434,32 +433,32 @@ msgid "Deadline to generate new charges. By default as never, if it is blank."
434
  msgstr "Fecha límite para generar nuevos cargos. De forma predeterminada es nunca, si está en blanco."
435
 
436
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:27
437
- msgid "Mercado Pago - Basic Checkout"
438
- msgstr "Mercado Pago - Checkout básico"
439
 
440
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:29
441
  msgid "Pay with the payment method you prefer"
442
  msgstr "Paga con el medio de pago que prefieras"
443
 
444
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:229
445
- msgid "Basic Checkout Accept all method of payment and take your charges to another level %s"
446
- msgstr "Checkout Básico. Acepta todos los medios de pago y lleva tus cobros a otro nivel %s"
447
 
448
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:233
 
 
 
 
449
  msgid "Turn your online store into your customers preferred payment gateway. Choose if the final payment experience will be inside or outside your store."
450
  msgstr "Convierte tu tienda online en la pasarela de pagos preferida de tus clientes. Elige si la experiencia de pago final será dentro o fuera de tu tienda."
451
 
452
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:250 includes/payments/WC_WooMercadoPago_TicketGateway.php:204
453
- msgid "Configure WooCommerce Mercado Pago"
454
- msgstr "Configura WooCommerce Mercado Pago"
455
 
456
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:263
457
- msgid ""
458
- "Enable the experience of the basic checkout of Mercado Pago in your online store, select the means of payment available to your customers and<br> define the maximum fees in which they can pay "
459
- "you."
460
- msgstr ""
461
- "Habilitá la experiencia del checkout básico de Mercado Pago en tu tienda online, seleccioná los medios de pago disponibles para tus clientes y<br> definí el máximo de cuotas en el que podrán "
462
- "pagarte."
463
 
464
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:276 includes/payments/WC_WooMercadoPago_CustomGateway.php:187 includes/payments/WC_WooMercadoPago_TicketGateway.php:217
465
  msgid "Go to the basics. Place your business information."
@@ -470,12 +469,12 @@ msgid "Set payment preferences in your store"
470
  msgstr "Configura las preferencias de pago en tu tienda"
471
 
472
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
473
- msgid "Advanced payment experience settings"
474
- msgstr "Configuración Avanzada de la experiencia de pago"
475
 
476
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
477
- msgid "Integration method"
478
- msgstr "Método de integración"
479
 
480
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:317
481
  msgid "Define what payment experience your customers will have, whether inside or outside your store."
@@ -502,10 +501,8 @@ msgid "Success URL"
502
  msgstr "URL de éxito"
503
 
504
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:357
505
- msgid ""
506
- "Choose the URL that we will show to your customers when we refuse their purchase. Make sure it includes a message appropriate to the situation and give them useful information so they can solve "
507
- "it."
508
- msgstr "Elige la URL que mostraremos a tus clientes cuando rechacemos su compra. Asegurate de que incluya un mensaje adecuado a la situación y dales información útil para que puedan solucionarlo."
509
 
510
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:360
511
  msgid "Payment URL rejected"
@@ -529,11 +526,11 @@ msgstr "Selecciona tarjetas de débito"
529
 
530
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:455
531
  msgid "Select offline payments"
532
- msgstr "Selecciona pagos offline"
533
 
534
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:464 includes/payments/WC_WooMercadoPago_TicketGateway.php:321
535
  msgid "Payment methods"
536
- msgstr "Medios de pago"
537
 
538
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:468 includes/payments/WC_WooMercadoPago_TicketGateway.php:325
539
  msgid "Enable the payment methods available to your customers."
@@ -544,8 +541,8 @@ msgid "Return to the store"
544
  msgstr "Volver a la tienda"
545
 
546
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:489
547
- msgid "Your customer automatically return to the store after payment."
548
- msgstr "Que tu cliente vuelva automáticamente a la tienda después del pago."
549
 
550
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:491 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:548 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:631
551
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:898 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1018 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1051
@@ -568,10 +565,14 @@ msgid "Pay with debit and credit cards"
568
  msgstr "Paga con tarjetas de débito y crédito"
569
 
570
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:153
571
- msgid "Checkout of payments with debit and credit cards<br> Accept payments instantly and maximize the conversion of your business %s"
572
- msgstr "Checkout de pagos con tarjetas de débito y crédito<br> Acepta pagos al instante y maximiza la conversión de tu negocio %s"
573
 
574
- #: includes/payments/WC_WooMercadoPago_CustomGateway.php:157
 
 
 
 
575
  msgid "Turn your online store into a secure and easy-to-use payment gateway for your customers. With personalized checkout your customers pay without leaving your store!"
576
  msgstr "Convierte tu tienda online en una pasarela de pagos segura y fácil de usar para tus clientes. Con el checkout personalizado tus clientes pagan ¡sin salir de tu tienda!"
577
 
@@ -588,8 +589,8 @@ msgid "Advanced configuration of the personalized payment experience\""
588
  msgstr "Configuración avanzada de la experiencia de pago personalizada"
589
 
590
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:228
591
- msgid "Ready, your payment has been accepted!"
592
- msgstr "Listo, su pago ha sido aceptado!"
593
 
594
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:230
595
  msgid "We are processing your payment. In less than an hour we will send you the result by email."
@@ -688,8 +689,8 @@ msgid "<b>Follow these steps to activate Mercado Pago in your store:</b>"
688
  msgstr "<b>Sigue estos pasos para activar Mercado Pago en tu tienda:</b>"
689
 
690
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:395
691
- msgid "Upload your <b>credentials</b> to test the store and charge with your Mercado Pago account <b>depending on the country</b> in which you are registered."
692
- msgstr "Carga tus <b>credenciales</b> para testear la tienda y cobrar con tu cuenta de Mercado Pago <b>según el país</b> en el que estés registrado."
693
 
694
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
695
  msgid "Approve your account to be able to charge."
@@ -704,16 +705,15 @@ msgid "Configure the <b>payment preferences</b> for your customers."
704
  msgstr "Configura las preferencias de pago para tus clientes."
705
 
706
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:423
707
- msgid "Go to advanced settings of both the plugin and checkout only when you want to change the presets."
708
- msgstr "Ve a configuraciones avanzadas tanto del plugin como del checkout solo cuando quieras modificar los ajustes preestablecidos."
709
 
710
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
711
  msgid ""
712
- "Credentials are the keys we provide you to integrate quickly <br>and securely. You must have a %s in Mercado Pago to obtain and collect them <br>on your website. You do not need to know how to "
713
- "design or program to do it"
714
  msgstr ""
715
- "Las credenciales son las claves que te proporcionamos para que integres de forma rápida <br>y segura. Debes tener una %s en Mercado Pago para obtenerlas y cobrar <br>en tu sitio web. No "
716
- "necesitas saber diseñar o programar para hacerlo."
717
 
718
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:443
719
  msgid "approved account"
@@ -765,15 +765,15 @@ msgstr "Modo Producción"
765
 
766
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:612
767
  msgid "When you see that everything is going well, deactivate Sandbox, turn on Production and make way for your online sales."
768
- msgstr "Cuando veas que todo va bien, desactivá Sandbox, prendé Producción y abrí paso a tus ventas online."
769
 
770
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:625
771
- msgid "Productio"
772
  msgstr "Producción"
773
 
774
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
775
- msgid "Choose \"YES\" only when you are ready to sell. Change to NO to activate the Tests mode."
776
- msgstr "Elige “SÍ” solo cuando estés listo para vender. Cambia a NO para activar el modo Pruebas."
777
 
778
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
779
  msgid "Load credentials"
@@ -832,8 +832,8 @@ msgid "Store Category"
832
  msgstr "Categoría de la tienda"
833
 
834
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:851
835
- msgid "What category do your products belong to? Choose the one that best characterizes them (choose <br>\"other\" if your product is too specific)."
836
- msgstr "¿A qué categoría pertenecen tus productos? Elige la que mejor los caracteriza (elige <br>“otro” si tu producto es demasiado específico)."
837
 
838
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:852
839
  msgid "Categories"
@@ -968,8 +968,8 @@ msgid "Accept and reject payments automatically. Do you want us to activate it?"
968
  msgstr "Acepta y rechaza pagos de forma automática. ¿Quieres que lo activemos?"
969
 
970
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1064
971
- msgid "Gateway Discounts"
972
- msgstr "Descuentos Gateway"
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."
@@ -992,16 +992,12 @@ msgid "Everything set up? Go to your store in Sandbox mode"
992
  msgstr "¿Todo configurado? Ve a tu tienda en modo Sandbox"
993
 
994
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1122
995
- msgid "You already went to Production. You just need your best customers <br> to arrive at your store to live the best online shopping experience with Mercado Pago."
996
- msgstr "Ya saliste a Producción. Solo falta que tus mejores clientes <br> lleguen a tu tienda para vivir la mejor experiencia de compra online com Mercado Pago."
997
 
998
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1124
999
- msgid ""
1000
- "Visit your store as if you were one of your customers and check that everything is fine. If you already went to Production,<br> bring your customers and increase your sales with the best online "
1001
- "shopping experience."
1002
- msgstr ""
1003
- "Visita tu tienda como si fueras uno de tus clientes y revisa que todo esté bien. Si ya saliste a Producción,<br> trae a tus clientes y aumenta tus ventas con la mejor experiencia de compra "
1004
- "online."
1005
 
1006
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1141
1007
  msgid "Visit my store"
@@ -1016,20 +1012,24 @@ msgid "Pay with cash"
1016
  msgstr "Paga con dinero en efectivo"
1017
 
1018
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:183
1019
- msgid "Checkout of payments with cash<br> Accept face-to-face payments, do not leave anyone out! %s"
1020
- msgstr "Checkout de pagos con dinero en efectivo<br> Acepta pagos presenciales ¡no dejes a nadie afuera! %s"
1021
 
1022
- #: includes/payments/WC_WooMercadoPago_TicketGateway.php:187
 
 
 
 
1023
  msgid "Include this preferred purchase option by some customers."
1024
  msgstr "Incluye esta opción de compra preferida por algunos clientes."
1025
 
1026
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:230
1027
  msgid "Enable Mercado Pago for cash payments in your store and <br> select the options available to your customers."
1028
- msgstr "Habilitá Mercado Pago para pagos en efectivo en tu tienda y <br> seleccioná las opciones disponibles para tus clientes."
1029
 
1030
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:243
1031
  msgid "Set payment preferences with cash"
1032
- msgstr "Configurá las preferencias de pago con dinero en efectivo"
1033
 
1034
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:256
1035
  msgid "Advanced configuration of the cash payment experience"
@@ -1104,7 +1104,7 @@ msgid "This controls the title that the user sees during the payment process."
1104
  msgstr "Esto controla el título que el usuario ve durante el proceso de pago."
1105
 
1106
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:236
1107
- msgid "nable free shipping for this shipping method"
1108
  msgstr "Habilitar envío gratis para este método de envío"
1109
 
1110
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:240
@@ -1191,8 +1191,8 @@ msgstr "Otra tarjeta"
1191
  msgid "CVV"
1192
  msgstr "CVV"
1193
 
1194
- #: templates/checkout/custom_checkout.php:94 templates/checkout/custom_checkout.php:108 templates/checkout/custom_checkout.php:111 templates/checkout/custom_checkout.php:121
1195
- #: templates/checkout/custom_checkout.php:141 templates/checkout/custom_checkout.php:205
1196
  msgid "Card number"
1197
  msgstr "Número de Tarjeta"
1198
 
@@ -1221,8 +1221,8 @@ msgid "Last 3 numbers on the back"
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?"
1226
 
1227
  #: templates/checkout/custom_checkout.php:153
1228
  msgid "Issuer"
@@ -1238,7 +1238,7 @@ msgstr "Seleccione el número de cotas"
1238
 
1239
  #: templates/checkout/custom_checkout.php:192
1240
  msgid "Enter your document number"
1241
- msgstr "Ingrese su número de documento"
1242
 
1243
  #: templates/checkout/custom_checkout.php:196
1244
  msgid "Type"
@@ -1393,7 +1393,7 @@ msgid "Select the issuer with whom you want to process the payment"
1393
  msgstr "Selecciona el emisor con el que quieras procesar el pago"
1394
 
1395
  #: woocommerce-mercadopago.php:48
1396
- msgid "WooCommerce Mercado Pago requires PHP version 5.6 or later. Please update your PHP version."
1397
  msgstr "El plugin de Mercado Pago requiere la versión de PHP 5.6 o posterior. Por favor actualice su versión de PHP."
1398
 
1399
  #: woocommerce-mercadopago.php:65
@@ -1427,3 +1427,27 @@ msgstr "Ofrece todos los medios de pago: tarjetas de crédito y débito, dinero
1427
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:28
1428
  msgid "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!"
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!"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  # Copyright (C) 2019 Mercado Pago
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.1.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: 2019-12-23 17:11-0300\n"
13
+ "X-Generator: Poedit 2.2.4\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
  "Language: es_ES\n"
18
 
19
  #. Plugin Name of the plugin
20
+ msgid "Mercado Pago payments for WooCommerce"
21
+ msgstr "Mercado Pago payments for WooCommerce"
22
 
23
  #. Plugin URI of the plugin
24
  msgid "https://github.com/mercadopago/cart-woocommerce"
79
 
80
  #: includes/module/WC_WooMercadoPago_Module.php:273
81
  msgid "Set up"
82
+ msgstr "Ajustes"
83
 
84
  #: includes/module/WC_WooMercadoPago_Module.php:274
85
  msgid "Your opinion helps us get better"
87
 
88
  #: includes/module/WC_WooMercadoPago_Module.php:275
89
  msgid "Guides and Documentation"
90
+ msgstr "Guías y documentación"
91
 
92
  #: includes/module/WC_WooMercadoPago_Module.php:276
93
  msgid "Report Problem"
94
+ msgstr "Informar problema"
95
 
96
  #: includes/module/WC_WooMercadoPago_Module.php:293
97
  msgid "By Mercado Pago"
229
  msgid "The payment is in mediation or the purchase was unknown by the customer."
230
  msgstr "El pago esta en mediación o la compra fue desconocida por el cliente."
231
 
232
+ #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:35 includes/notification/WC_WooMercadoPago_Notification_IPN.php:40 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:52
 
233
  msgid "The Mercado Pago request has failed"
234
  msgstr "La solicitud de Mercado Pago ha fallado"
235
 
236
+ #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:116 includes/notification/WC_WooMercadoPago_Notification_IPN.php:141 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:152
237
+ #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:170
238
  msgid "Buyer email"
239
  msgstr "Email del comprador"
240
 
241
+ #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:119 includes/notification/WC_WooMercadoPago_Notification_IPN.php:144 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:155
242
+ #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:173
243
  msgid "Payment method"
244
  msgstr "Medio de pago"
245
 
308
  msgstr "Descuento para el cupón %s"
309
 
310
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126 includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:128
311
+ msgid "discount of"
312
+ msgstr "descuento de"
313
 
314
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126
315
+ msgid " and fee of"
316
+ msgstr " y comisión de"
317
 
318
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:130
319
+ msgid "fee of"
320
+ msgstr "comisión de"
321
 
322
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:355
323
  msgid "Credentials for invalid production!"
348
  msgstr "Haga clic para intentarlo de nuevo"
349
 
350
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:77
351
+ msgid "Great, we processed your purchase order. Complete the payment with ticket so that we finish approving it."
352
+ msgstr "Excelente, procesamos tu orden de compra. Completa el pago con ticket para que terminemos de aprobarla."
353
 
354
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:82
355
+ msgid "Print ticket"
356
+ msgstr "Imprimir ticket"
357
 
358
  #: includes/payments/mercadoenvios/WC_WooMercadoPago_Product_Recurrent.php:40
359
  msgid "Subscription Mercado Pago"
433
  msgstr "Fecha límite para generar nuevos cargos. De forma predeterminada es nunca, si está en blanco."
434
 
435
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:27
436
+ msgid "Mercado Pago Checkout"
437
+ msgstr "Checkout de Mercado Pago"
438
 
439
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:29
440
  msgid "Pay with the payment method you prefer"
441
  msgstr "Paga con el medio de pago que prefieras"
442
 
443
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:229
444
+ msgid "Mercado Pago checkout %s"
445
+ msgstr "Checkout de Mercado Pago %s"
446
 
447
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:235
448
+ msgid "Accept all method of payment and take your charges to another level"
449
+ msgstr "Acepta todos los medios de pago y lleva tus cobros a otro nivel"
450
+
451
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:239
452
  msgid "Turn your online store into your customers preferred payment gateway. Choose if the final payment experience will be inside or outside your store."
453
  msgstr "Convierte tu tienda online en la pasarela de pagos preferida de tus clientes. Elige si la experiencia de pago final será dentro o fuera de tu tienda."
454
 
455
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:250 includes/payments/WC_WooMercadoPago_TicketGateway.php:204
456
+ msgid "Configure Mercado Pago for WooCommerce"
457
+ msgstr "Configura Mercado Pago para WooCommerce"
458
 
459
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:263
460
+ msgid "Enable the experience of the Mercado Pago Checkout in your online store, select the means of payment available to your customers and<br> define the maximum fees in which they can pay you."
461
+ msgstr "Habilita la experiencia del Checkout de Mercado Pago en tu tienda online, selecciona los medios de pago disponibles para tus clientes y<br> define el máximo de cuotas en el que podrán pagarte."
 
 
 
 
462
 
463
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:276 includes/payments/WC_WooMercadoPago_CustomGateway.php:187 includes/payments/WC_WooMercadoPago_TicketGateway.php:217
464
  msgid "Go to the basics. Place your business information."
469
  msgstr "Configura las preferencias de pago en tu tienda"
470
 
471
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
472
+ msgid "advanced settings"
473
+ msgstr "configuración avanzada"
474
 
475
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
476
+ msgid "Payment experience"
477
+ msgstr "Experiencia de pago"
478
 
479
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:317
480
  msgid "Define what payment experience your customers will have, whether inside or outside your store."
501
  msgstr "URL de éxito"
502
 
503
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:357
504
+ msgid "Choose the URL that we will show to your customers when we refuse their purchase. Make sure it includes a message appropriate to the situation and give them useful information so they can solve it."
505
+ msgstr "Elige la URL que mostraremos a tus clientes cuando rechacemos su compra. Asegúrate de incluir un mensaje adecuado a la situación y dales información útil para que puedan solucionarlo."
 
 
506
 
507
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:360
508
  msgid "Payment URL rejected"
526
 
527
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:455
528
  msgid "Select offline payments"
529
+ msgstr "Selecciona medios de pago presenciales"
530
 
531
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:464 includes/payments/WC_WooMercadoPago_TicketGateway.php:321
532
  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 "Enable the payment methods available to your customers."
541
  msgstr "Volver a la tienda"
542
 
543
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:489
544
+ msgid "Do you want your customer to automatically return to the store after payment?"
545
+ msgstr "¿Quieres que tu cliente vuelva automáticamente a la tienda después del pago?"
546
 
547
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:491 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:548 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:631
548
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:898 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1018 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1051
565
  msgstr "Paga con tarjetas de débito y crédito"
566
 
567
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:153
568
+ msgid "Checkout of payments with debit and credit cards %s"
569
+ msgstr "Checkout de pagos con tarjetas de débito y crédito %s"
570
 
571
+ #: includes/payments/WC_WooMercadoPago_CustomGateway.php:158
572
+ msgid "Accept payments instantly and maximize the conversion of your business"
573
+ msgstr "Acepta pagos al instante y maximiza la conversión de tu negocio"
574
+
575
+ #: includes/payments/WC_WooMercadoPago_CustomGateway.php:162
576
  msgid "Turn your online store into a secure and easy-to-use payment gateway for your customers. With personalized checkout your customers pay without leaving your store!"
577
  msgstr "Convierte tu tienda online en una pasarela de pagos segura y fácil de usar para tus clientes. Con el checkout personalizado tus clientes pagan ¡sin salir de tu tienda!"
578
 
589
  msgstr "Configuración avanzada de la experiencia de pago personalizada"
590
 
591
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:228
592
+ msgid "That’s it, payment accepted!"
593
+ msgstr "Listo, ¡aceptamos tu pago!"
594
 
595
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:230
596
  msgid "We are processing your payment. In less than an hour we will send you the result by email."
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 <b>credentials</b> depending on the country in which you are registered."
693
+ msgstr "Carga tus <b>credenciales</b> según el país en el que estés registrado."
694
 
695
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
696
  msgid "Approve your account to be able to charge."
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> solo cuando quieras modificar los ajustes preestablecidos."
710
 
711
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
712
  msgid ""
713
+ "Credentials are the keys we provide you to integrate quickly <br>and securely. You must have a %s in Mercado Pago to obtain and collect them <br>on your website. You do not need to know how to design or program to do it"
 
714
  msgstr ""
715
+ "Las credenciales son las claves que te proporcionamos para que integres de forma rápida <br>y segura. Debes tener una %s en Mercado Pago para obtenerlas y cobrar <br>en tu sitio web. No necesitas saber diseñar o "
716
+ "programar para hacerlo."
717
 
718
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:443
719
  msgid "approved account"
765
 
766
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:612
767
  msgid "When you see that everything is going well, deactivate Sandbox, turn on Production and make way for your online sales."
768
+ msgstr "Cuando veas que todo va bien, desactiva Sandbox para ir a Producción y abre paso a tus ventas online."
769
 
770
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:625
771
+ msgid "Production"
772
  msgstr "Producción"
773
 
774
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
775
+ msgid "Choose YES only when you are ready to sell. Change to NO to activate the Tests mode."
776
+ msgstr "Elige solo cuando estés listo para vender. Cambia a NO para activar el modo Pruebas."
777
 
778
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
779
  msgid "Load credentials"
832
  msgstr "Categoría de la tienda"
833
 
834
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:851
835
+ msgid "What category do your products belong to? Choose the one that best characterizes them (choose \"other\" if your product is too specific)."
836
+ msgstr "¿A qué categoría pertenecen tus productos? Elige la que mejor los caracteriza (elige otro” si tu producto es demasiado específico)."
837
 
838
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:852
839
  msgid "Categories"
968
  msgstr "Acepta y rechaza pagos de forma automática. ¿Quieres que lo activemos?"
969
 
970
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1064
971
+ msgid "Discounts per purchase with Mercado Pago"
972
+ msgstr "Descuentos por compra con 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."
992
  msgstr "¿Todo configurado? Ve a tu tienda en modo Sandbox"
993
 
994
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1122
995
+ msgid "Visit your store as if you were one of your customers and check that everything is fine. If you already went to Production,<br> bring your customers and increase your sales with the best online shopping experience."
996
+ msgstr "Visita tu tienda como si fueras uno de tus clientes y revisa que todo esté bien. Si ya saliste a Producción,<br> trae a tus clientes y aumenta tus ventas con la mejor experiencia de compra online."
997
 
998
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1124
999
+ msgid "Visit your store and simulate a payment to check that everything is fine."
1000
+ msgstr "Visita tu tienda y simula un pago para revisar que todo esté bien."
 
 
 
 
1001
 
1002
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1141
1003
  msgid "Visit my store"
1012
  msgstr "Paga con dinero en efectivo"
1013
 
1014
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:183
1015
+ msgid "Checkout of payments with cash %s"
1016
+ msgstr "Checkout de pagos con dinero en efectivo %s"
1017
 
1018
+ #: includes/payments/WC_WooMercadoPago_TicketGateway.php:192
1019
+ msgid "Accept face-to-face payments, do not leave anyone out!"
1020
+ msgstr "Acepta pagos presenciales ¡no dejes a nadie afuera!"
1021
+
1022
+ #: includes/payments/WC_WooMercadoPago_TicketGateway.php:197
1023
  msgid "Include this preferred purchase option by some customers."
1024
  msgstr "Incluye esta opción de compra preferida por algunos clientes."
1025
 
1026
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:230
1027
  msgid "Enable Mercado Pago for cash payments in your store and <br> select the options available to your customers."
1028
+ msgstr "Habilita Mercado Pago para pagos en efectivo en tu tienda y <br> selecciona las opciones disponibles para tus clientes."
1029
 
1030
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:243
1031
  msgid "Set payment preferences with cash"
1032
+ msgstr "Configura las preferencias de pago con dinero en efectivo"
1033
 
1034
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:256
1035
  msgid "Advanced configuration of the cash payment experience"
1104
  msgstr "Esto controla el título que el usuario ve durante el proceso de pago."
1105
 
1106
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:236
1107
+ msgid "Enable free shipping for this shipping method"
1108
  msgstr "Habilitar envío gratis para este método de envío"
1109
 
1110
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:240
1191
  msgid "CVV"
1192
  msgstr "CVV"
1193
 
1194
+ #: templates/checkout/custom_checkout.php:94 templates/checkout/custom_checkout.php:108 templates/checkout/custom_checkout.php:111 templates/checkout/custom_checkout.php:121 templates/checkout/custom_checkout.php:141
1195
+ #: templates/checkout/custom_checkout.php:205
1196
  msgid "Card number"
1197
  msgstr "Número de Tarjeta"
1198
 
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"
1226
 
1227
  #: templates/checkout/custom_checkout.php:153
1228
  msgid "Issuer"
1238
 
1239
  #: templates/checkout/custom_checkout.php:192
1240
  msgid "Enter your document number"
1241
+ msgstr "Ingresa tu número de documento"
1242
 
1243
  #: templates/checkout/custom_checkout.php:196
1244
  msgid "Type"
1393
  msgstr "Selecciona el emisor con el que quieras procesar el pago"
1394
 
1395
  #: woocommerce-mercadopago.php:48
1396
+ msgid "Mercado Pago payments for WooCommerce requires PHP version 5.6 or later. Please update your PHP version."
1397
  msgstr "El plugin de Mercado Pago requiere la versión de PHP 5.6 o posterior. Por favor actualice su versión de PHP."
1398
 
1399
  #: woocommerce-mercadopago.php:65
1427
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:28
1428
  msgid "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!"
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/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php:11
1432
+ msgid "Convert Currency"
1433
+ msgstr "Convertir moneda"
1434
+
1435
+ #: includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php:12
1436
+ msgid "Activate this option so that the value of the currency set in WooCommerce is compatible with the value of the currency you use in Mercado Pago."
1437
+ msgstr "Activa esta opción para que el valor de la moneda configurada en WooCommerce sea compatible al valor de la moneda que usas en Mercado Pago."
1438
+
1439
+ #: includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php:13
1440
+ msgid "Now we convert your currency from {%s} to {%s}."
1441
+ msgstr "Ahora convertimos tu moneda de {%s} a {%s}."
1442
+
1443
+ #: includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php:14
1444
+ msgid "We no longer convert your currency from {%s} to {%s}."
1445
+ msgstr "Dejamos de convertir tu moneda de {%s} a {%s}."
1446
+
1447
+ #: includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php:15
1448
+ msgid "<b>Attention:</b> The currency settings you have in WooCommerce are not compatible with the currency you use in your Mercado Pago account. Please activate the currency conversion."
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 "Select the payment methods available in your store."
1453
+ msgstr "Selecciona los medios de pago disponibles en tu tienda."
i18n/languages/woocommerce-mercadopago-es_MX.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_MX.po CHANGED
@@ -1,24 +1,24 @@
1
  # Copyright (C) 2019 Mercado Pago
2
- # This file is distributed under the same license as the WooCommerce Mercado Pago plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WooCommerce Mercado Pago 4.0.8\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: 2019-09-13 21:22-0300\n"
13
- "X-Generator: Poedit 2.2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
  "Language: es_MX\n"
18
 
19
  #. Plugin Name of the plugin
20
- msgid "WooCommerce Mercado Pago"
21
- msgstr "WooCommerce Mercado Pago"
22
 
23
  #. Plugin URI of the plugin
24
  msgid "https://github.com/mercadopago/cart-woocommerce"
@@ -79,7 +79,7 @@ msgstr "¡El módulo de pago de Woo Mercado depende de la última versión de %s
79
 
80
  #: includes/module/WC_WooMercadoPago_Module.php:273
81
  msgid "Set up"
82
- msgstr "Configurar"
83
 
84
  #: includes/module/WC_WooMercadoPago_Module.php:274
85
  msgid "Your opinion helps us get better"
@@ -87,11 +87,11 @@ msgstr "Tu opinión nos ayuda a mejorar"
87
 
88
  #: includes/module/WC_WooMercadoPago_Module.php:275
89
  msgid "Guides and Documentation"
90
- msgstr "Guías y Documentación"
91
 
92
  #: includes/module/WC_WooMercadoPago_Module.php:276
93
  msgid "Report Problem"
94
- msgstr "Informar Problema"
95
 
96
  #: includes/module/WC_WooMercadoPago_Module.php:293
97
  msgid "By Mercado Pago"
@@ -229,18 +229,17 @@ msgstr "El pago fue cancelado."
229
  msgid "The payment is in mediation or the purchase was unknown by the customer."
230
  msgstr "El pago esta en mediación o la compra fue desconocida por el cliente."
231
 
232
- #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:35 includes/notification/WC_WooMercadoPago_Notification_IPN.php:40
233
- #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:52
234
  msgid "The Mercado Pago request has failed"
235
  msgstr "La solicitud de Mercado Pago ha fallado"
236
 
237
- #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:116 includes/notification/WC_WooMercadoPago_Notification_IPN.php:141
238
- #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:152 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:170
239
  msgid "Buyer email"
240
  msgstr "Email del comprador"
241
 
242
- #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:119 includes/notification/WC_WooMercadoPago_Notification_IPN.php:144
243
- #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:155 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:173
244
  msgid "Payment method"
245
  msgstr "Medio de pago"
246
 
@@ -309,16 +308,16 @@ msgid "Discount for coupon %s"
309
  msgstr "Descuento para el cupón %s"
310
 
311
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126 includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:128
312
- msgid "Discount of"
313
- msgstr "Descuento de"
314
 
315
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126
316
- msgid " and Rate of"
317
- msgstr " y Tarifa de"
318
 
319
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:130
320
- msgid "Fee of"
321
- msgstr "Tarifa de"
322
 
323
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:355
324
  msgid "Credentials for invalid production!"
@@ -349,12 +348,12 @@ msgid "Click to try again"
349
  msgstr "Haga clic para intentarlo de nuevo"
350
 
351
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:77
352
- msgid "Thanks for your order. Please pay the ticket to have your order approved."
353
- msgstr "Gracias por su orden. Por favor, realice el pago del ticket para tener su orden aprobada."
354
 
355
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:82
356
- msgid "Print the ticket"
357
- msgstr "Imprimir el ticket"
358
 
359
  #: includes/payments/mercadoenvios/WC_WooMercadoPago_Product_Recurrent.php:40
360
  msgid "Subscription Mercado Pago"
@@ -434,32 +433,32 @@ msgid "Deadline to generate new charges. By default as never, if it is blank."
434
  msgstr "Fecha límite para generar nuevos cargos. De forma predeterminada es nunca, si está en blanco."
435
 
436
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:27
437
- msgid "Mercado Pago - Basic Checkout"
438
- msgstr "Mercado Pago - Checkout básico"
439
 
440
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:29
441
  msgid "Pay with the payment method you prefer"
442
  msgstr "Paga con el medio de pago que prefieras"
443
 
444
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:229
445
- msgid "Basic Checkout Accept all method of payment and take your charges to another level %s"
446
- msgstr "Checkout Básico. Acepta todos los medios de pago y lleva tus cobros a otro nivel %s"
447
 
448
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:233
 
 
 
 
449
  msgid "Turn your online store into your customers preferred payment gateway. Choose if the final payment experience will be inside or outside your store."
450
  msgstr "Convierte tu tienda online en la pasarela de pagos preferida de tus clientes. Elige si la experiencia de pago final será dentro o fuera de tu tienda."
451
 
452
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:250 includes/payments/WC_WooMercadoPago_TicketGateway.php:204
453
- msgid "Configure WooCommerce Mercado Pago"
454
- msgstr "Configura WooCommerce Mercado Pago"
455
 
456
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:263
457
- msgid ""
458
- "Enable the experience of the basic checkout of Mercado Pago in your online store, select the means of payment available to your customers and<br> define the maximum fees in which they can pay "
459
- "you."
460
- msgstr ""
461
- "Habilitá la experiencia del checkout básico de Mercado Pago en tu tienda online, seleccioná los medios de pago disponibles para tus clientes y<br> definí el máximo de cuotas en el que podrán "
462
- "pagarte."
463
 
464
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:276 includes/payments/WC_WooMercadoPago_CustomGateway.php:187 includes/payments/WC_WooMercadoPago_TicketGateway.php:217
465
  msgid "Go to the basics. Place your business information."
@@ -470,12 +469,12 @@ msgid "Set payment preferences in your store"
470
  msgstr "Configura las preferencias de pago en tu tienda"
471
 
472
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
473
- msgid "Advanced payment experience settings"
474
- msgstr "Configuración Avanzada de la experiencia de pago"
475
 
476
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
477
- msgid "Integration method"
478
- msgstr "Método de integración"
479
 
480
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:317
481
  msgid "Define what payment experience your customers will have, whether inside or outside your store."
@@ -502,10 +501,8 @@ msgid "Success URL"
502
  msgstr "URL de éxito"
503
 
504
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:357
505
- msgid ""
506
- "Choose the URL that we will show to your customers when we refuse their purchase. Make sure it includes a message appropriate to the situation and give them useful information so they can solve "
507
- "it."
508
- msgstr "Elige la URL que mostraremos a tus clientes cuando rechacemos su compra. Asegurate de que incluya un mensaje adecuado a la situación y dales información útil para que puedan solucionarlo."
509
 
510
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:360
511
  msgid "Payment URL rejected"
@@ -529,11 +526,11 @@ msgstr "Selecciona tarjetas de débito"
529
 
530
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:455
531
  msgid "Select offline payments"
532
- msgstr "Selecciona pagos offline"
533
 
534
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:464 includes/payments/WC_WooMercadoPago_TicketGateway.php:321
535
  msgid "Payment methods"
536
- msgstr "Medios de pago"
537
 
538
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:468 includes/payments/WC_WooMercadoPago_TicketGateway.php:325
539
  msgid "Enable the payment methods available to your customers."
@@ -544,8 +541,8 @@ msgid "Return to the store"
544
  msgstr "Volver a la tienda"
545
 
546
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:489
547
- msgid "Your customer automatically return to the store after payment."
548
- msgstr "Que tu cliente vuelva automáticamente a la tienda después del pago."
549
 
550
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:491 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:548 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:631
551
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:898 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1018 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1051
@@ -568,10 +565,14 @@ msgid "Pay with debit and credit cards"
568
  msgstr "Paga con tarjetas de débito y crédito"
569
 
570
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:153
571
- msgid "Checkout of payments with debit and credit cards<br> Accept payments instantly and maximize the conversion of your business %s"
572
- msgstr "Checkout de pagos con tarjetas de débito y crédito<br> Acepta pagos al instante y maximiza la conversión de tu negocio %s"
 
 
 
 
573
 
574
- #: includes/payments/WC_WooMercadoPago_CustomGateway.php:157
575
  msgid "Turn your online store into a secure and easy-to-use payment gateway for your customers. With personalized checkout your customers pay without leaving your store!"
576
  msgstr "Convierte tu tienda online en una pasarela de pagos segura y fácil de usar para tus clientes. Con el checkout personalizado tus clientes pagan ¡sin salir de tu tienda!"
577
 
@@ -588,8 +589,8 @@ msgid "Advanced configuration of the personalized payment experience\""
588
  msgstr "Configuración avanzada de la experiencia de pago personalizada"
589
 
590
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:228
591
- msgid "Ready, your payment has been accepted!"
592
- msgstr "Listo, su pago ha sido aceptado!"
593
 
594
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:230
595
  msgid "We are processing your payment. In less than an hour we will send you the result by email."
@@ -688,8 +689,8 @@ msgid "<b>Follow these steps to activate Mercado Pago in your store:</b>"
688
  msgstr "<b>Sigue estos pasos para activar Mercado Pago en tu tienda:</b>"
689
 
690
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:395
691
- msgid "Upload your <b>credentials</b> to test the store and charge with your Mercado Pago account <b>depending on the country</b> in which you are registered."
692
- msgstr "Carga tus <b>credenciales</b> para testear la tienda y cobrar con tu cuenta de Mercado Pago <b>según el país</b> en el que estés registrado."
693
 
694
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
695
  msgid "Approve your account to be able to charge."
@@ -704,16 +705,15 @@ msgid "Configure the <b>payment preferences</b> for your customers."
704
  msgstr "Configura las preferencias de pago para tus clientes."
705
 
706
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:423
707
- msgid "Go to advanced settings of both the plugin and checkout only when you want to change the presets."
708
- msgstr "Ve a configuraciones avanzadas tanto del plugin como del checkout solo cuando quieras modificar los ajustes preestablecidos."
709
 
710
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
711
  msgid ""
712
- "Credentials are the keys we provide you to integrate quickly <br>and securely. You must have a %s in Mercado Pago to obtain and collect them <br>on your website. You do not need to know how to "
713
- "design or program to do it"
714
  msgstr ""
715
- "Las credenciales son las claves que te proporcionamos para que integres de forma rápida <br>y segura. Debes tener una %s en Mercado Pago para obtenerlas y cobrar <br>en tu sitio web. No "
716
- "necesitas saber diseñar o programar para hacerlo."
717
 
718
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:443
719
  msgid "approved account"
@@ -765,15 +765,15 @@ msgstr "Modo Producción"
765
 
766
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:612
767
  msgid "When you see that everything is going well, deactivate Sandbox, turn on Production and make way for your online sales."
768
- msgstr "Cuando veas que todo va bien, desactivá Sandbox, prendé Producción y abrí paso a tus ventas online."
769
 
770
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:625
771
- msgid "Productio"
772
  msgstr "Producción"
773
 
774
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
775
- msgid "Choose \"YES\" only when you are ready to sell. Change to NO to activate the Tests mode."
776
- msgstr "Elige “SÍ” solo cuando estés listo para vender. Cambia a NO para activar el modo Pruebas."
777
 
778
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
779
  msgid "Load credentials"
@@ -832,8 +832,8 @@ msgid "Store Category"
832
  msgstr "Categoría de la tienda"
833
 
834
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:851
835
- msgid "What category do your products belong to? Choose the one that best characterizes them (choose <br>\"other\" if your product is too specific)."
836
- msgstr "¿A qué categoría pertenecen tus productos? Elige la que mejor los caracteriza (elige <br>“otro” si tu producto es demasiado específico)."
837
 
838
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:852
839
  msgid "Categories"
@@ -968,8 +968,8 @@ msgid "Accept and reject payments automatically. Do you want us to activate it?"
968
  msgstr "Acepta y rechaza pagos de forma automática. ¿Quieres que lo activemos?"
969
 
970
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1064
971
- msgid "Gateway Discounts"
972
- msgstr "Descuentos Gateway"
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."
@@ -992,16 +992,12 @@ msgid "Everything set up? Go to your store in Sandbox mode"
992
  msgstr "¿Todo configurado? Ve a tu tienda en modo Sandbox"
993
 
994
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1122
995
- msgid "You already went to Production. You just need your best customers <br> to arrive at your store to live the best online shopping experience with Mercado Pago."
996
- msgstr "Ya saliste a Producción. Solo falta que tus mejores clientes <br> lleguen a tu tienda para vivir la mejor experiencia de compra online com Mercado Pago."
997
 
998
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1124
999
- msgid ""
1000
- "Visit your store as if you were one of your customers and check that everything is fine. If you already went to Production,<br> bring your customers and increase your sales with the best online "
1001
- "shopping experience."
1002
- msgstr ""
1003
- "Visita tu tienda como si fueras uno de tus clientes y revisa que todo esté bien. Si ya saliste a Producción,<br> trae a tus clientes y aumenta tus ventas con la mejor experiencia de compra "
1004
- "online."
1005
 
1006
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1141
1007
  msgid "Visit my store"
@@ -1016,20 +1012,24 @@ msgid "Pay with cash"
1016
  msgstr "Paga con dinero en efectivo"
1017
 
1018
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:183
1019
- msgid "Checkout of payments with cash<br> Accept face-to-face payments, do not leave anyone out! %s"
1020
- msgstr "Checkout de pagos con dinero en efectivo<br> Acepta pagos presenciales ¡no dejes a nadie afuera! %s"
1021
 
1022
- #: includes/payments/WC_WooMercadoPago_TicketGateway.php:187
 
 
 
 
1023
  msgid "Include this preferred purchase option by some customers."
1024
  msgstr "Incluye esta opción de compra preferida por algunos clientes."
1025
 
1026
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:230
1027
  msgid "Enable Mercado Pago for cash payments in your store and <br> select the options available to your customers."
1028
- msgstr "Habilitá Mercado Pago para pagos en efectivo en tu tienda y <br> seleccioná las opciones disponibles para tus clientes."
1029
 
1030
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:243
1031
  msgid "Set payment preferences with cash"
1032
- msgstr "Configurá las preferencias de pago con dinero en efectivo"
1033
 
1034
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:256
1035
  msgid "Advanced configuration of the cash payment experience"
@@ -1104,7 +1104,7 @@ msgid "This controls the title that the user sees during the payment process."
1104
  msgstr "Esto controla el título que el usuario ve durante el proceso de pago."
1105
 
1106
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:236
1107
- msgid "nable free shipping for this shipping method"
1108
  msgstr "Habilitar envío gratis para este método de envío"
1109
 
1110
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:240
@@ -1191,8 +1191,8 @@ msgstr "Otra tarjeta"
1191
  msgid "CVV"
1192
  msgstr "CVV"
1193
 
1194
- #: templates/checkout/custom_checkout.php:94 templates/checkout/custom_checkout.php:108 templates/checkout/custom_checkout.php:111 templates/checkout/custom_checkout.php:121
1195
- #: templates/checkout/custom_checkout.php:141 templates/checkout/custom_checkout.php:205
1196
  msgid "Card number"
1197
  msgstr "Número de Tarjeta"
1198
 
@@ -1221,8 +1221,8 @@ msgid "Last 3 numbers on the back"
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?"
1226
 
1227
  #: templates/checkout/custom_checkout.php:153
1228
  msgid "Issuer"
@@ -1238,7 +1238,7 @@ msgstr "Seleccione el número de cotas"
1238
 
1239
  #: templates/checkout/custom_checkout.php:192
1240
  msgid "Enter your document number"
1241
- msgstr "Ingrese su número de documento"
1242
 
1243
  #: templates/checkout/custom_checkout.php:196
1244
  msgid "Type"
@@ -1393,7 +1393,7 @@ msgid "Select the issuer with whom you want to process the payment"
1393
  msgstr "Selecciona el emisor con el que quieras procesar el pago"
1394
 
1395
  #: woocommerce-mercadopago.php:48
1396
- msgid "WooCommerce Mercado Pago requires PHP version 5.6 or later. Please update your PHP version."
1397
  msgstr "El plugin de Mercado Pago requiere la versión de PHP 5.6 o posterior. Por favor actualice su versión de PHP."
1398
 
1399
  #: woocommerce-mercadopago.php:65
@@ -1427,3 +1427,7 @@ msgstr "Ofrece todos los medios de pago: tarjetas de crédito y débito, dinero
1427
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:28
1428
  msgid "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!"
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!"
 
 
 
 
1
  # Copyright (C) 2019 Mercado Pago
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.1.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: 2019-12-23 17:11-0300\n"
13
+ "X-Generator: Poedit 2.2.4\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
  "Language: es_MX\n"
18
 
19
  #. Plugin Name of the plugin
20
+ msgid "Mercado Pago payments for WooCommerce"
21
+ msgstr "Mercado Pago payments for WooCommerce"
22
 
23
  #. Plugin URI of the plugin
24
  msgid "https://github.com/mercadopago/cart-woocommerce"
79
 
80
  #: includes/module/WC_WooMercadoPago_Module.php:273
81
  msgid "Set up"
82
+ msgstr "Ajustes"
83
 
84
  #: includes/module/WC_WooMercadoPago_Module.php:274
85
  msgid "Your opinion helps us get better"
87
 
88
  #: includes/module/WC_WooMercadoPago_Module.php:275
89
  msgid "Guides and Documentation"
90
+ msgstr "Guías y documentación"
91
 
92
  #: includes/module/WC_WooMercadoPago_Module.php:276
93
  msgid "Report Problem"
94
+ msgstr "Informar problema"
95
 
96
  #: includes/module/WC_WooMercadoPago_Module.php:293
97
  msgid "By Mercado Pago"
229
  msgid "The payment is in mediation or the purchase was unknown by the customer."
230
  msgstr "El pago esta en mediación o la compra fue desconocida por el cliente."
231
 
232
+ #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:35 includes/notification/WC_WooMercadoPago_Notification_IPN.php:40 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:52
 
233
  msgid "The Mercado Pago request has failed"
234
  msgstr "La solicitud de Mercado Pago ha fallado"
235
 
236
+ #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:116 includes/notification/WC_WooMercadoPago_Notification_IPN.php:141 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:152
237
+ #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:170
238
  msgid "Buyer email"
239
  msgstr "Email del comprador"
240
 
241
+ #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:119 includes/notification/WC_WooMercadoPago_Notification_IPN.php:144 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:155
242
+ #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:173
243
  msgid "Payment method"
244
  msgstr "Medio de pago"
245
 
308
  msgstr "Descuento para el cupón %s"
309
 
310
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126 includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:128
311
+ msgid "discount of"
312
+ msgstr "descuento de"
313
 
314
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126
315
+ msgid " and fee of"
316
+ msgstr " y comisión de"
317
 
318
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:130
319
+ msgid "fee of"
320
+ msgstr "comisión de"
321
 
322
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:355
323
  msgid "Credentials for invalid production!"
348
  msgstr "Haga clic para intentarlo de nuevo"
349
 
350
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:77
351
+ msgid "Great, we processed your purchase order. Complete the payment with ticket so that we finish approving it."
352
+ msgstr "Excelente, procesamos tu orden de compra. Completa el pago con ticket para que terminemos de aprobarla."
353
 
354
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:82
355
+ msgid "Print ticket"
356
+ msgstr "Imprimir ticket"
357
 
358
  #: includes/payments/mercadoenvios/WC_WooMercadoPago_Product_Recurrent.php:40
359
  msgid "Subscription Mercado Pago"
433
  msgstr "Fecha límite para generar nuevos cargos. De forma predeterminada es nunca, si está en blanco."
434
 
435
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:27
436
+ msgid "Mercado Pago Checkout"
437
+ msgstr "Checkout de Mercado Pago"
438
 
439
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:29
440
  msgid "Pay with the payment method you prefer"
441
  msgstr "Paga con el medio de pago que prefieras"
442
 
443
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:229
444
+ msgid "Mercado Pago checkout %s"
445
+ msgstr "Checkout de Mercado Pago %s"
446
 
447
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:235
448
+ msgid "Accept all method of payment and take your charges to another level"
449
+ msgstr "Acepta todos los medios de pago y lleva tus cobros a otro nivel"
450
+
451
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:239
452
  msgid "Turn your online store into your customers preferred payment gateway. Choose if the final payment experience will be inside or outside your store."
453
  msgstr "Convierte tu tienda online en la pasarela de pagos preferida de tus clientes. Elige si la experiencia de pago final será dentro o fuera de tu tienda."
454
 
455
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:250 includes/payments/WC_WooMercadoPago_TicketGateway.php:204
456
+ msgid "Configure Mercado Pago for WooCommerce"
457
+ msgstr "Configura Mercado Pago para WooCommerce"
458
 
459
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:263
460
+ msgid "Enable the experience of the Mercado Pago Checkout in your online store, select the means of payment available to your customers and<br> define the maximum fees in which they can pay you."
461
+ msgstr "Habilita la experiencia del Checkout de Mercado Pago en tu tienda online, selecciona los medios de pago disponibles para tus clientes y<br> define el máximo de cuotas en el que podrán pagarte."
 
 
 
 
462
 
463
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:276 includes/payments/WC_WooMercadoPago_CustomGateway.php:187 includes/payments/WC_WooMercadoPago_TicketGateway.php:217
464
  msgid "Go to the basics. Place your business information."
469
  msgstr "Configura las preferencias de pago en tu tienda"
470
 
471
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
472
+ msgid "advanced settings"
473
+ msgstr "configuración avanzada"
474
 
475
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
476
+ msgid "Payment experience"
477
+ msgstr "Experiencia de pago"
478
 
479
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:317
480
  msgid "Define what payment experience your customers will have, whether inside or outside your store."
501
  msgstr "URL de éxito"
502
 
503
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:357
504
+ msgid "Choose the URL that we will show to your customers when we refuse their purchase. Make sure it includes a message appropriate to the situation and give them useful information so they can solve it."
505
+ msgstr "Elige la URL que mostraremos a tus clientes cuando rechacemos su compra. Asegúrate de incluir un mensaje adecuado a la situación y dales información útil para que puedan solucionarlo."
 
 
506
 
507
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:360
508
  msgid "Payment URL rejected"
526
 
527
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:455
528
  msgid "Select offline payments"
529
+ msgstr "Selecciona medios de pago presenciales"
530
 
531
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:464 includes/payments/WC_WooMercadoPago_TicketGateway.php:321
532
  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 "Enable the payment methods available to your customers."
541
  msgstr "Volver a la tienda"
542
 
543
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:489
544
+ msgid "Do you want your customer to automatically return to the store after payment?"
545
+ msgstr "¿Quieres que tu cliente vuelva automáticamente a la tienda después del pago?"
546
 
547
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:491 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:548 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:631
548
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:898 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1018 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1051
565
  msgstr "Paga con tarjetas de débito y crédito"
566
 
567
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:153
568
+ msgid "Checkout of payments with debit and credit cards %s"
569
+ msgstr "Checkout de pagos con tarjetas de débito y crédito %s"
570
+
571
+ #: includes/payments/WC_WooMercadoPago_CustomGateway.php:158
572
+ msgid "Accept payments instantly and maximize the conversion of your business"
573
+ msgstr "Acepta pagos al instante y maximiza la conversión de tu negocio"
574
 
575
+ #: includes/payments/WC_WooMercadoPago_CustomGateway.php:162
576
  msgid "Turn your online store into a secure and easy-to-use payment gateway for your customers. With personalized checkout your customers pay without leaving your store!"
577
  msgstr "Convierte tu tienda online en una pasarela de pagos segura y fácil de usar para tus clientes. Con el checkout personalizado tus clientes pagan ¡sin salir de tu tienda!"
578
 
589
  msgstr "Configuración avanzada de la experiencia de pago personalizada"
590
 
591
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:228
592
+ msgid "That’s it, payment accepted!"
593
+ msgstr "Listo, ¡aceptamos tu pago!"
594
 
595
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:230
596
  msgid "We are processing your payment. In less than an hour we will send you the result by email."
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 <b>credentials</b> depending on the country in which you are registered."
693
+ msgstr "Carga tus <b>credenciales</b> según el país en el que estés registrado."
694
 
695
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
696
  msgid "Approve your account to be able to charge."
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> solo cuando quieras modificar los ajustes preestablecidos."
710
 
711
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
712
  msgid ""
713
+ "Credentials are the keys we provide you to integrate quickly <br>and securely. You must have a %s in Mercado Pago to obtain and collect them <br>on your website. You do not need to know how to design or program to do it"
 
714
  msgstr ""
715
+ "Las credenciales son las claves que te proporcionamos para que integres de forma rápida <br>y segura. Debes tener una %s en Mercado Pago para obtenerlas y cobrar <br>en tu sitio web. No necesitas saber diseñar o "
716
+ "programar para hacerlo."
717
 
718
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:443
719
  msgid "approved account"
765
 
766
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:612
767
  msgid "When you see that everything is going well, deactivate Sandbox, turn on Production and make way for your online sales."
768
+ msgstr "Cuando veas que todo va bien, desactiva Sandbox para ir a Producción y abre paso a tus ventas online."
769
 
770
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:625
771
+ msgid "Production"
772
  msgstr "Producción"
773
 
774
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
775
+ msgid "Choose YES only when you are ready to sell. Change to NO to activate the Tests mode."
776
+ msgstr "Elige solo cuando estés listo para vender. Cambia a NO para activar el modo Pruebas."
777
 
778
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
779
  msgid "Load credentials"
832
  msgstr "Categoría de la tienda"
833
 
834
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:851
835
+ msgid "What category do your products belong to? Choose the one that best characterizes them (choose \"other\" if your product is too specific)."
836
+ msgstr "¿A qué categoría pertenecen tus productos? Elige la que mejor los caracteriza (elige otro” si tu producto es demasiado específico)."
837
 
838
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:852
839
  msgid "Categories"
968
  msgstr "Acepta y rechaza pagos de forma automática. ¿Quieres que lo activemos?"
969
 
970
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1064
971
+ msgid "Discounts per purchase with Mercado Pago"
972
+ msgstr "Descuentos por compra con 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."
992
  msgstr "¿Todo configurado? Ve a tu tienda en modo Sandbox"
993
 
994
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1122
995
+ msgid "Visit your store as if you were one of your customers and check that everything is fine. If you already went to Production,<br> bring your customers and increase your sales with the best online shopping experience."
996
+ msgstr "Visita tu tienda como si fueras uno de tus clientes y revisa que todo esté bien. Si ya saliste a Producción,<br> trae a tus clientes y aumenta tus ventas con la mejor experiencia de compra online."
997
 
998
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1124
999
+ msgid "Visit your store and simulate a payment to check that everything is fine."
1000
+ msgstr "Visita tu tienda y simula un pago para revisar que todo esté bien."
 
 
 
 
1001
 
1002
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1141
1003
  msgid "Visit my store"
1012
  msgstr "Paga con dinero en efectivo"
1013
 
1014
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:183
1015
+ msgid "Checkout of payments with cash %s"
1016
+ msgstr "Checkout de pagos con dinero en efectivo %s"
1017
 
1018
+ #: includes/payments/WC_WooMercadoPago_TicketGateway.php:192
1019
+ msgid "Accept face-to-face payments, do not leave anyone out!"
1020
+ msgstr "Acepta pagos presenciales ¡no dejes a nadie afuera!"
1021
+
1022
+ #: includes/payments/WC_WooMercadoPago_TicketGateway.php:197
1023
  msgid "Include this preferred purchase option by some customers."
1024
  msgstr "Incluye esta opción de compra preferida por algunos clientes."
1025
 
1026
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:230
1027
  msgid "Enable Mercado Pago for cash payments in your store and <br> select the options available to your customers."
1028
+ msgstr "Habilita Mercado Pago para pagos en efectivo en tu tienda y <br> selecciona las opciones disponibles para tus clientes."
1029
 
1030
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:243
1031
  msgid "Set payment preferences with cash"
1032
+ msgstr "Configura las preferencias de pago con dinero en efectivo"
1033
 
1034
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:256
1035
  msgid "Advanced configuration of the cash payment experience"
1104
  msgstr "Esto controla el título que el usuario ve durante el proceso de pago."
1105
 
1106
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:236
1107
+ msgid "Enable free shipping for this shipping method"
1108
  msgstr "Habilitar envío gratis para este método de envío"
1109
 
1110
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:240
1191
  msgid "CVV"
1192
  msgstr "CVV"
1193
 
1194
+ #: templates/checkout/custom_checkout.php:94 templates/checkout/custom_checkout.php:108 templates/checkout/custom_checkout.php:111 templates/checkout/custom_checkout.php:121 templates/checkout/custom_checkout.php:141
1195
+ #: templates/checkout/custom_checkout.php:205
1196
  msgid "Card number"
1197
  msgstr "Número de Tarjeta"
1198
 
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"
1226
 
1227
  #: templates/checkout/custom_checkout.php:153
1228
  msgid "Issuer"
1238
 
1239
  #: templates/checkout/custom_checkout.php:192
1240
  msgid "Enter your document number"
1241
+ msgstr "Ingresa tu número de documento"
1242
 
1243
  #: templates/checkout/custom_checkout.php:196
1244
  msgid "Type"
1393
  msgstr "Selecciona el emisor con el que quieras procesar el pago"
1394
 
1395
  #: woocommerce-mercadopago.php:48
1396
+ msgid "Mercado Pago payments for WooCommerce requires PHP version 5.6 or later. Please update your PHP version."
1397
  msgstr "El plugin de Mercado Pago requiere la versión de PHP 5.6 o posterior. Por favor actualice su versión de PHP."
1398
 
1399
  #: woocommerce-mercadopago.php:65
1427
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:28
1428
  msgid "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!"
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 "Select the payment methods available in your store."
1433
+ msgstr "Selecciona los medios de pago disponibles en tu tienda."
i18n/languages/woocommerce-mercadopago-es_PE.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_PE.po CHANGED
@@ -1,24 +1,24 @@
1
  # Copyright (C) 2019 Mercado Pago
2
- # This file is distributed under the same license as the WooCommerce Mercado Pago plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WooCommerce Mercado Pago 4.0.8\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: 2019-09-13 21:22-0300\n"
13
- "X-Generator: Poedit 2.2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
  "Language: es_PE\n"
18
 
19
  #. Plugin Name of the plugin
20
- msgid "WooCommerce Mercado Pago"
21
- msgstr "WooCommerce Mercado Pago"
22
 
23
  #. Plugin URI of the plugin
24
  msgid "https://github.com/mercadopago/cart-woocommerce"
@@ -79,7 +79,7 @@ msgstr "¡El módulo de pago de Woo Mercado depende de la última versión de %s
79
 
80
  #: includes/module/WC_WooMercadoPago_Module.php:273
81
  msgid "Set up"
82
- msgstr "Configurar"
83
 
84
  #: includes/module/WC_WooMercadoPago_Module.php:274
85
  msgid "Your opinion helps us get better"
@@ -87,11 +87,11 @@ msgstr "Tu opinión nos ayuda a mejorar"
87
 
88
  #: includes/module/WC_WooMercadoPago_Module.php:275
89
  msgid "Guides and Documentation"
90
- msgstr "Guías y Documentación"
91
 
92
  #: includes/module/WC_WooMercadoPago_Module.php:276
93
  msgid "Report Problem"
94
- msgstr "Informar Problema"
95
 
96
  #: includes/module/WC_WooMercadoPago_Module.php:293
97
  msgid "By Mercado Pago"
@@ -229,18 +229,17 @@ msgstr "El pago fue cancelado."
229
  msgid "The payment is in mediation or the purchase was unknown by the customer."
230
  msgstr "El pago esta en mediación o la compra fue desconocida por el cliente."
231
 
232
- #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:35 includes/notification/WC_WooMercadoPago_Notification_IPN.php:40
233
- #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:52
234
  msgid "The Mercado Pago request has failed"
235
  msgstr "La solicitud de Mercado Pago ha fallado"
236
 
237
- #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:116 includes/notification/WC_WooMercadoPago_Notification_IPN.php:141
238
- #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:152 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:170
239
  msgid "Buyer email"
240
  msgstr "Email del comprador"
241
 
242
- #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:119 includes/notification/WC_WooMercadoPago_Notification_IPN.php:144
243
- #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:155 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:173
244
  msgid "Payment method"
245
  msgstr "Medio de pago"
246
 
@@ -309,16 +308,16 @@ msgid "Discount for coupon %s"
309
  msgstr "Descuento para el cupón %s"
310
 
311
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126 includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:128
312
- msgid "Discount of"
313
- msgstr "Descuento de"
314
 
315
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126
316
- msgid " and Rate of"
317
- msgstr " y Tarifa de"
318
 
319
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:130
320
- msgid "Fee of"
321
- msgstr "Tarifa de"
322
 
323
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:355
324
  msgid "Credentials for invalid production!"
@@ -349,12 +348,12 @@ msgid "Click to try again"
349
  msgstr "Haga clic para intentarlo de nuevo"
350
 
351
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:77
352
- msgid "Thanks for your order. Please pay the ticket to have your order approved."
353
- msgstr "Gracias por su orden. Por favor, realice el pago del ticket para tener su orden aprobada."
354
 
355
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:82
356
- msgid "Print the ticket"
357
- msgstr "Imprimir el ticket"
358
 
359
  #: includes/payments/mercadoenvios/WC_WooMercadoPago_Product_Recurrent.php:40
360
  msgid "Subscription Mercado Pago"
@@ -434,32 +433,32 @@ msgid "Deadline to generate new charges. By default as never, if it is blank."
434
  msgstr "Fecha límite para generar nuevos cargos. De forma predeterminada es nunca, si está en blanco."
435
 
436
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:27
437
- msgid "Mercado Pago - Basic Checkout"
438
- msgstr "Mercado Pago - Checkout básico"
439
 
440
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:29
441
  msgid "Pay with the payment method you prefer"
442
  msgstr "Paga con el medio de pago que prefieras"
443
 
444
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:229
445
- msgid "Basic Checkout Accept all method of payment and take your charges to another level %s"
446
- msgstr "Checkout Básico. Acepta todos los medios de pago y lleva tus cobros a otro nivel %s"
447
 
448
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:233
 
 
 
 
449
  msgid "Turn your online store into your customers preferred payment gateway. Choose if the final payment experience will be inside or outside your store."
450
  msgstr "Convierte tu tienda online en la pasarela de pagos preferida de tus clientes. Elige si la experiencia de pago final será dentro o fuera de tu tienda."
451
 
452
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:250 includes/payments/WC_WooMercadoPago_TicketGateway.php:204
453
- msgid "Configure WooCommerce Mercado Pago"
454
- msgstr "Configura WooCommerce Mercado Pago"
455
 
456
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:263
457
- msgid ""
458
- "Enable the experience of the basic checkout of Mercado Pago in your online store, select the means of payment available to your customers and<br> define the maximum fees in which they can pay "
459
- "you."
460
- msgstr ""
461
- "Habilitá la experiencia del checkout básico de Mercado Pago en tu tienda online, seleccioná los medios de pago disponibles para tus clientes y<br> definí el máximo de cuotas en el que podrán "
462
- "pagarte."
463
 
464
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:276 includes/payments/WC_WooMercadoPago_CustomGateway.php:187 includes/payments/WC_WooMercadoPago_TicketGateway.php:217
465
  msgid "Go to the basics. Place your business information."
@@ -470,12 +469,12 @@ msgid "Set payment preferences in your store"
470
  msgstr "Configura las preferencias de pago en tu tienda"
471
 
472
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
473
- msgid "Advanced payment experience settings"
474
- msgstr "Configuración Avanzada de la experiencia de pago"
475
 
476
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
477
- msgid "Integration method"
478
- msgstr "Método de integración"
479
 
480
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:317
481
  msgid "Define what payment experience your customers will have, whether inside or outside your store."
@@ -502,10 +501,8 @@ msgid "Success URL"
502
  msgstr "URL de éxito"
503
 
504
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:357
505
- msgid ""
506
- "Choose the URL that we will show to your customers when we refuse their purchase. Make sure it includes a message appropriate to the situation and give them useful information so they can solve "
507
- "it."
508
- msgstr "Elige la URL que mostraremos a tus clientes cuando rechacemos su compra. Asegurate de que incluya un mensaje adecuado a la situación y dales información útil para que puedan solucionarlo."
509
 
510
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:360
511
  msgid "Payment URL rejected"
@@ -529,11 +526,11 @@ msgstr "Selecciona tarjetas de débito"
529
 
530
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:455
531
  msgid "Select offline payments"
532
- msgstr "Selecciona pagos offline"
533
 
534
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:464 includes/payments/WC_WooMercadoPago_TicketGateway.php:321
535
  msgid "Payment methods"
536
- msgstr "Medios de pago"
537
 
538
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:468 includes/payments/WC_WooMercadoPago_TicketGateway.php:325
539
  msgid "Enable the payment methods available to your customers."
@@ -544,8 +541,8 @@ msgid "Return to the store"
544
  msgstr "Volver a la tienda"
545
 
546
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:489
547
- msgid "Your customer automatically return to the store after payment."
548
- msgstr "Que tu cliente vuelva automáticamente a la tienda después del pago."
549
 
550
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:491 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:548 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:631
551
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:898 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1018 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1051
@@ -568,10 +565,14 @@ msgid "Pay with debit and credit cards"
568
  msgstr "Paga con tarjetas de débito y crédito"
569
 
570
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:153
571
- msgid "Checkout of payments with debit and credit cards<br> Accept payments instantly and maximize the conversion of your business %s"
572
- msgstr "Checkout de pagos con tarjetas de débito y crédito<br> Acepta pagos al instante y maximiza la conversión de tu negocio %s"
 
 
 
 
573
 
574
- #: includes/payments/WC_WooMercadoPago_CustomGateway.php:157
575
  msgid "Turn your online store into a secure and easy-to-use payment gateway for your customers. With personalized checkout your customers pay without leaving your store!"
576
  msgstr "Convierte tu tienda online en una pasarela de pagos segura y fácil de usar para tus clientes. Con el checkout personalizado tus clientes pagan ¡sin salir de tu tienda!"
577
 
@@ -588,8 +589,8 @@ msgid "Advanced configuration of the personalized payment experience\""
588
  msgstr "Configuración avanzada de la experiencia de pago personalizada"
589
 
590
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:228
591
- msgid "Ready, your payment has been accepted!"
592
- msgstr "Listo, su pago ha sido aceptado!"
593
 
594
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:230
595
  msgid "We are processing your payment. In less than an hour we will send you the result by email."
@@ -688,8 +689,8 @@ msgid "<b>Follow these steps to activate Mercado Pago in your store:</b>"
688
  msgstr "<b>Sigue estos pasos para activar Mercado Pago en tu tienda:</b>"
689
 
690
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:395
691
- msgid "Upload your <b>credentials</b> to test the store and charge with your Mercado Pago account <b>depending on the country</b> in which you are registered."
692
- msgstr "Carga tus <b>credenciales</b> para testear la tienda y cobrar con tu cuenta de Mercado Pago <b>según el país</b> en el que estés registrado."
693
 
694
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
695
  msgid "Approve your account to be able to charge."
@@ -704,16 +705,15 @@ msgid "Configure the <b>payment preferences</b> for your customers."
704
  msgstr "Configura las preferencias de pago para tus clientes."
705
 
706
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:423
707
- msgid "Go to advanced settings of both the plugin and checkout only when you want to change the presets."
708
- msgstr "Ve a configuraciones avanzadas tanto del plugin como del checkout solo cuando quieras modificar los ajustes preestablecidos."
709
 
710
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
711
  msgid ""
712
- "Credentials are the keys we provide you to integrate quickly <br>and securely. You must have a %s in Mercado Pago to obtain and collect them <br>on your website. You do not need to know how to "
713
- "design or program to do it"
714
  msgstr ""
715
- "Las credenciales son las claves que te proporcionamos para que integres de forma rápida <br>y segura. Debes tener una %s en Mercado Pago para obtenerlas y cobrar <br>en tu sitio web. No "
716
- "necesitas saber diseñar o programar para hacerlo."
717
 
718
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:443
719
  msgid "approved account"
@@ -765,15 +765,15 @@ msgstr "Modo Producción"
765
 
766
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:612
767
  msgid "When you see that everything is going well, deactivate Sandbox, turn on Production and make way for your online sales."
768
- msgstr "Cuando veas que todo va bien, desactivá Sandbox, prendé Producción y abrí paso a tus ventas online."
769
 
770
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:625
771
- msgid "Productio"
772
  msgstr "Producción"
773
 
774
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
775
- msgid "Choose \"YES\" only when you are ready to sell. Change to NO to activate the Tests mode."
776
- msgstr "Elige “SÍ” solo cuando estés listo para vender. Cambia a NO para activar el modo Pruebas."
777
 
778
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
779
  msgid "Load credentials"
@@ -832,8 +832,8 @@ msgid "Store Category"
832
  msgstr "Categoría de la tienda"
833
 
834
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:851
835
- msgid "What category do your products belong to? Choose the one that best characterizes them (choose <br>\"other\" if your product is too specific)."
836
- msgstr "¿A qué categoría pertenecen tus productos? Elige la que mejor los caracteriza (elige <br>“otro” si tu producto es demasiado específico)."
837
 
838
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:852
839
  msgid "Categories"
@@ -968,8 +968,8 @@ msgid "Accept and reject payments automatically. Do you want us to activate it?"
968
  msgstr "Acepta y rechaza pagos de forma automática. ¿Quieres que lo activemos?"
969
 
970
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1064
971
- msgid "Gateway Discounts"
972
- msgstr "Descuentos Gateway"
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."
@@ -992,16 +992,12 @@ msgid "Everything set up? Go to your store in Sandbox mode"
992
  msgstr "¿Todo configurado? Ve a tu tienda en modo Sandbox"
993
 
994
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1122
995
- msgid "You already went to Production. You just need your best customers <br> to arrive at your store to live the best online shopping experience with Mercado Pago."
996
- msgstr "Ya saliste a Producción. Solo falta que tus mejores clientes <br> lleguen a tu tienda para vivir la mejor experiencia de compra online com Mercado Pago."
997
 
998
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1124
999
- msgid ""
1000
- "Visit your store as if you were one of your customers and check that everything is fine. If you already went to Production,<br> bring your customers and increase your sales with the best online "
1001
- "shopping experience."
1002
- msgstr ""
1003
- "Visita tu tienda como si fueras uno de tus clientes y revisa que todo esté bien. Si ya saliste a Producción,<br> trae a tus clientes y aumenta tus ventas con la mejor experiencia de compra "
1004
- "online."
1005
 
1006
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1141
1007
  msgid "Visit my store"
@@ -1016,20 +1012,24 @@ msgid "Pay with cash"
1016
  msgstr "Paga con dinero en efectivo"
1017
 
1018
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:183
1019
- msgid "Checkout of payments with cash<br> Accept face-to-face payments, do not leave anyone out! %s"
1020
- msgstr "Checkout de pagos con dinero en efectivo<br> Acepta pagos presenciales ¡no dejes a nadie afuera! %s"
1021
 
1022
- #: includes/payments/WC_WooMercadoPago_TicketGateway.php:187
 
 
 
 
1023
  msgid "Include this preferred purchase option by some customers."
1024
  msgstr "Incluye esta opción de compra preferida por algunos clientes."
1025
 
1026
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:230
1027
  msgid "Enable Mercado Pago for cash payments in your store and <br> select the options available to your customers."
1028
- msgstr "Habilitá Mercado Pago para pagos en efectivo en tu tienda y <br> seleccioná las opciones disponibles para tus clientes."
1029
 
1030
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:243
1031
  msgid "Set payment preferences with cash"
1032
- msgstr "Configurá las preferencias de pago con dinero en efectivo"
1033
 
1034
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:256
1035
  msgid "Advanced configuration of the cash payment experience"
@@ -1104,7 +1104,7 @@ msgid "This controls the title that the user sees during the payment process."
1104
  msgstr "Esto controla el título que el usuario ve durante el proceso de pago."
1105
 
1106
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:236
1107
- msgid "nable free shipping for this shipping method"
1108
  msgstr "Habilitar envío gratis para este método de envío"
1109
 
1110
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:240
@@ -1191,8 +1191,8 @@ msgstr "Otra tarjeta"
1191
  msgid "CVV"
1192
  msgstr "CVV"
1193
 
1194
- #: templates/checkout/custom_checkout.php:94 templates/checkout/custom_checkout.php:108 templates/checkout/custom_checkout.php:111 templates/checkout/custom_checkout.php:121
1195
- #: templates/checkout/custom_checkout.php:141 templates/checkout/custom_checkout.php:205
1196
  msgid "Card number"
1197
  msgstr "Número de Tarjeta"
1198
 
@@ -1221,8 +1221,8 @@ msgid "Last 3 numbers on the back"
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?"
1226
 
1227
  #: templates/checkout/custom_checkout.php:153
1228
  msgid "Issuer"
@@ -1238,7 +1238,7 @@ msgstr "Seleccione el número de cotas"
1238
 
1239
  #: templates/checkout/custom_checkout.php:192
1240
  msgid "Enter your document number"
1241
- msgstr "Ingrese su número de documento"
1242
 
1243
  #: templates/checkout/custom_checkout.php:196
1244
  msgid "Type"
@@ -1393,7 +1393,7 @@ msgid "Select the issuer with whom you want to process the payment"
1393
  msgstr "Selecciona el emisor con el que quieras procesar el pago"
1394
 
1395
  #: woocommerce-mercadopago.php:48
1396
- msgid "WooCommerce Mercado Pago requires PHP version 5.6 or later. Please update your PHP version."
1397
  msgstr "El plugin de Mercado Pago requiere la versión de PHP 5.6 o posterior. Por favor actualice su versión de PHP."
1398
 
1399
  #: woocommerce-mercadopago.php:65
@@ -1427,3 +1427,7 @@ msgstr "Ofrece todos los medios de pago: tarjetas de crédito y débito, dinero
1427
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:28
1428
  msgid "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!"
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!"
 
 
 
 
1
  # Copyright (C) 2019 Mercado Pago
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.1.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: 2019-12-23 17:11-0300\n"
13
+ "X-Generator: Poedit 2.2.4\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
  "Language: es_PE\n"
18
 
19
  #. Plugin Name of the plugin
20
+ msgid "Mercado Pago payments for WooCommerce"
21
+ msgstr "Mercado Pago payments for WooCommerce"
22
 
23
  #. Plugin URI of the plugin
24
  msgid "https://github.com/mercadopago/cart-woocommerce"
79
 
80
  #: includes/module/WC_WooMercadoPago_Module.php:273
81
  msgid "Set up"
82
+ msgstr "Ajustes"
83
 
84
  #: includes/module/WC_WooMercadoPago_Module.php:274
85
  msgid "Your opinion helps us get better"
87
 
88
  #: includes/module/WC_WooMercadoPago_Module.php:275
89
  msgid "Guides and Documentation"
90
+ msgstr "Guías y documentación"
91
 
92
  #: includes/module/WC_WooMercadoPago_Module.php:276
93
  msgid "Report Problem"
94
+ msgstr "Informar problema"
95
 
96
  #: includes/module/WC_WooMercadoPago_Module.php:293
97
  msgid "By Mercado Pago"
229
  msgid "The payment is in mediation or the purchase was unknown by the customer."
230
  msgstr "El pago esta en mediación o la compra fue desconocida por el cliente."
231
 
232
+ #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:35 includes/notification/WC_WooMercadoPago_Notification_IPN.php:40 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:52
 
233
  msgid "The Mercado Pago request has failed"
234
  msgstr "La solicitud de Mercado Pago ha fallado"
235
 
236
+ #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:116 includes/notification/WC_WooMercadoPago_Notification_IPN.php:141 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:152
237
+ #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:170
238
  msgid "Buyer email"
239
  msgstr "Email del comprador"
240
 
241
+ #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:119 includes/notification/WC_WooMercadoPago_Notification_IPN.php:144 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:155
242
+ #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:173
243
  msgid "Payment method"
244
  msgstr "Medio de pago"
245
 
308
  msgstr "Descuento para el cupón %s"
309
 
310
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126 includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:128
311
+ msgid "discount of"
312
+ msgstr "descuento de"
313
 
314
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126
315
+ msgid " and fee of"
316
+ msgstr " y comisión de"
317
 
318
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:130
319
+ msgid "fee of"
320
+ msgstr "comisión de"
321
 
322
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:355
323
  msgid "Credentials for invalid production!"
348
  msgstr "Haga clic para intentarlo de nuevo"
349
 
350
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:77
351
+ msgid "Great, we processed your purchase order. Complete the payment with ticket so that we finish approving it."
352
+ msgstr "Excelente, procesamos tu orden de compra. Completa el pago con ticket para que terminemos de aprobarla."
353
 
354
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:82
355
+ msgid "Print ticket"
356
+ msgstr "Imprimir ticket"
357
 
358
  #: includes/payments/mercadoenvios/WC_WooMercadoPago_Product_Recurrent.php:40
359
  msgid "Subscription Mercado Pago"
433
  msgstr "Fecha límite para generar nuevos cargos. De forma predeterminada es nunca, si está en blanco."
434
 
435
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:27
436
+ msgid "Mercado Pago Checkout"
437
+ msgstr "Checkout de Mercado Pago"
438
 
439
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:29
440
  msgid "Pay with the payment method you prefer"
441
  msgstr "Paga con el medio de pago que prefieras"
442
 
443
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:229
444
+ msgid "Mercado Pago checkout %s"
445
+ msgstr "Checkout de Mercado Pago %s"
446
 
447
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:235
448
+ msgid "Accept all method of payment and take your charges to another level"
449
+ msgstr "Acepta todos los medios de pago y lleva tus cobros a otro nivel"
450
+
451
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:239
452
  msgid "Turn your online store into your customers preferred payment gateway. Choose if the final payment experience will be inside or outside your store."
453
  msgstr "Convierte tu tienda online en la pasarela de pagos preferida de tus clientes. Elige si la experiencia de pago final será dentro o fuera de tu tienda."
454
 
455
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:250 includes/payments/WC_WooMercadoPago_TicketGateway.php:204
456
+ msgid "Configure Mercado Pago for WooCommerce"
457
+ msgstr "Configura Mercado Pago para WooCommerce"
458
 
459
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:263
460
+ msgid "Enable the experience of the Mercado Pago Checkout in your online store, select the means of payment available to your customers and<br> define the maximum fees in which they can pay you."
461
+ msgstr "Habilita la experiencia del Checkout de Mercado Pago en tu tienda online, selecciona los medios de pago disponibles para tus clientes y<br> define el máximo de cuotas en el que podrán pagarte."
 
 
 
 
462
 
463
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:276 includes/payments/WC_WooMercadoPago_CustomGateway.php:187 includes/payments/WC_WooMercadoPago_TicketGateway.php:217
464
  msgid "Go to the basics. Place your business information."
469
  msgstr "Configura las preferencias de pago en tu tienda"
470
 
471
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
472
+ msgid "advanced settings"
473
+ msgstr "configuración avanzada"
474
 
475
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
476
+ msgid "Payment experience"
477
+ msgstr "Experiencia de pago"
478
 
479
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:317
480
  msgid "Define what payment experience your customers will have, whether inside or outside your store."
501
  msgstr "URL de éxito"
502
 
503
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:357
504
+ msgid "Choose the URL that we will show to your customers when we refuse their purchase. Make sure it includes a message appropriate to the situation and give them useful information so they can solve it."
505
+ msgstr "Elige la URL que mostraremos a tus clientes cuando rechacemos su compra. Asegúrate de incluir un mensaje adecuado a la situación y dales información útil para que puedan solucionarlo."
 
 
506
 
507
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:360
508
  msgid "Payment URL rejected"
526
 
527
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:455
528
  msgid "Select offline payments"
529
+ msgstr "Selecciona medios de pago presenciales"
530
 
531
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:464 includes/payments/WC_WooMercadoPago_TicketGateway.php:321
532
  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 "Enable the payment methods available to your customers."
541
  msgstr "Volver a la tienda"
542
 
543
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:489
544
+ msgid "Do you want your customer to automatically return to the store after payment?"
545
+ msgstr "¿Quieres que tu cliente vuelva automáticamente a la tienda después del pago?"
546
 
547
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:491 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:548 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:631
548
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:898 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1018 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1051
565
  msgstr "Paga con tarjetas de débito y crédito"
566
 
567
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:153
568
+ msgid "Checkout of payments with debit and credit cards %s"
569
+ msgstr "Checkout de pagos con tarjetas de débito y crédito %s"
570
+
571
+ #: includes/payments/WC_WooMercadoPago_CustomGateway.php:158
572
+ msgid "Accept payments instantly and maximize the conversion of your business"
573
+ msgstr "Acepta pagos al instante y maximiza la conversión de tu negocio"
574
 
575
+ #: includes/payments/WC_WooMercadoPago_CustomGateway.php:162
576
  msgid "Turn your online store into a secure and easy-to-use payment gateway for your customers. With personalized checkout your customers pay without leaving your store!"
577
  msgstr "Convierte tu tienda online en una pasarela de pagos segura y fácil de usar para tus clientes. Con el checkout personalizado tus clientes pagan ¡sin salir de tu tienda!"
578
 
589
  msgstr "Configuración avanzada de la experiencia de pago personalizada"
590
 
591
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:228
592
+ msgid "That’s it, payment accepted!"
593
+ msgstr "Listo, ¡aceptamos tu pago!"
594
 
595
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:230
596
  msgid "We are processing your payment. In less than an hour we will send you the result by email."
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 <b>credentials</b> depending on the country in which you are registered."
693
+ msgstr "Carga tus <b>credenciales</b> según el país en el que estés registrado."
694
 
695
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
696
  msgid "Approve your account to be able to charge."
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> solo cuando quieras modificar los ajustes preestablecidos."
710
 
711
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
712
  msgid ""
713
+ "Credentials are the keys we provide you to integrate quickly <br>and securely. You must have a %s in Mercado Pago to obtain and collect them <br>on your website. You do not need to know how to design or program to do it"
 
714
  msgstr ""
715
+ "Las credenciales son las claves que te proporcionamos para que integres de forma rápida <br>y segura. Debes tener una %s en Mercado Pago para obtenerlas y cobrar <br>en tu sitio web. No necesitas saber diseñar o "
716
+ "programar para hacerlo."
717
 
718
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:443
719
  msgid "approved account"
765
 
766
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:612
767
  msgid "When you see that everything is going well, deactivate Sandbox, turn on Production and make way for your online sales."
768
+ msgstr "Cuando veas que todo va bien, desactiva Sandbox para ir a Producción y abre paso a tus ventas online."
769
 
770
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:625
771
+ msgid "Production"
772
  msgstr "Producción"
773
 
774
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
775
+ msgid "Choose YES only when you are ready to sell. Change to NO to activate the Tests mode."
776
+ msgstr "Elige solo cuando estés listo para vender. Cambia a NO para activar el modo Pruebas."
777
 
778
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
779
  msgid "Load credentials"
832
  msgstr "Categoría de la tienda"
833
 
834
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:851
835
+ msgid "What category do your products belong to? Choose the one that best characterizes them (choose \"other\" if your product is too specific)."
836
+ msgstr "¿A qué categoría pertenecen tus productos? Elige la que mejor los caracteriza (elige otro” si tu producto es demasiado específico)."
837
 
838
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:852
839
  msgid "Categories"
968
  msgstr "Acepta y rechaza pagos de forma automática. ¿Quieres que lo activemos?"
969
 
970
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1064
971
+ msgid "Discounts per purchase with Mercado Pago"
972
+ msgstr "Descuentos por compra con 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."
992
  msgstr "¿Todo configurado? Ve a tu tienda en modo Sandbox"
993
 
994
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1122
995
+ msgid "Visit your store as if you were one of your customers and check that everything is fine. If you already went to Production,<br> bring your customers and increase your sales with the best online shopping experience."
996
+ msgstr "Visita tu tienda como si fueras uno de tus clientes y revisa que todo esté bien. Si ya saliste a Producción,<br> trae a tus clientes y aumenta tus ventas con la mejor experiencia de compra online."
997
 
998
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1124
999
+ msgid "Visit your store and simulate a payment to check that everything is fine."
1000
+ msgstr "Visita tu tienda y simula un pago para revisar que todo esté bien."
 
 
 
 
1001
 
1002
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1141
1003
  msgid "Visit my store"
1012
  msgstr "Paga con dinero en efectivo"
1013
 
1014
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:183
1015
+ msgid "Checkout of payments with cash %s"
1016
+ msgstr "Checkout de pagos con dinero en efectivo %s"
1017
 
1018
+ #: includes/payments/WC_WooMercadoPago_TicketGateway.php:192
1019
+ msgid "Accept face-to-face payments, do not leave anyone out!"
1020
+ msgstr "Acepta pagos presenciales ¡no dejes a nadie afuera!"
1021
+
1022
+ #: includes/payments/WC_WooMercadoPago_TicketGateway.php:197
1023
  msgid "Include this preferred purchase option by some customers."
1024
  msgstr "Incluye esta opción de compra preferida por algunos clientes."
1025
 
1026
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:230
1027
  msgid "Enable Mercado Pago for cash payments in your store and <br> select the options available to your customers."
1028
+ msgstr "Habilita Mercado Pago para pagos en efectivo en tu tienda y <br> selecciona las opciones disponibles para tus clientes."
1029
 
1030
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:243
1031
  msgid "Set payment preferences with cash"
1032
+ msgstr "Configura las preferencias de pago con dinero en efectivo"
1033
 
1034
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:256
1035
  msgid "Advanced configuration of the cash payment experience"
1104
  msgstr "Esto controla el título que el usuario ve durante el proceso de pago."
1105
 
1106
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:236
1107
+ msgid "Enable free shipping for this shipping method"
1108
  msgstr "Habilitar envío gratis para este método de envío"
1109
 
1110
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:240
1191
  msgid "CVV"
1192
  msgstr "CVV"
1193
 
1194
+ #: templates/checkout/custom_checkout.php:94 templates/checkout/custom_checkout.php:108 templates/checkout/custom_checkout.php:111 templates/checkout/custom_checkout.php:121 templates/checkout/custom_checkout.php:141
1195
+ #: templates/checkout/custom_checkout.php:205
1196
  msgid "Card number"
1197
  msgstr "Número de Tarjeta"
1198
 
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"
1226
 
1227
  #: templates/checkout/custom_checkout.php:153
1228
  msgid "Issuer"
1238
 
1239
  #: templates/checkout/custom_checkout.php:192
1240
  msgid "Enter your document number"
1241
+ msgstr "Ingresa tu número de documento"
1242
 
1243
  #: templates/checkout/custom_checkout.php:196
1244
  msgid "Type"
1393
  msgstr "Selecciona el emisor con el que quieras procesar el pago"
1394
 
1395
  #: woocommerce-mercadopago.php:48
1396
+ msgid "Mercado Pago payments for WooCommerce requires PHP version 5.6 or later. Please update your PHP version."
1397
  msgstr "El plugin de Mercado Pago requiere la versión de PHP 5.6 o posterior. Por favor actualice su versión de PHP."
1398
 
1399
  #: woocommerce-mercadopago.php:65
1427
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:28
1428
  msgid "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!"
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 "Select the payment methods available in your store."
1433
+ msgstr "Selecciona los medios de pago disponibles en tu tienda."
i18n/languages/woocommerce-mercadopago-es_UY.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_UY.po CHANGED
@@ -1,24 +1,24 @@
1
  # Copyright (C) 2019 Mercado Pago
2
- # This file is distributed under the same license as the WooCommerce Mercado Pago plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WooCommerce Mercado Pago 4.0.8\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: 2019-09-13 21:22-0300\n"
13
- "X-Generator: Poedit 2.2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
  "Language: es_UY\n"
18
 
19
  #. Plugin Name of the plugin
20
- msgid "WooCommerce Mercado Pago"
21
- msgstr "WooCommerce Mercado Pago"
22
 
23
  #. Plugin URI of the plugin
24
  msgid "https://github.com/mercadopago/cart-woocommerce"
@@ -79,7 +79,7 @@ msgstr "¡El módulo de pago de Woo Mercado depende de la última versión de %s
79
 
80
  #: includes/module/WC_WooMercadoPago_Module.php:273
81
  msgid "Set up"
82
- msgstr "Configurar"
83
 
84
  #: includes/module/WC_WooMercadoPago_Module.php:274
85
  msgid "Your opinion helps us get better"
@@ -87,11 +87,11 @@ msgstr "Tu opinión nos ayuda a mejorar"
87
 
88
  #: includes/module/WC_WooMercadoPago_Module.php:275
89
  msgid "Guides and Documentation"
90
- msgstr "Guías y Documentación"
91
 
92
  #: includes/module/WC_WooMercadoPago_Module.php:276
93
  msgid "Report Problem"
94
- msgstr "Informar Problema"
95
 
96
  #: includes/module/WC_WooMercadoPago_Module.php:293
97
  msgid "By Mercado Pago"
@@ -229,18 +229,17 @@ msgstr "El pago fue cancelado."
229
  msgid "The payment is in mediation or the purchase was unknown by the customer."
230
  msgstr "El pago esta en mediación o la compra fue desconocida por el cliente."
231
 
232
- #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:35 includes/notification/WC_WooMercadoPago_Notification_IPN.php:40
233
- #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:52
234
  msgid "The Mercado Pago request has failed"
235
  msgstr "La solicitud de Mercado Pago ha fallado"
236
 
237
- #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:116 includes/notification/WC_WooMercadoPago_Notification_IPN.php:141
238
- #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:152 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:170
239
  msgid "Buyer email"
240
  msgstr "Email del comprador"
241
 
242
- #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:119 includes/notification/WC_WooMercadoPago_Notification_IPN.php:144
243
- #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:155 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:173
244
  msgid "Payment method"
245
  msgstr "Medio de pago"
246
 
@@ -309,16 +308,16 @@ msgid "Discount for coupon %s"
309
  msgstr "Descuento para el cupón %s"
310
 
311
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126 includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:128
312
- msgid "Discount of"
313
- msgstr "Descuento de"
314
 
315
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126
316
- msgid " and Rate of"
317
- msgstr " y Tarifa de"
318
 
319
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:130
320
- msgid "Fee of"
321
- msgstr "Tarifa de"
322
 
323
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:355
324
  msgid "Credentials for invalid production!"
@@ -349,12 +348,12 @@ msgid "Click to try again"
349
  msgstr "Haga clic para intentarlo de nuevo"
350
 
351
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:77
352
- msgid "Thanks for your order. Please pay the ticket to have your order approved."
353
- msgstr "Gracias por su orden. Por favor, realice el pago del ticket para tener su orden aprobada."
354
 
355
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:82
356
- msgid "Print the ticket"
357
- msgstr "Imprimir el ticket"
358
 
359
  #: includes/payments/mercadoenvios/WC_WooMercadoPago_Product_Recurrent.php:40
360
  msgid "Subscription Mercado Pago"
@@ -434,32 +433,32 @@ msgid "Deadline to generate new charges. By default as never, if it is blank."
434
  msgstr "Fecha límite para generar nuevos cargos. De forma predeterminada es nunca, si está en blanco."
435
 
436
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:27
437
- msgid "Mercado Pago - Basic Checkout"
438
- msgstr "Mercado Pago - Checkout básico"
439
 
440
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:29
441
  msgid "Pay with the payment method you prefer"
442
  msgstr "Paga con el medio de pago que prefieras"
443
 
444
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:229
445
- msgid "Basic Checkout Accept all method of payment and take your charges to another level %s"
446
- msgstr "Checkout Básico. Acepta todos los medios de pago y lleva tus cobros a otro nivel %s"
447
 
448
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:233
 
 
 
 
449
  msgid "Turn your online store into your customers preferred payment gateway. Choose if the final payment experience will be inside or outside your store."
450
  msgstr "Convierte tu tienda online en la pasarela de pagos preferida de tus clientes. Elige si la experiencia de pago final será dentro o fuera de tu tienda."
451
 
452
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:250 includes/payments/WC_WooMercadoPago_TicketGateway.php:204
453
- msgid "Configure WooCommerce Mercado Pago"
454
- msgstr "Configura WooCommerce Mercado Pago"
455
 
456
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:263
457
- msgid ""
458
- "Enable the experience of the basic checkout of Mercado Pago in your online store, select the means of payment available to your customers and<br> define the maximum fees in which they can pay "
459
- "you."
460
- msgstr ""
461
- "Habilitá la experiencia del checkout básico de Mercado Pago en tu tienda online, seleccioná los medios de pago disponibles para tus clientes y<br> definí el máximo de cuotas en el que podrán "
462
- "pagarte."
463
 
464
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:276 includes/payments/WC_WooMercadoPago_CustomGateway.php:187 includes/payments/WC_WooMercadoPago_TicketGateway.php:217
465
  msgid "Go to the basics. Place your business information."
@@ -470,12 +469,12 @@ msgid "Set payment preferences in your store"
470
  msgstr "Configura las preferencias de pago en tu tienda"
471
 
472
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
473
- msgid "Advanced payment experience settings"
474
- msgstr "Configuración Avanzada de la experiencia de pago"
475
 
476
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
477
- msgid "Integration method"
478
- msgstr "Método de integración"
479
 
480
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:317
481
  msgid "Define what payment experience your customers will have, whether inside or outside your store."
@@ -502,10 +501,8 @@ msgid "Success URL"
502
  msgstr "URL de éxito"
503
 
504
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:357
505
- msgid ""
506
- "Choose the URL that we will show to your customers when we refuse their purchase. Make sure it includes a message appropriate to the situation and give them useful information so they can solve "
507
- "it."
508
- msgstr "Elige la URL que mostraremos a tus clientes cuando rechacemos su compra. Asegurate de que incluya un mensaje adecuado a la situación y dales información útil para que puedan solucionarlo."
509
 
510
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:360
511
  msgid "Payment URL rejected"
@@ -529,11 +526,11 @@ msgstr "Selecciona tarjetas de débito"
529
 
530
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:455
531
  msgid "Select offline payments"
532
- msgstr "Selecciona pagos offline"
533
 
534
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:464 includes/payments/WC_WooMercadoPago_TicketGateway.php:321
535
  msgid "Payment methods"
536
- msgstr "Medios de pago"
537
 
538
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:468 includes/payments/WC_WooMercadoPago_TicketGateway.php:325
539
  msgid "Enable the payment methods available to your customers."
@@ -544,8 +541,8 @@ msgid "Return to the store"
544
  msgstr "Volver a la tienda"
545
 
546
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:489
547
- msgid "Your customer automatically return to the store after payment."
548
- msgstr "Que tu cliente vuelva automáticamente a la tienda después del pago."
549
 
550
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:491 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:548 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:631
551
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:898 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1018 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1051
@@ -568,10 +565,14 @@ msgid "Pay with debit and credit cards"
568
  msgstr "Paga con tarjetas de débito y crédito"
569
 
570
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:153
571
- msgid "Checkout of payments with debit and credit cards<br> Accept payments instantly and maximize the conversion of your business %s"
572
- msgstr "Checkout de pagos con tarjetas de débito y crédito<br> Acepta pagos al instante y maximiza la conversión de tu negocio %s"
 
 
 
 
573
 
574
- #: includes/payments/WC_WooMercadoPago_CustomGateway.php:157
575
  msgid "Turn your online store into a secure and easy-to-use payment gateway for your customers. With personalized checkout your customers pay without leaving your store!"
576
  msgstr "Convierte tu tienda online en una pasarela de pagos segura y fácil de usar para tus clientes. Con el checkout personalizado tus clientes pagan ¡sin salir de tu tienda!"
577
 
@@ -588,8 +589,8 @@ msgid "Advanced configuration of the personalized payment experience\""
588
  msgstr "Configuración avanzada de la experiencia de pago personalizada"
589
 
590
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:228
591
- msgid "Ready, your payment has been accepted!"
592
- msgstr "Listo, su pago ha sido aceptado!"
593
 
594
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:230
595
  msgid "We are processing your payment. In less than an hour we will send you the result by email."
@@ -688,8 +689,8 @@ msgid "<b>Follow these steps to activate Mercado Pago in your store:</b>"
688
  msgstr "<b>Sigue estos pasos para activar Mercado Pago en tu tienda:</b>"
689
 
690
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:395
691
- msgid "Upload your <b>credentials</b> to test the store and charge with your Mercado Pago account <b>depending on the country</b> in which you are registered."
692
- msgstr "Carga tus <b>credenciales</b> para testear la tienda y cobrar con tu cuenta de Mercado Pago <b>según el país</b> en el que estés registrado."
693
 
694
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
695
  msgid "Approve your account to be able to charge."
@@ -704,16 +705,15 @@ msgid "Configure the <b>payment preferences</b> for your customers."
704
  msgstr "Configura las preferencias de pago para tus clientes."
705
 
706
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:423
707
- msgid "Go to advanced settings of both the plugin and checkout only when you want to change the presets."
708
- msgstr "Ve a configuraciones avanzadas tanto del plugin como del checkout solo cuando quieras modificar los ajustes preestablecidos."
709
 
710
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
711
  msgid ""
712
- "Credentials are the keys we provide you to integrate quickly <br>and securely. You must have a %s in Mercado Pago to obtain and collect them <br>on your website. You do not need to know how to "
713
- "design or program to do it"
714
  msgstr ""
715
- "Las credenciales son las claves que te proporcionamos para que integres de forma rápida <br>y segura. Debes tener una %s en Mercado Pago para obtenerlas y cobrar <br>en tu sitio web. No "
716
- "necesitas saber diseñar o programar para hacerlo."
717
 
718
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:443
719
  msgid "approved account"
@@ -765,15 +765,15 @@ msgstr "Modo Producción"
765
 
766
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:612
767
  msgid "When you see that everything is going well, deactivate Sandbox, turn on Production and make way for your online sales."
768
- msgstr "Cuando veas que todo va bien, desactivá Sandbox, prendé Producción y abrí paso a tus ventas online."
769
 
770
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:625
771
- msgid "Productio"
772
  msgstr "Producción"
773
 
774
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
775
- msgid "Choose \"YES\" only when you are ready to sell. Change to NO to activate the Tests mode."
776
- msgstr "Elige “SÍ” solo cuando estés listo para vender. Cambia a NO para activar el modo Pruebas."
777
 
778
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
779
  msgid "Load credentials"
@@ -832,8 +832,8 @@ msgid "Store Category"
832
  msgstr "Categoría de la tienda"
833
 
834
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:851
835
- msgid "What category do your products belong to? Choose the one that best characterizes them (choose <br>\"other\" if your product is too specific)."
836
- msgstr "¿A qué categoría pertenecen tus productos? Elige la que mejor los caracteriza (elige <br>“otro” si tu producto es demasiado específico)."
837
 
838
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:852
839
  msgid "Categories"
@@ -968,8 +968,8 @@ msgid "Accept and reject payments automatically. Do you want us to activate it?"
968
  msgstr "Acepta y rechaza pagos de forma automática. ¿Quieres que lo activemos?"
969
 
970
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1064
971
- msgid "Gateway Discounts"
972
- msgstr "Descuentos Gateway"
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."
@@ -992,16 +992,12 @@ msgid "Everything set up? Go to your store in Sandbox mode"
992
  msgstr "¿Todo configurado? Ve a tu tienda en modo Sandbox"
993
 
994
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1122
995
- msgid "You already went to Production. You just need your best customers <br> to arrive at your store to live the best online shopping experience with Mercado Pago."
996
- msgstr "Ya saliste a Producción. Solo falta que tus mejores clientes <br> lleguen a tu tienda para vivir la mejor experiencia de compra online com Mercado Pago."
997
 
998
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1124
999
- msgid ""
1000
- "Visit your store as if you were one of your customers and check that everything is fine. If you already went to Production,<br> bring your customers and increase your sales with the best online "
1001
- "shopping experience."
1002
- msgstr ""
1003
- "Visita tu tienda como si fueras uno de tus clientes y revisa que todo esté bien. Si ya saliste a Producción,<br> trae a tus clientes y aumenta tus ventas con la mejor experiencia de compra "
1004
- "online."
1005
 
1006
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1141
1007
  msgid "Visit my store"
@@ -1016,20 +1012,24 @@ msgid "Pay with cash"
1016
  msgstr "Paga con dinero en efectivo"
1017
 
1018
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:183
1019
- msgid "Checkout of payments with cash<br> Accept face-to-face payments, do not leave anyone out! %s"
1020
- msgstr "Checkout de pagos con dinero en efectivo<br> Acepta pagos presenciales ¡no dejes a nadie afuera! %s"
1021
 
1022
- #: includes/payments/WC_WooMercadoPago_TicketGateway.php:187
 
 
 
 
1023
  msgid "Include this preferred purchase option by some customers."
1024
  msgstr "Incluye esta opción de compra preferida por algunos clientes."
1025
 
1026
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:230
1027
  msgid "Enable Mercado Pago for cash payments in your store and <br> select the options available to your customers."
1028
- msgstr "Habilitá Mercado Pago para pagos en efectivo en tu tienda y <br> seleccioná las opciones disponibles para tus clientes."
1029
 
1030
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:243
1031
  msgid "Set payment preferences with cash"
1032
- msgstr "Configurá las preferencias de pago con dinero en efectivo"
1033
 
1034
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:256
1035
  msgid "Advanced configuration of the cash payment experience"
@@ -1104,7 +1104,7 @@ msgid "This controls the title that the user sees during the payment process."
1104
  msgstr "Esto controla el título que el usuario ve durante el proceso de pago."
1105
 
1106
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:236
1107
- msgid "nable free shipping for this shipping method"
1108
  msgstr "Habilitar envío gratis para este método de envío"
1109
 
1110
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:240
@@ -1191,8 +1191,8 @@ msgstr "Otra tarjeta"
1191
  msgid "CVV"
1192
  msgstr "CVV"
1193
 
1194
- #: templates/checkout/custom_checkout.php:94 templates/checkout/custom_checkout.php:108 templates/checkout/custom_checkout.php:111 templates/checkout/custom_checkout.php:121
1195
- #: templates/checkout/custom_checkout.php:141 templates/checkout/custom_checkout.php:205
1196
  msgid "Card number"
1197
  msgstr "Número de Tarjeta"
1198
 
@@ -1221,8 +1221,8 @@ msgid "Last 3 numbers on the back"
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?"
1226
 
1227
  #: templates/checkout/custom_checkout.php:153
1228
  msgid "Issuer"
@@ -1238,7 +1238,7 @@ msgstr "Seleccione el número de cotas"
1238
 
1239
  #: templates/checkout/custom_checkout.php:192
1240
  msgid "Enter your document number"
1241
- msgstr "Ingrese su número de documento"
1242
 
1243
  #: templates/checkout/custom_checkout.php:196
1244
  msgid "Type"
@@ -1393,7 +1393,7 @@ msgid "Select the issuer with whom you want to process the payment"
1393
  msgstr "Selecciona el emisor con el que quieras procesar el pago"
1394
 
1395
  #: woocommerce-mercadopago.php:48
1396
- msgid "WooCommerce Mercado Pago requires PHP version 5.6 or later. Please update your PHP version."
1397
  msgstr "El plugin de Mercado Pago requiere la versión de PHP 5.6 o posterior. Por favor actualice su versión de PHP."
1398
 
1399
  #: woocommerce-mercadopago.php:65
@@ -1427,3 +1427,7 @@ msgstr "Ofrece todos los medios de pago: tarjetas de crédito y débito, dinero
1427
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:28
1428
  msgid "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!"
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!"
 
 
 
 
1
  # Copyright (C) 2019 Mercado Pago
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.1.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: 2019-12-23 17:12-0300\n"
13
+ "X-Generator: Poedit 2.2.4\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
  "Language: es_UY\n"
18
 
19
  #. Plugin Name of the plugin
20
+ msgid "Mercado Pago payments for WooCommerce"
21
+ msgstr "Mercado Pago payments for WooCommerce"
22
 
23
  #. Plugin URI of the plugin
24
  msgid "https://github.com/mercadopago/cart-woocommerce"
79
 
80
  #: includes/module/WC_WooMercadoPago_Module.php:273
81
  msgid "Set up"
82
+ msgstr "Ajustes"
83
 
84
  #: includes/module/WC_WooMercadoPago_Module.php:274
85
  msgid "Your opinion helps us get better"
87
 
88
  #: includes/module/WC_WooMercadoPago_Module.php:275
89
  msgid "Guides and Documentation"
90
+ msgstr "Guías y documentación"
91
 
92
  #: includes/module/WC_WooMercadoPago_Module.php:276
93
  msgid "Report Problem"
94
+ msgstr "Informar problema"
95
 
96
  #: includes/module/WC_WooMercadoPago_Module.php:293
97
  msgid "By Mercado Pago"
229
  msgid "The payment is in mediation or the purchase was unknown by the customer."
230
  msgstr "El pago esta en mediación o la compra fue desconocida por el cliente."
231
 
232
+ #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:35 includes/notification/WC_WooMercadoPago_Notification_IPN.php:40 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:52
 
233
  msgid "The Mercado Pago request has failed"
234
  msgstr "La solicitud de Mercado Pago ha fallado"
235
 
236
+ #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:116 includes/notification/WC_WooMercadoPago_Notification_IPN.php:141 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:152
237
+ #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:170
238
  msgid "Buyer email"
239
  msgstr "Email del comprador"
240
 
241
+ #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:119 includes/notification/WC_WooMercadoPago_Notification_IPN.php:144 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:155
242
+ #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:173
243
  msgid "Payment method"
244
  msgstr "Medio de pago"
245
 
308
  msgstr "Descuento para el cupón %s"
309
 
310
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126 includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:128
311
+ msgid "discount of"
312
+ msgstr "descuento de"
313
 
314
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126
315
+ msgid " and fee of"
316
+ msgstr " y comisión de"
317
 
318
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:130
319
+ msgid "fee of"
320
+ msgstr "comisión de"
321
 
322
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:355
323
  msgid "Credentials for invalid production!"
348
  msgstr "Haga clic para intentarlo de nuevo"
349
 
350
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:77
351
+ msgid "Great, we processed your purchase order. Complete the payment with ticket so that we finish approving it."
352
+ msgstr "Excelente, procesamos tu orden de compra. Completa el pago con ticket para que terminemos de aprobarla."
353
 
354
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:82
355
+ msgid "Print ticket"
356
+ msgstr "Imprimir ticket"
357
 
358
  #: includes/payments/mercadoenvios/WC_WooMercadoPago_Product_Recurrent.php:40
359
  msgid "Subscription Mercado Pago"
433
  msgstr "Fecha límite para generar nuevos cargos. De forma predeterminada es nunca, si está en blanco."
434
 
435
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:27
436
+ msgid "Mercado Pago Checkout"
437
+ msgstr "Checkout de Mercado Pago"
438
 
439
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:29
440
  msgid "Pay with the payment method you prefer"
441
  msgstr "Paga con el medio de pago que prefieras"
442
 
443
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:229
444
+ msgid "Mercado Pago checkout %s"
445
+ msgstr "Checkout de Mercado Pago %s"
446
 
447
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:235
448
+ msgid "Accept all method of payment and take your charges to another level"
449
+ msgstr "Acepta todos los medios de pago y lleva tus cobros a otro nivel"
450
+
451
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:239
452
  msgid "Turn your online store into your customers preferred payment gateway. Choose if the final payment experience will be inside or outside your store."
453
  msgstr "Convierte tu tienda online en la pasarela de pagos preferida de tus clientes. Elige si la experiencia de pago final será dentro o fuera de tu tienda."
454
 
455
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:250 includes/payments/WC_WooMercadoPago_TicketGateway.php:204
456
+ msgid "Configure Mercado Pago for WooCommerce"
457
+ msgstr "Configura Mercado Pago para WooCommerce"
458
 
459
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:263
460
+ msgid "Enable the experience of the Mercado Pago Checkout in your online store, select the means of payment available to your customers and<br> define the maximum fees in which they can pay you."
461
+ msgstr "Habilita la experiencia del Checkout de Mercado Pago en tu tienda online, selecciona los medios de pago disponibles para tus clientes y<br> define el máximo de cuotas en el que podrán pagarte."
 
 
 
 
462
 
463
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:276 includes/payments/WC_WooMercadoPago_CustomGateway.php:187 includes/payments/WC_WooMercadoPago_TicketGateway.php:217
464
  msgid "Go to the basics. Place your business information."
469
  msgstr "Configura las preferencias de pago en tu tienda"
470
 
471
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
472
+ msgid "advanced settings"
473
+ msgstr "configuración avanzada"
474
 
475
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
476
+ msgid "Payment experience"
477
+ msgstr "Experiencia de pago"
478
 
479
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:317
480
  msgid "Define what payment experience your customers will have, whether inside or outside your store."
501
  msgstr "URL de éxito"
502
 
503
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:357
504
+ msgid "Choose the URL that we will show to your customers when we refuse their purchase. Make sure it includes a message appropriate to the situation and give them useful information so they can solve it."
505
+ msgstr "Elige la URL que mostraremos a tus clientes cuando rechacemos su compra. Asegúrate de incluir un mensaje adecuado a la situación y dales información útil para que puedan solucionarlo."
 
 
506
 
507
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:360
508
  msgid "Payment URL rejected"
526
 
527
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:455
528
  msgid "Select offline payments"
529
+ msgstr "Selecciona medios de pago presenciales"
530
 
531
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:464 includes/payments/WC_WooMercadoPago_TicketGateway.php:321
532
  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 "Enable the payment methods available to your customers."
541
  msgstr "Volver a la tienda"
542
 
543
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:489
544
+ msgid "Do you want your customer to automatically return to the store after payment?"
545
+ msgstr "¿Quieres que tu cliente vuelva automáticamente a la tienda después del pago?"
546
 
547
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:491 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:548 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:631
548
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:898 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1018 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1051
565
  msgstr "Paga con tarjetas de débito y crédito"
566
 
567
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:153
568
+ msgid "Checkout of payments with debit and credit cards %s"
569
+ msgstr "Checkout de pagos con tarjetas de débito y crédito %s"
570
+
571
+ #: includes/payments/WC_WooMercadoPago_CustomGateway.php:158
572
+ msgid "Accept payments instantly and maximize the conversion of your business"
573
+ msgstr "Acepta pagos al instante y maximiza la conversión de tu negocio"
574
 
575
+ #: includes/payments/WC_WooMercadoPago_CustomGateway.php:162
576
  msgid "Turn your online store into a secure and easy-to-use payment gateway for your customers. With personalized checkout your customers pay without leaving your store!"
577
  msgstr "Convierte tu tienda online en una pasarela de pagos segura y fácil de usar para tus clientes. Con el checkout personalizado tus clientes pagan ¡sin salir de tu tienda!"
578
 
589
  msgstr "Configuración avanzada de la experiencia de pago personalizada"
590
 
591
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:228
592
+ msgid "That’s it, payment accepted!"
593
+ msgstr "Listo, ¡aceptamos tu pago!"
594
 
595
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:230
596
  msgid "We are processing your payment. In less than an hour we will send you the result by email."
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 <b>credentials</b> depending on the country in which you are registered."
693
+ msgstr "Carga tus <b>credenciales</b> según el país en el que estés registrado."
694
 
695
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
696
  msgid "Approve your account to be able to charge."
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> solo cuando quieras modificar los ajustes preestablecidos."
710
 
711
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
712
  msgid ""
713
+ "Credentials are the keys we provide you to integrate quickly <br>and securely. You must have a %s in Mercado Pago to obtain and collect them <br>on your website. You do not need to know how to design or program to do it"
 
714
  msgstr ""
715
+ "Las credenciales son las claves que te proporcionamos para que integres de forma rápida <br>y segura. Debes tener una %s en Mercado Pago para obtenerlas y cobrar <br>en tu sitio web. No necesitas saber diseñar o "
716
+ "programar para hacerlo."
717
 
718
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:443
719
  msgid "approved account"
765
 
766
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:612
767
  msgid "When you see that everything is going well, deactivate Sandbox, turn on Production and make way for your online sales."
768
+ msgstr "Cuando veas que todo va bien, desactiva Sandbox para ir a Producción y abre paso a tus ventas online."
769
 
770
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:625
771
+ msgid "Production"
772
  msgstr "Producción"
773
 
774
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
775
+ msgid "Choose YES only when you are ready to sell. Change to NO to activate the Tests mode."
776
+ msgstr "Elige solo cuando estés listo para vender. Cambia a NO para activar el modo Pruebas."
777
 
778
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
779
  msgid "Load credentials"
832
  msgstr "Categoría de la tienda"
833
 
834
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:851
835
+ msgid "What category do your products belong to? Choose the one that best characterizes them (choose \"other\" if your product is too specific)."
836
+ msgstr "¿A qué categoría pertenecen tus productos? Elige la que mejor los caracteriza (elige otro” si tu producto es demasiado específico)."
837
 
838
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:852
839
  msgid "Categories"
968
  msgstr "Acepta y rechaza pagos de forma automática. ¿Quieres que lo activemos?"
969
 
970
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1064
971
+ msgid "Discounts per purchase with Mercado Pago"
972
+ msgstr "Descuentos por compra con 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."
992
  msgstr "¿Todo configurado? Ve a tu tienda en modo Sandbox"
993
 
994
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1122
995
+ msgid "Visit your store as if you were one of your customers and check that everything is fine. If you already went to Production,<br> bring your customers and increase your sales with the best online shopping experience."
996
+ msgstr "Visita tu tienda como si fueras uno de tus clientes y revisa que todo esté bien. Si ya saliste a Producción,<br> trae a tus clientes y aumenta tus ventas con la mejor experiencia de compra online."
997
 
998
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1124
999
+ msgid "Visit your store and simulate a payment to check that everything is fine."
1000
+ msgstr "Visita tu tienda y simula un pago para revisar que todo esté bien."
 
 
 
 
1001
 
1002
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1141
1003
  msgid "Visit my store"
1012
  msgstr "Paga con dinero en efectivo"
1013
 
1014
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:183
1015
+ msgid "Checkout of payments with cash %s"
1016
+ msgstr "Checkout de pagos con dinero en efectivo %s"
1017
 
1018
+ #: includes/payments/WC_WooMercadoPago_TicketGateway.php:192
1019
+ msgid "Accept face-to-face payments, do not leave anyone out!"
1020
+ msgstr "Acepta pagos presenciales ¡no dejes a nadie afuera!"
1021
+
1022
+ #: includes/payments/WC_WooMercadoPago_TicketGateway.php:197
1023
  msgid "Include this preferred purchase option by some customers."
1024
  msgstr "Incluye esta opción de compra preferida por algunos clientes."
1025
 
1026
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:230
1027
  msgid "Enable Mercado Pago for cash payments in your store and <br> select the options available to your customers."
1028
+ msgstr "Habilita Mercado Pago para pagos en efectivo en tu tienda y <br> selecciona las opciones disponibles para tus clientes."
1029
 
1030
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:243
1031
  msgid "Set payment preferences with cash"
1032
+ msgstr "Configura las preferencias de pago con dinero en efectivo"
1033
 
1034
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:256
1035
  msgid "Advanced configuration of the cash payment experience"
1104
  msgstr "Esto controla el título que el usuario ve durante el proceso de pago."
1105
 
1106
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:236
1107
+ msgid "Enable free shipping for this shipping method"
1108
  msgstr "Habilitar envío gratis para este método de envío"
1109
 
1110
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:240
1191
  msgid "CVV"
1192
  msgstr "CVV"
1193
 
1194
+ #: templates/checkout/custom_checkout.php:94 templates/checkout/custom_checkout.php:108 templates/checkout/custom_checkout.php:111 templates/checkout/custom_checkout.php:121 templates/checkout/custom_checkout.php:141
1195
+ #: templates/checkout/custom_checkout.php:205
1196
  msgid "Card number"
1197
  msgstr "Número de Tarjeta"
1198
 
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"
1226
 
1227
  #: templates/checkout/custom_checkout.php:153
1228
  msgid "Issuer"
1238
 
1239
  #: templates/checkout/custom_checkout.php:192
1240
  msgid "Enter your document number"
1241
+ msgstr "Ingresa tu número de documento"
1242
 
1243
  #: templates/checkout/custom_checkout.php:196
1244
  msgid "Type"
1393
  msgstr "Selecciona el emisor con el que quieras procesar el pago"
1394
 
1395
  #: woocommerce-mercadopago.php:48
1396
+ msgid "Mercado Pago payments for WooCommerce requires PHP version 5.6 or later. Please update your PHP version."
1397
  msgstr "El plugin de Mercado Pago requiere la versión de PHP 5.6 o posterior. Por favor actualice su versión de PHP."
1398
 
1399
  #: woocommerce-mercadopago.php:65
1427
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:28
1428
  msgid "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!"
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 "Select the payment methods available in your store."
1433
+ msgstr "Selecciona los medios de pago disponibles en tu tienda."
i18n/languages/woocommerce-mercadopago-es_VE.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_VE.po CHANGED
@@ -1,24 +1,24 @@
1
  # Copyright (C) 2019 Mercado Pago
2
- # This file is distributed under the same license as the WooCommerce Mercado Pago plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WooCommerce Mercado Pago 4.0.8\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: 2019-09-13 21:21-0300\n"
13
- "X-Generator: Poedit 2.2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
  "Language: es_VE\n"
18
 
19
  #. Plugin Name of the plugin
20
- msgid "WooCommerce Mercado Pago"
21
- msgstr "WooCommerce Mercado Pago"
22
 
23
  #. Plugin URI of the plugin
24
  msgid "https://github.com/mercadopago/cart-woocommerce"
@@ -79,7 +79,7 @@ msgstr "¡El módulo de pago de Woo Mercado depende de la última versión de %s
79
 
80
  #: includes/module/WC_WooMercadoPago_Module.php:273
81
  msgid "Set up"
82
- msgstr "Configurar"
83
 
84
  #: includes/module/WC_WooMercadoPago_Module.php:274
85
  msgid "Your opinion helps us get better"
@@ -87,11 +87,11 @@ msgstr "Tu opinión nos ayuda a mejorar"
87
 
88
  #: includes/module/WC_WooMercadoPago_Module.php:275
89
  msgid "Guides and Documentation"
90
- msgstr "Guías y Documentación"
91
 
92
  #: includes/module/WC_WooMercadoPago_Module.php:276
93
  msgid "Report Problem"
94
- msgstr "Informar Problema"
95
 
96
  #: includes/module/WC_WooMercadoPago_Module.php:293
97
  msgid "By Mercado Pago"
@@ -229,18 +229,17 @@ msgstr "El pago fue cancelado."
229
  msgid "The payment is in mediation or the purchase was unknown by the customer."
230
  msgstr "El pago esta en mediación o la compra fue desconocida por el cliente."
231
 
232
- #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:35 includes/notification/WC_WooMercadoPago_Notification_IPN.php:40
233
- #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:52
234
  msgid "The Mercado Pago request has failed"
235
  msgstr "La solicitud de Mercado Pago ha fallado"
236
 
237
- #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:116 includes/notification/WC_WooMercadoPago_Notification_IPN.php:141
238
- #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:152 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:170
239
  msgid "Buyer email"
240
  msgstr "Email del comprador"
241
 
242
- #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:119 includes/notification/WC_WooMercadoPago_Notification_IPN.php:144
243
- #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:155 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:173
244
  msgid "Payment method"
245
  msgstr "Medio de pago"
246
 
@@ -309,16 +308,16 @@ msgid "Discount for coupon %s"
309
  msgstr "Descuento para el cupón %s"
310
 
311
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126 includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:128
312
- msgid "Discount of"
313
- msgstr "Descuento de"
314
 
315
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126
316
- msgid " and Rate of"
317
- msgstr " y Tarifa de"
318
 
319
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:130
320
- msgid "Fee of"
321
- msgstr "Tarifa de"
322
 
323
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:355
324
  msgid "Credentials for invalid production!"
@@ -349,12 +348,12 @@ msgid "Click to try again"
349
  msgstr "Haga clic para intentarlo de nuevo"
350
 
351
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:77
352
- msgid "Thanks for your order. Please pay the ticket to have your order approved."
353
- msgstr "Gracias por su orden. Por favor, realice el pago del ticket para tener su orden aprobada."
354
 
355
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:82
356
- msgid "Print the ticket"
357
- msgstr "Imprimir el ticket"
358
 
359
  #: includes/payments/mercadoenvios/WC_WooMercadoPago_Product_Recurrent.php:40
360
  msgid "Subscription Mercado Pago"
@@ -434,32 +433,32 @@ msgid "Deadline to generate new charges. By default as never, if it is blank."
434
  msgstr "Fecha límite para generar nuevos cargos. De forma predeterminada es nunca, si está en blanco."
435
 
436
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:27
437
- msgid "Mercado Pago - Basic Checkout"
438
- msgstr "Mercado Pago - Checkout básico"
439
 
440
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:29
441
  msgid "Pay with the payment method you prefer"
442
  msgstr "Paga con el medio de pago que prefieras"
443
 
444
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:229
445
- msgid "Basic Checkout Accept all method of payment and take your charges to another level %s"
446
- msgstr "Checkout Básico. Acepta todos los medios de pago y lleva tus cobros a otro nivel %s"
447
 
448
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:233
 
 
 
 
449
  msgid "Turn your online store into your customers preferred payment gateway. Choose if the final payment experience will be inside or outside your store."
450
  msgstr "Convierte tu tienda online en la pasarela de pagos preferida de tus clientes. Elige si la experiencia de pago final será dentro o fuera de tu tienda."
451
 
452
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:250 includes/payments/WC_WooMercadoPago_TicketGateway.php:204
453
- msgid "Configure WooCommerce Mercado Pago"
454
- msgstr "Configura WooCommerce Mercado Pago"
455
 
456
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:263
457
- msgid ""
458
- "Enable the experience of the basic checkout of Mercado Pago in your online store, select the means of payment available to your customers and<br> define the maximum fees in which they can pay "
459
- "you."
460
- msgstr ""
461
- "Habilitá la experiencia del checkout básico de Mercado Pago en tu tienda online, seleccioná los medios de pago disponibles para tus clientes y<br> definí el máximo de cuotas en el que podrán "
462
- "pagarte."
463
 
464
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:276 includes/payments/WC_WooMercadoPago_CustomGateway.php:187 includes/payments/WC_WooMercadoPago_TicketGateway.php:217
465
  msgid "Go to the basics. Place your business information."
@@ -470,12 +469,12 @@ msgid "Set payment preferences in your store"
470
  msgstr "Configura las preferencias de pago en tu tienda"
471
 
472
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
473
- msgid "Advanced payment experience settings"
474
- msgstr "Configuración Avanzada de la experiencia de pago"
475
 
476
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
477
- msgid "Integration method"
478
- msgstr "Método de integración"
479
 
480
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:317
481
  msgid "Define what payment experience your customers will have, whether inside or outside your store."
@@ -502,10 +501,8 @@ msgid "Success URL"
502
  msgstr "URL de éxito"
503
 
504
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:357
505
- msgid ""
506
- "Choose the URL that we will show to your customers when we refuse their purchase. Make sure it includes a message appropriate to the situation and give them useful information so they can solve "
507
- "it."
508
- msgstr "Elige la URL que mostraremos a tus clientes cuando rechacemos su compra. Asegurate de que incluya un mensaje adecuado a la situación y dales información útil para que puedan solucionarlo."
509
 
510
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:360
511
  msgid "Payment URL rejected"
@@ -529,11 +526,11 @@ msgstr "Selecciona tarjetas de débito"
529
 
530
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:455
531
  msgid "Select offline payments"
532
- msgstr "Selecciona pagos offline"
533
 
534
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:464 includes/payments/WC_WooMercadoPago_TicketGateway.php:321
535
  msgid "Payment methods"
536
- msgstr "Medios de pago"
537
 
538
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:468 includes/payments/WC_WooMercadoPago_TicketGateway.php:325
539
  msgid "Enable the payment methods available to your customers."
@@ -544,8 +541,8 @@ msgid "Return to the store"
544
  msgstr "Volver a la tienda"
545
 
546
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:489
547
- msgid "Your customer automatically return to the store after payment."
548
- msgstr "Que tu cliente vuelva automáticamente a la tienda después del pago."
549
 
550
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:491 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:548 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:631
551
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:898 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1018 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1051
@@ -568,10 +565,14 @@ msgid "Pay with debit and credit cards"
568
  msgstr "Paga con tarjetas de débito y crédito"
569
 
570
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:153
571
- msgid "Checkout of payments with debit and credit cards<br> Accept payments instantly and maximize the conversion of your business %s"
572
- msgstr "Checkout de pagos con tarjetas de débito y crédito<br> Acepta pagos al instante y maximiza la conversión de tu negocio %s"
 
 
 
 
573
 
574
- #: includes/payments/WC_WooMercadoPago_CustomGateway.php:157
575
  msgid "Turn your online store into a secure and easy-to-use payment gateway for your customers. With personalized checkout your customers pay without leaving your store!"
576
  msgstr "Convierte tu tienda online en una pasarela de pagos segura y fácil de usar para tus clientes. Con el checkout personalizado tus clientes pagan ¡sin salir de tu tienda!"
577
 
@@ -588,8 +589,8 @@ msgid "Advanced configuration of the personalized payment experience\""
588
  msgstr "Configuración avanzada de la experiencia de pago personalizada"
589
 
590
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:228
591
- msgid "Ready, your payment has been accepted!"
592
- msgstr "Listo, su pago ha sido aceptado!"
593
 
594
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:230
595
  msgid "We are processing your payment. In less than an hour we will send you the result by email."
@@ -688,8 +689,8 @@ msgid "<b>Follow these steps to activate Mercado Pago in your store:</b>"
688
  msgstr "<b>Sigue estos pasos para activar Mercado Pago en tu tienda:</b>"
689
 
690
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:395
691
- msgid "Upload your <b>credentials</b> to test the store and charge with your Mercado Pago account <b>depending on the country</b> in which you are registered."
692
- msgstr "Carga tus <b>credenciales</b> para testear la tienda y cobrar con tu cuenta de Mercado Pago <b>según el país</b> en el que estés registrado."
693
 
694
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
695
  msgid "Approve your account to be able to charge."
@@ -704,16 +705,15 @@ msgid "Configure the <b>payment preferences</b> for your customers."
704
  msgstr "Configura las preferencias de pago para tus clientes."
705
 
706
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:423
707
- msgid "Go to advanced settings of both the plugin and checkout only when you want to change the presets."
708
- msgstr "Ve a configuraciones avanzadas tanto del plugin como del checkout solo cuando quieras modificar los ajustes preestablecidos."
709
 
710
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
711
  msgid ""
712
- "Credentials are the keys we provide you to integrate quickly <br>and securely. You must have a %s in Mercado Pago to obtain and collect them <br>on your website. You do not need to know how to "
713
- "design or program to do it"
714
  msgstr ""
715
- "Las credenciales son las claves que te proporcionamos para que integres de forma rápida <br>y segura. Debes tener una %s en Mercado Pago para obtenerlas y cobrar <br>en tu sitio web. No "
716
- "necesitas saber diseñar o programar para hacerlo."
717
 
718
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:443
719
  msgid "approved account"
@@ -765,15 +765,15 @@ msgstr "Modo Producción"
765
 
766
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:612
767
  msgid "When you see that everything is going well, deactivate Sandbox, turn on Production and make way for your online sales."
768
- msgstr "Cuando veas que todo va bien, desactivá Sandbox, prendé Producción y abrí paso a tus ventas online."
769
 
770
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:625
771
- msgid "Productio"
772
  msgstr "Producción"
773
 
774
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
775
- msgid "Choose \"YES\" only when you are ready to sell. Change to NO to activate the Tests mode."
776
- msgstr "Elige “SÍ” solo cuando estés listo para vender. Cambia a NO para activar el modo Pruebas."
777
 
778
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
779
  msgid "Load credentials"
@@ -832,8 +832,8 @@ msgid "Store Category"
832
  msgstr "Categoría de la tienda"
833
 
834
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:851
835
- msgid "What category do your products belong to? Choose the one that best characterizes them (choose <br>\"other\" if your product is too specific)."
836
- msgstr "¿A qué categoría pertenecen tus productos? Elige la que mejor los caracteriza (elige <br>“otro” si tu producto es demasiado específico)."
837
 
838
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:852
839
  msgid "Categories"
@@ -968,8 +968,8 @@ msgid "Accept and reject payments automatically. Do you want us to activate it?"
968
  msgstr "Acepta y rechaza pagos de forma automática. ¿Quieres que lo activemos?"
969
 
970
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1064
971
- msgid "Gateway Discounts"
972
- msgstr "Descuentos Gateway"
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."
@@ -992,16 +992,12 @@ msgid "Everything set up? Go to your store in Sandbox mode"
992
  msgstr "¿Todo configurado? Ve a tu tienda en modo Sandbox"
993
 
994
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1122
995
- msgid "You already went to Production. You just need your best customers <br> to arrive at your store to live the best online shopping experience with Mercado Pago."
996
- msgstr "Ya saliste a Producción. Solo falta que tus mejores clientes <br> lleguen a tu tienda para vivir la mejor experiencia de compra online com Mercado Pago."
997
 
998
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1124
999
- msgid ""
1000
- "Visit your store as if you were one of your customers and check that everything is fine. If you already went to Production,<br> bring your customers and increase your sales with the best online "
1001
- "shopping experience."
1002
- msgstr ""
1003
- "Visita tu tienda como si fueras uno de tus clientes y revisa que todo esté bien. Si ya saliste a Producción,<br> trae a tus clientes y aumenta tus ventas con la mejor experiencia de compra "
1004
- "online."
1005
 
1006
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1141
1007
  msgid "Visit my store"
@@ -1016,20 +1012,24 @@ msgid "Pay with cash"
1016
  msgstr "Paga con dinero en efectivo"
1017
 
1018
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:183
1019
- msgid "Checkout of payments with cash<br> Accept face-to-face payments, do not leave anyone out! %s"
1020
- msgstr "Checkout de pagos con dinero en efectivo<br> Acepta pagos presenciales ¡no dejes a nadie afuera! %s"
1021
 
1022
- #: includes/payments/WC_WooMercadoPago_TicketGateway.php:187
 
 
 
 
1023
  msgid "Include this preferred purchase option by some customers."
1024
  msgstr "Incluye esta opción de compra preferida por algunos clientes."
1025
 
1026
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:230
1027
  msgid "Enable Mercado Pago for cash payments in your store and <br> select the options available to your customers."
1028
- msgstr "Habilitá Mercado Pago para pagos en efectivo en tu tienda y <br> seleccioná las opciones disponibles para tus clientes."
1029
 
1030
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:243
1031
  msgid "Set payment preferences with cash"
1032
- msgstr "Configurá las preferencias de pago con dinero en efectivo"
1033
 
1034
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:256
1035
  msgid "Advanced configuration of the cash payment experience"
@@ -1104,7 +1104,7 @@ msgid "This controls the title that the user sees during the payment process."
1104
  msgstr "Esto controla el título que el usuario ve durante el proceso de pago."
1105
 
1106
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:236
1107
- msgid "nable free shipping for this shipping method"
1108
  msgstr "Habilitar envío gratis para este método de envío"
1109
 
1110
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:240
@@ -1191,8 +1191,8 @@ msgstr "Otra tarjeta"
1191
  msgid "CVV"
1192
  msgstr "CVV"
1193
 
1194
- #: templates/checkout/custom_checkout.php:94 templates/checkout/custom_checkout.php:108 templates/checkout/custom_checkout.php:111 templates/checkout/custom_checkout.php:121
1195
- #: templates/checkout/custom_checkout.php:141 templates/checkout/custom_checkout.php:205
1196
  msgid "Card number"
1197
  msgstr "Número de Tarjeta"
1198
 
@@ -1221,8 +1221,8 @@ msgid "Last 3 numbers on the back"
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?"
1226
 
1227
  #: templates/checkout/custom_checkout.php:153
1228
  msgid "Issuer"
@@ -1238,7 +1238,7 @@ msgstr "Seleccione el número de cotas"
1238
 
1239
  #: templates/checkout/custom_checkout.php:192
1240
  msgid "Enter your document number"
1241
- msgstr "Ingrese su número de documento"
1242
 
1243
  #: templates/checkout/custom_checkout.php:196
1244
  msgid "Type"
@@ -1393,7 +1393,7 @@ msgid "Select the issuer with whom you want to process the payment"
1393
  msgstr "Selecciona el emisor con el que quieras procesar el pago"
1394
 
1395
  #: woocommerce-mercadopago.php:48
1396
- msgid "WooCommerce Mercado Pago requires PHP version 5.6 or later. Please update your PHP version."
1397
  msgstr "El plugin de Mercado Pago requiere la versión de PHP 5.6 o posterior. Por favor actualice su versión de PHP."
1398
 
1399
  #: woocommerce-mercadopago.php:65
@@ -1427,3 +1427,7 @@ msgstr "Ofrece todos los medios de pago: tarjetas de crédito y débito, dinero
1427
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:28
1428
  msgid "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!"
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!"
 
 
 
 
1
  # Copyright (C) 2019 Mercado Pago
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.1.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: 2019-12-23 17:12-0300\n"
13
+ "X-Generator: Poedit 2.2.4\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
  "Language: es_VE\n"
18
 
19
  #. Plugin Name of the plugin
20
+ msgid "Mercado Pago payments for WooCommerce"
21
+ msgstr "Mercado Pago payments for WooCommerce"
22
 
23
  #. Plugin URI of the plugin
24
  msgid "https://github.com/mercadopago/cart-woocommerce"
79
 
80
  #: includes/module/WC_WooMercadoPago_Module.php:273
81
  msgid "Set up"
82
+ msgstr "Ajustes"
83
 
84
  #: includes/module/WC_WooMercadoPago_Module.php:274
85
  msgid "Your opinion helps us get better"
87
 
88
  #: includes/module/WC_WooMercadoPago_Module.php:275
89
  msgid "Guides and Documentation"
90
+ msgstr "Guías y documentación"
91
 
92
  #: includes/module/WC_WooMercadoPago_Module.php:276
93
  msgid "Report Problem"
94
+ msgstr "Informar problema"
95
 
96
  #: includes/module/WC_WooMercadoPago_Module.php:293
97
  msgid "By Mercado Pago"
229
  msgid "The payment is in mediation or the purchase was unknown by the customer."
230
  msgstr "El pago esta en mediación o la compra fue desconocida por el cliente."
231
 
232
+ #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:35 includes/notification/WC_WooMercadoPago_Notification_IPN.php:40 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:52
 
233
  msgid "The Mercado Pago request has failed"
234
  msgstr "La solicitud de Mercado Pago ha fallado"
235
 
236
+ #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:116 includes/notification/WC_WooMercadoPago_Notification_IPN.php:141 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:152
237
+ #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:170
238
  msgid "Buyer email"
239
  msgstr "Email del comprador"
240
 
241
+ #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:119 includes/notification/WC_WooMercadoPago_Notification_IPN.php:144 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:155
242
+ #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:173
243
  msgid "Payment method"
244
  msgstr "Medio de pago"
245
 
308
  msgstr "Descuento para el cupón %s"
309
 
310
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126 includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:128
311
+ msgid "discount of"
312
+ msgstr "descuento de"
313
 
314
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126
315
+ msgid " and fee of"
316
+ msgstr " y comisión de"
317
 
318
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:130
319
+ msgid "fee of"
320
+ msgstr "comisión de"
321
 
322
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:355
323
  msgid "Credentials for invalid production!"
348
  msgstr "Haga clic para intentarlo de nuevo"
349
 
350
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:77
351
+ msgid "Great, we processed your purchase order. Complete the payment with ticket so that we finish approving it."
352
+ msgstr "Excelente, procesamos tu orden de compra. Completa el pago con ticket para que terminemos de aprobarla."
353
 
354
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:82
355
+ msgid "Print ticket"
356
+ msgstr "Imprimir ticket"
357
 
358
  #: includes/payments/mercadoenvios/WC_WooMercadoPago_Product_Recurrent.php:40
359
  msgid "Subscription Mercado Pago"
433
  msgstr "Fecha límite para generar nuevos cargos. De forma predeterminada es nunca, si está en blanco."
434
 
435
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:27
436
+ msgid "Mercado Pago Checkout"
437
+ msgstr "Checkout de Mercado Pago"
438
 
439
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:29
440
  msgid "Pay with the payment method you prefer"
441
  msgstr "Paga con el medio de pago que prefieras"
442
 
443
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:229
444
+ msgid "Mercado Pago checkout %s"
445
+ msgstr "Checkout de Mercado Pago %s"
446
 
447
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:235
448
+ msgid "Accept all method of payment and take your charges to another level"
449
+ msgstr "Acepta todos los medios de pago y lleva tus cobros a otro nivel"
450
+
451
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:239
452
  msgid "Turn your online store into your customers preferred payment gateway. Choose if the final payment experience will be inside or outside your store."
453
  msgstr "Convierte tu tienda online en la pasarela de pagos preferida de tus clientes. Elige si la experiencia de pago final será dentro o fuera de tu tienda."
454
 
455
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:250 includes/payments/WC_WooMercadoPago_TicketGateway.php:204
456
+ msgid "Configure Mercado Pago for WooCommerce"
457
+ msgstr "Configura Mercado Pago para WooCommerce"
458
 
459
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:263
460
+ msgid "Enable the experience of the Mercado Pago Checkout in your online store, select the means of payment available to your customers and<br> define the maximum fees in which they can pay you."
461
+ msgstr "Habilita la experiencia del Checkout de Mercado Pago en tu tienda online, selecciona los medios de pago disponibles para tus clientes y<br> define el máximo de cuotas en el que podrán pagarte."
 
 
 
 
462
 
463
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:276 includes/payments/WC_WooMercadoPago_CustomGateway.php:187 includes/payments/WC_WooMercadoPago_TicketGateway.php:217
464
  msgid "Go to the basics. Place your business information."
469
  msgstr "Configura las preferencias de pago en tu tienda"
470
 
471
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
472
+ msgid "advanced settings"
473
+ msgstr "configuración avanzada"
474
 
475
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
476
+ msgid "Payment experience"
477
+ msgstr "Experiencia de pago"
478
 
479
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:317
480
  msgid "Define what payment experience your customers will have, whether inside or outside your store."
501
  msgstr "URL de éxito"
502
 
503
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:357
504
+ msgid "Choose the URL that we will show to your customers when we refuse their purchase. Make sure it includes a message appropriate to the situation and give them useful information so they can solve it."
505
+ msgstr "Elige la URL que mostraremos a tus clientes cuando rechacemos su compra. Asegúrate de incluir un mensaje adecuado a la situación y dales información útil para que puedan solucionarlo."
 
 
506
 
507
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:360
508
  msgid "Payment URL rejected"
526
 
527
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:455
528
  msgid "Select offline payments"
529
+ msgstr "Selecciona medios de pago presenciales"
530
 
531
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:464 includes/payments/WC_WooMercadoPago_TicketGateway.php:321
532
  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 "Enable the payment methods available to your customers."
541
  msgstr "Volver a la tienda"
542
 
543
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:489
544
+ msgid "Do you want your customer to automatically return to the store after payment?"
545
+ msgstr "¿Quieres que tu cliente vuelva automáticamente a la tienda después del pago?"
546
 
547
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:491 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:548 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:631
548
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:898 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1018 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1051
565
  msgstr "Paga con tarjetas de débito y crédito"
566
 
567
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:153
568
+ msgid "Checkout of payments with debit and credit cards %s"
569
+ msgstr "Checkout de pagos con tarjetas de débito y crédito %s"
570
+
571
+ #: includes/payments/WC_WooMercadoPago_CustomGateway.php:158
572
+ msgid "Accept payments instantly and maximize the conversion of your business"
573
+ msgstr "Acepta pagos al instante y maximiza la conversión de tu negocio"
574
 
575
+ #: includes/payments/WC_WooMercadoPago_CustomGateway.php:162
576
  msgid "Turn your online store into a secure and easy-to-use payment gateway for your customers. With personalized checkout your customers pay without leaving your store!"
577
  msgstr "Convierte tu tienda online en una pasarela de pagos segura y fácil de usar para tus clientes. Con el checkout personalizado tus clientes pagan ¡sin salir de tu tienda!"
578
 
589
  msgstr "Configuración avanzada de la experiencia de pago personalizada"
590
 
591
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:228
592
+ msgid "That’s it, payment accepted!"
593
+ msgstr "Listo, ¡aceptamos tu pago!"
594
 
595
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:230
596
  msgid "We are processing your payment. In less than an hour we will send you the result by email."
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 <b>credentials</b> depending on the country in which you are registered."
693
+ msgstr "Carga tus <b>credenciales</b> según el país en el que estés registrado."
694
 
695
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
696
  msgid "Approve your account to be able to charge."
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> solo cuando quieras modificar los ajustes preestablecidos."
710
 
711
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
712
  msgid ""
713
+ "Credentials are the keys we provide you to integrate quickly <br>and securely. You must have a %s in Mercado Pago to obtain and collect them <br>on your website. You do not need to know how to design or program to do it"
 
714
  msgstr ""
715
+ "Las credenciales son las claves que te proporcionamos para que integres de forma rápida <br>y segura. Debes tener una %s en Mercado Pago para obtenerlas y cobrar <br>en tu sitio web. No necesitas saber diseñar o "
716
+ "programar para hacerlo."
717
 
718
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:443
719
  msgid "approved account"
765
 
766
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:612
767
  msgid "When you see that everything is going well, deactivate Sandbox, turn on Production and make way for your online sales."
768
+ msgstr "Cuando veas que todo va bien, desactiva Sandbox para ir a Producción y abre paso a tus ventas online."
769
 
770
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:625
771
+ msgid "Production"
772
  msgstr "Producción"
773
 
774
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
775
+ msgid "Choose YES only when you are ready to sell. Change to NO to activate the Tests mode."
776
+ msgstr "Elige solo cuando estés listo para vender. Cambia a NO para activar el modo Pruebas."
777
 
778
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
779
  msgid "Load credentials"
832
  msgstr "Categoría de la tienda"
833
 
834
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:851
835
+ msgid "What category do your products belong to? Choose the one that best characterizes them (choose \"other\" if your product is too specific)."
836
+ msgstr "¿A qué categoría pertenecen tus productos? Elige la que mejor los caracteriza (elige otro” si tu producto es demasiado específico)."
837
 
838
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:852
839
  msgid "Categories"
968
  msgstr "Acepta y rechaza pagos de forma automática. ¿Quieres que lo activemos?"
969
 
970
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1064
971
+ msgid "Discounts per purchase with Mercado Pago"
972
+ msgstr "Descuentos por compra con 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."
992
  msgstr "¿Todo configurado? Ve a tu tienda en modo Sandbox"
993
 
994
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1122
995
+ msgid "Visit your store as if you were one of your customers and check that everything is fine. If you already went to Production,<br> bring your customers and increase your sales with the best online shopping experience."
996
+ msgstr "Visita tu tienda como si fueras uno de tus clientes y revisa que todo esté bien. Si ya saliste a Producción,<br> trae a tus clientes y aumenta tus ventas con la mejor experiencia de compra online."
997
 
998
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1124
999
+ msgid "Visit your store and simulate a payment to check that everything is fine."
1000
+ msgstr "Visita tu tienda y simula un pago para revisar que todo esté bien."
 
 
 
 
1001
 
1002
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1141
1003
  msgid "Visit my store"
1012
  msgstr "Paga con dinero en efectivo"
1013
 
1014
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:183
1015
+ msgid "Checkout of payments with cash %s"
1016
+ msgstr "Checkout de pagos con dinero en efectivo %s"
1017
 
1018
+ #: includes/payments/WC_WooMercadoPago_TicketGateway.php:192
1019
+ msgid "Accept face-to-face payments, do not leave anyone out!"
1020
+ msgstr "Acepta pagos presenciales ¡no dejes a nadie afuera!"
1021
+
1022
+ #: includes/payments/WC_WooMercadoPago_TicketGateway.php:197
1023
  msgid "Include this preferred purchase option by some customers."
1024
  msgstr "Incluye esta opción de compra preferida por algunos clientes."
1025
 
1026
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:230
1027
  msgid "Enable Mercado Pago for cash payments in your store and <br> select the options available to your customers."
1028
+ msgstr "Habilita Mercado Pago para pagos en efectivo en tu tienda y <br> selecciona las opciones disponibles para tus clientes."
1029
 
1030
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:243
1031
  msgid "Set payment preferences with cash"
1032
+ msgstr "Configura las preferencias de pago con dinero en efectivo"
1033
 
1034
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:256
1035
  msgid "Advanced configuration of the cash payment experience"
1104
  msgstr "Esto controla el título que el usuario ve durante el proceso de pago."
1105
 
1106
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:236
1107
+ msgid "Enable free shipping for this shipping method"
1108
  msgstr "Habilitar envío gratis para este método de envío"
1109
 
1110
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:240
1191
  msgid "CVV"
1192
  msgstr "CVV"
1193
 
1194
+ #: templates/checkout/custom_checkout.php:94 templates/checkout/custom_checkout.php:108 templates/checkout/custom_checkout.php:111 templates/checkout/custom_checkout.php:121 templates/checkout/custom_checkout.php:141
1195
+ #: templates/checkout/custom_checkout.php:205
1196
  msgid "Card number"
1197
  msgstr "Número de Tarjeta"
1198
 
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"
1226
 
1227
  #: templates/checkout/custom_checkout.php:153
1228
  msgid "Issuer"
1238
 
1239
  #: templates/checkout/custom_checkout.php:192
1240
  msgid "Enter your document number"
1241
+ msgstr "Ingresa tu número de documento"
1242
 
1243
  #: templates/checkout/custom_checkout.php:196
1244
  msgid "Type"
1393
  msgstr "Selecciona el emisor con el que quieras procesar el pago"
1394
 
1395
  #: woocommerce-mercadopago.php:48
1396
+ msgid "Mercado Pago payments for WooCommerce requires PHP version 5.6 or later. Please update your PHP version."
1397
  msgstr "El plugin de Mercado Pago requiere la versión de PHP 5.6 o posterior. Por favor actualice su versión de PHP."
1398
 
1399
  #: woocommerce-mercadopago.php:65
1427
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:28
1428
  msgid "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!"
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 "Select the payment methods available in your store."
1433
+ msgstr "Selecciona los medios de pago disponibles en tu tienda."
i18n/languages/woocommerce-mercadopago-pt_BR.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-pt_BR.po CHANGED
@@ -1,24 +1,24 @@
1
  # Copyright (C) 2019 Mercado Pago
2
- # This file is distributed under the same license as the WooCommerce Mercado Pago plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WooCommerce Mercado Pago 4.0.8\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: 2019-09-13 21:19-0300\n"
13
- "X-Generator: Poedit 2.2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n > 1);\n"
17
  "Language: pt_BR\n"
18
 
19
  #. Plugin Name of the plugin
20
- msgid "WooCommerce Mercado Pago"
21
- msgstr "WooCommerce Mercado Pago"
22
 
23
  #. Plugin URI of the plugin
24
  msgid "https://github.com/mercadopago/cart-woocommerce"
@@ -91,7 +91,7 @@ msgstr "Guias e documentação"
91
 
92
  #: includes/module/WC_WooMercadoPago_Module.php:276
93
  msgid "Report Problem"
94
- msgstr "Informar Problema"
95
 
96
  #: includes/module/WC_WooMercadoPago_Module.php:293
97
  msgid "By Mercado Pago"
@@ -233,13 +233,13 @@ msgstr "O pagamento está em mediação ou a compra não foi reconhecida pelo cl
233
  msgid "The Mercado Pago request has failed"
234
  msgstr "A solicitação do Mercado Pago falhou"
235
 
236
- #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:116 includes/notification/WC_WooMercadoPago_Notification_IPN.php:141
237
- #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:152 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:170
238
  msgid "Buyer email"
239
  msgstr "E-mail do comprador"
240
 
241
- #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:119 includes/notification/WC_WooMercadoPago_Notification_IPN.php:144
242
- #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:155 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:173
243
  msgid "Payment method"
244
  msgstr "Meio de pagamento"
245
 
@@ -308,16 +308,16 @@ msgid "Discount for coupon %s"
308
  msgstr "Desconto para o cupom %s"
309
 
310
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126 includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:128
311
- msgid "Discount of"
312
- msgstr "Desconto de"
313
 
314
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126
315
- msgid " and Rate of"
316
- msgstr " e Taxa de"
317
 
318
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:130
319
- msgid "Fee of"
320
- msgstr "Taxa de"
321
 
322
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:355
323
  msgid "Credentials for invalid production!"
@@ -348,12 +348,12 @@ msgid "Click to try again"
348
  msgstr "Clique para tentar novamente"
349
 
350
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:77
351
- msgid "Thanks for your order. Please pay the ticket to have your order approved."
352
- msgstr "Obrigado pelo seu pedido. Por favor, pague o boleto para ter seu pedido aprovado."
353
 
354
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:82
355
- msgid "Print the ticket"
356
- msgstr "Imprimir o boleto"
357
 
358
  #: includes/payments/mercadoenvios/WC_WooMercadoPago_Product_Recurrent.php:40
359
  msgid "Subscription Mercado Pago"
@@ -433,31 +433,32 @@ msgid "Deadline to generate new charges. By default as never, if it is blank."
433
  msgstr "Data limite para gerar nova cobrança. Por padrão nunca, se deixado em branco."
434
 
435
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:27
436
- msgid "Mercado Pago - Basic Checkout"
437
- msgstr "Mercado Pago - Checkout básico"
438
 
439
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:29
440
  msgid "Pay with the payment method you prefer"
441
  msgstr "Todos os meios de pagamento"
442
 
443
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:229
444
- msgid "Basic Checkout Accept all method of payment and take your charges to another level %s"
445
- msgstr "Checkout Básico. Aceite todos os meios de pagamento e leve suas cobranças a outro nível %s"
446
 
447
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:233
 
 
 
 
448
  msgid "Turn your online store into your customers preferred payment gateway. Choose if the final payment experience will be inside or outside your store."
449
  msgstr "Transforme sua loja virtual no lugar de pagamentos preferido dos seus clientes. Escolha a experiência de pagamento final entre as opções disponíveis."
450
 
451
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:250 includes/payments/WC_WooMercadoPago_TicketGateway.php:204
452
- msgid "Configure WooCommerce Mercado Pago"
453
- msgstr "Configure o WooCommerce Mercado Pago"
454
 
455
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:263
456
- msgid ""
457
- "Enable the experience of the basic checkout of Mercado Pago in your online store, select the means of payment available to your customers and<br> define the maximum fees in which they can pay you."
458
- msgstr ""
459
- "Habilite a experiência do Checkout Básico do Mercado Pago na sua loja virtual, selecione os meios de pagamento disponíveis para seus clientes e<br> defina o número máximo de vezes que podem "
460
- "parcelar suas compras."
461
 
462
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:276 includes/payments/WC_WooMercadoPago_CustomGateway.php:187 includes/payments/WC_WooMercadoPago_TicketGateway.php:217
463
  msgid "Go to the basics. Place your business information."
@@ -468,12 +469,12 @@ msgid "Set payment preferences in your store"
468
  msgstr "Configure as preferências de pagamento na sua loja"
469
 
470
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
471
- msgid "Advanced payment experience settings"
472
- msgstr "Configuração Avançada das preferências de pagamento"
473
 
474
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
475
- msgid "Integration method"
476
- msgstr "Método de integração"
477
 
478
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:317
479
  msgid "Define what payment experience your customers will have, whether inside or outside your store."
@@ -500,12 +501,8 @@ msgid "Success URL"
500
  msgstr "URL de sucesso"
501
 
502
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:357
503
- msgid ""
504
- "Choose the URL that we will show to your customers when we refuse their purchase. Make sure it includes a message appropriate to the situation and give them useful information so they can solve "
505
- "it."
506
- msgstr ""
507
- "Selecione a URL que mostraremos aos seus clientes quando recusarmos a compra. Certifique-se de incluir uma mensagem adequada à situação e dê informações úteis para que eles possam solucionar a "
508
- "questão."
509
 
510
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:360
511
  msgid "Payment URL rejected"
@@ -544,8 +541,8 @@ msgid "Return to the store"
544
  msgstr "Voltar à loja"
545
 
546
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:489
547
- msgid "Your customer automatically return to the store after payment."
548
- msgstr "Seu cliente retorna automaticamente à loja após o pagamento."
549
 
550
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:491 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:548 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:631
551
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:898 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1018 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1051
@@ -565,13 +562,17 @@ msgstr "Mercado Pago - Checkout personalizado"
565
 
566
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:30
567
  msgid "Pay with debit and credit cards"
568
- msgstr "Pague com cartões de crédito ou débito"
569
 
570
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:153
571
- msgid "Checkout of payments with debit and credit cards<br> Accept payments instantly and maximize the conversion of your business %s"
572
- msgstr "Checkout de pagamentos com cartão<br> Aceite pagamentos no ato e leve suas cobranças a outro nível %s"
 
 
 
 
573
 
574
- #: includes/payments/WC_WooMercadoPago_CustomGateway.php:157
575
  msgid "Turn your online store into a secure and easy-to-use payment gateway for your customers. With personalized checkout your customers pay without leaving your store!"
576
  msgstr "Elabore e adapte a experiência de pagamento final que quiser oferecer no seu site ou aplicativo e maximize a conversão do seu negócio com as nossas opções de personalização!"
577
 
@@ -588,8 +589,8 @@ msgid "Advanced configuration of the personalized payment experience\""
588
  msgstr "Configuração Avançada das preferências de pagamento"
589
 
590
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:228
591
- msgid "Ready, your payment has been accepted!"
592
- msgstr "Pronto, seu pagamento foi aprovado!"
593
 
594
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:230
595
  msgid "We are processing your payment. In less than an hour we will send you the result by email."
@@ -688,8 +689,8 @@ msgid "<b>Follow these steps to activate Mercado Pago in your store:</b>"
688
  msgstr "<b>Siga estas etapas para ativar o Mercado Pago na sua loja:</b>"
689
 
690
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:395
691
- msgid "Upload your <b>credentials</b> to test the store and charge with your Mercado Pago account <b>depending on the country</b> in which you are registered."
692
- msgstr "Adicione suas <b>credenciais</b> para testar a loja e cobrar com sua conta do Mercado Pago <b>conforme o país</b> onde você está cadastrado."
693
 
694
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
695
  msgid "Approve your account to be able to charge."
@@ -704,16 +705,15 @@ msgid "Configure the <b>payment preferences</b> for your customers."
704
  msgstr "Configure as <b>preferências de pagamento</b> para seus clientes."
705
 
706
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:423
707
- msgid "Go to advanced settings of both the plugin and checkout only when you want to change the presets."
708
- msgstr "Faça as <b>configurações avançadas</b> tanto do plugin como do checkout somente quando quiser alterar os ajustes pré-definidos."
709
 
710
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
711
  msgid ""
712
- "Credentials are the keys we provide you to integrate quickly <br>and securely. You must have a %s in Mercado Pago to obtain and collect them <br>on your website. You do not need to know how to "
713
- "design or program to do it"
714
  msgstr ""
715
- "As credenciais são as senhas que informamos para que você integre de forma rápida <br>e segura. %s para ir a Produção e receber pagamentos <br> na sua loja. Você não precisa de conhecimentos de "
716
- "programação ou design para ativar o Mercado Pago na sua loja."
717
 
718
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:443
719
  msgid "approved account"
@@ -765,15 +765,15 @@ msgstr "Modo Produção"
765
 
766
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:612
767
  msgid "When you see that everything is going well, deactivate Sandbox, turn on Production and make way for your online sales."
768
- msgstr "Tudo em ordem? Desative o Sandbox e abra o caminho para suas vendas on-line."
769
 
770
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:625
771
- msgid "Productio"
772
  msgstr "Produção"
773
 
774
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
775
- msgid "Choose \"YES\" only when you are ready to sell. Change to NO to activate the Tests mode."
776
- msgstr "Escolha SIM para começar a receber pagamentos on-line. Mude para NÃO para experimentar sua loja antes de vender."
777
 
778
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
779
  msgid "Load credentials"
@@ -832,8 +832,8 @@ msgid "Store Category"
832
  msgstr "Categoria da loja"
833
 
834
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:851
835
- msgid "What category do your products belong to? Choose the one that best characterizes them (choose <br>\"other\" if your product is too specific)."
836
- msgstr "A qual categoria os seus produtos pertencem? Selecione a que melhor os caracteriza (selecione <br>“outro” se seu produto for muito específico)."
837
 
838
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:852
839
  msgid "Categories"
@@ -968,8 +968,8 @@ msgid "Accept and reject payments automatically. Do you want us to activate it?"
968
  msgstr "Aceita e recusa pagamentos de forma automática. Quer ativá-lo?"
969
 
970
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1064
971
- msgid "Gateway Discounts"
972
- msgstr "Descontos Gateway"
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."
@@ -992,16 +992,12 @@ msgid "Everything set up? Go to your store in Sandbox mode"
992
  msgstr "Tudo configurado? Vá para sua loja no modo Sandbox"
993
 
994
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1122
995
- msgid "You already went to Production. You just need your best customers <br> to arrive at your store to live the best online shopping experience with Mercado Pago."
996
- msgstr "Você está em produção. precisa que seus clientes venham até sua loja <br> para viver a melhor experiência de compras online com o Mercado Pago."
997
 
998
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1124
999
- msgid ""
1000
- "Visit your store as if you were one of your customers and check that everything is fine. If you already went to Production,<br> bring your customers and increase your sales with the best online "
1001
- "shopping experience."
1002
- msgstr ""
1003
- "Visite sua loja como se fosse um dos seus clientes e confira se está tudo em ordem. Se você já está no modo Produção, <br> traga os seus clientes e aumente suas vendas com a melhor experiência de "
1004
- "compra on-line."
1005
 
1006
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1141
1007
  msgid "Visit my store"
@@ -1016,10 +1012,14 @@ msgid "Pay with cash"
1016
  msgstr "Pagamentos via boleto e em lotéricas"
1017
 
1018
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:183
1019
- msgid "Checkout of payments with cash<br> Accept face-to-face payments, do not leave anyone out! %s"
1020
- msgstr "Checkout de pagamentos via boleto ou em lotérica<br> Aceite pagamentos presenciais e amplie as opções de compra! %s"
1021
 
1022
- #: includes/payments/WC_WooMercadoPago_TicketGateway.php:187
 
 
 
 
1023
  msgid "Include this preferred purchase option by some customers."
1024
  msgstr "Incluí esta opção de compra preferida por alguns clientes."
1025
 
@@ -1104,7 +1104,7 @@ msgid "This controls the title that the user sees during the payment process."
1104
  msgstr "Isso controla o título que o usuário vê durante o processo de pagamento."
1105
 
1106
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:236
1107
- msgid "nable free shipping for this shipping method"
1108
  msgstr "Ativar frete grátis para este método de envio"
1109
 
1110
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:240
@@ -1191,8 +1191,8 @@ msgstr "Outro cartão"
1191
  msgid "CVV"
1192
  msgstr "CVV"
1193
 
1194
- #: templates/checkout/custom_checkout.php:94 templates/checkout/custom_checkout.php:108 templates/checkout/custom_checkout.php:111 templates/checkout/custom_checkout.php:121
1195
- #: templates/checkout/custom_checkout.php:141 templates/checkout/custom_checkout.php:205
1196
  msgid "Card number"
1197
  msgstr "Número do cartão"
1198
 
@@ -1221,8 +1221,8 @@ msgid "Last 3 numbers on the back"
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?"
1226
 
1227
  #: templates/checkout/custom_checkout.php:153
1228
  msgid "Issuer"
@@ -1393,7 +1393,7 @@ msgid "Select the issuer with whom you want to process the payment"
1393
  msgstr "Por favor, selecione o meio de pagamento"
1394
 
1395
  #: woocommerce-mercadopago.php:48
1396
- msgid "WooCommerce Mercado Pago requires PHP version 5.6 or later. Please update your PHP version."
1397
  msgstr "O plugin do Mercado Pago para o WooCommerce requer o PHP versão 5.6 ou posterior. Por favor, atualize sua versão do PHP."
1398
 
1399
  #: woocommerce-mercadopago.php:65
@@ -1427,3 +1427,27 @@ msgstr "Ofereça todos os meios de pagamento: cartão de crédito, boleto, na lo
1427
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:28
1428
  msgid "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!"
1429
  msgstr "Aceite pagamentos com cartão no seu site com o melhor financiamento possível e maximize a conversão dos seus negócios. Com o checkout personalizado seus clientes pagam sair da sua sua loja!"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  # Copyright (C) 2019 Mercado Pago
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.1.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: 2019-12-23 17:12-0300\n"
13
+ "X-Generator: Poedit 2.2.4\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
16
  "Plural-Forms: nplurals=2; plural=(n > 1);\n"
17
  "Language: pt_BR\n"
18
 
19
  #. Plugin Name of the plugin
20
+ msgid "Mercado Pago payments for WooCommerce"
21
+ msgstr "Mercado Pago payments for WooCommerce"
22
 
23
  #. Plugin URI of the plugin
24
  msgid "https://github.com/mercadopago/cart-woocommerce"
91
 
92
  #: includes/module/WC_WooMercadoPago_Module.php:276
93
  msgid "Report Problem"
94
+ msgstr "Informar problema"
95
 
96
  #: includes/module/WC_WooMercadoPago_Module.php:293
97
  msgid "By Mercado Pago"
233
  msgid "The Mercado Pago request has failed"
234
  msgstr "A solicitação do Mercado Pago falhou"
235
 
236
+ #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:116 includes/notification/WC_WooMercadoPago_Notification_IPN.php:141 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:152
237
+ #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:170
238
  msgid "Buyer email"
239
  msgstr "E-mail do comprador"
240
 
241
+ #: includes/notification/WC_WooMercadoPago_Notification_IPN.php:119 includes/notification/WC_WooMercadoPago_Notification_IPN.php:144 includes/notification/WC_WooMercadoPago_Notification_Webhook.php:155
242
+ #: includes/notification/WC_WooMercadoPago_Notification_Webhook.php:173
243
  msgid "Payment method"
244
  msgstr "Meio de pagamento"
245
 
308
  msgstr "Desconto para o cupom %s"
309
 
310
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126 includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:128
311
+ msgid "discount of"
312
+ msgstr "desconto de"
313
 
314
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126
315
+ msgid " and fee of"
316
+ msgstr " e taxa de"
317
 
318
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:130
319
+ msgid "fee of"
320
+ msgstr "taxa de"
321
 
322
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:355
323
  msgid "Credentials for invalid production!"
348
  msgstr "Clique para tentar novamente"
349
 
350
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:77
351
+ msgid "Great, we processed your purchase order. Complete the payment with ticket so that we finish approving it."
352
+ msgstr "Ótimo, processamos seu pedido. Complete o pagamento com ticket para que possamos aprovar o pedido."
353
 
354
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:82
355
+ msgid "Print ticket"
356
+ msgstr "Imprimir boleto"
357
 
358
  #: includes/payments/mercadoenvios/WC_WooMercadoPago_Product_Recurrent.php:40
359
  msgid "Subscription Mercado Pago"
433
  msgstr "Data limite para gerar nova cobrança. Por padrão nunca, se deixado em branco."
434
 
435
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:27
436
+ msgid "Mercado Pago Checkout"
437
+ msgstr "Checkout Mercado Pago"
438
 
439
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:29
440
  msgid "Pay with the payment method you prefer"
441
  msgstr "Todos os meios de pagamento"
442
 
443
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:229
444
+ msgid "Mercado Pago checkout %s"
445
+ msgstr "Checkout Mercado Pago %s"
446
 
447
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:235
448
+ msgid "Accept all method of payment and take your charges to another level"
449
+ msgstr "Aceite todos os meios de pagamento e leve suas cobranças a outro nível"
450
+
451
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:239
452
  msgid "Turn your online store into your customers preferred payment gateway. Choose if the final payment experience will be inside or outside your store."
453
  msgstr "Transforme sua loja virtual no lugar de pagamentos preferido dos seus clientes. Escolha a experiência de pagamento final entre as opções disponíveis."
454
 
455
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:250 includes/payments/WC_WooMercadoPago_TicketGateway.php:204
456
+ msgid "Configure Mercado Pago for WooCommerce"
457
+ msgstr "Configure o Mercado Pago para WooCommerce"
458
 
459
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:263
460
+ msgid "Enable the experience of the Mercado Pago Checkout in your online store, select the means of payment available to your customers and<br> define the maximum fees in which they can pay you."
461
+ msgstr "Habilite a experiência do Checkout Mercado Pago na sua loja virtual, selecione os meios de pagamento disponíveis para seus clientes e<br> defina o número máximo de vezes que podem parcelar suas compras."
 
 
 
462
 
463
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:276 includes/payments/WC_WooMercadoPago_CustomGateway.php:187 includes/payments/WC_WooMercadoPago_TicketGateway.php:217
464
  msgid "Go to the basics. Place your business information."
469
  msgstr "Configure as preferências de pagamento na sua loja"
470
 
471
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
472
+ msgid "advanced settings"
473
+ msgstr "configuração avançada"
474
 
475
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
476
+ msgid "Payment experience"
477
+ msgstr "Experiência de pagamento"
478
 
479
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:317
480
  msgid "Define what payment experience your customers will have, whether inside or outside your store."
501
  msgstr "URL de sucesso"
502
 
503
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:357
504
+ msgid "Choose the URL that we will show to your customers when we refuse their purchase. Make sure it includes a message appropriate to the situation and give them useful information so they can solve it."
505
+ msgstr "Selecione a URL que mostraremos aos seus clientes quando recusarmos a compra. Certifique-se de incluir uma mensagem adequada à situação e informações úteis para que eles possam solucionar a questão."
 
 
 
 
506
 
507
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:360
508
  msgid "Payment URL rejected"
541
  msgstr "Voltar à loja"
542
 
543
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:489
544
+ msgid "Do you want your customer to automatically return to the store after payment?"
545
+ msgstr "Deseja que seu cliente retorne automaticamente à loja após o pagamento?"
546
 
547
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:491 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:548 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:631
548
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:898 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1018 includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1051
562
 
563
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:30
564
  msgid "Pay with debit and credit cards"
565
+ msgstr "Pague com cartões de crédito"
566
 
567
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:153
568
+ msgid "Checkout of payments with debit and credit cards %s"
569
+ msgstr "Checkout de pagamentos com cartão %s"
570
+
571
+ #: includes/payments/WC_WooMercadoPago_CustomGateway.php:158
572
+ msgid "Accept payments instantly and maximize the conversion of your business"
573
+ msgstr "Aceite pagamentos no ato e leve suas cobranças a outro nível"
574
 
575
+ #: includes/payments/WC_WooMercadoPago_CustomGateway.php:162
576
  msgid "Turn your online store into a secure and easy-to-use payment gateway for your customers. With personalized checkout your customers pay without leaving your store!"
577
  msgstr "Elabore e adapte a experiência de pagamento final que quiser oferecer no seu site ou aplicativo e maximize a conversão do seu negócio com as nossas opções de personalização!"
578
 
589
  msgstr "Configuração Avançada das preferências de pagamento"
590
 
591
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:228
592
+ msgid "That’s it, payment accepted!"
593
+ msgstr "Pronto, aceitamos seu pagamento!"
594
 
595
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:230
596
  msgid "We are processing your payment. In less than an hour we will send you the result by email."
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 <b>credentials</b> depending on the country in which you are registered."
693
+ msgstr "Adicione suas <b>credenciais</b> conforme o país onde você está cadastrado."
694
 
695
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
696
  msgid "Approve your account to be able to charge."
705
  msgstr "Configure as <b>preferências de pagamento</b> para seus 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 "Faça as <b>configurações avançadas</b> somente quando quiser alterar os ajustes pré-definidos."
710
 
711
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
712
  msgid ""
713
+ "Credentials are the keys we provide you to integrate quickly <br>and securely. You must have a %s in Mercado Pago to obtain and collect them <br>on your website. You do not need to know how to design or program to do it"
 
714
  msgstr ""
715
+ "As credenciais são as senhas que informamos para que você integre de forma rápida <br>e segura. %s para ir a Produção e receber pagamentos <br> na sua loja. Você não precisa de conhecimentos de programação ou design "
716
+ "para ativar o Mercado Pago na sua loja."
717
 
718
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:443
719
  msgid "approved account"
765
 
766
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:612
767
  msgid "When you see that everything is going well, deactivate Sandbox, turn on Production and make way for your online sales."
768
+ msgstr "Tudo pronto para começar a receber pagamentos, desative o ambiente Sandbox, selecione o de Produção e comece a receber pagamentos on-line."
769
 
770
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:625
771
+ msgid "Production"
772
  msgstr "Produção"
773
 
774
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
775
+ msgid "Choose YES only when you are ready to sell. Change to NO to activate the Tests mode."
776
+ msgstr "Escolha SIM para começar a receber pagamentos on-line. Mude para NÃO para ativar o modo de testes."
777
 
778
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
779
  msgid "Load credentials"
832
  msgstr "Categoria da loja"
833
 
834
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:851
835
+ msgid "What category do your products belong to? Choose the one that best characterizes them (choose \"other\" if your product is too specific)."
836
+ msgstr "A qual categoria os seus produtos pertencem? Selecione a que melhor os caracteriza (selecione outro” se seu produto for muito específico)."
837
 
838
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:852
839
  msgid "Categories"
968
  msgstr "Aceita e recusa pagamentos de forma automática. Quer ativá-lo?"
969
 
970
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1064
971
+ msgid "Discounts per purchase with Mercado Pago"
972
+ 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."
992
  msgstr "Tudo configurado? Vá para sua loja no modo Sandbox"
993
 
994
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1122
995
+ msgid "Visit your store as if you were one of your customers and check that everything is fine. If you already went to Production,<br> bring your customers and increase your sales with the best online shopping experience."
996
+ msgstr "Visite sua loja como se você fosse um de seus clientes e verifique se está tudo bem. Se você já foi à Produção,<br> traga seus clientes e aumente suas vendas com a melhor experiência de compra on-line."
997
 
998
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1124
999
+ msgid "Visit your store and simulate a payment to check that everything is fine."
1000
+ msgstr "Visite sua loja e simule um pagamento para verificar se está tudo bem."
 
 
 
 
1001
 
1002
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1141
1003
  msgid "Visit my store"
1012
  msgstr "Pagamentos via boleto e em lotéricas"
1013
 
1014
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:183
1015
+ msgid "Checkout of payments with cash %s"
1016
+ msgstr "Checkout de pagamentos via boleto ou em lotérica %s"
1017
 
1018
+ #: includes/payments/WC_WooMercadoPago_TicketGateway.php:192
1019
+ msgid "Accept face-to-face payments, do not leave anyone out!"
1020
+ msgstr "Aceite pagamentos presenciais e amplie as opções de compra!"
1021
+
1022
+ #: includes/payments/WC_WooMercadoPago_TicketGateway.php:197
1023
  msgid "Include this preferred purchase option by some customers."
1024
  msgstr "Incluí esta opção de compra preferida por alguns clientes."
1025
 
1104
  msgstr "Isso controla o título que o usuário vê durante o processo de pagamento."
1105
 
1106
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:236
1107
+ msgid "Enable free shipping for this shipping method"
1108
  msgstr "Ativar frete grátis para este método de envio"
1109
 
1110
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:240
1191
  msgid "CVV"
1192
  msgstr "CVV"
1193
 
1194
+ #: templates/checkout/custom_checkout.php:94 templates/checkout/custom_checkout.php:108 templates/checkout/custom_checkout.php:111 templates/checkout/custom_checkout.php:121 templates/checkout/custom_checkout.php:141
1195
+ #: templates/checkout/custom_checkout.php:205
1196
  msgid "Card number"
1197
  msgstr "Número do cartão"
1198
 
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"
1226
 
1227
  #: templates/checkout/custom_checkout.php:153
1228
  msgid "Issuer"
1393
  msgstr "Por favor, selecione o meio de pagamento"
1394
 
1395
  #: woocommerce-mercadopago.php:48
1396
+ msgid "Mercado Pago payments for WooCommerce requires PHP version 5.6 or later. Please update your PHP version."
1397
  msgstr "O plugin do Mercado Pago para o WooCommerce requer o PHP versão 5.6 ou posterior. Por favor, atualize sua versão do PHP."
1398
 
1399
  #: woocommerce-mercadopago.php:65
1427
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:28
1428
  msgid "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!"
1429
  msgstr "Aceite pagamentos com cartão no seu site com o melhor financiamento possível e maximize a conversão dos seus negócios. Com o checkout personalizado seus clientes pagam sair da sua sua loja!"
1430
+
1431
+ #: includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php:11
1432
+ msgid "Convert Currency"
1433
+ msgstr "Converter moeda"
1434
+
1435
+ #: includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php:12
1436
+ msgid "Activate this option so that the value of the currency set in WooCommerce is compatible with the value of the currency you use in Mercado Pago."
1437
+ msgstr "Ative esta opção para que o valor da moeda configurada no WooCommerce seja compatível ao valor da moeda que você usa no Mercado Pago."
1438
+
1439
+ #: includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php:13
1440
+ msgid "Now we convert your currency from {%s} to {%s}."
1441
+ msgstr "Agora convertemos sua moeda de {%s} para {%s}."
1442
+
1443
+ #: includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php:14
1444
+ msgid "We no longer convert your currency from {%s} to {%s}."
1445
+ msgstr "Paramos de converter sua moreda de {%s} para {%s}."
1446
+
1447
+ #: includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php:15
1448
+ msgid "<b>Attention:</b> The currency settings you have in WooCommerce are not compatible with the currency you use in your Mercado Pago account. Please activate the currency conversion."
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 "Select the payment methods available in your store."
1453
+ msgstr "Selecione os métodos de pagamento disponíveis em sua loja."
i18n/languages/woocommerce-mercadopago.pot CHANGED
@@ -1,21 +1,22 @@
1
  # Copyright (C) 2019 Mercado Pago
2
- # This file is distributed under the same license as the WooCommerce Mercado Pago plugin.
 
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WooCommerce Mercado Pago 4.0.8\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
- "X-Generator: WP-CLI 2.3.0\n"
15
  "X-Domain: woocommerce-mercadopago\n"
16
 
17
  #. Plugin Name of the plugin
18
- msgid "WooCommerce Mercado Pago"
19
  msgstr ""
20
 
21
  #. Plugin URI of the plugin
@@ -328,15 +329,15 @@ msgstr ""
328
 
329
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126
330
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:128
331
- msgid "Discount of"
332
  msgstr ""
333
 
334
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126
335
- msgid " and Rate of"
336
  msgstr ""
337
 
338
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:130
339
- msgid "Fee of"
340
  msgstr ""
341
 
342
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:355
@@ -369,11 +370,11 @@ msgid "Click to try again"
369
  msgstr ""
370
 
371
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:77
372
- msgid "Thanks for your order. Please pay the ticket to have your order approved."
373
  msgstr ""
374
 
375
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:82
376
- msgid "Print the ticket"
377
  msgstr ""
378
 
379
  #: includes/payments/mercadoenvios/WC_WooMercadoPago_Product_Recurrent.php:40
@@ -455,7 +456,7 @@ msgid "Deadline to generate new charges. By default as never, if it is blank."
455
  msgstr ""
456
 
457
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:27
458
- msgid "Mercado Pago - Basic Checkout"
459
  msgstr ""
460
 
461
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:29
@@ -463,20 +464,24 @@ msgid "Pay with the payment method you prefer"
463
  msgstr ""
464
 
465
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:229
466
- msgid "Basic Checkout Accept all method of payment and take your charges to another level %s"
467
  msgstr ""
468
 
469
- #: includes/payments/WC_WooMercadoPago_BasicGateway.php:233
 
 
 
 
470
  msgid "Turn your online store into your customers preferred payment gateway. Choose if the final payment experience will be inside or outside your store."
471
  msgstr ""
472
 
473
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:250
474
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:204
475
- msgid "Configure WooCommerce Mercado Pago"
476
  msgstr ""
477
 
478
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:263
479
- msgid "Enable the experience of the basic checkout of Mercado Pago in your online store, select the means of payment available to your customers and<br> define the maximum fees in which they can pay you."
480
  msgstr ""
481
 
482
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:276
@@ -490,11 +495,11 @@ msgid "Set payment preferences in your store"
490
  msgstr ""
491
 
492
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
493
- msgid "Advanced payment experience settings"
494
  msgstr ""
495
 
496
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
497
- msgid "Integration method"
498
  msgstr ""
499
 
500
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:317
@@ -566,7 +571,7 @@ msgid "Return to the store"
566
  msgstr ""
567
 
568
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:489
569
- msgid "Your customer automatically return to the store after payment."
570
  msgstr ""
571
 
572
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:491
@@ -599,10 +604,14 @@ msgid "Pay with debit and credit cards"
599
  msgstr ""
600
 
601
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:153
602
- msgid "Checkout of payments with debit and credit cards<br> Accept payments instantly and maximize the conversion of your business %s"
603
  msgstr ""
604
 
605
- #: includes/payments/WC_WooMercadoPago_CustomGateway.php:157
 
 
 
 
606
  msgid "Turn your online store into a secure and easy-to-use payment gateway for your customers. With personalized checkout your customers pay without leaving your store!"
607
  msgstr ""
608
 
@@ -619,7 +628,7 @@ msgid "Advanced configuration of the personalized payment experience\""
619
  msgstr ""
620
 
621
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:228
622
- msgid "Ready, your payment has been accepted!"
623
  msgstr ""
624
 
625
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:230
@@ -721,7 +730,7 @@ msgid "<b>Follow these steps to activate Mercado Pago in your store:</b>"
721
  msgstr ""
722
 
723
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:395
724
- msgid "Upload your <b>credentials</b> to test the store and charge with your Mercado Pago account <b>depending on the country</b> in which you are registered."
725
  msgstr ""
726
 
727
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
@@ -737,7 +746,7 @@ msgid "Configure the <b>payment preferences</b> for your customers."
737
  msgstr ""
738
 
739
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:423
740
- msgid "Go to advanced settings of both the plugin and checkout only when you want to change the presets."
741
  msgstr ""
742
 
743
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
@@ -799,11 +808,11 @@ msgid "When you see that everything is going well, deactivate Sandbox, turn on P
799
  msgstr ""
800
 
801
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:625
802
- msgid "Productio"
803
  msgstr ""
804
 
805
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
806
- msgid "Choose \"YES\" only when you are ready to sell. Change to NO to activate the Tests mode."
807
  msgstr ""
808
 
809
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
@@ -865,7 +874,7 @@ msgid "Store Category"
865
  msgstr ""
866
 
867
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:851
868
- msgid "What category do your products belong to? Choose the one that best characterizes them (choose <br>\"other\" if your product is too specific)."
869
  msgstr ""
870
 
871
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:852
@@ -1001,7 +1010,7 @@ msgid "Accept and reject payments automatically. Do you want us to activate it?"
1001
  msgstr ""
1002
 
1003
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1064
1004
- msgid "Gateway Discounts"
1005
  msgstr ""
1006
 
1007
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1066
@@ -1025,11 +1034,11 @@ msgid "Everything set up? Go to your store in Sandbox mode"
1025
  msgstr ""
1026
 
1027
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1122
1028
- msgid "You already went to Production. You just need your best customers <br> to arrive at your store to live the best online shopping experience with Mercado Pago."
1029
  msgstr ""
1030
 
1031
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1124
1032
- msgid "Visit your store as if you were one of your customers and check that everything is fine. If you already went to Production,<br> bring your customers and increase your sales with the best online shopping experience."
1033
  msgstr ""
1034
 
1035
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1141
@@ -1045,10 +1054,14 @@ msgid "Pay with cash"
1045
  msgstr ""
1046
 
1047
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:183
1048
- msgid "Checkout of payments with cash<br> Accept face-to-face payments, do not leave anyone out! %s"
 
 
 
 
1049
  msgstr ""
1050
 
1051
- #: includes/payments/WC_WooMercadoPago_TicketGateway.php:187
1052
  msgid "Include this preferred purchase option by some customers."
1053
  msgstr ""
1054
 
@@ -1136,7 +1149,7 @@ msgid "This controls the title that the user sees during the payment process."
1136
  msgstr ""
1137
 
1138
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:236
1139
- msgid "nable free shipping for this shipping method"
1140
  msgstr ""
1141
 
1142
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:240
@@ -1269,7 +1282,7 @@ msgid "Last 3 numbers on the back"
1269
  msgstr ""
1270
 
1271
  #: templates/checkout/custom_checkout.php:148
1272
- msgid "In how many installments do you want to pay?"
1273
  msgstr ""
1274
 
1275
  #: templates/checkout/custom_checkout.php:153
@@ -1451,7 +1464,7 @@ msgid "Select the issuer with whom you want to process the payment"
1451
  msgstr ""
1452
 
1453
  #: woocommerce-mercadopago.php:48
1454
- msgid "WooCommerce Mercado Pago requires PHP version 5.6 or later. Please update your PHP version."
1455
  msgstr ""
1456
 
1457
  #: woocommerce-mercadopago.php:65
@@ -1485,3 +1498,28 @@ msgstr ""
1485
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:28
1486
  msgid "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!"
1487
  msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  # Copyright (C) 2019 Mercado Pago
2
+ # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
+ #, fuzzy
4
  msgid ""
5
  msgstr ""
6
+ "Project-Id-Version: Mercado Pago payments for WooCommerce 4.1.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: 2019-12-23 11:44-0300\n"
14
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
15
+ "X-Generator: Poedit 2.2.4\n"
16
  "X-Domain: woocommerce-mercadopago\n"
17
 
18
  #. Plugin Name of the plugin
19
+ msgid "Mercado Pago payments for WooCommerce"
20
  msgstr ""
21
 
22
  #. Plugin URI of the plugin
329
 
330
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126
331
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:128
332
+ msgid "discount of"
333
  msgstr ""
334
 
335
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:126
336
+ msgid " and fee of"
337
  msgstr ""
338
 
339
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:130
340
+ msgid "fee of"
341
  msgstr ""
342
 
343
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php:355
370
  msgstr ""
371
 
372
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:77
373
+ msgid "Great, we processed your purchase order. Complete the payment with ticket so that we finish approving it."
374
  msgstr ""
375
 
376
  #: includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php:82
377
+ msgid "Print ticket"
378
  msgstr ""
379
 
380
  #: includes/payments/mercadoenvios/WC_WooMercadoPago_Product_Recurrent.php:40
456
  msgstr ""
457
 
458
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:27
459
+ msgid "Mercado Pago Checkout"
460
  msgstr ""
461
 
462
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:29
464
  msgstr ""
465
 
466
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:229
467
+ msgid "Mercado Pago checkout %s"
468
  msgstr ""
469
 
470
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:235
471
+ msgid "Accept all method of payment and take your charges to another level"
472
+ msgstr ""
473
+
474
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:239
475
  msgid "Turn your online store into your customers preferred payment gateway. Choose if the final payment experience will be inside or outside your store."
476
  msgstr ""
477
 
478
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:250
479
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:204
480
+ msgid "Configure Mercado Pago for WooCommerce"
481
  msgstr ""
482
 
483
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:263
484
+ msgid "Enable the experience of the Mercado Pago Checkout in your online store, select the means of payment available to your customers and<br> define the maximum fees in which they can pay you."
485
  msgstr ""
486
 
487
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:276
495
  msgstr ""
496
 
497
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:302
498
+ msgid "advanced settings"
499
  msgstr ""
500
 
501
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:315
502
+ msgid "Payment experience"
503
  msgstr ""
504
 
505
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:317
571
  msgstr ""
572
 
573
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:489
574
+ msgid "Do you want your customer to automatically return to the store after payment?"
575
  msgstr ""
576
 
577
  #: includes/payments/WC_WooMercadoPago_BasicGateway.php:491
604
  msgstr ""
605
 
606
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:153
607
+ msgid "Checkout of payments with debit and credit cards %s"
608
  msgstr ""
609
 
610
+ #: includes/payments/WC_WooMercadoPago_CustomGateway.php:158
611
+ msgid "Accept payments instantly and maximize the conversion of your business"
612
+ msgstr ""
613
+
614
+ #: includes/payments/WC_WooMercadoPago_CustomGateway.php:162
615
  msgid "Turn your online store into a secure and easy-to-use payment gateway for your customers. With personalized checkout your customers pay without leaving your store!"
616
  msgstr ""
617
 
628
  msgstr ""
629
 
630
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:228
631
+ msgid "That’s it, payment accepted!"
632
  msgstr ""
633
 
634
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:230
730
  msgstr ""
731
 
732
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:395
733
+ msgid "Upload your <b>credentials</b> depending on the country in which you are registered."
734
  msgstr ""
735
 
736
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:402
746
  msgstr ""
747
 
748
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:423
749
+ msgid "<b>Go to advanced settings</b> only when you want to change the presets."
750
  msgstr ""
751
 
752
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:442
808
  msgstr ""
809
 
810
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:625
811
+ msgid "Production"
812
  msgstr ""
813
 
814
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:627
815
+ msgid "Choose YES only when you are ready to sell. Change to NO to activate the Tests mode."
816
  msgstr ""
817
 
818
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:649
874
  msgstr ""
875
 
876
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:851
877
+ msgid "What category do your products belong to? Choose the one that best characterizes them (choose \"other\" if your product is too specific)."
878
  msgstr ""
879
 
880
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:852
1010
  msgstr ""
1011
 
1012
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1064
1013
+ msgid "Discounts per purchase with Mercado Pago"
1014
  msgstr ""
1015
 
1016
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1066
1034
  msgstr ""
1035
 
1036
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1122
1037
+ msgid "Visit your store as if you were one of your customers and check that everything is fine. If you already went to Production,<br> bring your customers and increase your sales with the best online shopping experience."
1038
  msgstr ""
1039
 
1040
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1124
1041
+ msgid "Visit your store and simulate a payment to check that everything is fine."
1042
  msgstr ""
1043
 
1044
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1141
1054
  msgstr ""
1055
 
1056
  #: includes/payments/WC_WooMercadoPago_TicketGateway.php:183
1057
+ msgid "Checkout of payments with cash %s"
1058
+ msgstr ""
1059
+
1060
+ #: includes/payments/WC_WooMercadoPago_TicketGateway.php:192
1061
+ msgid "Accept face-to-face payments, do not leave anyone out!"
1062
  msgstr ""
1063
 
1064
+ #: includes/payments/WC_WooMercadoPago_TicketGateway.php:197
1065
  msgid "Include this preferred purchase option by some customers."
1066
  msgstr ""
1067
 
1149
  msgstr ""
1150
 
1151
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:236
1152
+ msgid "Enable free shipping for this shipping method"
1153
  msgstr ""
1154
 
1155
  #: includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php:240
1282
  msgstr ""
1283
 
1284
  #: templates/checkout/custom_checkout.php:148
1285
+ msgid "In how many installments do you want to pay"
1286
  msgstr ""
1287
 
1288
  #: templates/checkout/custom_checkout.php:153
1464
  msgstr ""
1465
 
1466
  #: woocommerce-mercadopago.php:48
1467
+ msgid "Mercado Pago payments for WooCommerce requires PHP version 5.6 or later. Please update your PHP version."
1468
  msgstr ""
1469
 
1470
  #: woocommerce-mercadopago.php:65
1498
  #: includes/payments/WC_WooMercadoPago_CustomGateway.php:28
1499
  msgid "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!"
1500
  msgstr ""
1501
+
1502
+ #: includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php:11
1503
+ msgid "Convert Currency"
1504
+ msgstr ""
1505
+
1506
+ #: includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php:12
1507
+ msgid "Activate this option so that the value of the currency set in WooCommerce is compatible with the value of the currency you use in Mercado Pago."
1508
+ msgstr ""
1509
+
1510
+ #: includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php:13
1511
+ msgid "Now we convert your currency from {%s} to {%s}."
1512
+ msgstr ""
1513
+
1514
+ #: includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php:14
1515
+ msgid "We no longer convert your currency from {%s} to {%s}."
1516
+ msgstr ""
1517
+
1518
+ #: includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php:15
1519
+ msgid "<b>Attention:</b> The currency settings you have in WooCommerce are not compatible with the currency you use in your Mercado Pago account. Please activate the currency conversion."
1520
+ msgstr ""
1521
+
1522
+ #: includes/payments/WC_WooMercadoPago_BasicGateway.php:471
1523
+ #: includes/payments/WC_WooMercadoPago_TicketGateway.php:331
1524
+ msgid "Select the payment methods available in your store."
1525
+ msgstr ""
includes/admin/WC_MercadoEnvios_Admin_Orders.php DELETED
@@ -1,75 +0,0 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- }
5
-
6
- /**
7
- * MercadoEnvios orders.
8
- */
9
- class WC_MercadoEnvios_Admin_Orders {
10
-
11
- /**
12
- * Initialize the order actions.
13
- */
14
- public function __construct() {
15
- add_action( 'add_meta_boxes', array( $this, 'register_metabox' ) );
16
- }
17
-
18
- /**
19
- * Register tracking code metabox.
20
- */
21
- public function register_metabox() {
22
- global $post;
23
- $order = wc_get_order( $post->ID );
24
- $shipment_id = ( method_exists( $order, 'get_meta' ) ) ?
25
- $order->get_meta( '_mercadoenvios_shipment_id' ) :
26
- get_post_meta( $post->ID, '_mercadoenvios_shipment_id', true );
27
- if ( isset( $shipment_id ) && ! empty( $shipment_id ) ) {
28
- add_meta_box(
29
- 'wc_mercadoenvios',
30
- 'Mercado Envios',
31
- array( $this, 'metabox_content' ),
32
- 'shop_order',
33
- 'side',
34
- 'high'
35
- );
36
- }
37
- }
38
-
39
- /**
40
- * @param $post
41
- * @throws WC_WooMercadoPago_Exception
42
- */
43
- public function metabox_content( $post ) {
44
- $order = wc_get_order( $post->ID );
45
- $shipment_id = ( method_exists( $order, 'get_meta' ) ) ?
46
- $order->get_meta( '_mercadoenvios_shipment_id' ) :
47
- get_post_meta( $post->ID, '_mercadoenvios_shipment_id', true );
48
- $status = ( method_exists( $order, 'get_meta' ) ) ?
49
- $order->get_meta( '_mercadoenvios_status' ) :
50
- get_post_meta( $post->ID, '_mercadoenvios_status', true );
51
- $tracking_number = ( method_exists( $order, 'get_meta' ) ) ?
52
- $order->get_meta( '_mercadoenvios_tracking_number' ) :
53
- get_post_meta( $post->ID, '_mercadoenvios_tracking_number', true );
54
-
55
- if ( isset( $status ) && $status != '' && $status != 'pending' ) {
56
- echo '<label for="mercadoenvios_tracking_code">' . esc_html__( 'Tracking code:', 'woocommerce-mercadopago' ) . '</label><br />';
57
- echo '<input type="text" id="mercadoenvios_tracking_code" name="mercadoenvios_tracking_code" value="' .
58
- esc_attr( $tracking_number ) . '" style="width:100%; text-align:center;" />';
59
- // Check exist shipment_id
60
- if ( isset( $shipment_id ) && $shipment_id != '' ) {
61
- $mp = WC_WooMercadoPago_Module::getMpInstanceSingleton();
62
- $email = ( wp_get_current_user()->ID != 0 ) ? wp_get_current_user()->user_email : null;
63
- $mp->set_email( $email );
64
- echo '<br /><label for="mercadoenvios_tracking_number">' . esc_html__( 'Tag:', 'woocommerce-mercadopago' ) . '</label><br />';
65
- echo '<a href="https://api.mercadolibre.com/shipment_labels?shipment_ids=' . esc_attr( $shipment_id ) .
66
- '&savePdf=Y&access_token=' . $mp->get_access_token() .
67
- '" style="width:100%; text-align:center;" class="button" target="_blank">' . esc_html__( 'Print', 'woocommerce-mercadopago' ) . '</a>';
68
- }
69
- } else {
70
- echo '<label for="mercadoenvios_tracking_number">' . esc_html__( 'Shipping is pending', 'woocommerce-mercadopago' ) . '</label><br />';
71
- }
72
- }
73
- }
74
-
75
- new WC_MercadoEnvios_Admin_Orders();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php ADDED
@@ -0,0 +1,425 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class WC_WooMercadoPago_Helpers_CurrencyConverter
5
+ */
6
+ class WC_WooMercadoPago_Helpers_CurrencyConverter
7
+ {
8
+ const CONFIG_KEY = 'currency_conversion';
9
+ const DEFAULT_RATIO = 1;
10
+ const MSG_TITLE = 'Convert Currency';
11
+ const MSG_DESCRIPTION = 'Activate this option so that the value of the currency set in WooCommerce is compatible with the value of the currency you use in Mercado Pago.';
12
+ const NOTICE_ENABLED = 'Now we convert your currency from {%s} to {%s}.';
13
+ const NOTICE_DISABLED = 'We no longer convert your currency from {%s} to {%s}.';
14
+ const NOTICE_WARNING = '<b>Attention:</b> The currency settings you have in WooCommerce are not compatible with the currency you use in your Mercado Pago account. Please activate the currency conversion.';
15
+
16
+ /** @var WC_WooMercadoPago_Helpers_CurrencyConverter */
17
+ private static $instance;
18
+
19
+ /**
20
+ * @var array
21
+ */
22
+ private $ratios = [];
23
+
24
+ /**
25
+ * @var array
26
+ */
27
+ private $cache = [];
28
+
29
+ /**
30
+ * @var array
31
+ */
32
+ private $currencyCache = [];
33
+
34
+ /**
35
+ * @var
36
+ */
37
+ private $supportedCurrencies;
38
+
39
+ /**
40
+ * @var bool
41
+ */
42
+ private $isShowingAlert = false;
43
+
44
+ /** @var WC_WooMercadoPago_Log */
45
+ private $log;
46
+
47
+ /**
48
+ * Private constructor to make class singleton
49
+ */
50
+ private function __construct()
51
+ {
52
+ $this->log = new WC_WooMercadoPago_Log();
53
+ return $this;
54
+ }
55
+
56
+ /**
57
+ * @return static
58
+ */
59
+ public static function getInstance()
60
+ {
61
+ if (is_null(self::$instance)) {
62
+ self::$instance = new static();
63
+ }
64
+
65
+ return self::$instance;
66
+ }
67
+
68
+ /**
69
+ * @param WC_WooMercadoPago_PaymentAbstract $method
70
+ * @return $this
71
+ */
72
+ private function init(WC_WooMercadoPago_PaymentAbstract $method)
73
+ {
74
+ if (!isset($this->ratios[$method->id])) {
75
+
76
+ try {
77
+ if (!$this->isEnabled($method)) {
78
+ $this->setRatio($method->id);
79
+ return $this;
80
+ }
81
+
82
+ $accountCurrency = $this->getAccountCurrency($method);
83
+ $localCurrency = get_woocommerce_currency();
84
+
85
+ if (!$accountCurrency || $accountCurrency == $localCurrency) {
86
+ $this->setRatio($method->id);
87
+ return $this;
88
+ }
89
+
90
+ $this->setRatio($method->id, $this->loadRatio($localCurrency, $accountCurrency));
91
+ } catch (Exception $e) {
92
+ $this->setRatio($method->id);
93
+ }
94
+ }
95
+
96
+ return $this;
97
+ }
98
+
99
+ /**
100
+ * @param WC_WooMercadoPago_PaymentAbstract $method
101
+ * @return mixed|null
102
+ */
103
+ private function getAccountCurrency(WC_WooMercadoPago_PaymentAbstract $method)
104
+ {
105
+ $key = $method->id;
106
+
107
+ if (isset($this->currencyCache[$key])) {
108
+ return $this->currencyCache[$key];
109
+ }
110
+
111
+ $siteId = $this->getSiteId($this->getAccessToken($method));
112
+
113
+ if (!$siteId) {
114
+ return null;
115
+ }
116
+
117
+ $configs = $this->getCountryConfigs();
118
+
119
+ if (!isset($configs[$siteId]) || !isset($configs[$siteId]['currency'])) {
120
+ return null;
121
+ }
122
+
123
+ return isset($configs[$siteId]) ? $configs[$siteId]['currency'] : null;
124
+ }
125
+
126
+ /**
127
+ * @return array
128
+ */
129
+ private function getCountryConfigs()
130
+ {
131
+ try {
132
+ $configInstance = new WC_WooMercadoPago_Configs();
133
+ return $configInstance->getCountryConfigs();
134
+ } catch (Exception $e) {
135
+ return [];
136
+ }
137
+ }
138
+
139
+ /**
140
+ * @param WC_WooMercadoPago_PaymentAbstract $method
141
+ * @return mixed
142
+ */
143
+ private function getAccessToken(WC_WooMercadoPago_PaymentAbstract $method)
144
+ {
145
+ $type = $method->getOption('checkout_credential_production') == 'no'
146
+ ? '_mp_access_token_test'
147
+ : '_mp_access_token_prod';
148
+
149
+ return $method->getOption($type);
150
+ }
151
+
152
+ /**
153
+ * @param WC_WooMercadoPago_PaymentAbstract $method
154
+ * @return mixed
155
+ */
156
+ public function isEnabled(WC_WooMercadoPago_PaymentAbstract $method)
157
+ {
158
+ return $method->getoption(self::CONFIG_KEY, 'no') == 'yes' ? true : false;
159
+ }
160
+
161
+ /**
162
+ * @param $methodId
163
+ * @param int $value
164
+ */
165
+ private function setRatio($methodId, $value = self::DEFAULT_RATIO)
166
+ {
167
+ $this->ratios[$methodId] = $value;
168
+ }
169
+
170
+ /**
171
+ * @param WC_WooMercadoPago_PaymentAbstract $method
172
+ * @return int|mixed
173
+ */
174
+ private function getRatio(WC_WooMercadoPago_PaymentAbstract $method)
175
+ {
176
+ $this->init($method);
177
+ return isset($this->ratios[$method->id])
178
+ ? $this->ratios[$method->id]
179
+ : self::DEFAULT_RATIO;
180
+ }
181
+
182
+ /**
183
+ * @param $fromCurrency
184
+ * @param $toCurrency
185
+ * @return int
186
+ */
187
+ public function loadRatio($fromCurrency, $toCurrency)
188
+ {
189
+ $cacheKey = $fromCurrency . '--' . $toCurrency;
190
+
191
+ if (isset($this->cache[$cacheKey])) {
192
+ return $this->cache[$cacheKey];
193
+ }
194
+
195
+ $ratio = self::DEFAULT_RATIO;
196
+
197
+ if ($fromCurrency == $toCurrency) {
198
+ $this->cache[$cacheKey] = $ratio;
199
+ return $ratio;
200
+ }
201
+
202
+ try {
203
+ $result = MeliRestClient::get(
204
+ array('uri' => sprintf('/currency_conversions/search?from=%s&to=%s', $fromCurrency, $toCurrency))
205
+ );
206
+
207
+ if (isset($result['response'], $result['response']['ratio'])) {
208
+ $ratio = $result['response']['ratio'] > 0 ? $result['response']['ratio'] : self::DEFAULT_RATIO;
209
+ }
210
+ } catch (Exception $e) {
211
+ //error getting from API
212
+ $this->log->write_log(
213
+ "WC_WooMercadoPago_Helpers_CurrencyConverter::loadRatio('$fromCurrency', '$toCurrency')",
214
+ $e->__toString()
215
+ );
216
+ }
217
+
218
+ $this->cache[$cacheKey] = $ratio;
219
+ return $ratio;
220
+ }
221
+
222
+ /**
223
+ * @param $accessToken
224
+ * @return string | null
225
+ */
226
+ private function getSiteId($accessToken)
227
+ {
228
+ try {
229
+ $mp = new MP($accessToken);
230
+ $result = $mp->get(sprintf('/users/me?access_token=%s', $accessToken));
231
+ return isset($result['response'], $result['response']['site_id']) ? $result['response']['site_id'] : null;
232
+ } catch (Exception $e) {
233
+ return null;
234
+ }
235
+ }
236
+
237
+ /**
238
+ * @param WC_WooMercadoPago_PaymentAbstract $method
239
+ * @return float
240
+ */
241
+ public function ratio(WC_WooMercadoPago_PaymentAbstract $method)
242
+ {
243
+ $this->init($method);
244
+ return $this->getRatio($method);
245
+ }
246
+
247
+ /**
248
+ * @param WC_WooMercadoPago_PaymentAbstract $method
249
+ * @return string|void
250
+ */
251
+ public function getDescription(WC_WooMercadoPago_PaymentAbstract $method)
252
+ {
253
+ return $this->__(self::MSG_DESCRIPTION);
254
+ }
255
+
256
+ /**
257
+ * Check if currency is supported in mercado pago API
258
+ * @param $currency
259
+ * @return bool
260
+ */
261
+ private function isCurrencySupported($currency)
262
+ {
263
+ foreach ($this->getSupportedCurrencies() as $country) {
264
+ if ($country['id'] == $currency) {
265
+ return true;
266
+ }
267
+ }
268
+
269
+ return false;
270
+ }
271
+
272
+ /**
273
+ * Get supported currencies from mercado pago API
274
+ * @return array|bool
275
+ */
276
+ public function getSupportedCurrencies()
277
+ {
278
+ if (is_null($this->supportedCurrencies)) {
279
+ try {
280
+ $result = MeliRestClient::get(['uri' => '/currencies']);
281
+
282
+ if (!isset($result['response'])) {
283
+ return false;
284
+ }
285
+
286
+ $this->supportedCurrencies = $result['response'];
287
+ } catch (Exception $e) {
288
+ $this->supportedCurrencies = [];
289
+ }
290
+ }
291
+
292
+ return $this->supportedCurrencies;
293
+ }
294
+
295
+ /**
296
+ * @param WC_WooMercadoPago_PaymentAbstract $method
297
+ * @return array
298
+ */
299
+ public function getField(WC_WooMercadoPago_PaymentAbstract $method)
300
+ {
301
+ return array(
302
+ 'title' => $this->__(self::MSG_TITLE),
303
+ 'type' => 'select',
304
+ 'default' => 'no',
305
+ 'description' => $this->__(self::MSG_DESCRIPTION),
306
+ 'options' => array(
307
+ 'no' => $this->__('No'),
308
+ 'yes' => $this->__('Yes'),
309
+ ),
310
+ );
311
+ }
312
+
313
+ /**
314
+ * @param WC_WooMercadoPago_PaymentAbstract $method
315
+ * @param $oldData
316
+ * @param $newData
317
+ */
318
+ public function scheduleNotice(WC_WooMercadoPago_PaymentAbstract $method, $oldData, $newData)
319
+ {
320
+ if (!isset($oldData[self::CONFIG_KEY]) || !isset($newData[self::CONFIG_KEY])) {
321
+ return;
322
+ }
323
+
324
+ if ($oldData[self::CONFIG_KEY] != $newData[self::CONFIG_KEY]) {
325
+ $_SESSION[self::CONFIG_KEY]['notice'] = array(
326
+ 'type' => $newData[self::CONFIG_KEY] == 'yes' ? 'enabled' : 'disabled',
327
+ 'method' => $method,
328
+ );
329
+ }
330
+ }
331
+
332
+ /**
333
+ * @param WC_WooMercadoPago_PaymentAbstract $method
334
+ */
335
+ public function notices(WC_WooMercadoPago_PaymentAbstract $method)
336
+ {
337
+ $show = isset($_SESSION[self::CONFIG_KEY]) ? $_SESSION[self::CONFIG_KEY] : array();
338
+ $localCurrency = get_woocommerce_currency();
339
+
340
+ if ($localCurrency == $this->getAccountCurrency($method)) {
341
+ return;
342
+ }
343
+
344
+ if (isset($show['notice'])) {
345
+ unset($_SESSION[self::CONFIG_KEY]['notice']);
346
+ if ($show['notice']['type'] == 'enabled') {
347
+ echo $this->noticeEnabled($method);
348
+ } elseif ($show['notice']['type'] == 'disabled') {
349
+ echo $this->noticeDisabled($method);
350
+ }
351
+ }
352
+
353
+ if (!$this->isEnabled($method) && !$this->isShowingAlert && $method->isCurrencyConvertable()) {
354
+ echo $this->noticeWarning($method);
355
+ }
356
+ }
357
+
358
+ /**
359
+ * @param WC_WooMercadoPago_PaymentAbstract $method
360
+ * @return string
361
+ */
362
+ public function noticeEnabled(WC_WooMercadoPago_PaymentAbstract $method)
363
+ {
364
+ $localCurrency = get_woocommerce_currency();
365
+ $currency = $this->getAccountCurrency($method);
366
+
367
+ return '
368
+ <div class="notice notice-success">
369
+ <p>' . $this->__(self::NOTICE_ENABLED, $localCurrency, $currency) . '</p>
370
+ </div>
371
+ ';
372
+ }
373
+
374
+ /**
375
+ * @param WC_WooMercadoPago_PaymentAbstract $method
376
+ * @return string
377
+ */
378
+ public function noticeDisabled(WC_WooMercadoPago_PaymentAbstract $method)
379
+ {
380
+ $localCurrency = get_woocommerce_currency();
381
+ $currency = $this->getAccountCurrency($method);
382
+
383
+ return '
384
+ <div class="notice notice-error">
385
+ <p>' . $this->__(self::NOTICE_DISABLED, $localCurrency, $currency) . '</p>
386
+ </div>
387
+ ';
388
+ }
389
+
390
+ /**
391
+ * @param WC_WooMercadoPago_PaymentAbstract $method
392
+ * @return string
393
+ */
394
+ public function noticeWarning(WC_WooMercadoPago_PaymentAbstract $method)
395
+ {
396
+ global $current_section;
397
+
398
+ if (in_array($current_section, array($method->id, sanitize_title(get_class($method))), true)) {
399
+ $this->isShowingAlert = true;
400
+
401
+ $type = 'notice-error';
402
+ $message = $this->__(self::NOTICE_WARNING);
403
+
404
+ return WC_WooMercadoPago_Configs::getAlertFrame($message, $type);
405
+ }
406
+
407
+ return '';
408
+ }
409
+
410
+ /**
411
+ * @param $str
412
+ * @param mixed ...$values
413
+ * @return string|void
414
+ */
415
+ private function __($str, ...$values)
416
+ {
417
+ $translated = __($str, 'woocommerce-mercadopago');
418
+
419
+ if (!empty($values)) {
420
+ $translated = vsprintf($translated, $values);
421
+ }
422
+
423
+ return $translated;
424
+ }
425
+ }
includes/module/WC_WooMercadoPago_Configs.php CHANGED
@@ -50,7 +50,7 @@ class WC_WooMercadoPago_Configs
50
  }
51
 
52
  $ticketMethods = get_option('_all_payment_methods_ticket', '');
53
- if (empty($ticketMethods)) {
54
  $this->updateTicketMethods();
55
  }
56
 
@@ -97,11 +97,9 @@ class WC_WooMercadoPago_Configs
97
  */
98
  public function noticeUpdateAccessToken()
99
  {
100
- echo '<div class="error is-dismissible">
101
- <p><strong>MERCADO PAGO: </strong>'
102
- . __('Actualizá tus credenciales con las claves Access Token y Public Key ¡las necesitás para seguir recibiendo pagos!', 'woocommerce-mercadopado') . '
103
- </p>
104
- </div>';
105
  }
106
 
107
  /**
@@ -109,15 +107,9 @@ class WC_WooMercadoPago_Configs
109
  */
110
  public function noticeHttps()
111
  {
 
112
  $message = __('The store must have HTTPS to see the payment methods.', 'woocommerce-mercadopago');
113
- echo '<div class="notice notice-warning is-dismissible">
114
- <p>
115
- <strong>MERCADO PAGO:</strong> ' . $message . '
116
- </p>
117
- <button type="button" class="notice-dismiss">
118
- <span class="screen-reader-text">' . __('Discard', 'woocommerce-mercadopago') . '</span>
119
- </button>
120
- </div>';
121
  }
122
 
123
  /**
@@ -134,6 +126,10 @@ class WC_WooMercadoPago_Configs
134
  if (strpos(get_option('_mp_public_key'), 'APP_USR') === 0 && strpos(get_option('_mp_access_token'), 'APP_USR') === 0) {
135
  update_option('_mp_public_key_prod', get_option('_mp_public_key'), true);
136
  update_option('_mp_access_token_prod', get_option('_mp_access_token'), true);
 
 
 
 
137
  update_option('checkout_credential_production', 'yes', true);
138
  }
139
  }
@@ -141,7 +137,7 @@ class WC_WooMercadoPago_Configs
141
  /**
142
  * Country Configs
143
  */
144
- public function getCountryConfigs()
145
  {
146
  return array(
147
  'MCO' => array(
@@ -149,56 +145,64 @@ class WC_WooMercadoPago_Configs
149
  'sponsor_id' => 208687643,
150
  'checkout_banner' => plugins_url('../../assets/images/MCO/standard_mco.jpg', __FILE__),
151
  'checkout_banner_custom' => plugins_url('../../assets/images/MCO/credit_card.png', __FILE__),
152
- 'currency' => 'COP'
 
153
  ),
154
  'MLA' => array(
155
  'site_id' => 'MLA',
156
  'sponsor_id' => 208682286,
157
  'checkout_banner' => plugins_url('../../assets/images/MLA/standard_mla.jpg', __FILE__),
158
  'checkout_banner_custom' => plugins_url('../../assets/images/MLA/credit_card.png', __FILE__),
159
- 'currency' => 'ARS'
 
160
  ),
161
  'MLB' => array(
162
  'site_id' => 'MLB',
163
  'sponsor_id' => 208686191,
164
  'checkout_banner' => plugins_url('../../assets/images/MLB/standard_mlb.jpg', __FILE__),
165
  'checkout_banner_custom' => plugins_url('../../assets/images/MLB/credit_card.png', __FILE__),
166
- 'currency' => 'BRL'
 
167
  ),
168
  'MLC' => array(
169
  'site_id' => 'MLC',
170
  'sponsor_id' => 208690789,
171
  'checkout_banner' => plugins_url('../../assets/images/MLC/standard_mlc.gif', __FILE__),
172
  'checkout_banner_custom' => plugins_url('../../assets/images/MLC/credit_card.png', __FILE__),
173
- 'currency' => 'CLP'
 
174
  ),
175
  'MLM' => array(
176
  'site_id' => 'MLM',
177
  'sponsor_id' => 208692380,
178
  'checkout_banner' => plugins_url('../../assets/images/MLM/standard_mlm.jpg', __FILE__),
179
  'checkout_banner_custom' => plugins_url('../../assets/images/MLM/credit_card.png', __FILE__),
180
- 'currency' => 'MXN'
 
181
  ),
182
  'MLU' => array(
183
  'site_id' => 'MLU',
184
  'sponsor_id' => 243692679,
185
  'checkout_banner' => plugins_url('../../assets/images/MLU/standard_mlu.png', __FILE__),
186
  'checkout_banner_custom' => plugins_url('../../assets/images/MLU/credit_card.png', __FILE__),
187
- 'currency' => 'UYU'
 
188
  ),
189
  'MLV' => array(
190
  'site_id' => 'MLV',
191
  'sponsor_id' => 208692735,
192
  'checkout_banner' => plugins_url('../../assets/images/MLV/standard_mlv.jpg', __FILE__),
193
  'checkout_banner_custom' => plugins_url('../../assets/images/MLV/credit_card.png', __FILE__),
194
- 'currency' => 'VEF'
 
195
  ),
196
  'MPE' => array(
197
  'site_id' => 'MPE',
198
  'sponsor_id' => 216998692,
199
  'checkout_banner' => plugins_url('../../assets/images/MPE/standard_mpe.png', __FILE__),
200
  'checkout_banner_custom' => plugins_url('../../assets/images/MPE/credit_card.png', __FILE__),
201
- 'currency' => 'PEN'
 
202
  )
203
  );
204
  }
@@ -232,17 +236,6 @@ class WC_WooMercadoPago_Configs
232
  );
233
  }
234
 
235
- /**
236
- * @param $methods
237
- * @return mixed
238
- */
239
- public function setShipping($methods)
240
- {
241
- $methods['woo-mercado-pago-me-normal'] = 'WC_MercadoEnvios_Shipping_Normal';
242
- $methods['woo-mercado-pago-me-express'] = 'WC_MercadoEnvios_Shipping_Express';
243
- return $methods;
244
- }
245
-
246
  /**
247
  * @param $methods
248
  * @return array
@@ -264,5 +257,27 @@ class WC_WooMercadoPago_Configs
264
  return $methods;
265
  }
266
 
267
-
268
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  }
51
 
52
  $ticketMethods = get_option('_all_payment_methods_ticket', '');
53
+ if (empty($ticketMethods) || !is_array($ticketMethods)) {
54
  $this->updateTicketMethods();
55
  }
56
 
97
  */
98
  public function noticeUpdateAccessToken()
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 self::getAlertFrame($message, $type);
 
 
103
  }
104
 
105
  /**
107
  */
108
  public function noticeHttps()
109
  {
110
+ $type = 'notice-warning';
111
  $message = __('The store must have HTTPS to see the payment methods.', 'woocommerce-mercadopago');
112
+ echo self::getAlertFrame($message, $type);
 
 
 
 
 
 
 
113
  }
114
 
115
  /**
126
  if (strpos(get_option('_mp_public_key'), 'APP_USR') === 0 && strpos(get_option('_mp_access_token'), 'APP_USR') === 0) {
127
  update_option('_mp_public_key_prod', get_option('_mp_public_key'), true);
128
  update_option('_mp_access_token_prod', get_option('_mp_access_token'), true);
129
+ if(!empty(get_option('_mp_public_key_prod', '')) && !empty(get_option('_mp_access_token_prod', ''))) {
130
+ update_option('_mp_public_key', '');
131
+ update_option('_mp_access_token', '');
132
+ }
133
  update_option('checkout_credential_production', 'yes', true);
134
  }
135
  }
137
  /**
138
  * Country Configs
139
  */
140
+ public static function getCountryConfigs()
141
  {
142
  return array(
143
  'MCO' => array(
145
  'sponsor_id' => 208687643,
146
  'checkout_banner' => plugins_url('../../assets/images/MCO/standard_mco.jpg', __FILE__),
147
  'checkout_banner_custom' => plugins_url('../../assets/images/MCO/credit_card.png', __FILE__),
148
+ 'currency' => 'COP',
149
+ 'zip_code' => '110111',
150
  ),
151
  'MLA' => array(
152
  'site_id' => 'MLA',
153
  'sponsor_id' => 208682286,
154
  'checkout_banner' => plugins_url('../../assets/images/MLA/standard_mla.jpg', __FILE__),
155
  'checkout_banner_custom' => plugins_url('../../assets/images/MLA/credit_card.png', __FILE__),
156
+ 'currency' => 'ARS',
157
+ 'zip_code' => '3039',
158
  ),
159
  'MLB' => array(
160
  'site_id' => 'MLB',
161
  'sponsor_id' => 208686191,
162
  'checkout_banner' => plugins_url('../../assets/images/MLB/standard_mlb.jpg', __FILE__),
163
  'checkout_banner_custom' => plugins_url('../../assets/images/MLB/credit_card.png', __FILE__),
164
+ 'currency' => 'BRL',
165
+ 'zip_code' => '01310924',
166
  ),
167
  'MLC' => array(
168
  'site_id' => 'MLC',
169
  'sponsor_id' => 208690789,
170
  'checkout_banner' => plugins_url('../../assets/images/MLC/standard_mlc.gif', __FILE__),
171
  'checkout_banner_custom' => plugins_url('../../assets/images/MLC/credit_card.png', __FILE__),
172
+ 'currency' => 'CLP',
173
+ 'zip_code' => '7591538',
174
  ),
175
  'MLM' => array(
176
  'site_id' => 'MLM',
177
  'sponsor_id' => 208692380,
178
  'checkout_banner' => plugins_url('../../assets/images/MLM/standard_mlm.jpg', __FILE__),
179
  'checkout_banner_custom' => plugins_url('../../assets/images/MLM/credit_card.png', __FILE__),
180
+ 'currency' => 'MXN',
181
+ 'zip_code' => '11250',
182
  ),
183
  'MLU' => array(
184
  'site_id' => 'MLU',
185
  'sponsor_id' => 243692679,
186
  'checkout_banner' => plugins_url('../../assets/images/MLU/standard_mlu.png', __FILE__),
187
  'checkout_banner_custom' => plugins_url('../../assets/images/MLU/credit_card.png', __FILE__),
188
+ 'currency' => 'UYU',
189
+ 'zip_code' => '11800',
190
  ),
191
  'MLV' => array(
192
  'site_id' => 'MLV',
193
  'sponsor_id' => 208692735,
194
  'checkout_banner' => plugins_url('../../assets/images/MLV/standard_mlv.jpg', __FILE__),
195
  'checkout_banner_custom' => plugins_url('../../assets/images/MLV/credit_card.png', __FILE__),
196
+ 'currency' => 'VEF',
197
+ 'zip_code' => '1160',
198
  ),
199
  'MPE' => array(
200
  'site_id' => 'MPE',
201
  'sponsor_id' => 216998692,
202
  'checkout_banner' => plugins_url('../../assets/images/MPE/standard_mpe.png', __FILE__),
203
  'checkout_banner_custom' => plugins_url('../../assets/images/MPE/credit_card.png', __FILE__),
204
+ 'currency' => 'PEN',
205
+ 'zip_code' => '15074',
206
  )
207
  );
208
  }
236
  );
237
  }
238
 
 
 
 
 
 
 
 
 
 
 
 
239
  /**
240
  * @param $methods
241
  * @return array
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
+ }
includes/module/WC_WooMercadoPago_Credentials.php CHANGED
@@ -5,7 +5,6 @@
5
  */
6
  class WC_WooMercadoPago_Credentials
7
  {
8
-
9
  const TYPE_ACCESS_CLIENT = 'client';
10
  const TYPE_ACCESS_TOKEN = 'token';
11
 
@@ -35,6 +34,11 @@ class WC_WooMercadoPago_Credentials
35
  }
36
  }
37
 
 
 
 
 
 
38
  $this->publicKey = $publicKey;
39
  $this->accessToken = $accessToken;
40
  $this->clientId = get_option('_mp_client_id');
@@ -98,7 +102,6 @@ class WC_WooMercadoPago_Credentials
98
  update_option('_all_payment_methods_v0', array(), true);
99
  update_option('_all_payment_methods_ticket', '[]', true);
100
  update_option('_can_do_currency_conversion_v1', false, true);
101
-
102
  }
103
 
104
  /**
@@ -160,7 +163,10 @@ class WC_WooMercadoPago_Credentials
160
  self::updatePaymentMethods($mp_v1, $access_token, $payments_response);
161
  self::updateTicketMethod($mp_v1, $access_token, $payments_response);
162
 
163
- $currency_ratio = WC_WooMercadoPago_Module::get_conversion_rate(WC_WooMercadoPago_Module::$country_configs[$get_request['response']['site_id']]['currency']);
 
 
 
164
  if ($currency_ratio > 0) {
165
  update_option('_can_do_currency_conversion_v1', true, true);
166
  } else {
@@ -214,7 +220,11 @@ class WC_WooMercadoPago_Credentials
214
 
215
  $arr = array();
216
  $cho = array();
 
 
217
  foreach ($paymentsResponse as $payment) {
 
 
218
  $arr[] = $payment['id'];
219
 
220
  $cho[] = array(
@@ -250,22 +260,25 @@ class WC_WooMercadoPago_Credentials
250
  }
251
 
252
  $payment_methods_ticket = array();
 
 
253
  foreach ($paymentsResponse as $payment) {
254
- if (
255
- $payment['payment_type_id'] != 'account_money' &&
256
- $payment['payment_type_id'] != 'credit_card' &&
257
- $payment['payment_type_id'] != 'debit_card' &&
258
- $payment['payment_type_id'] != 'prepaid_card'
259
- ) {
260
- $obj = new stdClass();
261
- $obj->id = $payment['id'];
262
- $obj->name = $payment['name'];
263
- $obj->secure_thumbnail = $payment['secure_thumbnail'];
264
- array_push($payment_methods_ticket, $obj);
265
- }
 
266
  }
267
 
268
- update_option('_all_payment_methods_ticket', json_encode($payment_methods_ticket), true);
269
  }
270
 
271
  /**
5
  */
6
  class WC_WooMercadoPago_Credentials
7
  {
 
8
  const TYPE_ACCESS_CLIENT = 'client';
9
  const TYPE_ACCESS_TOKEN = 'token';
10
 
34
  }
35
  }
36
 
37
+ if (is_null($this->payment) && empty($publicKey) && empty($accessToken)) {
38
+ $publicKey = get_option('_mp_public_key_test', '');
39
+ $accessToken = get_option('_mp_access_token_test', '');
40
+ }
41
+
42
  $this->publicKey = $publicKey;
43
  $this->accessToken = $accessToken;
44
  $this->clientId = get_option('_mp_client_id');
102
  update_option('_all_payment_methods_v0', array(), true);
103
  update_option('_all_payment_methods_ticket', '[]', true);
104
  update_option('_can_do_currency_conversion_v1', false, true);
 
105
  }
106
 
107
  /**
163
  self::updatePaymentMethods($mp_v1, $access_token, $payments_response);
164
  self::updateTicketMethod($mp_v1, $access_token, $payments_response);
165
 
166
+ $currency_ratio = WC_WooMercadoPago_Module::get_conversion_rate(
167
+ WC_WooMercadoPago_Module::$country_configs[$get_request['response']['site_id']]['currency']
168
+ );
169
+
170
  if ($currency_ratio > 0) {
171
  update_option('_can_do_currency_conversion_v1', true, true);
172
  } else {
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)){ continue; }
227
+
228
  $arr[] = $payment['id'];
229
 
230
  $cho[] = array(
260
  }
261
 
262
  $payment_methods_ticket = array();
263
+ $excluded = array('consumer_credits');
264
+
265
  foreach ($paymentsResponse as $payment) {
266
+ if (
267
+ !in_array($payment['id'], $excluded) &&
268
+ $payment['payment_type_id'] != 'account_money' &&
269
+ $payment['payment_type_id'] != 'credit_card' &&
270
+ $payment['payment_type_id'] != 'debit_card' &&
271
+ $payment['payment_type_id'] != 'prepaid_card'
272
+ ) {
273
+ $payment_methods_ticket[] = array(
274
+ "id" => $payment['id'],
275
+ "name" => $payment['name'],
276
+ "secure_thumbnail" => $payment['secure_thumbnail'],
277
+ );
278
+ }
279
  }
280
 
281
+ update_option('_all_payment_methods_ticket', $payment_methods_ticket, true);
282
  }
283
 
284
  /**
includes/module/WC_WooMercadoPago_Module.php CHANGED
@@ -22,31 +22,29 @@ class WC_WooMercadoPago_Module extends WC_WooMercadoPago_Configs
22
  public function __construct()
23
  {
24
  try {
25
- if (!class_exists('WC_Payment_Gateway')) {
26
- add_action('admin_notices', array($this, 'notify_woocommerce_miss'));
27
- }
28
-
29
  $this->loadConfigs();
30
- $this->loadLog();
31
  $this->loadHooks();
32
  $this->loadPreferences();
33
  $this->loadPayments();
34
  $this->loadNotifications();
35
- $this->loadShipments();
 
36
 
37
  add_filter('woocommerce_available_payment_gateways', array($this, 'filterPaymentMethodByShipping'));
38
  add_filter('plugin_action_links_' . WC_MERCADOPAGO_BASENAME, array($this, 'woomercadopago_settings_link'));
39
  add_filter('plugin_row_meta', array($this, 'mp_plugin_row_meta'), 10, 2);
40
-
41
  if (is_admin()) {
42
- if(isset($_REQUEST['section'])){
43
- $credentials = new WC_WooMercadoPago_Credentials();
44
- if (!$credentials->tokenIsValid()) {
45
- add_action('admin_notices', array($this, 'enablePaymentNotice'));
 
 
46
  }
47
- }
48
- self::loadMercadoEnviosAdmin();
49
- }
50
  } catch (Exception $e) {
51
  $log = WC_WooMercadoPago_Log::init_mercado_pago_log('WC_WooMercadoPago_Module');
52
  $log->write_log('__construct: ', $e->getMessage());
@@ -133,7 +131,7 @@ class WC_WooMercadoPago_Module extends WC_WooMercadoPago_Configs
133
  {
134
  $configs = new parent();
135
  self::$categories = $configs->getCategories();
136
- self::$country_configs = $configs->getCountryConfigs();
137
  self::$site_data = self::get_site_data();
138
  self::$payments_name = self::setPaymentGateway();
139
  }
@@ -149,6 +147,14 @@ class WC_WooMercadoPago_Module extends WC_WooMercadoPago_Configs
149
  include_once dirname(__FILE__) . '/../payments/hooks/WC_WooMercadoPago_Hook_Ticket.php';
150
  }
151
 
 
 
 
 
 
 
 
 
152
  /**
153
  * Load Preferences Classes
154
  */
@@ -169,7 +175,6 @@ class WC_WooMercadoPago_Module extends WC_WooMercadoPago_Configs
169
  include_once dirname(__FILE__) . '/../payments/WC_WooMercadoPago_BasicGateway.php';
170
  include_once dirname(__FILE__) . '/../payments/WC_WooMercadoPago_CustomGateway.php';
171
  include_once dirname(__FILE__) . '/../payments/WC_WooMercadoPago_TicketGateway.php';
172
- include_once dirname(__FILE__) . '/../payments/mercadoenvios/WC_WooMercadoPago_Product_Recurrent.php';
173
  add_filter('woocommerce_payment_gateways', array($this, 'setPaymentGateway'));
174
  }
175
 
@@ -190,25 +195,18 @@ class WC_WooMercadoPago_Module extends WC_WooMercadoPago_Configs
190
  {
191
  include_once dirname(__FILE__) . '/log/WC_WooMercadoPago_Log.php';
192
  }
193
-
194
- /**
195
- * Load Shipment Types
196
- */
197
- public function loadShipments()
198
- {
199
- include_once dirname(__FILE__) . '/../shipment/WC_MercadoEnvios_Shipping_Abstract.php';
200
- include_once dirname(__FILE__) . '/../shipment/WC_MercadoEnvios_Shipping_Express.php';
201
- include_once dirname(__FILE__) . '/../shipment/WC_MercadoEnvios_Shipping_Normal.php';
202
- include_once dirname(__FILE__) . '/../shipment/WC_MercadoEnvios_Package.php';
203
- add_filter('woocommerce_shipping_methods', array($this, 'setShipping'));
204
- }
205
 
206
  /**
207
- * Load Admin Classes
208
  */
209
- public static function loadMercadoEnviosAdmin()
210
  {
211
- include_once dirname(__FILE__) . '/../admin/WC_MercadoEnvios_Admin_Orders.php';
 
 
 
 
 
212
  }
213
 
214
  /**
@@ -240,29 +238,9 @@ class WC_WooMercadoPago_Module extends WC_WooMercadoPago_Configs
240
  */
241
  public function enablePaymentNotice()
242
  {
 
243
  $message = __('Complete your credentials to enable the payment of method.', 'woocommerce-mercadopago');
244
- echo '<div class="notice notice-warning is-dismissible">
245
- <p style="font-size:13px">
246
- <strong>MERCADO PAGO:</strong> ' . $message . '
247
- </p>
248
- <button type="button" class="notice-dismiss">
249
- <span class="screen-reader-text">' . __('Discard', 'woocommerce-mercadopago') . '</span>
250
- </button>
251
- </div>';
252
- }
253
-
254
- /**
255
- * Summary: Places a warning error to notify user that WooCommerce is missing.
256
- * Description: Places a warning error to notify user that WooCommerce is missing.
257
- */
258
- public function notify_woocommerce_miss()
259
- {
260
- echo '<div class="error"><p>' .
261
- sprintf(
262
- __('The payment module of Woo Mercado depends on the latest version of %s to run!', 'woocommerce-mercadopago'),
263
- '<a href="https://wordpress.org/extend/plugins/woocommerce/">WooCommerce</a>'
264
- ) .
265
- '</p></div>';
266
  }
267
 
268
  // Add settings link on plugin page.
@@ -271,17 +249,15 @@ class WC_WooMercadoPago_Module extends WC_WooMercadoPago_Configs
271
  $plugin_links = array();
272
  $plugin_links[] = '<a href="' . admin_url('admin.php?page=wc-settings&tab=checkout') . '">' . __('Set up', 'woocommerce-mercadopago') . '</a>';
273
  $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>';
274
- $plugin_links[] = '<br><a target="_blank" href="' . 'https://github.com/mercadopago/cart-woocommerce#installation' . '">' . __('Guides and Documentation', 'woocommerce-mercadopago') . '</a>';
275
  $plugin_links[] = '<a target="_blank" href="' . 'https://www.mercadopago.com.br/ajuda' . '">' . __('Report Problem', 'woocommerce-mercadopago') . '</a>';
276
  return array_merge($plugin_links, $links);
277
  }
278
 
279
  /**
280
  * Show row meta on the plugin screen.
281
- *
282
  * @param mixed $links Plugin Row Meta.
283
  * @param mixed $file Plugin Base file.
284
- *
285
  * @return array
286
  */
287
  public function mp_plugin_row_meta($links, $file)
@@ -347,7 +323,6 @@ class WC_WooMercadoPago_Module extends WC_WooMercadoPago_Configs
347
  * @return boolean true/false depending on the validation result.
348
  */
349
 
350
-
351
  // Get WooCommerce instance
352
  public static function woocommerce_instance()
353
  {
@@ -383,30 +358,14 @@ class WC_WooMercadoPago_Module extends WC_WooMercadoPago_Configs
383
  /**
384
  * Summary: Get the rate of conversion between two currencies.
385
  * Description: The currencies are the one used in WooCommerce and the one used in $site_id.
386
- * @return a float that is the rate of conversion.
387
  */
388
  public static function get_conversion_rate($used_currency)
389
  {
390
- $wc_currency = get_woocommerce_currency();
391
- $email = (wp_get_current_user()->ID != 0) ? wp_get_current_user()->user_email : null;
392
- MPRestClient::set_email($email);
393
- if (strlen($wc_currency) == 3 && strlen($used_currency) == 3) {
394
- $currency_obj = MPRestClient::get(
395
- array(
396
- 'uri' => '/currency_conversions/search?' .
397
- 'from=' . get_woocommerce_currency() .
398
- '&to=' . $used_currency
399
- ),
400
- WC_WooMercadoPago_Constants::VERSION
401
- );
402
- if (isset($currency_obj['response'])) {
403
- $currency_obj = $currency_obj['response'];
404
- if (isset($currency_obj['ratio'])) {
405
- return ((float) $currency_obj['ratio']);
406
- }
407
- }
408
- }
409
- return -1;
410
  }
411
 
412
  /**
@@ -443,7 +402,6 @@ class WC_WooMercadoPago_Module extends WC_WooMercadoPago_Configs
443
  }
444
  }
445
 
446
-
447
  /**
448
  * Summary: Get information about the used Mercado Pago account based in its site.
449
  * Description: Get information about the used Mercado Pago account based in its site.
@@ -572,7 +530,6 @@ class WC_WooMercadoPago_Module extends WC_WooMercadoPago_Configs
572
  $gateway_name . '</a>';
573
  }
574
 
575
-
576
  public static function get_map($selector_id)
577
  {
578
  $html = '';
22
  public function __construct()
23
  {
24
  try {
25
+ $this->loadHelpers();
 
 
 
26
  $this->loadConfigs();
27
+ $this->loadLog();
28
  $this->loadHooks();
29
  $this->loadPreferences();
30
  $this->loadPayments();
31
  $this->loadNotifications();
32
+
33
+ add_action('admin_enqueue_scripts', [$this, 'loadAdminCss']);
34
 
35
  add_filter('woocommerce_available_payment_gateways', array($this, 'filterPaymentMethodByShipping'));
36
  add_filter('plugin_action_links_' . WC_MERCADOPAGO_BASENAME, array($this, 'woomercadopago_settings_link'));
37
  add_filter('plugin_row_meta', array($this, 'mp_plugin_row_meta'), 10, 2);
38
+
39
  if (is_admin()) {
40
+ //validate credentials
41
+ if (isset($_REQUEST['section'])) {
42
+ $credentials = new WC_WooMercadoPago_Credentials();
43
+ if (!$credentials->tokenIsValid()) {
44
+ add_action('admin_notices', [$this, 'enablePaymentNotice']);
45
+ }
46
  }
47
+ }
 
 
48
  } catch (Exception $e) {
49
  $log = WC_WooMercadoPago_Log::init_mercado_pago_log('WC_WooMercadoPago_Module');
50
  $log->write_log('__construct: ', $e->getMessage());
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
  }
147
  include_once dirname(__FILE__) . '/../payments/hooks/WC_WooMercadoPago_Hook_Ticket.php';
148
  }
149
 
150
+ /**
151
+ * Load Helpers
152
+ */
153
+ public function loadHelpers()
154
+ {
155
+ include_once dirname(__FILE__) . '/../helpers/WC_WooMercadoPago_Helpers_CurrencyConverter.php';
156
+ }
157
+
158
  /**
159
  * Load Preferences Classes
160
  */
175
  include_once dirname(__FILE__) . '/../payments/WC_WooMercadoPago_BasicGateway.php';
176
  include_once dirname(__FILE__) . '/../payments/WC_WooMercadoPago_CustomGateway.php';
177
  include_once dirname(__FILE__) . '/../payments/WC_WooMercadoPago_TicketGateway.php';
 
178
  add_filter('woocommerce_payment_gateways', array($this, 'setPaymentGateway'));
179
  }
180
 
195
  {
196
  include_once dirname(__FILE__) . '/log/WC_WooMercadoPago_Log.php';
197
  }
 
 
 
 
 
 
 
 
 
 
 
 
198
 
199
  /**
200
+ *
201
  */
202
+ public function loadAdminCss()
203
  {
204
+ if (is_admin()) {
205
+ wp_enqueue_style(
206
+ 'woocommerce-mercadopago-basic-config-styles',
207
+ plugins_url('../assets/css/config_mercadopago.css', plugin_dir_path(__FILE__))
208
+ );
209
+ }
210
  }
211
 
212
  /**
238
  */
239
  public function enablePaymentNotice()
240
  {
241
+ $type = 'notice-warning';
242
  $message = __('Complete your credentials to enable the payment of method.', 'woocommerce-mercadopago');
243
+ echo WC_WooMercadoPago_Configs::getAlertFrame($message, $type);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
244
  }
245
 
246
  // Add settings link on plugin page.
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.com.ar/developers/en/plugins_sdks/plugins/woocommerce/introduction/' . '">' . __('Guides and Documentation', 'woocommerce-mercadopago') . '</a>';
253
  $plugin_links[] = '<a target="_blank" href="' . 'https://www.mercadopago.com.br/ajuda' . '">' . __('Report Problem', 'woocommerce-mercadopago') . '</a>';
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.
260
  * @param mixed $file Plugin Base file.
 
261
  * @return array
262
  */
263
  public function mp_plugin_row_meta($links, $file)
323
  * @return boolean true/false depending on the validation result.
324
  */
325
 
 
326
  // Get WooCommerce instance
327
  public static function woocommerce_instance()
328
  {
358
  /**
359
  * Summary: Get the rate of conversion between two currencies.
360
  * Description: The currencies are the one used in WooCommerce and the one used in $site_id.
361
+ * @return float float that is the rate of conversion.
362
  */
363
  public static function get_conversion_rate($used_currency)
364
  {
365
+ $fromCurrency = get_woocommerce_currency();
366
+ $toCurrency = $used_currency;
367
+
368
+ return WC_WooMercadoPago_Helpers_CurrencyConverter::getInstance()->loadRatio($fromCurrency, $toCurrency);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
369
  }
370
 
371
  /**
402
  }
403
  }
404
 
 
405
  /**
406
  * Summary: Get information about the used Mercado Pago account based in its site.
407
  * Description: Get information about the used Mercado Pago account based in its site.
530
  $gateway_name . '</a>';
531
  }
532
 
 
533
  public static function get_map($selector_id)
534
  {
535
  $html = '';
includes/module/config/WC_WooMercadoPago_Constants.php CHANGED
@@ -10,8 +10,8 @@ if (!defined('ABSPATH')) {
10
  class WC_WooMercadoPago_Constants
11
  {
12
  const PRODUCT_ID = 'BC32CPFTRPP001U8NHRG';
13
- const PLATAFORM_ID = 'WooCommerce';
14
- const VERSION = '4.0.8';
15
  const MIN_PHP = 5.6;
16
  const API_MP_BASE_URL = 'https://api.mercadopago.com';
17
- }
10
  class WC_WooMercadoPago_Constants
11
  {
12
  const PRODUCT_ID = 'BC32CPFTRPP001U8NHRG';
13
+ const PLATAFORM_ID = 'bo2hnr2ic4p001kbgpt0';
14
+ const VERSION = '4.1.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
@@ -65,6 +65,21 @@ abstract class WC_WooMercadoPago_PreferenceAbstract extends WC_Payment_Gateway
65
  if (sizeof($this->order->get_items()) > 0) {
66
  $this->items = $this->get_items_build_array();
67
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  }
69
 
70
  /**
@@ -73,8 +88,8 @@ abstract class WC_WooMercadoPago_PreferenceAbstract extends WC_Payment_Gateway
73
  public function make_commum_preference()
74
  {
75
  $preference = array(
76
- 'binary_mode' => $this->get_binary_mode(),
77
- 'external_reference' => $this->get_external_reference(),
78
  'notification_url' => $this->get_notification_url(),
79
  'statement_descriptor' => $this->payment->getOption('mp_statement_descriptor', 'Mercado Pago'),
80
  );
@@ -86,16 +101,9 @@ abstract class WC_WooMercadoPago_PreferenceAbstract extends WC_Payment_Gateway
86
  */
87
  public function get_currency_conversion()
88
  {
89
- $currency_ratio = 1;
90
- $_mp_currency_conversion_v1 = get_option('_mp_currency_conversion_v1', '');
91
- if (!empty($_mp_currency_conversion_v1)) {
92
- $currency_ratio = WC_WooMercadoPago_Module::get_conversion_rate($this->site_data[$this->site_id]['currency']);
93
- $currency_ratio = $currency_ratio > 0 ? $currency_ratio : 1;
94
- }
95
- return $currency_ratio;
96
  }
97
 
98
-
99
  /**
100
  * @return mixed
101
  */
@@ -154,8 +162,8 @@ abstract class WC_WooMercadoPago_PreferenceAbstract extends WC_Payment_Gateway
154
  $line_amount = $item['line_total'] + $item['line_tax'];
155
  $discount_by_gateway = (float)$line_amount * ($this->gateway_discount / 100);
156
  $commission_by_gateway = (float)$line_amount * ($this->commission / 100);
157
- $this->order_total += ($line_amount - $discount_by_gateway);
158
- $this->order_total += ($line_amount + $commission_by_gateway);
159
 
160
  // Add the item.
161
  array_push($this->list_of_items, $product_title . ' x ' . $item['qty']);
@@ -170,8 +178,7 @@ abstract class WC_WooMercadoPago_PreferenceAbstract extends WC_Payment_Gateway
170
  plugins_url('assets/images/cart.png', plugin_dir_path(__FILE__)) : wp_get_attachment_url($product->get_image_id()),
171
  'category_id' => get_option('_mp_category_id', 'others'),
172
  'quantity' => 1,
173
- 'unit_price' => ($this->site_data[$this->site_id]['currency'] == 'COP' || $this->site_data[$this->site_id]['currency'] == 'CLP') ?
174
- floor(($line_amount - $discount_by_gateway + $commission_by_gateway) * $this->currency_ratio) : floor(($line_amount - $discount_by_gateway + $commission_by_gateway) * $this->currency_ratio * 100) / 100,
175
  'currency_id' => $this->site_data[$this->site_id]['currency']
176
  ));
177
  }
@@ -184,17 +191,13 @@ abstract class WC_WooMercadoPago_PreferenceAbstract extends WC_Payment_Gateway
184
  */
185
  public function ship_cost_item()
186
  {
187
- $item = array(
188
- 'title' => method_exists($this->order, 'get_id') ? $this->order->get_shipping_method() : $this->order->shipping_method,
189
  'description' => __('Shipping service used by the store.', 'woocommerce-mercadopago'),
190
  'category_id' => get_option('_mp_category_id', 'others'),
191
- 'quantity' => 1,
192
- 'unit_price' => ($this->site_data[$this->site_id]['currency'] == 'COP' || $this->site_data[$this->site_id]['currency'] == 'CLP') ?
193
- floor($this->ship_cost * $this->currency_ratio) : floor($this->ship_cost * $this->currency_ratio * 100) / 100,
194
- 'currency_id' => $this->site_data[$this->site_id]['currency']
195
  );
196
-
197
- return $item;
198
  }
199
 
200
  /**
@@ -233,7 +236,7 @@ abstract class WC_WooMercadoPago_PreferenceAbstract extends WC_Payment_Gateway
233
  public function get_notification_url()
234
  {
235
  if (!strrpos(get_site_url(), 'localhost')) {
236
- $notification_url = get_option('_mp_custom_domain', '');
237
  // Check if we have a custom URL.
238
  if (empty($notification_url) || filter_var($notification_url, FILTER_VALIDATE_URL) === FALSE) {
239
  return WC()->api_request_url($this->notification_class);
@@ -246,16 +249,19 @@ abstract class WC_WooMercadoPago_PreferenceAbstract extends WC_Payment_Gateway
246
  }
247
 
248
  /**
 
 
249
  * @return bool
250
  */
251
- public function get_binary_mode()
252
  {
253
- $binary_mode = get_option('binary_mode', 'no');
254
- if ($binary_mode == 'yes') {
 
255
  return true;
256
- } else {
257
- return false;
258
  }
 
 
259
  }
260
 
261
  /**
@@ -269,9 +275,10 @@ abstract class WC_WooMercadoPago_PreferenceAbstract extends WC_Payment_Gateway
269
  /**
270
  * @return string
271
  */
272
- public function get_external_reference()
273
  {
274
- $store_identificator = get_option('_mp_store_identificator', 'WC-');
 
275
  if (method_exists($this->order, 'get_id')) {
276
  return $store_identificator . $this->order->get_id();
277
  } else {
@@ -293,28 +300,38 @@ abstract class WC_WooMercadoPago_PreferenceAbstract extends WC_Payment_Gateway
293
  */
294
  public function get_transaction_amount()
295
  {
296
- if ($this->site_data[$this->site_id]['currency'] == 'COP' || $this->site_data[$this->site_id]['currency'] == 'CLP') {
297
- return floor($this->order->get_total() * $this->currency_ratio);
298
- } else {
299
- return floor($this->order->get_total() * $this->currency_ratio * 100) / 100;
300
- }
 
 
 
 
 
 
 
 
 
 
 
 
301
  }
302
 
303
  /**
304
  * Discount Campaign
 
 
305
  */
306
  public function add_discounts_campaign()
307
  {
308
- if (
309
- isset($this->checkout['discount']) && !empty($this->checkout['discount']) &&
310
- isset($this->checkout['coupon_code']) && !empty($this->checkout['coupon_code']) &&
311
- $this->checkout['discount'] > 0 && WC()->session->chosen_payment_method == 'woo-mercado-pago-custom'
312
- ) {
313
- $this->preference['campaign_id'] = (int)$this->checkout['campaign_id'];
314
- $this->preference['coupon_amount'] = ($this->site_data['currency'] == 'COP' || $this->site_data['currency'] == 'CLP') ?
315
- floor($this->checkout['discount'] * $this->currency_ratio) : floor($this->checkout['discount'] * $this->currency_ratio * 100) / 100;
316
- $this->preference['coupon_code'] = strtoupper($this->checkout['coupon_code']);
317
- }
318
  }
319
 
320
  /**
@@ -322,19 +339,18 @@ abstract class WC_WooMercadoPago_PreferenceAbstract extends WC_Payment_Gateway
322
  */
323
  public function get_internal_metadata()
324
  {
325
-
326
  $accessToken = get_option('_mp_access_token_prod', '');
327
  if (empty($accessToken)) {
328
- return;
329
  }
330
-
331
  $test_mode = false;
332
  if ($this->payment->getOption('checkout_credential_production', '') == 'no') {
333
  $test_mode = true;
334
  }
335
-
336
  $seller = explode('-', $accessToken);
337
- $w = WC_WooMercadoPago_Module::woocommerce_instance();
338
  $internal_metadata = array(
339
  "platform" => WC_WooMercadoPago_Constants::PLATAFORM_ID,
340
  "plataform_version" => $w->version,
@@ -345,8 +361,18 @@ abstract class WC_WooMercadoPago_PreferenceAbstract extends WC_Payment_Gateway
345
  "test_mode" => $test_mode,
346
  "details" => ""
347
  );
348
-
349
  return $internal_metadata;
350
  }
351
-
 
 
 
 
 
 
 
 
 
 
352
  }
65
  if (sizeof($this->order->get_items()) > 0) {
66
  $this->items = $this->get_items_build_array();
67
  }
68
+
69
+ //shipping is added to items
70
+ $this->items = array_merge($this->items, $this->prepare_shipping());
71
+ }
72
+
73
+ protected function prepare_shipping()
74
+ {
75
+ $result = [];
76
+
77
+ if ($this->ship_cost > 0) {
78
+ $shipCost = $this->ship_cost_item();
79
+ $result[] = $shipCost;
80
+ }
81
+
82
+ return $result;
83
  }
84
 
85
  /**
88
  public function make_commum_preference()
89
  {
90
  $preference = array(
91
+ 'binary_mode' => $this->get_binary_mode($this->payment),
92
+ 'external_reference' => $this->get_external_reference($this->payment),
93
  'notification_url' => $this->get_notification_url(),
94
  'statement_descriptor' => $this->payment->getOption('mp_statement_descriptor', 'Mercado Pago'),
95
  );
101
  */
102
  public function get_currency_conversion()
103
  {
104
+ return WC_WooMercadoPago_Helpers_CurrencyConverter::getInstance()->ratio($this->payment);
 
 
 
 
 
 
105
  }
106
 
 
107
  /**
108
  * @return mixed
109
  */
162
  $line_amount = $item['line_total'] + $item['line_tax'];
163
  $discount_by_gateway = (float)$line_amount * ($this->gateway_discount / 100);
164
  $commission_by_gateway = (float)$line_amount * ($this->commission / 100);
165
+ $item_amount = $line_amount - $discount_by_gateway + $commission_by_gateway;
166
+ $this->order_total += $item_amount;
167
 
168
  // Add the item.
169
  array_push($this->list_of_items, $product_title . ' x ' . $item['qty']);
178
  plugins_url('assets/images/cart.png', plugin_dir_path(__FILE__)) : wp_get_attachment_url($product->get_image_id()),
179
  'category_id' => get_option('_mp_category_id', 'others'),
180
  'quantity' => 1,
181
+ 'unit_price' => $this->calculate_price($item_amount),
 
182
  'currency_id' => $this->site_data[$this->site_id]['currency']
183
  ));
184
  }
191
  */
192
  public function ship_cost_item()
193
  {
194
+ return array(
195
+ 'title' => method_exists($this->order, 'get_id') ? $this->order->get_shipping_method() : $this->order->shipping_method,
196
  'description' => __('Shipping service used by the store.', 'woocommerce-mercadopago'),
197
  'category_id' => get_option('_mp_category_id', 'others'),
198
+ 'quantity' => 1,
199
+ 'unit_price' => $this->calculate_price($this->ship_cost),
 
 
200
  );
 
 
201
  }
202
 
203
  /**
236
  public function get_notification_url()
237
  {
238
  if (!strrpos(get_site_url(), 'localhost')) {
239
+ $notification_url = $this->payment->custom_domain;
240
  // Check if we have a custom URL.
241
  if (empty($notification_url) || filter_var($notification_url, FILTER_VALIDATE_URL) === FALSE) {
242
  return WC()->api_request_url($this->notification_class);
249
  }
250
 
251
  /**
252
+ * get binary_mode
253
+ * @param class $payment
254
  * @return bool
255
  */
256
+ public function get_binary_mode($payment = null)
257
  {
258
+ $binary_mode = !is_null($payment) ? $payment->getOption('binary_mode', 'no') : 'no';
259
+
260
+ if ($binary_mode != 'no') {
261
  return true;
 
 
262
  }
263
+
264
+ return false;
265
  }
266
 
267
  /**
275
  /**
276
  * @return string
277
  */
278
+ public function get_external_reference($payment = null)
279
  {
280
+ $store_identificator = !is_null($payment) ? $payment->getOption('_mp_store_identificator') : 'WC-';
281
+
282
  if (method_exists($this->order, 'get_id')) {
283
  return $store_identificator . $this->order->get_id();
284
  } else {
300
  */
301
  public function get_transaction_amount()
302
  {
303
+ return $this->calculate_price($this->order_total);
304
+ }
305
+
306
+ /**
307
+ * @return array
308
+ */
309
+ public function add_discounts()
310
+ {
311
+ $item = array(
312
+ 'title' => __('Discount provided by store', 'woocommerce-mercadopago'),
313
+ 'description' => __('Discount provided by store', 'woocommerce-mercadopago'),
314
+ 'quantity' => 1,
315
+ 'category_id' => get_option('_mp_category_name', 'others'),
316
+ 'unit_price' => ($this->site_data[$this->site_id]['currency'] == 'COP' || $this->site_data[$this->site_id]['currency'] == 'CLP') ?
317
+ -floor($this->checkout['discount'] * $this->currency_ratio) : -floor($this->checkout['discount'] * $this->currency_ratio * 100) / 100
318
+ );
319
+ return $item;
320
  }
321
 
322
  /**
323
  * Discount Campaign
324
+ *
325
+ * @return array
326
  */
327
  public function add_discounts_campaign()
328
  {
329
+ return array(
330
+ 'campaign_id' => (int) $this->checkout['campaign_id'],
331
+ 'coupon_amount' => ($this->site_data[$this->site_id]['currency'] == 'COP' || $this->site_data[$this->site_id]['currency'] == 'CLP') ?
332
+ floor($this->checkout['discount'] * $this->currency_ratio) : floor($this->checkout['discount'] * $this->currency_ratio * 100) / 100,
333
+ 'coupon_code' => strtoupper($this->checkout['coupon_code'])
334
+ );
 
 
 
 
335
  }
336
 
337
  /**
339
  */
340
  public function get_internal_metadata()
341
  {
 
342
  $accessToken = get_option('_mp_access_token_prod', '');
343
  if (empty($accessToken)) {
344
+ return null;
345
  }
346
+
347
  $test_mode = false;
348
  if ($this->payment->getOption('checkout_credential_production', '') == 'no') {
349
  $test_mode = true;
350
  }
351
+
352
  $seller = explode('-', $accessToken);
353
+ $w = WC_WooMercadoPago_Module::woocommerce_instance();
354
  $internal_metadata = array(
355
  "platform" => WC_WooMercadoPago_Constants::PLATAFORM_ID,
356
  "plataform_version" => $w->version,
361
  "test_mode" => $test_mode,
362
  "details" => ""
363
  );
364
+
365
  return $internal_metadata;
366
  }
367
+
368
+ /**
369
+ * @param $amount
370
+ * @return float
371
+ */
372
+ private function calculate_price($amount) {
373
+ if ($this->site_data[$this->site_id]['currency'] == 'COP' || $this->site_data[$this->site_id]['currency'] == 'CLP') {
374
+ return floor($amount * $this->currency_ratio);
375
+ }
376
+ return floor($amount * $this->currency_ratio * 100) / 100;
377
+ }
378
  }
includes/module/preference/WC_WooMercadoPago_PreferenceBasic.php CHANGED
@@ -23,11 +23,7 @@ class WC_WooMercadoPago_PreferenceBasic extends WC_WooMercadoPago_PreferenceAbst
23
  $this->preference['back_urls'] = $this->get_back_urls();
24
  $this->preference['shipments'] = $this->shipments_receiver_address();
25
 
26
- if (strpos($this->selected_shipping, 'Mercado Envios') !== 0 && $this->ship_cost > 0) {
27
- $this->preference['items'][] = $this->ship_cost_item();
28
- }
29
-
30
- if (strpos($this->selected_shipping, 'Mercado Envios') === 0 && $this->ship_cost > 0) {
31
  $this->shipment_info();
32
  }
33
 
@@ -35,9 +31,8 @@ class WC_WooMercadoPago_PreferenceBasic extends WC_WooMercadoPago_PreferenceAbst
35
  $this->preference['auto_return'] = $this->auto_return();
36
 
37
  $internal_metadata = parent::get_internal_metadata();
38
- $internal_metadata = $this->get_internal_metadata_basic($internal_metadata);
39
- $this->preference['metadata'] = $internal_metadata;
40
-
41
  }
42
 
43
  /**
@@ -51,7 +46,7 @@ class WC_WooMercadoPago_PreferenceBasic extends WC_WooMercadoPago_PreferenceAbst
51
  'email' => $this->order->get_billing_email(),
52
  'phone' => array(
53
  //'area_code' =>
54
- 'number' => (method_exists($this->order, 'get_id') ? $this->order->get_billing_phone() : $this->order->billing_phone)
55
  ),
56
  'address' => array(
57
  'zip_code' => (method_exists($this->order, 'get_id') ? $this->order->get_billing_postcode() : $this->order->billing_postcode),
@@ -147,18 +142,15 @@ class WC_WooMercadoPago_PreferenceBasic extends WC_WooMercadoPago_PreferenceAbst
147
  $shipping_id = $prepare_method_id[count($prepare_method_id) - 1];
148
  // TODO: Refactor to Get zone by instance_id.
149
  $shipping_zone = WC_Shipping_Zones::get_zone_by('instance_id', $shipping_id);
150
- // Get all shipping and filter by free_shipping (Mercado Envios).
151
  foreach ($shipping_zone->get_shipping_methods() as $key => $shipping_object) {
152
- // Check is a free method.
153
  if ($shipping_object->get_option('free_shipping') == 'yes') {
154
- // Get shipping method id (Mercado Envios).
155
  $shipping_method_id = $shipping_object->get_shipping_method_id($this->site_data['site_id']);
156
  $this->preference['shipments']['free_methods'][] = array('id' => (int)$shipping_method_id);
157
  }
158
  }
159
  }
160
  }
161
-
162
  /**
163
  * @return array
164
  */
@@ -168,7 +160,7 @@ class WC_WooMercadoPago_PreferenceBasic extends WC_WooMercadoPago_PreferenceAbst
168
  "checkout" => "smart",
169
  "checkout_type" => "",
170
  );
171
-
172
  return $internal_metadata;
173
- }
174
- }
23
  $this->preference['back_urls'] = $this->get_back_urls();
24
  $this->preference['shipments'] = $this->shipments_receiver_address();
25
 
26
+ if ($this->ship_cost > 0) {
 
 
 
 
27
  $this->shipment_info();
28
  }
29
 
31
  $this->preference['auto_return'] = $this->auto_return();
32
 
33
  $internal_metadata = parent::get_internal_metadata();
34
+ $merge_array = array_merge($internal_metadata, $this->get_internal_metadata_basic());
35
+ $this->preference['metadata'] = $merge_array;
 
36
  }
37
 
38
  /**
46
  'email' => $this->order->get_billing_email(),
47
  'phone' => array(
48
  //'area_code' =>
49
+ 'number' => (method_exists($this->order, 'get_id') ? $this->order->get_billing_phone() : $this->order->billing_phone),
50
  ),
51
  'address' => array(
52
  'zip_code' => (method_exists($this->order, 'get_id') ? $this->order->get_billing_postcode() : $this->order->billing_postcode),
142
  $shipping_id = $prepare_method_id[count($prepare_method_id) - 1];
143
  // TODO: Refactor to Get zone by instance_id.
144
  $shipping_zone = WC_Shipping_Zones::get_zone_by('instance_id', $shipping_id);
 
145
  foreach ($shipping_zone->get_shipping_methods() as $key => $shipping_object) {
 
146
  if ($shipping_object->get_option('free_shipping') == 'yes') {
 
147
  $shipping_method_id = $shipping_object->get_shipping_method_id($this->site_data['site_id']);
148
  $this->preference['shipments']['free_methods'][] = array('id' => (int)$shipping_method_id);
149
  }
150
  }
151
  }
152
  }
153
+
154
  /**
155
  * @return array
156
  */
160
  "checkout" => "smart",
161
  "checkout_type" => "",
162
  );
163
+
164
  return $internal_metadata;
165
+ }
166
+ }
includes/module/preference/WC_WooMercadoPago_PreferenceCustom.php CHANGED
@@ -38,25 +38,19 @@ class WC_WooMercadoPago_PreferenceCustom extends WC_WooMercadoPago_PreferenceAbs
38
  $this->preference['additional_info']['items'] = $this->items;
39
  $this->preference['additional_info']['payer'] = $this->get_payer_custom();
40
  $this->preference['additional_info']['shipments'] = $this->shipments_receiver_address();
41
- if ($this->ship_cost > 0) {
42
- $shipCost = $this->ship_cost_item();
43
- $this->preference['additional_info']['items'][] = $shipCost;
44
- if (isset($shipCost['unit_price']) && $shipCost['unit_price'] > 0) {
45
- $sumTransaction = $this->preference['transaction_amount'] + $shipCost['unit_price'];
46
- }
47
- }
48
  if (
49
  isset($this->checkout['discount']) && !empty($this->checkout['discount']) &&
50
  isset($this->checkout['coupon_code']) && !empty($this->checkout['coupon_code']) &&
51
  $this->checkout['discount'] > 0 && WC()->session->chosen_payment_method == 'woo-mercado-pago-custom'
52
  ) {
53
  $this->preference['additional_info']['items'][] = $this->add_discounts();
 
54
  }
55
- $this->add_discounts_campaign();
56
 
57
  $internal_metadata = parent::get_internal_metadata();
58
- $internal_metadata = $this->get_internal_metadata_custom($internal_metadata);
59
- $this->preference['metadata'] = $internal_metadata;
60
 
61
  }
62
 
@@ -72,22 +66,6 @@ class WC_WooMercadoPago_PreferenceCustom extends WC_WooMercadoPago_PreferenceAbs
72
  return $item;
73
  }
74
 
75
- /**
76
- * @return array
77
- */
78
- public function add_discounts()
79
- {
80
- $item = array(
81
- 'title' => __('Discount provided by store', 'woocommerce-mercadopago'),
82
- 'description' => __('Discount provided by store', 'woocommerce-mercadopago'),
83
- 'quantity' => 1,
84
- 'category_id' => get_option('_mp_category_name', 'others'),
85
- 'unit_price' => ($this->site_data['currency'] == 'COP' || $this->site_data['currency'] == 'CLP') ?
86
- -floor($this->checkout['discount'] * $this->currency_ratio) : -floor($this->checkout['discount'] * $this->currency_ratio * 100) / 100
87
- );
88
- return $item;
89
- }
90
-
91
  /**
92
  * @return array
93
  */
@@ -102,7 +80,7 @@ class WC_WooMercadoPago_PreferenceCustom extends WC_WooMercadoPago_PreferenceAbs
102
 
103
  return $items;
104
  }
105
-
106
  /**
107
  * @return array
108
  */
@@ -112,7 +90,7 @@ class WC_WooMercadoPago_PreferenceCustom extends WC_WooMercadoPago_PreferenceAbs
112
  "checkout" => "custom",
113
  "checkout_type" => "credit_cart",
114
  );
115
-
116
  return $internal_metadata;
117
- }
118
- }
38
  $this->preference['additional_info']['items'] = $this->items;
39
  $this->preference['additional_info']['payer'] = $this->get_payer_custom();
40
  $this->preference['additional_info']['shipments'] = $this->shipments_receiver_address();
41
+
 
 
 
 
 
 
42
  if (
43
  isset($this->checkout['discount']) && !empty($this->checkout['discount']) &&
44
  isset($this->checkout['coupon_code']) && !empty($this->checkout['coupon_code']) &&
45
  $this->checkout['discount'] > 0 && WC()->session->chosen_payment_method == 'woo-mercado-pago-custom'
46
  ) {
47
  $this->preference['additional_info']['items'][] = $this->add_discounts();
48
+ $this->preference = array_merge($this->preference , $this->add_discounts_campaign());
49
  }
 
50
 
51
  $internal_metadata = parent::get_internal_metadata();
52
+ $merge_array = array_merge($internal_metadata, $this->get_internal_metadata_custom());
53
+ $this->preference['metadata'] = $merge_array;
54
 
55
  }
56
 
66
  return $item;
67
  }
68
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  /**
70
  * @return array
71
  */
80
 
81
  return $items;
82
  }
83
+
84
  /**
85
  * @return array
86
  */
90
  "checkout" => "custom",
91
  "checkout_type" => "credit_cart",
92
  );
93
+
94
  return $internal_metadata;
95
+ }
96
+ }
includes/module/preference/WC_WooMercadoPago_PreferenceTicket.php CHANGED
@@ -20,7 +20,7 @@ class WC_WooMercadoPago_PreferenceTicket extends WC_WooMercadoPago_PreferenceAbs
20
  {
21
  parent::__construct($payment, $order, $ticket_checkout);
22
  $this->preference = $this->make_commum_preference();
23
- $this->preference['date_of_expiration'] = $this->get_date_of_expiration();
24
  $this->preference['transaction_amount'] = $this->get_transaction_amount();
25
  $this->preference['description'] = implode(', ', $this->list_of_items);
26
  $this->preference['payment_method_id'] = $this->checkout['paymentMethodId'];
@@ -42,22 +42,33 @@ class WC_WooMercadoPago_PreferenceTicket extends WC_WooMercadoPago_PreferenceAbs
42
  $this->preference['additional_info']['items'] = $this->items;
43
  $this->preference['additional_info']['payer'] = $this->get_payer_custom();
44
  $this->preference['additional_info']['shipments'] = $this->shipments_receiver_address();
45
-
46
- $internal_metadata = parent::get_internal_metadata();
47
- $internal_metadata = $this->get_internal_metadata_ticket($internal_metadata);
48
- $this->preference['metadata'] = $internal_metadata;
49
-
50
  $this->preference['additional_info']['payer'] = $this->get_payer_custom();
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  }
52
 
53
  /**
54
  * get_date_of_expiration
55
- *
56
  * @return string date
57
  */
58
- public function get_date_of_expiration()
59
  {
60
- $date_expiration = $this->get_option('date_expiration', '');
 
 
 
61
  if($date_expiration != ""){
62
  return date('Y-m-d\TH:i:s.000O', strtotime('+' . $date_expiration . ' days'));
63
  }
@@ -78,22 +89,16 @@ class WC_WooMercadoPago_PreferenceTicket extends WC_WooMercadoPago_PreferenceAbs
78
  return $items;
79
  }
80
 
81
- /**
82
- * @return bool
83
- */
84
- public function get_binary_mode()
85
- {
86
- return true;
87
- }
88
-
89
  /**
90
  * @return array
91
  */
92
- public function get_internal_metadata_ticket($internal_metadata)
93
  {
94
- $internal_metadata["checkout"] = "custom";
95
- $internal_metadata["checkout_type"] = "ticket";
96
-
 
 
97
  return $internal_metadata;
98
  }
99
- }
20
  {
21
  parent::__construct($payment, $order, $ticket_checkout);
22
  $this->preference = $this->make_commum_preference();
23
+ $this->preference['date_of_expiration'] = $this->get_date_of_expiration($payment);
24
  $this->preference['transaction_amount'] = $this->get_transaction_amount();
25
  $this->preference['description'] = implode(', ', $this->list_of_items);
26
  $this->preference['payment_method_id'] = $this->checkout['paymentMethodId'];
42
  $this->preference['additional_info']['items'] = $this->items;
43
  $this->preference['additional_info']['payer'] = $this->get_payer_custom();
44
  $this->preference['additional_info']['shipments'] = $this->shipments_receiver_address();
 
 
 
 
 
45
  $this->preference['additional_info']['payer'] = $this->get_payer_custom();
46
+
47
+ if (
48
+ isset($this->checkout['discount']) && !empty($this->checkout['discount']) &&
49
+ isset($this->checkout['coupon_code']) && !empty($this->checkout['coupon_code']) &&
50
+ $this->checkout['discount'] > 0 && WC()->session->chosen_payment_method == 'woo-mercado-pago-ticket'
51
+ ) {
52
+ $this->preference['additional_info']['items'][] = $this->add_discounts();
53
+ $this->preference = array_merge($this->preference , $this->add_discounts_campaign());
54
+ }
55
+
56
+ $internal_metadata = parent::get_internal_metadata();
57
+ $merge_array = array_merge($internal_metadata, $this->get_internal_metadata_ticket());
58
+ $this->preference['metadata'] = $merge_array;
59
  }
60
 
61
  /**
62
  * get_date_of_expiration
63
+ * @param WC_WooMercadoPago_TicketGateway $payment
64
  * @return string date
65
  */
66
+ public function get_date_of_expiration(WC_WooMercadoPago_TicketGateway $payment = null)
67
  {
68
+ $date_expiration = !is_null($payment)
69
+ ? $payment->getOption('date_expiration')
70
+ : $this->get_option('date_expiration', '');
71
+
72
  if($date_expiration != ""){
73
  return date('Y-m-d\TH:i:s.000O', strtotime('+' . $date_expiration . ' days'));
74
  }
89
  return $items;
90
  }
91
 
 
 
 
 
 
 
 
 
92
  /**
93
  * @return array
94
  */
95
+ public function get_internal_metadata_ticket()
96
  {
97
+ $internal_metadata = array(
98
+ "checkout" => "custom",
99
+ "checkout_type" => "ticket",
100
+ );
101
+
102
  return $internal_metadata;
103
  }
104
+ }
includes/module/sdk/lib/MP.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  if (!defined('ABSPATH')) {
4
- exit; // Exit if accessed directly.
5
  }
6
 
7
  $GLOBALS['LIB_LOCATION'] = dirname(__FILE__);
@@ -11,729 +11,749 @@ $GLOBALS['LIB_LOCATION'] = dirname(__FILE__);
11
  */
12
  class MP
13
  {
14
- private $client_id;
15
- private $client_secret;
16
- private $ll_access_token;
17
- private $sandbox = FALSE;
18
- private $accessTokenByClient;
19
- private $paymentClass;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
  /**
22
- * MP constructor.
23
- * @throws WC_WooMercadoPago_Exception
24
- */
25
- public function __construct()
26
- {
27
- $includes_path = dirname(__FILE__);
28
- require_once($includes_path . '/RestClient/AbstractRestClient.php');
29
- require_once($includes_path . '/RestClient/MeliRestClient.php');
30
- require_once($includes_path . '/RestClient/MpRestClient.php');
31
-
32
- $i = func_num_args();
33
- if ($i > 2 || $i < 1) {
34
- throw new WC_WooMercadoPago_Exception('Invalid arguments. Use CLIENT_ID and CLIENT SECRET, or ACCESS_TOKEN');
35
- }
36
-
37
- if ($i == 1) {
38
- $this->ll_access_token = func_get_arg(0);
39
- }
40
-
41
- if ($i == 2) {
42
- $this->client_id = func_get_arg(0);
43
- $this->client_secret = func_get_arg(1);
44
- }
45
- }
46
-
47
- /**
48
- * @param $email
49
- */
50
- public function set_email($email)
51
- {
52
- MPRestClient::set_email($email);
53
- MeliRestClient::set_email($email);
54
- }
55
-
56
- /**
57
- * @param $country_code
58
- */
59
- public function set_locale($country_code)
60
- {
61
- MPRestClient::set_locale($country_code);
62
- MeliRestClient::set_locale($country_code);
63
- }
64
-
65
- /**
66
- * @param null $enable
67
- * @return bool
68
- */
69
- public function sandbox_mode($enable = NULL)
70
- {
71
- if (!is_null($enable)) {
72
- $this->sandbox = $enable === TRUE;
73
- }
74
- return $this->sandbox;
75
- }
76
-
77
- /**
78
- * @return mixed|null
79
- * @throws WC_WooMercadoPago_Exception
80
- */
81
- public function get_access_token()
82
- {
83
-
84
- if (isset($this->ll_access_token) && !is_null($this->ll_access_token)) {
85
- return $this->ll_access_token;
86
- }
87
-
88
- if (!empty($this->accessTokenByClient)) {
89
- return $this->accessTokenByClient;
90
- }
91
-
92
- $app_client_values = array(
93
- 'client_id' => $this->client_id,
94
- 'client_secret' => $this->client_secret,
95
- 'grant_type' => 'client_credentials'
96
- );
97
-
98
- $access_data = MPRestClient::post(
99
- array(
100
- 'uri' => '/oauth/token',
101
- 'data' => $app_client_values,
102
- 'headers' => array(
103
- 'content-type' => 'application/x-www-form-urlencoded'
104
- )
105
- ),
106
- WC_WooMercadoPago_Constants::VERSION
107
- );
108
-
109
- if ($access_data['status'] != 200) {
110
- return null;
111
- }
112
-
113
- $response = $access_data['response'];
114
- $this->accessTokenByClient = $response['access_token'];
115
-
116
- return $this->accessTokenByClient;
117
- }
118
-
119
- /**
120
- * @param $id
121
- * @return array|null
122
- */
123
- public function search_paymentV1($id)
124
- {
125
-
126
- $request = array(
127
- 'uri' => '/v1/payments/' . $id,
128
- 'params' => array('access_token' => $this->get_access_token())
129
- );
130
-
131
- $payment = MPRestClient::get($request, WC_WooMercadoPago_Constants::VERSION);
132
- return $payment;
133
- }
134
-
135
- //=== CUSTOMER CARDS FUNCTIONS ===
136
-
137
- /**
138
- * @param $payer_email
139
- * @return array|mixed|null
140
- */
141
- public function get_or_create_customer($payer_email)
142
- {
143
-
144
- $customer = $this->search_customer($payer_email);
145
-
146
- if ($customer['status'] == 200 && $customer['response']['paging']['total'] > 0) {
147
- $customer = $customer['response']['results'][0];
148
- } else {
149
- $resp = $this->create_customer($payer_email);
150
- $customer = $resp['response'];
151
- }
152
-
153
- return $customer;
154
-
155
- }
156
-
157
- /**
158
- * @param $email
159
- * @return array|null
160
- */
161
- public function create_customer($email)
162
- {
163
-
164
- $request = array(
165
- 'uri' => '/v1/customers',
166
- 'params' => array(
167
- 'access_token' => $this->get_access_token()
168
- ),
169
- 'data' => array(
170
- 'email' => $email
171
- )
172
- );
173
-
174
- $customer = MPRestClient::post($request);
175
- return $customer;
176
-
177
- }
178
-
179
- /**
180
- * @param $email
181
- * @return array|null
182
- */
183
- public function search_customer($email)
184
- {
185
-
186
- $request = array(
187
- 'uri' => '/v1/customers/search',
188
- 'params' => array(
189
- 'access_token' => $this->get_access_token(),
190
- 'email' => $email
191
- )
192
- );
193
-
194
- $customer = MPRestClient::get($request);
195
- return $customer;
196
-
197
- }
198
-
199
- /**
200
- * @param $customer_id
201
- * @param $token
202
- * @param null $payment_method_id
203
- * @param null $issuer_id
204
- * @return array|null
205
- */
206
- public function create_card_in_customer($customer_id, $token, $payment_method_id = null,
207
- $issuer_id = null)
208
- {
209
-
210
- $request = array(
211
- 'uri' => '/v1/customers/' . $customer_id . '/cards',
212
- 'params' => array(
213
- 'access_token' => $this->get_access_token()
214
- ),
215
- 'data' => array(
216
- 'token' => $token,
217
- 'issuer_id' => $issuer_id,
218
- 'payment_method_id' => $payment_method_id
219
- )
220
- );
221
-
222
- $card = MPRestClient::post($request);
223
- return $card;
224
-
225
- }
226
-
227
- /**
228
- * @param $customer_id
229
- * @param $token
230
- * @return array|null
231
- */
232
- public function get_all_customer_cards($customer_id, $token)
233
- {
234
-
235
- $request = array(
236
- 'uri' => '/v1/customers/' . $customer_id . '/cards',
237
- 'params' => array(
238
- 'access_token' => $this->get_access_token()
239
- )
240
- );
241
-
242
- $cards = MPRestClient::get($request);
243
- return $cards;
244
-
245
- }
246
-
247
- //=== COUPOM AND DISCOUNTS FUNCTIONS ===
248
-
249
- /**
250
- * @param $transaction_amount
251
- * @param $payer_email
252
- * @param $coupon_code
253
- * @return array|null
254
- */
255
- public function check_discount_campaigns($transaction_amount, $payer_email, $coupon_code)
256
- {
257
-
258
- $request = array(
259
- 'uri' => '/discount_campaigns',
260
- 'params' => array(
261
- 'access_token' => $this->get_access_token(),
262
- 'transaction_amount' => $transaction_amount,
263
- 'payer_email' => $payer_email,
264
- 'coupon_code' => $coupon_code
265
- )
266
- );
267
-
268
- $discount_info = MPRestClient::get($request);
269
- return $discount_info;
270
-
271
- }
272
-
273
- //=== CHECKOUT AUXILIARY FUNCTIONS ===
274
-
275
- /**
276
- * @param $id
277
- * @return array|null
278
- */
279
- public function get_authorized_payment($id)
280
- {
281
-
282
- $request = array(
283
- 'uri' => '/authorized_payments/{$id}',
284
- 'params' => array(
285
- 'access_token' => $this->get_access_token()
286
- )
287
- );
288
-
289
- $authorized_payment_info = MPRestClient::get($request);
290
- return $authorized_payment_info;
291
-
292
- }
293
-
294
- /**
295
- * @param $preference
296
- * @return array|null
297
- */
298
- public function create_preference($preference)
299
- {
300
-
301
- $request = array(
302
- 'uri' => '/checkout/preferences',
303
- 'params' => array(
304
- 'access_token' => $this->get_access_token()
305
- ),
306
- 'headers' => array(
307
- 'user-agent' => 'platform:desktop,type:woocommerce,so:' . WC_WooMercadoPago_Constants::VERSION
308
- ),
309
- 'data' => $preference
310
- );
311
-
312
- $preference_result = MPRestClient::post($request);
313
- return $preference_result;
314
-
315
- }
316
-
317
- /**
318
- * @param $id
319
- * @param $preference
320
- * @return array|null
321
- */
322
- public function update_preference($id, $preference)
323
- {
324
-
325
- $request = array(
326
- 'uri' => '/checkout/preferences/{$id}',
327
- 'params' => array(
328
- 'access_token' => $this->get_access_token()
329
- ),
330
- 'data' => $preference
331
- );
332
-
333
- $preference_result = MPRestClient::put($request);
334
- return $preference_result;
335
-
336
- }
337
-
338
- /**
339
- * @param $id
340
- * @return array|null
341
- */
342
- public function get_preference($id)
343
- {
344
-
345
- $request = array(
346
- 'uri' => '/checkout/preferences/{$id}',
347
- 'params' => array(
348
- 'access_token' => $this->get_access_token()
349
- )
350
- );
351
-
352
- $preference_result = MPRestClient::get($request);
353
- return $preference_result;
354
-
355
- }
356
-
357
- /**
358
- * @param $preference
359
- * @return array|null
360
- */
361
- public function create_payment($preference)
362
- {
363
-
364
- $request = array(
365
- 'uri' => '/v1/payments',
366
- 'params' => array(
367
- 'access_token' => $this->get_access_token()
368
- ),
369
- 'headers' => array(
370
- 'X-Tracking-Id' => 'platform:v1-whitelabel,type:woocommerce,so:' . WC_WooMercadoPago_Constants::VERSION
371
- ),
372
- 'data' => $preference
373
- );
374
-
375
- $payment = MPRestClient::post($request, WC_WooMercadoPago_Constants::VERSION);
376
- return $payment;
377
- }
378
-
379
- /**
380
- * @param $preapproval_payment
381
- * @return array|null
382
- */
383
- public function create_preapproval_payment($preapproval_payment)
384
- {
385
-
386
- $request = array(
387
- 'uri' => '/preapproval',
388
- 'params' => array(
389
- 'access_token' => $this->get_access_token()
390
- ),
391
- 'data' => $preapproval_payment
392
- );
393
-
394
- $preapproval_payment_result = MPRestClient::post($request);
395
- return $preapproval_payment_result;
396
-
397
- }
398
-
399
- /**
400
- * @param $id
401
- * @return array|null
402
- * @throws MercadoPagoException
403
- */
404
- public function get_preapproval_payment($id)
405
- {
406
-
407
- $request = array(
408
- 'uri' => '/preapproval/' . $id,
409
- 'params' => array(
410
- 'access_token' => $this->get_access_token()
411
- )
412
- );
413
-
414
- $preapproval_payment_result = MPRestClient::get($request);
415
- return $preapproval_payment_result;
416
-
417
- }
418
-
419
- /**
420
- * @param $id
421
- * @param $preapproval_payment
422
- * @return array|null
423
- * @throws MercadoPagoException
424
- */
425
- public function update_preapproval_payment($id, $preapproval_payment)
426
- {
427
-
428
- $request = array(
429
- 'uri' => '/preapproval/' . $id,
430
- 'params' => array(
431
- 'access_token' => $this->get_access_token()
432
- ),
433
- 'data' => $preapproval_payment
434
- );
435
-
436
- $preapproval_payment_result = MPRestClient::put($request);
437
- return $preapproval_payment_result;
438
-
439
- }
440
-
441
- /**
442
- * @param $id
443
- * @return array|null
444
- * @throws MercadoPagoException
445
- */
446
- public function cancel_preapproval_payment($id)
447
- {
448
-
449
- $request = array(
450
- 'uri' => '/preapproval/' . $id,
451
- 'params' => array(
452
- 'access_token' => $this->get_access_token()
453
- ),
454
- 'data' => array(
455
- 'status' => 'cancelled'
456
- )
457
- );
458
-
459
- $response = MPRestClient::put($request);
460
- return $response;
461
-
462
- }
463
-
464
- //=== REFUND AND CANCELING FLOW FUNCTIONS ===
465
-
466
- /**
467
- * @param $id
468
- * @return array|null
469
- * @throws MercadoPagoException
470
- */
471
- public function refund_payment($id)
472
- {
473
-
474
- $request = array(
475
- 'uri' => '/v1/payments/' . $id . '/refunds',
476
- 'params' => array(
477
- 'access_token' => $this->get_access_token()
478
- )
479
- );
480
-
481
- $response = MPRestClient::post($request);
482
- return $response;
483
-
484
- }
485
-
486
- /**
487
- * @param $id
488
- * @param $amount
489
- * @param $reason
490
- * @param $external_reference
491
- * @return array|null
492
- * @throws MercadoPagoException
493
- */
494
- public function partial_refund_payment($id, $amount, $reason, $external_reference)
495
- {
496
-
497
- $request = array(
498
- 'uri' => '/v1/payments/' . $id . '/refunds?access_token=' . $this->get_access_token(),
499
- 'data' => array(
500
- 'amount' => $amount,
501
- 'metadata' => array(
502
- 'metadata' => $reason,
503
- 'external_reference' => $external_reference
504
- )
505
- )
506
- );
507
-
508
- $response = MPRestClient::post($request);
509
- return $response;
510
-
511
- }
512
-
513
- /**
514
- * @param $id
515
- * @return array|null
516
- * @throws MercadoPagoException
517
- */
518
- public function cancel_payment($id)
519
- {
520
-
521
- $request = array(
522
- 'uri' => '/v1/payments/' . $id,
523
- 'params' => array(
524
- 'access_token' => $this->get_access_token()
525
- ),
526
- 'data' => '{"status":"cancelled"}'
527
- );
528
-
529
- $response = MPRestClient::put($request);
530
- return $response;
531
-
532
- }
533
-
534
- /**
535
- * @return array|null
536
- * @throws MercadoPagoException
537
- */
538
- public function get_payment_methods()
539
- {
540
- $request = array(
541
- 'uri' => '/v1/payment_methods',
542
- 'params' => array(
543
- 'access_token' => $this->get_access_token()
544
- )
545
- );
546
-
547
- $response = MPRestClient::get($request);
548
-
549
- return $response;
550
- }
551
-
552
- //=== GENERIC RESOURCE CALL METHODS ===
553
-
554
- /**
555
- * @param $request
556
- * @param null $params
557
- * @param bool $authenticate
558
- * @return array|null
559
- * @throws MercadoPagoException
560
- */
561
- public function get($request, $params = null, $authenticate = true)
562
- {
563
-
564
- if (is_string($request)) {
565
- $request = array(
566
- 'uri' => $request,
567
- 'params' => $params,
568
- 'authenticate' => $authenticate
569
- );
570
- }
571
-
572
- $request['params'] = isset($request['params']) && is_array($request['params']) ?
573
- $request['params'] :
574
- array();
575
-
576
- if (!isset($request['authenticate']) || $request['authenticate'] !== false) {
577
- $request['params']['access_token'] = $this->get_access_token();
578
- }
579
-
580
- $result = MPRestClient::get($request);
581
- return $result;
582
-
583
- }
584
-
585
- /**
586
- * @param $request
587
- * @param null $data
588
- * @param null $params
589
- * @return array|null
590
- * @throws MercadoPagoException
591
- */
592
- public function post($request, $data = null, $params = null)
593
- {
594
-
595
- if (is_string($request)) {
596
- $request = array(
597
- 'uri' => $request,
598
- 'data' => $data,
599
- 'params' => $params
600
- );
601
- }
602
-
603
- $request['params'] = isset($request['params']) && is_array($request['params']) ?
604
- $request["params"] :
605
- array();
606
-
607
- if (!isset ($request['authenticate']) || $request['authenticate'] !== false) {
608
- $request['params']['access_token'] = $this->get_access_token();
609
- }
610
-
611
- $result = MPRestClient::post($request);
612
- return $result;
613
-
614
- }
615
-
616
- /**
617
- * @param $request
618
- * @param null $data
619
- * @param null $params
620
- * @return array|null
621
- * @throws MercadoPagoException
622
- */
623
- public function put($request, $data = null, $params = null)
624
- {
625
-
626
- if (is_string($request)) {
627
- $request = array(
628
- 'uri' => $request,
629
- 'data' => $data,
630
- 'params' => $params
631
- );
632
- }
633
-
634
- $request['params'] = isset($request['params']) && is_array($request['params']) ?
635
- $request['params'] :
636
- array();
637
-
638
- if (!isset ($request['authenticate']) || $request['authenticate'] !== false) {
639
- $request['params']['access_token'] = $this->get_access_token();
640
- }
641
-
642
- $result = MPRestClient::put($request);
643
- return $result;
644
-
645
- }
646
-
647
- /**
648
- * @param $request
649
- * @param null $params
650
  * @return array|null
651
- * @throws MercadoPagoException
652
  */
653
- public function delete($request, $params = null)
654
  {
655
-
656
- if (is_string($request)) {
657
  $request = array(
658
- 'uri' => $request,
659
- 'params' => $params
660
  );
661
- }
662
-
663
- $request['params'] = isset($request['params']) && is_array($request['params']) ?
664
- $request['params'] :
665
- array();
666
 
667
- if (!isset($request['authenticate']) || $request['authenticate'] !== false) {
668
- $request['params']['access_token'] = $this->get_access_token();
 
669
  }
670
 
671
- $result = MPRestClient::delete($request);
672
- return $result;
673
-
674
- }
675
-
676
- //=== MODULE ANALYTICS FUNCTIONS ===
677
-
678
- /**
679
- * @param $module_info
680
- * @return array|null
681
- * @throws MercadoPagoException
682
- */
683
- public function analytics_save_settings($module_info)
684
- {
685
-
686
- $request = array(
687
- 'uri' => '/modules/tracking/settings?access_token=' . $this->get_access_token(),
688
- 'data' => $module_info
689
- );
690
-
691
- $result = MPRestClient::post($request);
692
  return $result;
693
-
694
- }
695
-
696
- /**
697
- * @param null $payment
698
- */
699
- public function setPaymentClass($payment = null)
700
- {
701
- if (!empty($payment)) {
702
- $this->paymentClass = get_class($payment);
703
- }
704
  }
705
 
706
- /**
707
- * @return mixed
708
- */
709
- public function getPaymentClass()
710
- {
711
- return $this->paymentClass;
712
- }
713
-
714
- /**
715
- * @param $accessToken
716
- * @return null
717
- */
718
- public function homologValidate($accessToken)
719
- {
720
- $seller = explode('-', $accessToken);
721
-
722
- $response = MeliRestClient::get(
723
- array('uri' => '/applications/' . $seller[1]), WC_WooMercadoPago_Constants::VERSION
724
- );
725
-
726
- //in case of failures
727
- if ($response['status'] > 202) {
728
- $log = WC_WooMercadoPago_Log::init_mercado_pago_log('WC_WooMercadoPago_Module');
729
- $log->write_log('API application_search_owner_id error:', $response['response']['message']);
730
- return 0;
731
- }
732
- //response treatment
733
- $result = $response['response'];
734
- if(in_array('payments',$result['scopes'])){
735
- return 1;
736
- }
737
- return 0;
738
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
739
  }
1
  <?php
2
 
3
  if (!defined('ABSPATH')) {
4
+ exit; // Exit if accessed directly.
5
  }
6
 
7
  $GLOBALS['LIB_LOCATION'] = dirname(__FILE__);
11
  */
12
  class MP
13
  {
14
+ private $client_id;
15
+ private $client_secret;
16
+ private $ll_access_token;
17
+ private $sandbox = FALSE;
18
+ private $accessTokenByClient;
19
+ private $paymentClass;
20
+
21
+ /**
22
+ * MP constructor.
23
+ * @throws WC_WooMercadoPago_Exception
24
+ */
25
+ public function __construct()
26
+ {
27
+ $includes_path = dirname(__FILE__);
28
+ require_once($includes_path . '/RestClient/AbstractRestClient.php');
29
+ require_once($includes_path . '/RestClient/MeliRestClient.php');
30
+ require_once($includes_path . '/RestClient/MpRestClient.php');
31
+
32
+ $i = func_num_args();
33
+ if ($i > 2 || $i < 1) {
34
+ throw new WC_WooMercadoPago_Exception('Invalid arguments. Use CLIENT_ID and CLIENT SECRET, or ACCESS_TOKEN');
35
+ }
36
+
37
+ if ($i == 1) {
38
+ $this->ll_access_token = func_get_arg(0);
39
+ }
40
+
41
+ if ($i == 2) {
42
+ $this->client_id = func_get_arg(0);
43
+ $this->client_secret = func_get_arg(1);
44
+ }
45
+ }
46
+
47
+ /**
48
+ * @param $email
49
+ */
50
+ public function set_email($email)
51
+ {
52
+ MPRestClient::set_email($email);
53
+ MeliRestClient::set_email($email);
54
+ }
55
+
56
+ /**
57
+ * @param $country_code
58
+ */
59
+ public function set_locale($country_code)
60
+ {
61
+ MPRestClient::set_locale($country_code);
62
+ MeliRestClient::set_locale($country_code);
63
+ }
64
+
65
+ /**
66
+ * @param null $enable
67
+ * @return bool
68
+ */
69
+ public function sandbox_mode($enable = NULL)
70
+ {
71
+ if (!is_null($enable)) {
72
+ $this->sandbox = $enable === TRUE;
73
+ }
74
+ return $this->sandbox;
75
+ }
76
+
77
+ /**
78
+ * @return mixed|null
79
+ * @throws WC_WooMercadoPago_Exception
80
+ */
81
+ public function get_access_token()
82
+ {
83
+
84
+ if (isset($this->ll_access_token) && !is_null($this->ll_access_token)) {
85
+ return $this->ll_access_token;
86
+ }
87
+
88
+ if (!empty($this->accessTokenByClient)) {
89
+ return $this->accessTokenByClient;
90
+ }
91
+
92
+ $app_client_values = array(
93
+ 'client_id' => $this->client_id,
94
+ 'client_secret' => $this->client_secret,
95
+ 'grant_type' => 'client_credentials'
96
+ );
97
+
98
+ $access_data = MPRestClient::post(
99
+ array(
100
+ 'uri' => '/oauth/token',
101
+ 'data' => $app_client_values,
102
+ 'headers' => array(
103
+ 'content-type' => 'application/x-www-form-urlencoded'
104
+ )
105
+ ),
106
+ WC_WooMercadoPago_Constants::VERSION
107
+ );
108
+
109
+ if ($access_data['status'] != 200) {
110
+ return null;
111
+ }
112
+
113
+ $response = $access_data['response'];
114
+ $this->accessTokenByClient = $response['access_token'];
115
+
116
+ return $this->accessTokenByClient;
117
+ }
118
+
119
+ /**
120
+ * @param $id
121
+ * @return array|null
122
+ * @throws WC_WooMercadoPago_Exception
123
+ */
124
+ public function search_paymentV1($id)
125
+ {
126
+
127
+ $request = array(
128
+ 'uri' => '/v1/payments/' . $id,
129
+ 'params' => array('access_token' => $this->get_access_token())
130
+ );
131
+
132
+ $payment = MPRestClient::get($request, WC_WooMercadoPago_Constants::VERSION);
133
+ return $payment;
134
+ }
135
+
136
+ //=== CUSTOMER CARDS FUNCTIONS ===
137
+
138
+ /**
139
+ * @param $payer_email
140
+ * @return array|mixed|null
141
+ * @throws WC_WooMercadoPago_Exception
142
+ */
143
+ public function get_or_create_customer($payer_email)
144
+ {
145
+
146
+ $customer = $this->search_customer($payer_email);
147
+
148
+ if ($customer['status'] == 200 && $customer['response']['paging']['total'] > 0) {
149
+ $customer = $customer['response']['results'][0];
150
+ } else {
151
+ $resp = $this->create_customer($payer_email);
152
+ $customer = $resp['response'];
153
+ }
154
+
155
+ return $customer;
156
+
157
+ }
158
+
159
+ /**
160
+ * @param $email
161
+ * @return array|null
162
+ * @throws WC_WooMercadoPago_Exception
163
+ */
164
+ public function create_customer($email)
165
+ {
166
+
167
+ $request = array(
168
+ 'uri' => '/v1/customers',
169
+ 'params' => array(
170
+ 'access_token' => $this->get_access_token()
171
+ ),
172
+ 'data' => array(
173
+ 'email' => $email
174
+ )
175
+ );
176
+
177
+ $customer = MPRestClient::post($request);
178
+ return $customer;
179
+
180
+ }
181
+
182
+ /**
183
+ * @param $email
184
+ * @return array|null
185
+ * @throws WC_WooMercadoPago_Exception
186
+ */
187
+ public function search_customer($email)
188
+ {
189
+
190
+ $request = array(
191
+ 'uri' => '/v1/customers/search',
192
+ 'params' => array(
193
+ 'access_token' => $this->get_access_token(),
194
+ 'email' => $email
195
+ )
196
+ );
197
+
198
+ $customer = MPRestClient::get($request);
199
+ return $customer;
200
+
201
+ }
202
+
203
+ /**
204
+ * @param $customer_id
205
+ * @param $token
206
+ * @param null $payment_method_id
207
+ * @param null $issuer_id
208
+ * @return array|null
209
+ * @throws WC_WooMercadoPago_Exception
210
+ */
211
+ public function create_card_in_customer($customer_id, $token, $payment_method_id = null,
212
+ $issuer_id = null)
213
+ {
214
+
215
+ $request = array(
216
+ 'uri' => '/v1/customers/' . $customer_id . '/cards',
217
+ 'params' => array(
218
+ 'access_token' => $this->get_access_token()
219
+ ),
220
+ 'data' => array(
221
+ 'token' => $token,
222
+ 'issuer_id' => $issuer_id,
223
+ 'payment_method_id' => $payment_method_id
224
+ )
225
+ );
226
+
227
+ $card = MPRestClient::post($request);
228
+ return $card;
229
+
230
+ }
231
+
232
+ /**
233
+ * @param $customer_id
234
+ * @param $token
235
+ * @return array|null
236
+ * @throws WC_WooMercadoPago_Exception
237
+ */
238
+ public function get_all_customer_cards($customer_id, $token)
239
+ {
240
+
241
+ $request = array(
242
+ 'uri' => '/v1/customers/' . $customer_id . '/cards',
243
+ 'params' => array(
244
+ 'access_token' => $this->get_access_token()
245
+ )
246
+ );
247
+
248
+ $cards = MPRestClient::get($request);
249
+ return $cards;
250
+
251
+ }
252
+
253
+ //=== COUPOM AND DISCOUNTS FUNCTIONS ===
254
+ /**
255
+ * @param $transaction_amount
256
+ * @param $payer_email
257
+ * @param $coupon_code
258
+ * @return array|null
259
+ * @throws WC_WooMercadoPago_Exception
260
+ */
261
+ public function check_discount_campaigns($transaction_amount, $payer_email, $coupon_code)
262
+ {
263
+ $request = array(
264
+ 'uri' => '/discount_campaigns',
265
+ 'params' => array(
266
+ 'access_token' => $this->get_access_token(),
267
+ 'transaction_amount' => $transaction_amount,
268
+ 'payer_email' => $payer_email,
269
+ 'coupon_code' => $coupon_code
270
+ )
271
+ );
272
+ $discount_info = MPRestClient::get($request);
273
+ return $discount_info;
274
+ }
275
+
276
+ //=== CHECKOUT AUXILIARY FUNCTIONS ===
277
+
278
+ /**
279
+ * @param $id
280
+ * @return array|null
281
+ * @throws WC_WooMercadoPago_Exception
282
+ */
283
+ public function get_authorized_payment($id)
284
+ {
285
+
286
+ $request = array(
287
+ 'uri' => '/authorized_payments/{$id}',
288
+ 'params' => array(
289
+ 'access_token' => $this->get_access_token()
290
+ )
291
+ );
292
+
293
+ $authorized_payment_info = MPRestClient::get($request);
294
+ return $authorized_payment_info;
295
+
296
+ }
297
+
298
+ /**
299
+ * @param $preference
300
+ * @return array|null
301
+ * @throws WC_WooMercadoPago_Exception
302
+ */
303
+ public function create_preference($preference)
304
+ {
305
+
306
+ $request = array(
307
+ 'uri' => '/checkout/preferences',
308
+ 'params' => array(
309
+ 'access_token' => $this->get_access_token()
310
+ ),
311
+ 'headers' => array(
312
+ 'user-agent' => 'platform:desktop,type:woocommerce,so:' . WC_WooMercadoPago_Constants::VERSION
313
+ ),
314
+ 'data' => $preference
315
+ );
316
+
317
+ $preference_result = MPRestClient::post($request);
318
+ return $preference_result;
319
+
320
+ }
321
+
322
+ /**
323
+ * @param $id
324
+ * @param $preference
325
+ * @return array|null
326
+ * @throws WC_WooMercadoPago_Exception
327
+ */
328
+ public function update_preference($id, $preference)
329
+ {
330
+
331
+ $request = array(
332
+ 'uri' => '/checkout/preferences/{$id}',
333
+ 'params' => array(
334
+ 'access_token' => $this->get_access_token()
335
+ ),
336
+ 'data' => $preference
337
+ );
338
+
339
+ $preference_result = MPRestClient::put($request);
340
+ return $preference_result;
341
+
342
+ }
343
+
344
+ /**
345
+ * @param $id
346
+ * @return array|null
347
+ * @throws WC_WooMercadoPago_Exception
348
+ */
349
+ public function get_preference($id)
350
+ {
351
+
352
+ $request = array(
353
+ 'uri' => '/checkout/preferences/{$id}',
354
+ 'params' => array(
355
+ 'access_token' => $this->get_access_token()
356
+ )
357
+ );
358
+
359
+ $preference_result = MPRestClient::get($request);
360
+ return $preference_result;
361
+
362
+ }
363
+
364
+ /**
365
+ * @param $preference
366
+ * @return array|null
367
+ * @throws WC_WooMercadoPago_Exception
368
+ */
369
+ public function create_payment($preference)
370
+ {
371
+
372
+ $request = array(
373
+ 'uri' => '/v1/payments',
374
+ 'params' => array(
375
+ 'access_token' => $this->get_access_token()
376
+ ),
377
+ 'headers' => array(
378
+ 'X-Tracking-Id' => 'platform:v1-whitelabel,type:woocommerce,so:' . WC_WooMercadoPago_Constants::VERSION
379
+ ),
380
+ 'data' => $preference
381
+ );
382
+
383
+ $payment = MPRestClient::post($request, WC_WooMercadoPago_Constants::VERSION);
384
+ return $payment;
385
+ }
386
+
387
+ /**
388
+ * @param $preapproval_payment
389
+ * @return array|null
390
+ * @throws WC_WooMercadoPago_Exception
391
+ */
392
+ public function create_preapproval_payment($preapproval_payment)
393
+ {
394
+
395
+ $request = array(
396
+ 'uri' => '/preapproval',
397
+ 'params' => array(
398
+ 'access_token' => $this->get_access_token()
399
+ ),
400
+ 'data' => $preapproval_payment
401
+ );
402
+
403
+ $preapproval_payment_result = MPRestClient::post($request);
404
+ return $preapproval_payment_result;
405
+
406
+ }
407
+
408
+ /**
409
+ * @param $id
410
+ * @return array|null
411
+ * @throws WC_WooMercadoPago_Exception
412
+ */
413
+ public function get_preapproval_payment($id)
414
+ {
415
+
416
+ $request = array(
417
+ 'uri' => '/preapproval/' . $id,
418
+ 'params' => array(
419
+ 'access_token' => $this->get_access_token()
420
+ )
421
+ );
422
+
423
+ $preapproval_payment_result = MPRestClient::get($request);
424
+ return $preapproval_payment_result;
425
+
426
+ }
427
+
428
+ /**
429
+ * @param $id
430
+ * @param $preapproval_payment
431
+ * @return array|null
432
+ * @throws WC_WooMercadoPago_Exception
433
+ */
434
+ public function update_preapproval_payment($id, $preapproval_payment)
435
+ {
436
+
437
+ $request = array(
438
+ 'uri' => '/preapproval/' . $id,
439
+ 'params' => array(
440
+ 'access_token' => $this->get_access_token()
441
+ ),
442
+ 'data' => $preapproval_payment
443
+ );
444
+
445
+ $preapproval_payment_result = MPRestClient::put($request);
446
+ return $preapproval_payment_result;
447
+
448
+ }
449
+
450
+ /**
451
+ * @param $id
452
+ * @return array|null
453
+ * @throws WC_WooMercadoPago_Exception
454
+ */
455
+ public function cancel_preapproval_payment($id)
456
+ {
457
+
458
+ $request = array(
459
+ 'uri' => '/preapproval/' . $id,
460
+ 'params' => array(
461
+ 'access_token' => $this->get_access_token()
462
+ ),
463
+ 'data' => array(
464
+ 'status' => 'cancelled'
465
+ )
466
+ );
467
+
468
+ $response = MPRestClient::put($request);
469
+ return $response;
470
+
471
+ }
472
+
473
+ //=== REFUND AND CANCELING FLOW FUNCTIONS ===
474
+
475
+ /**
476
+ * @param $id
477
+ * @return array|null
478
+ * @throws WC_WooMercadoPago_Exception
479
+ */
480
+ public function refund_payment($id)
481
+ {
482
+
483
+ $request = array(
484
+ 'uri' => '/v1/payments/' . $id . '/refunds',
485
+ 'params' => array(
486
+ 'access_token' => $this->get_access_token()
487
+ )
488
+ );
489
+
490
+ $response = MPRestClient::post($request);
491
+ return $response;
492
+
493
+ }
494
+
495
+ /**
496
+ * @param $id
497
+ * @param $amount
498
+ * @param $reason
499
+ * @param $external_reference
500
+ * @return array|null
501
+ * @throws WC_WooMercadoPago_Exception
502
+ */
503
+ public function partial_refund_payment($id, $amount, $reason, $external_reference)
504
+ {
505
+
506
+ $request = array(
507
+ 'uri' => '/v1/payments/' . $id . '/refunds?access_token=' . $this->get_access_token(),
508
+ 'data' => array(
509
+ 'amount' => $amount,
510
+ 'metadata' => array(
511
+ 'metadata' => $reason,
512
+ 'external_reference' => $external_reference
513
+ )
514
+ )
515
+ );
516
+
517
+ $response = MPRestClient::post($request);
518
+ return $response;
519
+
520
+ }
521
+
522
+ /**
523
+ * @param $id
524
+ * @return array|null
525
+ * @throws WC_WooMercadoPago_Exception
526
+ */
527
+ public function cancel_payment($id)
528
+ {
529
+
530
+ $request = array(
531
+ 'uri' => '/v1/payments/' . $id,
532
+ 'params' => array(
533
+ 'access_token' => $this->get_access_token()
534
+ ),
535
+ 'data' => '{"status":"cancelled"}'
536
+ );
537
+
538
+ $response = MPRestClient::put($request);
539
+ return $response;
540
+
541
+ }
542
+
543
+ /**
544
+ * @return array|null
545
+ * @throws WC_WooMercadoPago_Exception
546
+ */
547
+ public function get_payment_methods()
548
+ {
549
+ $request = array(
550
+ 'uri' => '/v1/payment_methods',
551
+ 'params' => array(
552
+ 'access_token' => $this->get_access_token()
553
+ )
554
+ );
555
+
556
+ $response = MPRestClient::get($request);
557
+
558
+ return $response;
559
+ }
560
+
561
+ //=== GENERIC RESOURCE CALL METHODS ===
562
+
563
+ /**
564
+ * @param $request
565
+ * @param null $params
566
+ * @param bool $authenticate
567
+ * @return array|null
568
+ * @throws WC_WooMercadoPago_Exception
569
+ */
570
+ public function get($request, $params = null, $authenticate = true)
571
+ {
572
+
573
+ if (is_string($request)) {
574
+ $request = array(
575
+ 'uri' => $request,
576
+ 'params' => $params,
577
+ 'authenticate' => $authenticate
578
+ );
579
+ }
580
+
581
+ $request['params'] = isset($request['params']) && is_array($request['params']) ?
582
+ $request['params'] :
583
+ array();
584
+
585
+ if (!isset($request['authenticate']) || $request['authenticate'] !== false) {
586
+ $request['params']['access_token'] = $this->get_access_token();
587
+ }
588
+
589
+ $result = MPRestClient::get($request);
590
+ return $result;
591
+
592
+ }
593
+
594
+ /**
595
+ * @param $request
596
+ * @param null $data
597
+ * @param null $params
598
+ * @return array|null
599
+ * @throws WC_WooMercadoPago_Exception
600
+ */
601
+ public function post($request, $data = null, $params = null)
602
+ {
603
+
604
+ if (is_string($request)) {
605
+ $request = array(
606
+ 'uri' => $request,
607
+ 'data' => $data,
608
+ 'params' => $params
609
+ );
610
+ }
611
+
612
+ $request['params'] = isset($request['params']) && is_array($request['params']) ?
613
+ $request["params"] :
614
+ array();
615
+
616
+ if (!isset ($request['authenticate']) || $request['authenticate'] !== false) {
617
+ $request['params']['access_token'] = $this->get_access_token();
618
+ }
619
+
620
+ $result = MPRestClient::post($request);
621
+ return $result;
622
+
623
+ }
624
+
625
+ /**
626
+ * @param $request
627
+ * @param null $data
628
+ * @param null $params
629
+ * @return array|null
630
+ * @throws WC_WooMercadoPago_Exception
631
+ */
632
+ public function put($request, $data = null, $params = null)
633
+ {
634
+
635
+ if (is_string($request)) {
636
+ $request = array(
637
+ 'uri' => $request,
638
+ 'data' => $data,
639
+ 'params' => $params
640
+ );
641
+ }
642
+
643
+ $request['params'] = isset($request['params']) && is_array($request['params']) ?
644
+ $request['params'] :
645
+ array();
646
+
647
+ if (!isset ($request['authenticate']) || $request['authenticate'] !== false) {
648
+ $request['params']['access_token'] = $this->get_access_token();
649
+ }
650
+
651
+ $result = MPRestClient::put($request);
652
+ return $result;
653
+
654
+ }
655
+
656
+ /**
657
+ * @param $request
658
+ * @param null $params
659
+ * @return array|null
660
+ * @throws WC_WooMercadoPago_Exception
661
+ */
662
+ public function delete($request, $params = null)
663
+ {
664
+
665
+ if (is_string($request)) {
666
+ $request = array(
667
+ 'uri' => $request,
668
+ 'params' => $params
669
+ );
670
+ }
671
+
672
+ $request['params'] = isset($request['params']) && is_array($request['params']) ?
673
+ $request['params'] :
674
+ array();
675
+
676
+ if (!isset($request['authenticate']) || $request['authenticate'] !== false) {
677
+ $request['params']['access_token'] = $this->get_access_token();
678
+ }
679
+
680
+ $result = MPRestClient::delete($request);
681
+ return $result;
682
+
683
+ }
684
+
685
+ //=== MODULE ANALYTICS FUNCTIONS ===
686
 
687
  /**
688
+ * @param $module_info
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
689
  * @return array|null
690
+ * @throws WC_WooMercadoPago_Exception
691
  */
692
+ public function analytics_save_settings($module_info)
693
  {
694
+ try {
 
695
  $request = array(
696
+ 'uri' => '/modules/tracking/settings?access_token=' . $this->get_access_token(),
697
+ 'data' => $module_info,
698
  );
 
 
 
 
 
699
 
700
+ $result = MPRestClient::post($request);
701
+ } catch (Exception $e) {
702
+ $result = null;
703
  }
704
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
705
  return $result;
 
 
 
 
 
 
 
 
 
 
 
706
  }
707
 
708
+ /**
709
+ * @param null $payment
710
+ */
711
+ public function setPaymentClass($payment = null)
712
+ {
713
+ if (!empty($payment)) {
714
+ $this->paymentClass = get_class($payment);
715
+ }
716
+ }
717
+
718
+ /**
719
+ * @return mixed
720
+ */
721
+ public function getPaymentClass()
722
+ {
723
+ return $this->paymentClass;
724
+ }
725
+
726
+ /**
727
+ * @param $accessToken
728
+ * @return int
729
+ * @throws WC_WooMercadoPago_Exception
730
+ */
731
+ public function homologValidate($accessToken)
732
+ {
733
+ $session = 'homolog_validate_' . $accessToken;
734
+ if (isset($_SESSION[$session])) {
735
+ return $_SESSION[$session];
736
+ }
737
+
738
+ $seller = explode('-', $accessToken);
739
+ $response = MeliRestClient::get(
740
+ array('uri' => '/applications/' . $seller[1]), WC_WooMercadoPago_Constants::VERSION
741
+ );
742
+
743
+ //in case of failures
744
+ if ($response['status'] > 202) {
745
+ $log = WC_WooMercadoPago_Log::init_mercado_pago_log('WC_WooMercadoPago_Module');
746
+ $log->write_log('API application_search_owner_id error:', $response['response']['message']);
747
+ $_SESSION[$session] = 0;
748
+ return 0;
749
+ }
750
+ //response treatment
751
+ $result = $response['response'];
752
+ if (in_array('payments', $result['scopes'])) {
753
+ $_SESSION[$session] = 1;
754
+ return 1;
755
+ }
756
+ $_SESSION[$session] = 0;
757
+ return 0;
758
+ }
759
  }
includes/module/sdk/lib/RestClient/AbstractRestClient.php CHANGED
@@ -16,9 +16,12 @@ class AbstractRestClient
16
  */
17
  public static function execAbs($request, $url)
18
  {
19
- $connect = self::build_request($request, $url);
20
-
21
- return self::execute($request, $connect);
 
 
 
22
  }
23
 
24
  /**
@@ -115,11 +118,10 @@ class AbstractRestClient
115
  {
116
  $response = null;
117
  $api_result = curl_exec($connect);
118
- $api_http_code = curl_getinfo($connect, CURLINFO_HTTP_CODE);
119
-
120
- if ($api_result === FALSE) {
121
  throw new WC_WooMercadoPago_Exception (curl_error($connect));
122
  }
 
123
 
124
  if ($api_http_code != null && $api_result != null) {
125
  $response = array('status' => $api_http_code, 'response' => json_decode($api_result, true));
16
  */
17
  public static function execAbs($request, $url)
18
  {
19
+ try {
20
+ $connect = self::build_request($request, $url);
21
+ return self::execute($request, $connect);
22
+ } catch (Exception $e) {
23
+ return null;
24
+ }
25
  }
26
 
27
  /**
118
  {
119
  $response = null;
120
  $api_result = curl_exec($connect);
121
+ if (curl_errno($connect)) {
 
 
122
  throw new WC_WooMercadoPago_Exception (curl_error($connect));
123
  }
124
+ $api_http_code = curl_getinfo($connect, CURLINFO_HTTP_CODE);
125
 
126
  if ($api_http_code != null && $api_result != null) {
127
  $response = array('status' => $api_http_code, 'response' => json_decode($api_result, true));
includes/module/sdk/lib/RestClient/MeliRestClient.php CHANGED
@@ -8,7 +8,6 @@ class MeliRestClient extends AbstractRestClient
8
 
9
  /**
10
  * @param $request
11
- * @param $version
12
  * @return array|null
13
  * @throws WC_WooMercadoPago_Exception
14
  */
@@ -20,7 +19,6 @@ class MeliRestClient extends AbstractRestClient
20
 
21
  /**
22
  * @param $request
23
- * @param $version
24
  * @return array|null
25
  * @throws WC_WooMercadoPago_Exception
26
  */
@@ -32,7 +30,6 @@ class MeliRestClient extends AbstractRestClient
32
 
33
  /**
34
  * @param $request
35
- * @param $version
36
  * @return array|null
37
  * @throws WC_WooMercadoPago_Exception
38
  */
@@ -44,7 +41,6 @@ class MeliRestClient extends AbstractRestClient
44
 
45
  /**
46
  * @param $request
47
- * @param $version
48
  * @return array|null
49
  * @throws WC_WooMercadoPago_Exception
50
  */
8
 
9
  /**
10
  * @param $request
 
11
  * @return array|null
12
  * @throws WC_WooMercadoPago_Exception
13
  */
19
 
20
  /**
21
  * @param $request
 
22
  * @return array|null
23
  * @throws WC_WooMercadoPago_Exception
24
  */
30
 
31
  /**
32
  * @param $request
 
33
  * @return array|null
34
  * @throws WC_WooMercadoPago_Exception
35
  */
41
 
42
  /**
43
  * @param $request
 
44
  * @return array|null
45
  * @throws WC_WooMercadoPago_Exception
46
  */
includes/notification/WC_WooMercadoPago_Notification_Abstract.php CHANGED
@@ -60,27 +60,28 @@ 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
- * @param $data
65
- * @return bool|void|WC_Order|WC_Order_Refund
66
- */
 
67
  public function successful_request($data)
68
  {
69
  $this->log->write_log(__FUNCTION__, 'starting to process ipn update...');
70
  $order_key = $data['external_reference'];
71
  if (empty($order_key)) {
72
- return;
73
  }
74
  $invoice_prefix = get_option('_mp_store_identificator', 'WC-');
75
  $id = (int)str_replace($invoice_prefix, '', $order_key);
76
  $order = wc_get_order($id);
77
  if (!$order) {
78
- return;
79
  }
80
 
81
  $order_id = (method_exists($order, 'get_id') ? $order->get_id() : $order->get_id());
82
  if ($order_id !== $id) {
83
- return;
84
  }
85
  $this->log->write_log(__FUNCTION__, 'updating metadata and status with data: ' . json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
86
 
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 mixed
66
+ * @throws WC_WooMercadoPago_Exception
67
+ */
68
  public function successful_request($data)
69
  {
70
  $this->log->write_log(__FUNCTION__, 'starting to process ipn update...');
71
  $order_key = $data['external_reference'];
72
  if (empty($order_key)) {
73
+ throw new WC_WooMercadoPago_Exception('Invalid external reference.', 422);
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
+ throw new WC_WooMercadoPago_Exception('Order not found.', 422);
80
  }
81
 
82
  $order_id = (method_exists($order, 'get_id') ? $order->get_id() : $order->get_id());
83
  if ($order_id !== $id) {
84
+ throw new WC_WooMercadoPago_Exception('Order Id error', 422);
85
  }
86
  $this->log->write_log(__FUNCTION__, 'updating metadata and status with data: ' . json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
87
 
includes/notification/WC_WooMercadoPago_Notification_IPN.php CHANGED
@@ -64,14 +64,17 @@ class WC_WooMercadoPago_Notification_IPN extends WC_WooMercadoPago_Notification_
64
  * @return bool|void|WC_Order|WC_Order_Refund
65
  * @throws WC_Data_Exception
66
  */
67
- public function successful_request($data)
68
- {
69
- $order = parent::successful_request($data);
70
- $processed_status = $this->process_status_mp_business($data, $order);
71
- $this->log->write_log(__FUNCTION__, 'Changing order status to: ' . parent::get_wc_status_for_mp_status(str_replace('_', '', $processed_status)));
72
- $this->proccessStatus($processed_status, $data, $order);
73
- $this->check_mercado_envios($data);
74
- }
 
 
 
75
 
76
  /**
77
  * @param $data
@@ -163,143 +166,4 @@ class WC_WooMercadoPago_Notification_IPN extends WC_WooMercadoPago_Notification_
163
  }
164
  return $status;
165
  }
166
-
167
- /**
168
- * @param $merchant_order
169
- * @throws WC_Data_Exception
170
- */
171
- public function check_mercado_envios($merchant_order)
172
- {
173
- $order_key = $merchant_order['external_reference'];
174
- if (!empty($order_key)) {
175
- $invoice_prefix = get_option('_mp_store_identificator', 'WC-');
176
- $order_id = (int)str_replace($invoice_prefix, '', $order_key);
177
- $order = wc_get_order($order_id);
178
- if (count($merchant_order['shipments']) > 0) {
179
- foreach ($merchant_order['shipments'] as $shipment) {
180
-
181
- $shipment_id = $shipment['id'];
182
- $shipment_name = $shipment['shipping_option']['name'];
183
- $shipment_cost = $shipment['shipping_option']['cost'];
184
- $shipping_method_id = $shipment['shipping_option']['shipping_method_id'];
185
-
186
- $shipping_meta = $order->get_items('shipping');
187
- $order_item_shipping_id = null;
188
- $method_id = null;
189
- foreach ($shipping_meta as $key => $shipping) {
190
- $order_item_shipping_id = $key;
191
- $method_id = $shipping['method_id'];
192
- }
193
- $free_shipping_text = '';
194
- $free_shipping_status = 'no';
195
- if ($shipment_cost == 0) {
196
- $free_shipping_status = 'yes';
197
- $free_shipping_text = ' (' . __('Envío Gratuito', 'woocommerce') . ')';
198
- }
199
- // WooCommerce 3.0 or later.
200
- if (method_exists($order, 'get_id')) {
201
- $shipping_item = $order->get_item($order_item_shipping_id);
202
- $shipping_item->set_order_id($order->get_id());
203
- // Update shipping cost and method title.
204
- $shipping_item->set_props(array(
205
- 'method_title' => 'Mercado Envios - ' . $shipment_name . $free_shipping_text,
206
- 'method_id' => $method_id,
207
- 'total' => wc_format_decimal($shipment_cost),
208
- ));
209
- $shipping_item->save();
210
- $order->calculate_shipping();
211
- } else {
212
- $order->update_shipping($order_item_shipping_id, array(
213
- 'method_title' => 'Mercado Envios - ' . $shipment_name . $free_shipping_text,
214
- 'method_id' => $method_id,
215
- 'cost' => wc_format_decimal($shipment_cost)
216
- ));
217
- }
218
- $order->set_total(wc_format_decimal($shipment_cost), 'shipping');
219
- $order->set_total(
220
- wc_format_decimal($order->get_subtotal())
221
- + wc_format_decimal($order->get_total_shipping())
222
- + wc_format_decimal($order->get_total_tax())
223
- - wc_format_decimal($order->get_total_discount())
224
- );
225
- // Update additional info.
226
- wc_update_order_item_meta($order_item_shipping_id, 'shipping_method_id', $shipping_method_id);
227
- wc_update_order_item_meta($order_item_shipping_id, 'free_shipping', $free_shipping_status);
228
- $access_token = $this->mp->get_access_token();
229
- $request = array(
230
- 'uri' => '/shipments/' . $shipment_id,
231
- 'params' => array(
232
- 'access_token' => $access_token
233
- )
234
- );
235
-
236
- $email = (wp_get_current_user()->ID != 0) ? wp_get_current_user()->user_email : null;
237
- MeliRestClient::set_email($email);
238
- $shipments_data = MeliRestClient::get($request);
239
-
240
- switch ($shipments_data['response']['substatus']) {
241
- case 'ready_to_print':
242
- $substatus_description = __('Label ready to print', 'woocommerce-mercadopago');
243
- break;
244
- case 'printed':
245
- $substatus_description = __('Label ready to print', 'woocommerce-mercadopago');
246
- break;
247
- case 'stale':
248
- $substatus_description = __('Failed', 'woocommerce-mercadopago');
249
- break;
250
- case 'delayed':
251
- $substatus_description = __('Delayed Shipping', 'woocommerce-mercadopago');
252
- break;
253
- case 'receiver_absent':
254
- $substatus_description = __('Recipient absent for shipment', 'woocommerce-mercadopago');
255
- break;
256
- case 'returning_to_sender':
257
- $substatus_description = __('Returning to the sender', 'woocommerce-mercadopago');
258
- break;
259
- case 'claimed_me':
260
- $substatus_description = __('The buyer initiated a discussion and request a chargeback.', 'woocommerce-mercadopago');
261
- break;
262
- default:
263
- $substatus_description = $shipments_data['response']['substatus'];
264
- break;
265
- }
266
- if ($substatus_description == '') {
267
- $substatus_description = $shipments_data['response']['status'];
268
- }
269
- $order->add_order_note('Mercado Envios: ' . $substatus_description);
270
- $this->log->write_log(__FUNCTION__, 'Mercado Envios - shipments_data : ' . json_encode($shipments_data, JSON_PRETTY_PRINT));
271
- update_post_meta($order_id, '_mercadoenvios_tracking_number', $shipments_data['response']['tracking_number']);
272
- update_post_meta($order_id, '_mercadoenvios_shipment_id', $shipment_id);
273
- update_post_meta($order_id, '_mercadoenvios_status', $shipments_data['response']['status']);
274
- update_post_meta($order_id, '_mercadoenvios_substatus', $shipments_data['response']['substatus']);
275
- $tracking_id = $shipments_data['response']['tracking_number'];
276
- if (isset($order->billing_email) && isset($tracking_id)) {
277
- $list_of_items = array();
278
- $items = $order->get_items();
279
- foreach ($items as $item) {
280
- $product = new WC_product($item['product_id']);
281
- if (method_exists($product, 'get_description')) {
282
- $product_title = $product->get_name();
283
- } else {
284
- $product_title = $product->post->post_title;
285
- }
286
- array_push($list_of_items, $product_title . ' x ' . $item['qty']);
287
- }
288
- wp_mail(
289
- $order->billing_email,
290
- __('Order', 'woocommerce-mercadopago') . ' ' . $order_id . ' - ' . __('Mercado Envios Tracking ID', 'woocommerce-mercadopago'),
291
- __('Hello,', 'woocommerce-mercadopago') . "\r\n\r\n" .
292
- __('Your order', 'woocommerce-mercadopago') . ' ' . ' [ ' . implode(', ', $list_of_items) . ' ] ' .
293
- __('made in', 'woocommerce-mercadopago') . ' ' . get_site_url() . ' ' .
294
- __('He used the Shipping Market as his means of shipping.', 'woocommerce-mercadopago') . "\r\n" .
295
- __('You can track it with the following tracking code:', 'woocommerce-mercadopago') . ' ' . $tracking_id . ".\r\n\r\n" .
296
- __('Greetings.', 'woocommerce-mercadopago')
297
- );
298
- }
299
- }
300
- }
301
- }
302
- }
303
-
304
-
305
  }
64
  * @return bool|void|WC_Order|WC_Order_Refund
65
  * @throws WC_Data_Exception
66
  */
67
+ public function successful_request($data)
68
+ {
69
+ try {
70
+ $order = parent::successful_request($data);
71
+ $processed_status = $this->process_status_mp_business($data, $order);
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
+ }
78
 
79
  /**
80
  * @param $data
166
  }
167
  return $status;
168
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
169
  }
includes/notification/WC_WooMercadoPago_Notification_Webhook.php CHANGED
@@ -74,10 +74,15 @@ class WC_WooMercadoPago_Notification_Webhook extends WC_WooMercadoPago_Notificat
74
  */
75
  public function successful_request($data)
76
  {
77
- $order = parent::successful_request($data);
78
- $status = $this->process_status_mp_business($data, $order);
79
- $this->log->write_log(__FUNCTION__, 'Changing order status to: ' . parent::get_wc_status_for_mp_status(str_replace('_', '', $status)));
80
- $this->proccessStatus($status, $data, $order);
 
 
 
 
 
81
  }
82
 
83
  /**
@@ -184,4 +189,4 @@ class WC_WooMercadoPago_Notification_Webhook extends WC_WooMercadoPago_Notificat
184
  }
185
  return $status;
186
  }
187
- }
74
  */
75
  public function successful_request($data)
76
  {
77
+ try {
78
+ $order = parent::successful_request($data);
79
+ $status = $this->process_status_mp_business($data, $order);
80
+ $this->log->write_log(__FUNCTION__, 'Changing order status to: ' . parent::get_wc_status_for_mp_status(str_replace('_', '', $status)));
81
+ $this->proccessStatus($status, $data, $order);
82
+ }catch (Exception $e){
83
+ $this->log->write_log(__FUNCTION__, $e->getMessage());
84
+ }
85
+
86
  }
87
 
88
  /**
189
  }
190
  return $status;
191
  }
192
+ }
includes/payments/WC_WooMercadoPago_BasicGateway.php CHANGED
@@ -23,13 +23,13 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
23
  return;
24
  }
25
 
26
- $this->desc = __('It offers all means of payment: credit and debit cards, cash and account money. Your customers choose whether they pay as guests or from their Mercado Pago account.', 'woocommerce-mercadopago');
27
 
28
  $this->form_fields = array();
29
- $this->method_title = __('Mercado Pago - Basic Checkout', 'woocommerce-mercadopago');
30
  $this->method = $this->getOption('method', 'redirect');
31
  $this->title = __('Pay with the payment method you prefer', 'woocommerce-mercadopago');
32
- $this->method_description = $this->getMethodDescription($this->desc);
33
  $this->auto_return = $this->getOption('auto_return', 'yes');
34
  $this->success_url = $this->getOption('success_url', '');
35
  $this->failure_url = $this->getOption('failure_url', '');
@@ -43,6 +43,7 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
43
  $this->form_fields = $this->getFormFields('Basic');
44
  $this->hook = new WC_WooMercadoPago_Hook_Basic($this);
45
  $this->notification = new WC_WooMercadoPago_Notification_IPN($this);
 
46
  }
47
 
48
  /**
@@ -51,7 +52,7 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
51
  */
52
  public function getFormFields($label)
53
  {
54
- if (is_admin()) {
55
  wp_enqueue_script(
56
  'woocommerce-mercadopago-basic-config-script',
57
  plugins_url('../assets/js/basic_config_mercadopago.js', plugin_dir_path(__FILE__))
@@ -136,7 +137,7 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
136
  'checkout_homolog_title',
137
  'checkout_homolog_subtitle',
138
  'checkout_homolog_link',
139
- // Configure WooCommerce Mercado Pago
140
  'checkout_options_title',
141
  'checkout_options_subtitle',
142
  'mp_statement_descriptor',
@@ -152,7 +153,7 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
152
  'checkout_payments_description',
153
  'enabled',
154
  'installments',
155
- // Advanced payment experience settings
156
  'checkout_payments_advanced_title',
157
  'checkout_payments_advanced_description',
158
  'method',
@@ -228,17 +229,20 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
228
  {
229
  $checkout_header = array(
230
  'title' => sprintf(
231
- __('Basic Checkout Accept all method of payment and take your charges to another level %s', 'woocommerce-mercadopago'),
232
  '<div class="row">
 
 
 
233
  <div class="mp-col-md-12">
234
- <p class="text-checkout-body mp-mb-0">
235
  ' . __('Turn your online store into your customers preferred payment gateway. Choose if the final payment experience will be inside or outside your store.', 'woocommerce-mercadopago') . '
236
  </p>
237
  </div>
238
  </div>'
239
  ),
240
  'type' => 'title',
241
- 'class' => 'mp_title_checkout'
242
  );
243
  return $checkout_header;
244
  }
@@ -249,7 +253,7 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
249
  public function field_checkout_options_title()
250
  {
251
  $checkout_options_title = array(
252
- 'title' => __('Configure WooCommerce Mercado Pago', 'woocommerce-mercadopago'),
253
  'type' => 'title',
254
  'class' => 'mp_title_bd'
255
  );
@@ -262,7 +266,7 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
262
  public function field_checkout_options_description()
263
  {
264
  $checkout_options_description = array(
265
- 'title' => __('Enable the experience of the basic checkout of Mercado Pago in your online store, select the means of payment available to your customers and<br> define the maximum fees in which they can pay you.', 'woocommerce-mercadopago'),
266
  'type' => 'title',
267
  'class' => 'mp_small_text'
268
  );
@@ -277,7 +281,7 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
277
  $checkout_options_subtitle = array(
278
  'title' => __('Go to the basics. Place your business information.', 'woocommerce-mercadopago'),
279
  'type' => 'title',
280
- 'class' => 'mp_subtitle mp-mt-5'
281
  );
282
  return $checkout_options_subtitle;
283
  }
@@ -301,7 +305,7 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
301
  public function field_checkout_payments_advanced_title()
302
  {
303
  $checkout_payments_advanced_title = array(
304
- 'title' => __('Advanced payment experience settings', 'woocommerce-mercadopago'),
305
  'type' => 'title',
306
  'class' => 'mp_subtitle_bd'
307
  );
@@ -314,7 +318,7 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
314
  public function field_method()
315
  {
316
  $method = array(
317
- 'title' => __('Integration method', 'woocommerce-mercadopago'),
318
  'type' => 'select',
319
  'description' => __('Define what payment experience your customers will have, whether inside or outside your store.', 'woocommerce-mercadopago'),
320
  'default' => ($this->method == 'iframe') ? 'redirect' : $this->method,
@@ -469,7 +473,7 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
469
 
470
  if ($count_payment == 1) {
471
  $element['title'] = __('Payment methods', 'woocommerce-mercadopago');
472
- $element['desc_tip'] = __('Selecciona los medios de pago disponibles en tu tienda.', 'woocommerce-services');
473
  }
474
  if ($count_payment == count($get_payment_methods)) {
475
  $element['description'] = __('Enable the payment methods available to your customers.', 'woocommerce-mercadopago');
@@ -493,7 +497,7 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
493
  'title' => __('Return to the store', 'woocommerce-mercadopago'),
494
  'type' => 'select',
495
  'default' => 'yes',
496
- 'description' => __('Your customer automatically return to the store after payment.', 'woocommerce-mercadopago'),
497
  'options' => array(
498
  'yes' => __('Yes', 'woocommerce-mercadopago'),
499
  'no' => __('No', 'woocommerce-mercadopago'),
@@ -517,6 +521,7 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
517
  $debito = 0;
518
  $credito = 0;
519
  $efectivo = 0;
 
520
  $tarjetas = get_option('_checkout_payments_methods', '');
521
  $installments = $this->getOption('installments');
522
  $str_cuotas = __('installments', 'woocommerce-mercadopago');
@@ -553,6 +558,7 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
553
  "credito" => $credito,
554
  "efectivo" => $efectivo,
555
  "tarjetas" => $cho_tarjetas,
 
556
  "str_cuotas" => $str_cuotas,
557
  "installments" => $installments,
558
  "cho_image" => plugins_url('../assets/images/redirect_checkout.png', plugin_dir_path(__FILE__)),
@@ -569,11 +575,32 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
569
  public function process_payment($order_id)
570
  {
571
  $order = wc_get_order($order_id);
 
572
  if (method_exists($order, 'update_meta_data')) {
573
  $order->update_meta_data('_used_gateway', get_class($this));
 
 
 
 
 
 
 
 
 
 
574
  $order->save();
575
  } else {
576
  update_post_meta($order_id, '_used_gateway', get_class($this));
 
 
 
 
 
 
 
 
 
 
577
  }
578
 
579
  if ('redirect' == $this->method || 'iframe' == $this->method) {
@@ -620,4 +647,11 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
620
  return false;
621
  }
622
  }
623
- }
 
 
 
 
 
 
 
23
  return;
24
  }
25
 
26
+ $this->description = __('It offers all means of payment: credit and debit cards, cash and account money. Your customers choose whether they pay as guests or from their Mercado Pago account.', 'woocommerce-mercadopago');
27
 
28
  $this->form_fields = array();
29
+ $this->method_title = __('Mercado Pago Checkout', 'woocommerce-mercadopago');
30
  $this->method = $this->getOption('method', 'redirect');
31
  $this->title = __('Pay with the payment method you prefer', 'woocommerce-mercadopago');
32
+ $this->method_description = $this->getMethodDescription($this->description);
33
  $this->auto_return = $this->getOption('auto_return', 'yes');
34
  $this->success_url = $this->getOption('success_url', '');
35
  $this->failure_url = $this->getOption('failure_url', '');
43
  $this->form_fields = $this->getFormFields('Basic');
44
  $this->hook = new WC_WooMercadoPago_Hook_Basic($this);
45
  $this->notification = new WC_WooMercadoPago_Notification_IPN($this);
46
+ $this->currency_convertion = false;
47
  }
48
 
49
  /**
52
  */
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__))
137
  'checkout_homolog_title',
138
  'checkout_homolog_subtitle',
139
  'checkout_homolog_link',
140
+ // Configure Mercado Pago for WooCommerce
141
  'checkout_options_title',
142
  'checkout_options_subtitle',
143
  'mp_statement_descriptor',
153
  'checkout_payments_description',
154
  'enabled',
155
  'installments',
156
+ // advanced settings
157
  'checkout_payments_advanced_title',
158
  'checkout_payments_advanced_description',
159
  'method',
229
  {
230
  $checkout_header = array(
231
  'title' => sprintf(
232
+ __('Mercado Pago checkout %s', 'woocommerce-mercadopago'),
233
  '<div class="row">
234
+ <div class="mp-col-md-12 mp_subtitle_header">
235
+ ' . __('Accept all method of payment and take your charges to another level', 'woocommerce-mercadopago') . '
236
+ </div>
237
  <div class="mp-col-md-12">
238
+ <p class="mp-text-checkout-body mp-mb-0">
239
  ' . __('Turn your online store into your customers preferred payment gateway. Choose if the final payment experience will be inside or outside your store.', 'woocommerce-mercadopago') . '
240
  </p>
241
  </div>
242
  </div>'
243
  ),
244
  'type' => 'title',
245
+ 'class' => 'mp_title_header'
246
  );
247
  return $checkout_header;
248
  }
253
  public function field_checkout_options_title()
254
  {
255
  $checkout_options_title = array(
256
+ 'title' => __('Configure Mercado Pago for WooCommerce', 'woocommerce-mercadopago'),
257
  'type' => 'title',
258
  'class' => 'mp_title_bd'
259
  );
266
  public function field_checkout_options_description()
267
  {
268
  $checkout_options_description = array(
269
+ 'title' => __('Enable the experience of the Mercado Pago Checkout in your online store, select the means of payment available to your customers and<br> define the maximum fees in which they can pay you.', 'woocommerce-mercadopago'),
270
  'type' => 'title',
271
  'class' => 'mp_small_text'
272
  );
281
  $checkout_options_subtitle = array(
282
  'title' => __('Go to the basics. Place your business information.', 'woocommerce-mercadopago'),
283
  'type' => 'title',
284
+ 'class' => 'mp_subtitle mp-mt-5 mp-mb-5'
285
  );
286
  return $checkout_options_subtitle;
287
  }
305
  public function field_checkout_payments_advanced_title()
306
  {
307
  $checkout_payments_advanced_title = array(
308
+ 'title' => __('advanced settings', 'woocommerce-mercadopago'),
309
  'type' => 'title',
310
  'class' => 'mp_subtitle_bd'
311
  );
318
  public function field_method()
319
  {
320
  $method = array(
321
+ 'title' => __('Payment experience', 'woocommerce-mercadopago'),
322
  'type' => 'select',
323
  'description' => __('Define what payment experience your customers will have, whether inside or outside your store.', 'woocommerce-mercadopago'),
324
  'default' => ($this->method == 'iframe') ? 'redirect' : $this->method,
473
 
474
  if ($count_payment == 1) {
475
  $element['title'] = __('Payment methods', 'woocommerce-mercadopago');
476
+ $element['desc_tip'] = __('Select the payment methods available in your store.', 'woocommerce-mercadopago');
477
  }
478
  if ($count_payment == count($get_payment_methods)) {
479
  $element['description'] = __('Enable the payment methods available to your customers.', 'woocommerce-mercadopago');
497
  'title' => __('Return to the store', 'woocommerce-mercadopago'),
498
  'type' => 'select',
499
  'default' => 'yes',
500
+ 'description' => __('Do you want your customer to automatically return to the store after payment?', 'woocommerce-mercadopago'),
501
  'options' => array(
502
  'yes' => __('Yes', 'woocommerce-mercadopago'),
503
  'no' => __('No', 'woocommerce-mercadopago'),
521
  $debito = 0;
522
  $credito = 0;
523
  $efectivo = 0;
524
+ $method = $this->getOption('method', 'redirect');
525
  $tarjetas = get_option('_checkout_payments_methods', '');
526
  $installments = $this->getOption('installments');
527
  $str_cuotas = __('installments', 'woocommerce-mercadopago');
558
  "credito" => $credito,
559
  "efectivo" => $efectivo,
560
  "tarjetas" => $cho_tarjetas,
561
+ "method" => $method,
562
  "str_cuotas" => $str_cuotas,
563
  "installments" => $installments,
564
  "cho_image" => plugins_url('../assets/images/redirect_checkout.png', plugin_dir_path(__FILE__)),
575
  public function process_payment($order_id)
576
  {
577
  $order = wc_get_order($order_id);
578
+ $amount = $this->get_order_total();
579
  if (method_exists($order, 'update_meta_data')) {
580
  $order->update_meta_data('_used_gateway', get_class($this));
581
+
582
+ if (!empty($this->gateway_discount)) {
583
+ $discount = $amount * ($this->gateway_discount / 100);
584
+ $order->update_meta_data('Mercado Pago: discount', __('discount of', 'woocommerce-mercadopago') . ' ' . $this->gateway_discount . '% / ' . __('discount of', 'woocommerce-mercadopago') . ' = ' . $discount);
585
+ }
586
+
587
+ if (!empty($this->commission)) {
588
+ $comission = $amount * ($this->commission / 100);
589
+ $order->update_meta_data('Mercado Pago: comission', __('fee of', 'woocommerce-mercadopago') . ' ' . $this->commission . '% / ' . __('fee of', 'woocommerce-mercadopago') . ' = ' . $comission);
590
+ }
591
  $order->save();
592
  } else {
593
  update_post_meta($order_id, '_used_gateway', get_class($this));
594
+
595
+ if (!empty($this->gateway_discount)) {
596
+ $discount = $amount * ($this->gateway_discount / 100);
597
+ update_post_meta($order_id,'Mercado Pago: discount', __('discount of', 'woocommerce-mercadopago') . ' ' . $this->gateway_discount . '% / ' . __('discount of', 'woocommerce-mercadopago') . ' = ' . $discount);
598
+ }
599
+
600
+ if (!empty($this->commission)) {
601
+ $comission = $amount * ($this->commission / 100);
602
+ update_post_meta($order_id,'Mercado Pago: comission', __('fee of', 'woocommerce-mercadopago') . ' ' . $this->commission . '% / ' . __('fee of', 'woocommerce-mercadopago') . ' = ' . $comission);
603
+ }
604
  }
605
 
606
  if ('redirect' == $this->method || 'iframe' == $this->method) {
647
  return false;
648
  }
649
  }
650
+
651
+ /**
652
+ * @return string
653
+ */
654
+ public static function getId(){
655
+ return WC_WooMercadoPago_BasicGateway::ID;
656
+ }
657
+ }
includes/payments/WC_WooMercadoPago_CustomGateway.php CHANGED
@@ -5,9 +5,7 @@ if (!defined('ABSPATH')) {
5
  }
6
 
7
  /**
8
- *
9
  * WC_WooMercadoPago_CustomGateway
10
- *
11
  */
12
  class WC_WooMercadoPago_CustomGateway extends WC_WooMercadoPago_PaymentAbstract
13
  {
@@ -24,19 +22,20 @@ class WC_WooMercadoPago_CustomGateway extends WC_WooMercadoPago_PaymentAbstract
24
  if (!$this->validateSection()) {
25
  return;
26
  }
27
-
28
- $this->desc = __('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');
29
-
30
  $this->form_fields = array();
31
  $this->method_title = __('Mercado Pago - Custom Checkout', 'woocommerce-mercadopago');
32
  $this->title = __('Pay with debit and credit cards', 'woocommerce-mercadopago');
33
- $this->method_description = $this->getMethodDescription($this->desc);
34
  $this->coupon_mode = $this->getOption('coupon_mode', 'no');
35
  $this->field_forms_order = $this->get_fields_sequence();
36
  parent::__construct();
37
  $this->form_fields = $this->getFormFields('Custom');
 
38
  $this->hook = new WC_WooMercadoPago_Hook_Custom($this);
39
  $this->notification = new WC_WooMercadoPago_Notification_Webhook($this);
 
40
  }
41
 
42
  /**
@@ -45,7 +44,7 @@ class WC_WooMercadoPago_CustomGateway extends WC_WooMercadoPago_PaymentAbstract
45
  */
46
  public function getFormFields($label)
47
  {
48
- if (is_admin()) {
49
  wp_enqueue_script('woocommerce-mercadopago-custom-config-script', plugins_url('../assets/js/custom_config_mercadopago.js', plugin_dir_path(__FILE__)));
50
  }
51
 
@@ -53,7 +52,7 @@ class WC_WooMercadoPago_CustomGateway extends WC_WooMercadoPago_PaymentAbstract
53
  $this->field_forms_order = array_slice($this->field_forms_order, 0, 7);
54
  }
55
 
56
- if(!empty($this->checkout_country) && empty($this->getAccessToken())) {
57
  $this->field_forms_order = array_slice($this->field_forms_order, 0, 22);
58
  }
59
 
@@ -65,6 +64,7 @@ class WC_WooMercadoPago_CustomGateway extends WC_WooMercadoPago_PaymentAbstract
65
  $form_fields['checkout_custom_payments_title'] = $this->field_checkout_custom_payments_title();
66
  $form_fields['checkout_payments_subtitle'] = $this->field_checkout_payments_subtitle();
67
  $form_fields['binary_mode'] = $this->field_binary_mode();
 
68
  $form_fields['checkout_custom_payments_advanced_title'] = $this->field_checkout_custom_payments_advanced_title();
69
  $form_fields['coupon_mode'] = $this->field_coupon_mode();
70
  }
@@ -80,7 +80,6 @@ class WC_WooMercadoPago_CustomGateway extends WC_WooMercadoPago_PaymentAbstract
80
 
81
  /**
82
  * get_fields_sequence
83
- *
84
  * @return array
85
  */
86
  public function get_fields_sequence()
@@ -89,7 +88,7 @@ class WC_WooMercadoPago_CustomGateway extends WC_WooMercadoPago_PaymentAbstract
89
  // Necessary to run
90
  'title',
91
  'description',
92
- // Checkout de pagos con tarjetas de débito y crédito<br> Aceptá pagos al instante y maximizá la conversión de tu negocio
93
  'checkout_custom_header',
94
  'checkout_steps',
95
  // ¿En qué país vas a activar tu tienda?
@@ -131,6 +130,7 @@ class WC_WooMercadoPago_CustomGateway extends WC_WooMercadoPago_PaymentAbstract
131
  'checkout_payments_subtitle',
132
  'checkout_payments_description',
133
  'enabled',
 
134
  // Advanced configuration of the personalized payment experience"
135
  'checkout_custom_payments_advanced_title',
136
  'checkout_payments_advanced_description',
@@ -152,17 +152,20 @@ class WC_WooMercadoPago_CustomGateway extends WC_WooMercadoPago_PaymentAbstract
152
  {
153
  $checkout_custom_header = array(
154
  'title' => sprintf(
155
- __('Checkout of payments with debit and credit cards<br> Accept payments instantly and maximize the conversion of your business %s', 'woocommerce-mercadopago'),
156
  '<div class="mp-row">
 
 
 
157
  <div class="mp-col-md-12">
158
- <p class="text-checkout-body mp-mb-0">
159
  ' . __('Turn your online store into a secure and easy-to-use payment gateway for your customers. With personalized checkout your customers pay without leaving your store!', 'woocommerce-mercadopago') . '
160
  </p>
161
  </div>
162
  </div>'
163
  ),
164
  'type' => 'title',
165
- 'class' => 'mp_title_checkout'
166
  );
167
  return $checkout_custom_header;
168
  }
@@ -187,7 +190,7 @@ class WC_WooMercadoPago_CustomGateway extends WC_WooMercadoPago_PaymentAbstract
187
  {
188
  $checkout_custom_options_subtitle = array(
189
  'title' => __('Go to the basics. Place your business information.', 'woocommerce-mercadopago'),
190
- 'type' => 'title',
191
  'class' => 'mp_subtitle mp-mt-5'
192
  );
193
  return $checkout_custom_options_subtitle;
@@ -201,7 +204,7 @@ class WC_WooMercadoPago_CustomGateway extends WC_WooMercadoPago_PaymentAbstract
201
  $checkout_custom_payments_title = array(
202
  'title' => __('Configure the personalized payment experience in your store', 'woocommerce-mercadopago'),
203
  'type' => 'title',
204
- 'class' => 'mp_title_bd'
205
  );
206
  return $checkout_custom_payments_title;
207
  }
@@ -227,7 +230,7 @@ class WC_WooMercadoPago_CustomGateway extends WC_WooMercadoPago_PaymentAbstract
227
  {
228
  switch ($status_detail) {
229
  case 'accredited':
230
- return __('Ready, your payment has been accepted!', 'woocommerce-mercadopago');
231
  case 'pending_contingency':
232
  return __('We are processing your payment. In less than an hour we will send you the result by email.', 'woocommerce-mercadopago');
233
  case 'pending_review_manual':
@@ -275,19 +278,11 @@ class WC_WooMercadoPago_CustomGateway extends WC_WooMercadoPago_PaymentAbstract
275
  'woocommerce-mercadopago-basic-checkout-styles',
276
  plugins_url('../assets/css/basic_checkout_mercadopago.css', plugin_dir_path(__FILE__))
277
  );
278
-
279
- $amount = $this->get_order_total();
280
- $logged_user_email = (wp_get_current_user()->ID != 0) ? wp_get_current_user()->user_email : null;
281
- $customer = isset($logged_user_email) ? $this->mp->get_or_create_customer($logged_user_email) : null;
282
- $discount_action_url = get_site_url() . '/index.php/woocommerce-mercadopago/?wc-api=' . get_class($this);
283
-
284
- $currency_ratio = 1;
285
- $_mp_currency_conversion_v1 = $this->getOption('_mp_currency_conversion_v1', '');
286
- if (!empty($_mp_currency_conversion_v1)) {
287
- $currency_ratio = WC_WooMercadoPago_Module::get_conversion_rate($this->site_data['currency']);
288
- $currency_ratio = $currency_ratio > 0 ? $currency_ratio : 1;
289
- }
290
 
 
 
 
 
291
  $banner_url = $this->getOption('_mp_custom_banner');
292
  if (!isset($banner_url) || empty($banner_url)) {
293
  $banner_url = $this->site_data['checkout_banner_custom'];
@@ -299,28 +294,24 @@ class WC_WooMercadoPago_CustomGateway extends WC_WooMercadoPago_PaymentAbstract
299
  $tarjetas = get_option('_checkout_payments_methods', '');
300
 
301
  foreach ($tarjetas as $tarjeta) {
302
- if ($tarjeta['type'] == 'credit_card') {
303
- $credit_card[] = $tarjeta['image'];
304
- } elseif ($tarjeta['type'] == 'debit_card' || $tarjeta['type'] == 'prepaid_card') {
305
- $debit_card[] = $tarjeta['image'];
306
- }
307
  }
308
 
309
  $parameters = array(
310
  'amount' => $amount,
311
  'site_id' => $this->getOption('_site_id_v1'),
312
  'public_key' => $this->getPublicKey(),
313
- 'coupon_mode' => isset($logged_user_email) ? $this->coupon_mode : 'no',
314
- 'discount_action_url' => $discount_action_url,
315
- 'payer_email' => $logged_user_email,
316
  'images_path' => plugins_url('../assets/images/', plugin_dir_path(__FILE__)),
317
- 'banner_path' => $banner_url,
318
- 'customer_cards' => isset($customer) ? (isset($customer['cards']) ? $customer['cards'] : array()) : array(),
319
- 'customerId' => isset($customer) ? (isset($customer['id']) ? $customer['id'] : null) : null,
320
- 'currency_ratio' => $currency_ratio,
321
  'woocommerce_currency' => get_woocommerce_currency(),
322
  'account_currency' => $this->site_data['currency'],
323
- 'path_to_javascript' => plugins_url('../assets/js/credit-card.js', plugin_dir_path(__FILE__)),
324
  'debit_card' => $debit_card,
325
  'credit_card' => $credit_card,
326
  );
@@ -337,11 +328,31 @@ class WC_WooMercadoPago_CustomGateway extends WC_WooMercadoPago_PaymentAbstract
337
  $custom_checkout = $_POST['mercadopago_custom'];
338
  $this->log->write_log(__FUNCTION__, 'POST Custom: ' . json_encode($custom_checkout, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
339
  $order = wc_get_order($order_id);
 
340
  if (method_exists($order, 'update_meta_data')) {
341
  $order->update_meta_data('_used_gateway', get_class($this));
 
 
 
 
 
 
 
 
 
 
342
  $order->save();
343
  } else {
344
  update_post_meta($order_id, '_used_gateway', get_class($this));
 
 
 
 
 
 
 
 
 
345
  }
346
  // Mexico country case.
347
  if (!isset($custom_checkout['paymentMethodId']) || empty($custom_checkout['paymentMethodId'])) {
@@ -356,21 +367,6 @@ class WC_WooMercadoPago_CustomGateway extends WC_WooMercadoPago_PaymentAbstract
356
  ) {
357
  $response = $this->create_preference($order, $custom_checkout);
358
 
359
- // Check for card save.
360
- if (method_exists($order, 'update_meta_data')) {
361
- if (isset($custom_checkout['doNotSaveCard'])) {
362
- $order->update_meta_data('_save_card', 'no');
363
- } else {
364
- $order->update_meta_data('_save_card', 'yes');
365
- }
366
- $order->save();
367
- } else {
368
- if (isset($custom_checkout['doNotSaveCard'])) {
369
- update_post_meta($order_id, '_save_card', 'no');
370
- } else {
371
- update_post_meta($order_id, '_save_card', 'yes');
372
- }
373
- }
374
  if (!is_array($response)) {
375
  return array(
376
  'result' => 'fail',
@@ -400,9 +396,9 @@ class WC_WooMercadoPago_CustomGateway extends WC_WooMercadoPago_PaymentAbstract
400
  WC()->cart->empty_cart();
401
  wc_add_notice(
402
  '<p>' . $this->get_order_status($response['status_detail']) . '</p>' .
403
- '<p><a class="button" href="' . esc_url($order->get_checkout_order_received_url()) . '">' .
404
- __('See your order form', 'woocommerce-mercadopago') .
405
- '</a></p>',
406
  'notice'
407
  );
408
  return array(
@@ -413,12 +409,13 @@ class WC_WooMercadoPago_CustomGateway extends WC_WooMercadoPago_PaymentAbstract
413
  case 'rejected':
414
  // If rejected is received, the order will not proceed until another payment try, so we must inform this status.
415
  wc_add_notice(
416
- '<p>' . __('Your payment was declined. You can try again.', 'woocommerce-mercadopago') . '<br>' .
417
- $this->get_order_status($response['status_detail']) .
418
- '</p>' .
419
- '<p><a class="button" href="' . esc_url($order->get_checkout_payment_url()) . '">' .
420
- __('Click to try again', 'woocommerce-mercadopago') .
421
- '</a></p>',
 
422
  'error'
423
  );
424
  return array(
@@ -447,7 +444,7 @@ class WC_WooMercadoPago_CustomGateway extends WC_WooMercadoPago_PaymentAbstract
447
  );
448
  }
449
  } else {
450
- $this->log->write_log(__FUNCTION__, 'A problem was occurred when processing your payment. Please, try again.' );
451
  wc_add_notice('<p>' . __('A problem was occurred when processing your payment. Please, try again.', 'woocommerce-mercadopago') . '</p>', 'error');
452
  return array(
453
  'result' => 'fail',
@@ -536,4 +533,24 @@ class WC_WooMercadoPago_CustomGateway extends WC_WooMercadoPago_PaymentAbstract
536
 
537
  return true;
538
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
539
  }
5
  }
6
 
7
  /**
 
8
  * WC_WooMercadoPago_CustomGateway
 
9
  */
10
  class WC_WooMercadoPago_CustomGateway extends WC_WooMercadoPago_PaymentAbstract
11
  {
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');
29
  $this->title = __('Pay with debit and credit cards', 'woocommerce-mercadopago');
30
+ $this->method_description = $this->getMethodDescription($this->description);
31
  $this->coupon_mode = $this->getOption('coupon_mode', 'no');
32
  $this->field_forms_order = $this->get_fields_sequence();
33
  parent::__construct();
34
  $this->form_fields = $this->getFormFields('Custom');
35
+ $this->customer = isset($this->logged_user_email) ? $this->mp->get_or_create_customer($this->logged_user_email) : null;
36
  $this->hook = new WC_WooMercadoPago_Hook_Custom($this);
37
  $this->notification = new WC_WooMercadoPago_Notification_Webhook($this);
38
+ $this->currency_convertion = true;
39
  }
40
 
41
  /**
44
  */
45
  public function getFormFields($label)
46
  {
47
+ if (is_admin() && $this->isManageSection()) {
48
  wp_enqueue_script('woocommerce-mercadopago-custom-config-script', plugins_url('../assets/js/custom_config_mercadopago.js', plugin_dir_path(__FILE__)));
49
  }
50
 
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
 
64
  $form_fields['checkout_custom_payments_title'] = $this->field_checkout_custom_payments_title();
65
  $form_fields['checkout_payments_subtitle'] = $this->field_checkout_payments_subtitle();
66
  $form_fields['binary_mode'] = $this->field_binary_mode();
67
+ $form_fields[WC_WooMercadoPago_Helpers_CurrencyConverter::CONFIG_KEY] = $this->field_currency_conversion($this);
68
  $form_fields['checkout_custom_payments_advanced_title'] = $this->field_checkout_custom_payments_advanced_title();
69
  $form_fields['coupon_mode'] = $this->field_coupon_mode();
70
  }
80
 
81
  /**
82
  * get_fields_sequence
 
83
  * @return array
84
  */
85
  public function get_fields_sequence()
88
  // Necessary to run
89
  'title',
90
  'description',
91
+ // Checkout de pagos con tarjetas de débito y crédito<br> Aceptá pagos al instante y maximizá la conversión de tu negocio
92
  'checkout_custom_header',
93
  'checkout_steps',
94
  // ¿En qué país vas a activar tu tienda?
130
  'checkout_payments_subtitle',
131
  'checkout_payments_description',
132
  'enabled',
133
+ WC_WooMercadoPago_Helpers_CurrencyConverter::CONFIG_KEY,
134
  // Advanced configuration of the personalized payment experience"
135
  'checkout_custom_payments_advanced_title',
136
  'checkout_payments_advanced_description',
152
  {
153
  $checkout_custom_header = array(
154
  'title' => sprintf(
155
+ __('Checkout of payments with debit and credit cards %s', 'woocommerce-mercadopago'),
156
  '<div class="mp-row">
157
+ <div class="mp-col-md-12 mp_subtitle_header">
158
+ ' . __('Accept payments instantly and maximize the conversion of your business', 'woocommerce-mercadopago') . '
159
+ </div>
160
  <div class="mp-col-md-12">
161
+ <p class="mp-text-checkout-body mp-mb-0">
162
  ' . __('Turn your online store into a secure and easy-to-use payment gateway for your customers. With personalized checkout your customers pay without leaving your store!', 'woocommerce-mercadopago') . '
163
  </p>
164
  </div>
165
  </div>'
166
  ),
167
  'type' => 'title',
168
+ 'class' => 'mp_title_header'
169
  );
170
  return $checkout_custom_header;
171
  }
190
  {
191
  $checkout_custom_options_subtitle = array(
192
  'title' => __('Go to the basics. Place your business information.', 'woocommerce-mercadopago'),
193
+ 'type' => 'title',
194
  'class' => 'mp_subtitle mp-mt-5'
195
  );
196
  return $checkout_custom_options_subtitle;
204
  $checkout_custom_payments_title = array(
205
  'title' => __('Configure the personalized payment experience in your store', 'woocommerce-mercadopago'),
206
  'type' => 'title',
207
+ 'class' => 'mp_title_bd',
208
  );
209
  return $checkout_custom_payments_title;
210
  }
230
  {
231
  switch ($status_detail) {
232
  case 'accredited':
233
+ return __('That’s it, payment accepted!', 'woocommerce-mercadopago');
234
  case 'pending_contingency':
235
  return __('We are processing your payment. In less than an hour we will send you the result by email.', 'woocommerce-mercadopago');
236
  case 'pending_review_manual':
278
  'woocommerce-mercadopago-basic-checkout-styles',
279
  plugins_url('../assets/css/basic_checkout_mercadopago.css', plugin_dir_path(__FILE__))
280
  );
 
 
 
 
 
 
 
 
 
 
 
 
281
 
282
+ $amount = $this->get_order_total();
283
+ $discount = $amount * ($this->gateway_discount / 100);
284
+ $comission = $amount * ($this->commission / 100);
285
+ $amount = $amount - $discount + $comission;
286
  $banner_url = $this->getOption('_mp_custom_banner');
287
  if (!isset($banner_url) || empty($banner_url)) {
288
  $banner_url = $this->site_data['checkout_banner_custom'];
294
  $tarjetas = get_option('_checkout_payments_methods', '');
295
 
296
  foreach ($tarjetas as $tarjeta) {
297
+ if ($tarjeta['type'] == 'credit_card') {
298
+ $credit_card[] = $tarjeta['image'];
299
+ } elseif ($tarjeta['type'] == 'debit_card' || $tarjeta['type'] == 'prepaid_card') {
300
+ $debit_card[] = $tarjeta['image'];
301
+ }
302
  }
303
 
304
  $parameters = array(
305
  'amount' => $amount,
306
  'site_id' => $this->getOption('_site_id_v1'),
307
  'public_key' => $this->getPublicKey(),
308
+ 'coupon_mode' => isset($this->logged_user_email) ? $this->coupon_mode : 'no',
309
+ 'discount_action_url' => $this->discount_action_url,
310
+ 'payer_email' => $this->logged_user_email,
311
  'images_path' => plugins_url('../assets/images/', plugin_dir_path(__FILE__)),
312
+ 'currency_ratio' => WC_WooMercadoPago_Helpers_CurrencyConverter::getInstance()->ratio($this),
 
 
 
313
  'woocommerce_currency' => get_woocommerce_currency(),
314
  'account_currency' => $this->site_data['currency'],
 
315
  'debit_card' => $debit_card,
316
  'credit_card' => $credit_card,
317
  );
328
  $custom_checkout = $_POST['mercadopago_custom'];
329
  $this->log->write_log(__FUNCTION__, 'POST Custom: ' . json_encode($custom_checkout, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
330
  $order = wc_get_order($order_id);
331
+ $amount = $this->get_order_total();
332
  if (method_exists($order, 'update_meta_data')) {
333
  $order->update_meta_data('_used_gateway', get_class($this));
334
+
335
+ if (!empty($this->gateway_discount)) {
336
+ $discount = $amount * ($this->gateway_discount / 100);
337
+ $order->update_meta_data('Mercado Pago: discount', __('discount of', 'woocommerce-mercadopago') . ' ' . $this->gateway_discount . '% / ' . __('discount of', 'woocommerce-mercadopago') . ' = ' . $discount);
338
+ }
339
+
340
+ if (!empty($this->commission)) {
341
+ $comission = $amount * ($this->commission / 100);
342
+ $order->update_meta_data('Mercado Pago: comission', __('fee of', 'woocommerce-mercadopago') . ' ' . $this->commission . '% / ' . __('fee of', 'woocommerce-mercadopago') . ' = ' . $comission);
343
+ }
344
  $order->save();
345
  } else {
346
  update_post_meta($order_id, '_used_gateway', get_class($this));
347
+ if (!empty($this->gateway_discount)) {
348
+ $discount = $amount * ($this->gateway_discount / 100);
349
+ update_post_meta($order_id, 'Mercado Pago: discount', __('discount of', 'woocommerce-mercadopago') . ' ' . $this->gateway_discount . '% / ' . __('discount of', 'woocommerce-mercadopago') . ' = ' . $discount);
350
+ }
351
+
352
+ if (!empty($this->commission)) {
353
+ $comission = $amount * ($this->commission / 100);
354
+ update_post_meta($order_id, 'Mercado Pago: comission', __('fee of', 'woocommerce-mercadopago') . ' ' . $this->commission . '% / ' . __('fee of', 'woocommerce-mercadopago') . ' = ' . $comission);
355
+ }
356
  }
357
  // Mexico country case.
358
  if (!isset($custom_checkout['paymentMethodId']) || empty($custom_checkout['paymentMethodId'])) {
367
  ) {
368
  $response = $this->create_preference($order, $custom_checkout);
369
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
370
  if (!is_array($response)) {
371
  return array(
372
  'result' => 'fail',
396
  WC()->cart->empty_cart();
397
  wc_add_notice(
398
  '<p>' . $this->get_order_status($response['status_detail']) . '</p>' .
399
+ '<p><a class="button" href="' . esc_url($order->get_checkout_order_received_url()) . '">' .
400
+ __('See your order form', 'woocommerce-mercadopago') .
401
+ '</a></p>',
402
  'notice'
403
  );
404
  return array(
409
  case 'rejected':
410
  // If rejected is received, the order will not proceed until another payment try, so we must inform this status.
411
  wc_add_notice(
412
+ '<p>' . __('Your payment was declined. You can try again.',
413
+ 'woocommerce-mercadopago') . '<br>' .
414
+ $this->get_order_status($response['status_detail']) .
415
+ '</p>' .
416
+ '<p><a class="button" href="' . esc_url($order->get_checkout_payment_url()) . '">' .
417
+ __('Click to try again', 'woocommerce-mercadopago') .
418
+ '</a></p>',
419
  'error'
420
  );
421
  return array(
444
  );
445
  }
446
  } else {
447
+ $this->log->write_log(__FUNCTION__, 'A problem was occurred when processing your payment. Please, try again.');
448
  wc_add_notice('<p>' . __('A problem was occurred when processing your payment. Please, try again.', 'woocommerce-mercadopago') . '</p>', 'error');
449
  return array(
450
  'result' => 'fail',
533
 
534
  return true;
535
  }
536
+
537
+ /**
538
+ * @return array|mixed|null
539
+ * @throws WC_WooMercadoPago_Exception
540
+ */
541
+ public function getOrCreateCustomer()
542
+ {
543
+ if(empty($this->mp))
544
+ {
545
+ return null;
546
+ }
547
+ return isset($this->logged_user_email) ? $this->mp->get_or_create_customer($this->logged_user_email) : null;
548
+ }
549
+
550
+ /**
551
+ * @return string
552
+ */
553
+ public static function getId(){
554
+ return WC_WooMercadoPago_CustomGateway::ID;
555
+ }
556
  }
includes/payments/WC_WooMercadoPago_PaymentAbstract.php CHANGED
@@ -9,7 +9,6 @@ if (!defined('ABSPATH')) {
9
  */
10
  class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
11
  {
12
-
13
  //ONLY get_option in this fields
14
  const COMMON_CONFIGS = array(
15
  '_mp_public_key_test',
@@ -69,7 +68,6 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
69
  public $mp_public_key_prod;
70
  public $mp_access_token_prod;
71
  public $notification;
72
- public $checkout_credential_token_production;
73
  public $checkout_country;
74
  public $wc_country;
75
  public $commission;
@@ -78,6 +76,9 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
78
  public $activated_payment;
79
  public $homolog_validate;
80
  public $clientid_old_version;
 
 
 
81
 
82
  /**
83
  * WC_WooMercadoPago_PaymentAbstract constructor.
@@ -91,12 +92,10 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
91
  $this->mp_access_token_prod = $this->getOption('_mp_access_token_prod');
92
  $this->checkout_country = get_option('checkout_country', '');
93
  $this->wc_country = get_option('woocommerce_default_country', '');
94
- $this->checkout_credential_token_production = $this->getOption('checkout_credential_production', get_option('checkout_credential_production', 'no'));
95
- $this->description = $this->getOption('description');
96
  $this->mp_category_id = $this->getOption('_mp_category_id', 0);
97
  $this->store_identificator = $this->getOption('_mp_store_identificator', 'WC-');
98
  $this->debug_mode = $this->getOption('_mp_debug_mode', 'no');
99
- $this->custom_domain = $this->getOption('_mp_custom_domain');
100
  $this->binary_mode = $this->getOption('binary_mode', 'no');
101
  $this->gateway_discount = $this->getOption('gateway_discount', 0);
102
  $this->commission = $this->getOption('commission', 0);
@@ -108,21 +107,26 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
108
  $this->mp = $this->getMpInstance();
109
  $this->homolog_validate = $this->getHomologValidate();
110
  $this->application_id = $this->getApplicationId($this->mp_access_token_prod);
 
 
111
  }
112
 
113
- /**
114
- * @return
 
115
  */
116
  public function getHomologValidate()
117
  {
118
- $homolog_validate = get_option('homolog_validate', 0);
119
- if (($this->checkout_credential_token_production == 'yes' && !empty($this->mp_access_token_prod)) && $homolog_validate == 0) {
120
- $homolog_validate = $this->mp->homologValidate($this->mp_access_token_prod);
121
- update_option('homolog_validate', $homolog_validate, true);
122
- return $homolog_validate;
123
- } else {
124
- return true;
 
125
  }
 
126
  }
127
 
128
  /**
@@ -130,7 +134,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
130
  */
131
  public function getAccessToken()
132
  {
133
- if ($this->checkout_credential_token_production == 'no') {
134
  return $this->mp_access_token_test;
135
  }
136
  return $this->mp_access_token_prod;
@@ -141,7 +145,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
141
  */
142
  public function getPublicKey()
143
  {
144
- if ($this->checkout_credential_token_production == 'no') {
145
  return $this->mp_public_key_test;
146
  }
147
  return $this->mp_public_key_prod;
@@ -159,7 +163,6 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
159
  return get_option($key, $default);
160
  }
161
 
162
-
163
  $option = $this->get_option($key, $default);
164
  if (!empty($option)) {
165
  return $option;
@@ -173,6 +176,13 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
173
  */
174
  public function normalizeCommonAdminFields()
175
  {
 
 
 
 
 
 
 
176
  $changed = false;
177
  foreach (self::COMMON_CONFIGS as $config) {
178
  $commonOption = get_option($config);
@@ -199,6 +209,18 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
199
  return true;
200
  }
201
 
 
 
 
 
 
 
 
 
 
 
 
 
202
  /**
203
  * @return string
204
  */
@@ -222,12 +244,10 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
222
  public function getMethodDescription($description)
223
  {
224
  return '<div class="mp-header-logo">
225
- <div class="left-header">
226
  <img src="' . plugins_url('../assets/images/mplogo.png', plugin_dir_path(__FILE__)) . '">
227
  </div>
228
- <div class="right-header">
229
- <strong>' . $description . '</strong>
230
- </div>
231
  </div>';
232
  }
233
 
@@ -254,9 +274,9 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
254
  */
255
  public function noticeHomologValidate()
256
  {
257
- echo '<div class="notice notice-warning is-dismissible">
258
- <p><strong>MERCADO PAGO: </strong>' . 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>') . '</p>
259
- </div>';
260
  }
261
 
262
  /**
@@ -264,13 +284,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
264
  * @return array
265
  */
266
  public function getFormFields($label)
267
- {
268
- //add css
269
- wp_enqueue_style(
270
- 'woocommerce-mercadopago-basic-config-styles',
271
- plugins_url('../assets/css/config_mercadopago.css', plugin_dir_path(__FILE__))
272
- );
273
-
274
  $this->init_form_fields();
275
  $this->init_settings();
276
  $form_fields = array();
@@ -299,10 +313,10 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
299
  $form_fields['_mp_access_token_prod'] = $this->field_checkout_credential_accesstoken_prod();
300
  $form_fields['_mp_category_id'] = $this->field_category_store();
301
  if (!empty($this->getAccessToken())) {
302
- if($this->homolog_validate == 0) {
303
- if($_GET['section'] == $this->id && !has_action('woocommerce_update_options_payment_gateways_'. $this->id)) {
304
  add_action('admin_notices', array($this, 'noticeHomologValidate'));
305
- }
306
  $form_fields['checkout_steps_link_homolog'] = $this->field_checkout_steps_link_homolog($this->checkout_country, $this->application_id);
307
  $form_fields['checkout_homolog_title'] = $this->field_checkout_homolog_title();
308
  $form_fields['checkout_homolog_subtitle'] = $this->field_checkout_homolog_subtitle();
@@ -340,7 +354,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
340
  'title' => __('Title', 'woocommerce-mercadopago'),
341
  'type' => 'text',
342
  'description' => '',
343
- 'class' => 'hidden-field-mp-title',
344
  'default' => $this->title
345
  );
346
  return $field_title;
@@ -354,7 +368,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
354
  $field_description = array(
355
  'title' => __('Description', 'woocommerce-mercadopago'),
356
  'type' => 'text',
357
- 'class' => 'hidden-field-mp-desc',
358
  'description' => '',
359
  'default' => $this->method_description
360
  );
@@ -389,38 +403,38 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
389
  '<div class="mp-row">
390
  <h4 class="mp-title-checkout-body mp-pb-20">' . __('<b>Follow these steps to activate Mercado Pago in your store:</b>', 'woocommerce-mercadopago') . '</h4>
391
 
392
- <div class="col-md-2 mp-text-center mp-pb-10">
393
- <p class="number-checkout-body">1</p>
394
- <p class="text-checkout-body mp-text-center mp-px-20">
395
- ' . __('Upload your <b>credentials</b> to test the store and charge with your Mercado Pago account <b>depending on the country</b> in which you are registered.', 'woocommerce-mercadopago') . '
396
  </p>
397
  </div>
398
 
399
- <div class="col-md-2 mp-text-center mp-pb-10">
400
- <p class="number-checkout-body">2</p>
401
- <p class="text-checkout-body mp-text-center mp-px-20">
402
  ' . __('Approve your account to be able to charge.', 'woocommerce-mercadopago') . '
403
  </p>
404
  </div>
405
 
406
- <div class="col-md-2 mp-text-center mp-pb-10">
407
- <p class="number-checkout-body">3</p>
408
- <p class="text-checkout-body mp-text-center mp-px-20">
409
  ' . __('Add the basic information of your business in the plugin configuration.', 'woocommerce-mercadopago') . '
410
  </p>
411
  </div>
412
 
413
- <div class="col-md-2 mp-text-center mp-pb-10">
414
- <p class="number-checkout-body">4</p>
415
- <p class="text-checkout-body mp-text-center mp-px-20">
416
  ' . __('Configure the <b>payment preferences</b> for your customers.', 'woocommerce-mercadopago') . '
417
  </p>
418
  </div>
419
 
420
- <div class="col-md-2 mp-text-center mp-pb-10">
421
- <p class="number-checkout-body">5</p>
422
- <p class="text-checkout-body mp-text-center mp-px-20">
423
- ' . __('Go to advanced settings of both the plugin and checkout only when you want to change the presets.', 'woocommerce-mercadopago') . '
424
  </p>
425
  </div>
426
  </div>'
@@ -443,7 +457,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
443
  '<a href="https://www.mercadopago.com/' . $country_link . '/account/credentials/appliance?application_id=' . $appliocation_id . '" target="_blank">' . __('approved account', 'woocommerce-mercadopago') . '</a>'
444
  ),
445
  'type' => 'title',
446
- 'class' => 'mp_small_text'
447
  );
448
 
449
  array_splice($this->field_forms_order, 4, 0, 'checkout_steps_link_homolog');
@@ -524,7 +538,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
524
  $checkout_btn_save = array(
525
  'title' => sprintf(
526
  __('%s', 'woocommerce-mercadopago'),
527
- '<button name="save" class="woocommerce-save-button mp-save-button" type="submit" value="Save changes">' . __('Save Changes', 'woocommerce-mercadopago') . '</button>'
528
  ),
529
  'type' => 'title',
530
  'class' => ''
@@ -572,7 +586,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
572
  $checkout_credential_mod_test_title = array(
573
  'title' => __('Test Mode', 'woocommerce-mercadopago'),
574
  'type' => 'title',
575
- 'class' => 'mp_subtitle_mb'
576
  );
577
  return $checkout_credential_mod_test_title;
578
  }
@@ -585,7 +599,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
585
  $checkout_credential_mod_test_description = array(
586
  'title' => __('By default, we activate the Sandbox test environment for you to test before you start selling.', 'woocommerce-mercadopago'),
587
  'type' => 'title',
588
- 'class' => 'mp_small_text mp-mt--10'
589
  );
590
  return $checkout_credential_mod_test_description;
591
  }
@@ -598,7 +612,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
598
  $checkout_credential_mod_prod_title = array(
599
  'title' => __('Production Mode', 'woocommerce-mercadopago'),
600
  'type' => 'title',
601
- 'class' => 'mp_subtitle_mb'
602
  );
603
  return $checkout_credential_mod_prod_title;
604
  }
@@ -611,7 +625,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
611
  $checkout_credential_mod_prod_description = array(
612
  'title' => __('When you see that everything is going well, deactivate Sandbox, turn on Production and make way for your online sales.', 'woocommerce-mercadopago'),
613
  'type' => 'title',
614
- 'class' => 'mp_small_text mp-mt--10'
615
  );
616
  return $checkout_credential_mod_prod_description;
617
  }
@@ -621,11 +635,12 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
621
  */
622
  public function field_checkout_credential_production()
623
  {
 
624
  $checkout_credential_production = array(
625
- 'title' => __('Productio', 'woocommerce-mercadopago'),
626
  'type' => 'select',
627
- 'description' => __('Choose "YES" only when you are ready to sell. Change to NO to activate the Tests mode.', 'woocommerce-mercadopago'),
628
- 'default' => $this->id == 'woo-mercado-pago-basic' && $this->clientid_old_version ? 'yes' : $this->getOption('checkout_credential_production', 'no'),
629
  'options' => array(
630
  'no' => __('No', 'woocommerce-mercadopago'),
631
  'yes' => __('Yes', 'woocommerce-mercadopago')
@@ -683,7 +698,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
683
  $checkout_credential__description_test = array(
684
  'title' => __('With these keys you can do the tests you want..', 'woocommerce-mercadopago'),
685
  'type' => 'title',
686
- 'class' => 'mp_small_text mp-mt--10'
687
  );
688
  return $checkout_credential__description_test;
689
  }
@@ -740,7 +755,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
740
  $checkout_credential__description_prod = array(
741
  'title' => __('With these keys you can receive real payments from your customers.', 'woocommerce-mercadopago'),
742
  'type' => 'title',
743
- 'class' => 'mp_small_text mp-mt--10'
744
  );
745
  return $checkout_credential__description_prod;
746
  }
@@ -800,7 +815,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
800
  $checkout_homolog_subtitle = array(
801
  'title' => __('Complete this process to secure your customers data and comply with the regulations<br> and legal provisions of each country.', 'woocommerce-mercadopago'),
802
  'type' => 'title',
803
- 'class' => 'mp_text mp-mt--10'
804
  );
805
  return $checkout_homolog_subtitle;
806
  }
@@ -830,7 +845,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
830
  'title' => __('Store Description', 'woocommerce-mercadopago'),
831
  'type' => 'text',
832
  'description' => __('This name will appear on your customers invoice.', 'woocommerce-mercadopago'),
833
- 'default' => __('Mercado Pago', 'woocommerce-mercadopago')
834
  );
835
  return $mp_statement_descriptor;
836
  }
@@ -848,7 +863,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
848
  $field_category_store = array(
849
  'title' => __('Store Category', 'woocommerce-mercadopago'),
850
  'type' => 'select',
851
- 'description' => __('What category do your products belong to? Choose the one that best characterizes them (choose <br>"other" if your product is too specific).', 'woocommerce-mercadopago'),
852
  'default' => __('Categories', 'woocommerce-mercadopago'),
853
  'options' => $option_category
854
  );
@@ -909,7 +924,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
909
  $checkout_payments_subtitle = array(
910
  'title' => __('Basic Configuration', 'woocommerce-mercadopago'),
911
  'type' => 'title',
912
- 'class' => 'mp_subtitle mp-mt-5'
913
  );
914
  return $checkout_payments_subtitle;
915
  }
@@ -962,13 +977,13 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
962
  $countryLink = array(
963
  'mla' => 'https://www.mercadopago.com.ar/developers/es/', // Argentinian
964
  'mlb' => 'https://www.mercadopago.com.br/developers/pt/', // Brazil
965
- 'mlc' => 'https://www.mercadopago.cl/developers/es/' , // Chile
966
  'mco' => 'https://www.mercadopago.com.co/developers/es/', // Colombia
967
  'mlm' => 'https://www.mercadopago.com.mx/developers/es/', // Mexico
968
  'mpe' => 'https://www.mercadopago.com.pe/developers/es/', // Peru
969
  'mlu' => 'https://www.mercadopago.com.uy/developers/es/', // Uruguay
970
  );
971
- return $countryLink[$checkout];
972
  }
973
 
974
  /**
@@ -981,7 +996,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
981
  'type' => 'text',
982
  'description' => sprintf(
983
  __('Enter a URL to receive payment notifications. In %s you can check more information.', 'woocommerce-mercadopago'),
984
- '<a href="' . $this->getCountryLinkGuide($this->checkout_country) .'guides/notifications/ipn/">' . __('our guides', 'woocommerce-mercadopago') .
985
  '</a>'
986
  ),
987
  'default' => '',
@@ -998,14 +1013,14 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
998
  $checkout_payments_advanced_description = array(
999
  'title' => __('Edit these advanced fields only when you want to modify the preset values.', 'woocommerce-mercadopago'),
1000
  'type' => 'title',
1001
- 'class' => 'mp_small_text mp-mt--10'
1002
  );
1003
  return $checkout_payments_advanced_description;
1004
  }
1005
 
1006
  /**
1007
- * @return array
1008
- */
1009
  public function field_coupon_mode()
1010
  {
1011
  return array(
@@ -1061,7 +1076,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
1061
  public function field_gateway_discount()
1062
  {
1063
  $gateway_discount = array(
1064
- 'title' => __('Gateway Discounts', 'woocommerce-mercadopago'),
1065
  'type' => 'number',
1066
  'description' => __('Choose a percentage value that you want to discount your customers for paying with Mercado Pago.', 'woocommerce-mercadopago'),
1067
  'default' => '0',
@@ -1093,18 +1108,23 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
1093
  return $commission;
1094
  }
1095
 
1096
- /**
 
 
 
 
 
1097
  * @return array
1098
  */
1099
  public function field_checkout_ready_title()
1100
  {
1101
-
1102
- if($this->checkout_credential_token_production == 'yes') {
1103
- $message_ready_title = __('Everything ready for the takeoff of your sales?', 'woocommerce-mercadopago');
1104
- } else {
1105
- $message_ready_title = __('Everything set up? Go to your store in Sandbox mode', 'woocommerce-mercadopago');
1106
  }
1107
-
1108
  $checkout_options_title = array(
1109
  'title' => $message_ready_title,
1110
  'type' => 'title',
@@ -1118,12 +1138,12 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
1118
  */
1119
  public function field_checkout_ready_description()
1120
  {
1121
- if($this->checkout_credential_token_production == 'yes') {
1122
- $message_ready_description = __('You already went to Production. You just need your best customers <br> to arrive at your store to live the best online shopping experience with Mercado Pago.', 'woocommerce-mercadopago');
1123
- } else {
1124
- $message_ready_description = __('Visit your store as if you were one of your customers and check that everything is fine. If you already went to Production,<br> bring your customers and increase your sales with the best online shopping experience.', 'woocommerce-mercadopago');
1125
  }
1126
-
1127
  $checkout_options_subtitle = array(
1128
  'title' => $message_ready_description,
1129
  'type' => 'title',
@@ -1137,11 +1157,11 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
1137
  */
1138
  public function field_checkout_ready_description_link()
1139
  {
1140
- if($this->checkout_credential_token_production == 'yes') {
1141
- $message_link = __('Visit my store', 'woocommerce-mercadopago');
1142
- } else {
1143
- $message_link = __('I want to test my sales', 'woocommerce-mercadopago');
1144
- }
1145
 
1146
  $checkout_options_subtitle = array(
1147
  'title' => sprintf(
@@ -1175,15 +1195,13 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
1175
  $_mp_access_token = $this->getAccessToken();
1176
  $_site_id_v1 = $this->getOption('_site_id_v1');
1177
 
1178
-
1179
  if (!isset($this->settings['enabled'])) {
1180
  return false;
1181
  }
1182
 
1183
- return ('yes' == $this->settings['enabled']) && !empty($_mp_public_key) && !empty($_mp_access_token) && !empty($_site_id_v1);
1184
  }
1185
 
1186
-
1187
  /**
1188
  * @return mixed
1189
  */
@@ -1208,7 +1226,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
1208
  */
1209
  public function isTestUser()
1210
  {
1211
- if ($this->checkout_credential_token_production == 'yes') {
1212
  return false;
1213
  }
1214
  return true;
@@ -1226,4 +1244,47 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
1226
  }
1227
  return $mp;
1228
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1229
  }
9
  */
10
  class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
11
  {
 
12
  //ONLY get_option in this fields
13
  const COMMON_CONFIGS = array(
14
  '_mp_public_key_test',
68
  public $mp_public_key_prod;
69
  public $mp_access_token_prod;
70
  public $notification;
 
71
  public $checkout_country;
72
  public $wc_country;
73
  public $commission;
76
  public $activated_payment;
77
  public $homolog_validate;
78
  public $clientid_old_version;
79
+ public $customer;
80
+ public $logged_user_email;
81
+ public $currency_convertion;
82
 
83
  /**
84
  * WC_WooMercadoPago_PaymentAbstract constructor.
92
  $this->mp_access_token_prod = $this->getOption('_mp_access_token_prod');
93
  $this->checkout_country = get_option('checkout_country', '');
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');
100
  $this->gateway_discount = $this->getOption('gateway_discount', 0);
101
  $this->commission = $this->getOption('commission', 0);
107
  $this->mp = $this->getMpInstance();
108
  $this->homolog_validate = $this->getHomologValidate();
109
  $this->application_id = $this->getApplicationId($this->mp_access_token_prod);
110
+ $this->logged_user_email = (wp_get_current_user()->ID != 0) ? wp_get_current_user()->user_email : null;
111
+ $this->discount_action_url = get_site_url() . '/index.php/woocommerce-mercadopago/?wc-api=' . get_class($this);
112
  }
113
 
114
+ /**
115
+ * @return mixed
116
+ * @throws WC_WooMercadoPago_Exception
117
  */
118
  public function getHomologValidate()
119
  {
120
+ $homolog_validate = (int)get_option('homolog_validate', 0);
121
+ if (($this->isProductionMode() && !empty($this->mp_access_token_prod)) && $homolog_validate == 0) {
122
+ if ($this->mp instanceof MP) {
123
+ $homolog_validate = $this->mp->homologValidate($this->mp_access_token_prod);
124
+ update_option('homolog_validate', $homolog_validate, true);
125
+ return $homolog_validate;
126
+ }
127
+ return 0;
128
  }
129
+ return 1;
130
  }
131
 
132
  /**
134
  */
135
  public function getAccessToken()
136
  {
137
+ if (!$this->isProductionMode()) {
138
  return $this->mp_access_token_test;
139
  }
140
  return $this->mp_access_token_prod;
145
  */
146
  public function getPublicKey()
147
  {
148
+ if (!$this->isProductionMode()) {
149
  return $this->mp_public_key_test;
150
  }
151
  return $this->mp_public_key_prod;
163
  return get_option($key, $default);
164
  }
165
 
 
166
  $option = $this->get_option($key, $default);
167
  if (!empty($option)) {
168
  return $option;
176
  */
177
  public function normalizeCommonAdminFields()
178
  {
179
+ if (empty($this->mp_access_token_test) && empty($this->mp_access_token_prod)) {
180
+ if (isset($this->settings['enabled']) && $this->settings['enabled'] == 'yes') {
181
+ $this->settings['enabled'] = 'no';
182
+ $this->disableAllPaymentsMethodsMP();
183
+ }
184
+ }
185
+
186
  $changed = false;
187
  foreach (self::COMMON_CONFIGS as $config) {
188
  $commonOption = get_option($config);
209
  return true;
210
  }
211
 
212
+ /**
213
+ * @return bool
214
+ */
215
+ public function isManageSection()
216
+ {
217
+ if (!isset($_GET['section']) || ($this->id !== $_GET['section'])) {
218
+ return false;
219
+ }
220
+
221
+ return true;
222
+ }
223
+
224
  /**
225
  * @return string
226
  */
244
  public function getMethodDescription($description)
245
  {
246
  return '<div class="mp-header-logo">
247
+ <div class="mp-left-header">
248
  <img src="' . plugins_url('../assets/images/mplogo.png', plugin_dir_path(__FILE__)) . '">
249
  </div>
250
+ <div>' . $description . '</div>
 
 
251
  </div>';
252
  }
253
 
274
  */
275
  public function noticeHomologValidate()
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 WC_WooMercadoPago_Configs::getAlertFrame($message, $type);
280
  }
281
 
282
  /**
284
  * @return array
285
  */
286
  public function getFormFields($label)
287
+ {
 
 
 
 
 
 
288
  $this->init_form_fields();
289
  $this->init_settings();
290
  $form_fields = array();
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'));
319
+ }
320
  $form_fields['checkout_steps_link_homolog'] = $this->field_checkout_steps_link_homolog($this->checkout_country, $this->application_id);
321
  $form_fields['checkout_homolog_title'] = $this->field_checkout_homolog_title();
322
  $form_fields['checkout_homolog_subtitle'] = $this->field_checkout_homolog_subtitle();
354
  'title' => __('Title', 'woocommerce-mercadopago'),
355
  'type' => 'text',
356
  'description' => '',
357
+ 'class' => 'hidden-field-mp-title mp-hidden-field',
358
  'default' => $this->title
359
  );
360
  return $field_title;
368
  $field_description = array(
369
  'title' => __('Description', 'woocommerce-mercadopago'),
370
  'type' => 'text',
371
+ 'class' => 'hidden-field-mp-desc mp-hidden-field',
372
  'description' => '',
373
  'default' => $this->method_description
374
  );
403
  '<div class="mp-row">
404
  <h4 class="mp-title-checkout-body mp-pb-20">' . __('<b>Follow these steps to activate Mercado Pago in your store:</b>', 'woocommerce-mercadopago') . '</h4>
405
 
406
+ <div class="mp-col-md-2 mp-text-center mp-pb-10">
407
+ <p class="mp-number-checkout-body">1</p>
408
+ <p class="mp-text-steps mp-text-center mp-px-20">
409
+ ' . __('Upload your <b>credentials</b> depending on the country in which you are registered.', 'woocommerce-mercadopago') . '
410
  </p>
411
  </div>
412
 
413
+ <div class="mp-col-md-2 mp-text-center mp-pb-10">
414
+ <p class="mp-number-checkout-body">2</p>
415
+ <p class="mp-text-steps mp-text-center mp-px-20">
416
  ' . __('Approve your account to be able to charge.', 'woocommerce-mercadopago') . '
417
  </p>
418
  </div>
419
 
420
+ <div class="mp-col-md-2 mp-text-center mp-pb-10">
421
+ <p class="mp-number-checkout-body">3</p>
422
+ <p class="mp-text-steps mp-text-center mp-px-20">
423
  ' . __('Add the basic information of your business in the plugin configuration.', 'woocommerce-mercadopago') . '
424
  </p>
425
  </div>
426
 
427
+ <div class="mp-col-md-2 mp-text-center mp-pb-10">
428
+ <p class="mp-number-checkout-body">4</p>
429
+ <p class="mp-text-steps mp-text-center mp-px-20">
430
  ' . __('Configure the <b>payment preferences</b> for your customers.', 'woocommerce-mercadopago') . '
431
  </p>
432
  </div>
433
 
434
+ <div class="mp-col-md-2 mp-text-center mp-pb-10">
435
+ <p class="mp-number-checkout-body">5</p>
436
+ <p class="mp-text-steps mp-text-center mp-px-20">
437
+ ' . __('<b>Go to advanced settings</b> only when you want to change the presets.', 'woocommerce-mercadopago') . '
438
  </p>
439
  </div>
440
  </div>'
457
  '<a href="https://www.mercadopago.com/' . $country_link . '/account/credentials/appliance?application_id=' . $appliocation_id . '" target="_blank">' . __('approved account', 'woocommerce-mercadopago') . '</a>'
458
  ),
459
  'type' => 'title',
460
+ 'class' => 'mp_homolog_text'
461
  );
462
 
463
  array_splice($this->field_forms_order, 4, 0, 'checkout_steps_link_homolog');
538
  $checkout_btn_save = array(
539
  'title' => sprintf(
540
  __('%s', 'woocommerce-mercadopago'),
541
+ '<button name="save" class="button button-primary mp-save-button" type="submit" value="Save changes">' . __('Save Changes', 'woocommerce-mercadopago') . '</button>'
542
  ),
543
  'type' => 'title',
544
  'class' => ''
586
  $checkout_credential_mod_test_title = array(
587
  'title' => __('Test Mode', 'woocommerce-mercadopago'),
588
  'type' => 'title',
589
+ 'class' => 'mp_subtitle_mt'
590
  );
591
  return $checkout_credential_mod_test_title;
592
  }
599
  $checkout_credential_mod_test_description = array(
600
  'title' => __('By default, we activate the Sandbox test environment for you to test before you start selling.', 'woocommerce-mercadopago'),
601
  'type' => 'title',
602
+ 'class' => 'mp_small_text mp-mt--12'
603
  );
604
  return $checkout_credential_mod_test_description;
605
  }
612
  $checkout_credential_mod_prod_title = array(
613
  'title' => __('Production Mode', 'woocommerce-mercadopago'),
614
  'type' => 'title',
615
+ 'class' => 'mp_subtitle_mt'
616
  );
617
  return $checkout_credential_mod_prod_title;
618
  }
625
  $checkout_credential_mod_prod_description = array(
626
  'title' => __('When you see that everything is going well, deactivate Sandbox, turn on Production and make way for your online sales.', 'woocommerce-mercadopago'),
627
  'type' => 'title',
628
+ 'class' => 'mp_small_text mp-mt--12'
629
  );
630
  return $checkout_credential_mod_prod_description;
631
  }
635
  */
636
  public function field_checkout_credential_production()
637
  {
638
+ $production_mode = $this->isProductionMode() ? 'yes' : 'no';
639
  $checkout_credential_production = array(
640
+ 'title' => __('Production', 'woocommerce-mercadopago'),
641
  'type' => 'select',
642
+ 'description' => __('Choose YES only when you are ready to sell. Change to NO to activate the Tests mode.', 'woocommerce-mercadopago'),
643
+ 'default' => $this->id == 'woo-mercado-pago-basic' && $this->clientid_old_version ? 'yes' : $production_mode,
644
  'options' => array(
645
  'no' => __('No', 'woocommerce-mercadopago'),
646
  'yes' => __('Yes', 'woocommerce-mercadopago')
698
  $checkout_credential__description_test = array(
699
  'title' => __('With these keys you can do the tests you want..', 'woocommerce-mercadopago'),
700
  'type' => 'title',
701
+ 'class' => 'mp_small_text mp-mt--12'
702
  );
703
  return $checkout_credential__description_test;
704
  }
755
  $checkout_credential__description_prod = array(
756
  'title' => __('With these keys you can receive real payments from your customers.', 'woocommerce-mercadopago'),
757
  'type' => 'title',
758
+ 'class' => 'mp_small_text mp-mt--12'
759
  );
760
  return $checkout_credential__description_prod;
761
  }
815
  $checkout_homolog_subtitle = array(
816
  'title' => __('Complete this process to secure your customers data and comply with the regulations<br> and legal provisions of each country.', 'woocommerce-mercadopago'),
817
  'type' => 'title',
818
+ 'class' => 'mp_text mp-mt--12'
819
  );
820
  return $checkout_homolog_subtitle;
821
  }
845
  'title' => __('Store Description', 'woocommerce-mercadopago'),
846
  'type' => 'text',
847
  'description' => __('This name will appear on your customers invoice.', 'woocommerce-mercadopago'),
848
+ 'default' => __('Mercado Pago', 'woocommerce-mercadopago'),
849
  );
850
  return $mp_statement_descriptor;
851
  }
863
  $field_category_store = array(
864
  'title' => __('Store Category', 'woocommerce-mercadopago'),
865
  'type' => 'select',
866
+ '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'),
867
  'default' => __('Categories', 'woocommerce-mercadopago'),
868
  'options' => $option_category
869
  );
924
  $checkout_payments_subtitle = array(
925
  'title' => __('Basic Configuration', 'woocommerce-mercadopago'),
926
  'type' => 'title',
927
+ 'class' => 'mp_subtitle mp-mt-5 mp-mb-0'
928
  );
929
  return $checkout_payments_subtitle;
930
  }
977
  $countryLink = array(
978
  'mla' => 'https://www.mercadopago.com.ar/developers/es/', // Argentinian
979
  'mlb' => 'https://www.mercadopago.com.br/developers/pt/', // Brazil
980
+ 'mlc' => 'https://www.mercadopago.cl/developers/es/', // Chile
981
  'mco' => 'https://www.mercadopago.com.co/developers/es/', // Colombia
982
  'mlm' => 'https://www.mercadopago.com.mx/developers/es/', // Mexico
983
  'mpe' => 'https://www.mercadopago.com.pe/developers/es/', // Peru
984
  'mlu' => 'https://www.mercadopago.com.uy/developers/es/', // Uruguay
985
  );
986
+ return $countryLink[$checkout];
987
  }
988
 
989
  /**
996
  'type' => 'text',
997
  'description' => sprintf(
998
  __('Enter a URL to receive payment notifications. In %s you can check more information.', 'woocommerce-mercadopago'),
999
+ '<a href="' . $this->getCountryLinkGuide($this->checkout_country) . 'guides/notifications/ipn/">' . __('our guides', 'woocommerce-mercadopago') .
1000
  '</a>'
1001
  ),
1002
  'default' => '',
1013
  $checkout_payments_advanced_description = array(
1014
  'title' => __('Edit these advanced fields only when you want to modify the preset values.', 'woocommerce-mercadopago'),
1015
  'type' => 'title',
1016
+ 'class' => 'mp_small_text mp-mt--12 mp-mb-18'
1017
  );
1018
  return $checkout_payments_advanced_description;
1019
  }
1020
 
1021
  /**
1022
+ * @return array
1023
+ */
1024
  public function field_coupon_mode()
1025
  {
1026
  return array(
1076
  public function field_gateway_discount()
1077
  {
1078
  $gateway_discount = array(
1079
+ 'title' => __('Discounts per purchase with Mercado Pago', 'woocommerce-mercadopago'),
1080
  'type' => 'number',
1081
  'description' => __('Choose a percentage value that you want to discount your customers for paying with Mercado Pago.', 'woocommerce-mercadopago'),
1082
  'default' => '0',
1108
  return $commission;
1109
  }
1110
 
1111
+ public function field_currency_conversion(WC_WooMercadoPago_PaymentAbstract $method)
1112
+ {
1113
+ return WC_WooMercadoPago_Helpers_CurrencyConverter::getInstance()->getField($method);
1114
+ }
1115
+
1116
+ /**
1117
  * @return array
1118
  */
1119
  public function field_checkout_ready_title()
1120
  {
1121
+
1122
+ if ($this->isProductionMode()) {
1123
+ $message_ready_title = __('Everything ready for the takeoff of your sales?', 'woocommerce-mercadopago');
1124
+ } else {
1125
+ $message_ready_title = __('Everything set up? Go to your store in Sandbox mode', 'woocommerce-mercadopago');
1126
  }
1127
+
1128
  $checkout_options_title = array(
1129
  'title' => $message_ready_title,
1130
  'type' => 'title',
1138
  */
1139
  public function field_checkout_ready_description()
1140
  {
1141
+ if ($this->isProductionMode()) {
1142
+ $message_ready_description = __('Visit your store as if you were one of your customers and check that everything is fine. If you already went to Production,<br> bring your customers and increase your sales with the best online shopping experience.', 'woocommerce-mercadopago');
1143
+ } else {
1144
+ $message_ready_description = __('Visit your store and simulate a payment to check that everything is fine.', 'woocommerce-mercadopago');
1145
  }
1146
+
1147
  $checkout_options_subtitle = array(
1148
  'title' => $message_ready_description,
1149
  'type' => 'title',
1157
  */
1158
  public function field_checkout_ready_description_link()
1159
  {
1160
+ if ($this->isProductionMode()) {
1161
+ $message_link = __('Visit my store', 'woocommerce-mercadopago');
1162
+ } else {
1163
+ $message_link = __('I want to test my sales', 'woocommerce-mercadopago');
1164
+ }
1165
 
1166
  $checkout_options_subtitle = array(
1167
  'title' => sprintf(
1195
  $_mp_access_token = $this->getAccessToken();
1196
  $_site_id_v1 = $this->getOption('_site_id_v1');
1197
 
 
1198
  if (!isset($this->settings['enabled'])) {
1199
  return false;
1200
  }
1201
 
1202
+ return ('yes' == $this->settings['enabled']) && !empty($_mp_public_key) && !empty($_mp_access_token) && !empty($_site_id_v1);
1203
  }
1204
 
 
1205
  /**
1206
  * @return mixed
1207
  */
1226
  */
1227
  public function isTestUser()
1228
  {
1229
+ if ($this->isProductionMode()) {
1230
  return false;
1231
  }
1232
  return true;
1244
  }
1245
  return $mp;
1246
  }
1247
+
1248
+ /**
1249
+ * Disable Payments MP
1250
+ */
1251
+ public function disableAllPaymentsMethodsMP()
1252
+ {
1253
+ $gateways = apply_filters('woocommerce_payment_gateways', array());
1254
+ foreach ($gateways as $gateway) {
1255
+ if (!strpos($gateway, "MercadoPago")) {
1256
+ continue;
1257
+ }
1258
+
1259
+ $key = 'woocommerce_' . $gateway::getId() . '_settings';
1260
+ $options = get_option($key);
1261
+ if (!empty($options)) {
1262
+ if (isset($options['checkout_credential_production']) && $options['checkout_credential_production'] == 'yes' && !empty($this->mp_access_token_prod)) {
1263
+ continue;
1264
+ }
1265
+
1266
+ if (isset($options['checkout_credential_production']) && $options['checkout_credential_production'] == 'no' && !empty($this->mp_access_token_test)) {
1267
+ continue;
1268
+ }
1269
+
1270
+ $options['enabled'] = 'no';
1271
+ update_option($key, apply_filters('woocommerce_settings_api_sanitized_fields_' . $gateway::getId(), $options));
1272
+ }
1273
+ }
1274
+ }
1275
+
1276
+ /**
1277
+ * @return bool
1278
+ */
1279
+ public function isCurrencyConvertable()
1280
+ {
1281
+ return $this->currency_convertion;
1282
+ }
1283
+
1284
+ /**
1285
+ * @return bool
1286
+ */
1287
+ public function isProductionMode() {
1288
+ return $this->getOption('checkout_credential_production', get_option('checkout_credential_production', 'no')) === 'yes';
1289
+ }
1290
  }
includes/payments/WC_WooMercadoPago_TicketGateway.php CHANGED
@@ -23,11 +23,11 @@ class WC_WooMercadoPago_TicketGateway extends WC_WooMercadoPago_PaymentAbstract
23
  return;
24
  }
25
 
26
- $this->desc = __('Accept cash payments within the custom checkout and expand your customers purchase options.', 'woocommerce-mercadopago');
27
  $this->form_fields = array();
28
  $this->method_title = __('Mercado Pago - Custom Checkout', 'woocommerce-mercadopago');
29
  $this->title = __('Pay with cash', 'woocommerce-mercadopago');
30
- $this->method_description = $this->getMethodDescription($this->desc);
31
  $this->coupon_mode = $this->getOption('coupon_mode', 'no');
32
  $this->stock_reduce_mode = $this->getOption('stock_reduce_mode', 'no');
33
  $this->date_expiration = $this->getOption('date_expiration', 3);
@@ -40,7 +40,7 @@ class WC_WooMercadoPago_TicketGateway extends WC_WooMercadoPago_PaymentAbstract
40
  $this->form_fields = $this->getFormFields('Ticket');
41
  $this->hook = new WC_WooMercadoPago_Hook_Ticket($this);
42
  $this->notification = new WC_WooMercadoPago_Notification_Webhook($this);
43
-
44
  }
45
 
46
  /**
@@ -49,7 +49,7 @@ class WC_WooMercadoPago_TicketGateway extends WC_WooMercadoPago_PaymentAbstract
49
  */
50
  public function getFormFields($label)
51
  {
52
- if (is_admin()) {
53
  wp_enqueue_script('woocommerce-mercadopago-ticket-config-script', plugins_url('../assets/js/ticket_config_mercadopago.js', plugin_dir_path(__FILE__)));
54
  }
55
 
@@ -71,6 +71,7 @@ class WC_WooMercadoPago_TicketGateway extends WC_WooMercadoPago_PaymentAbstract
71
  $form_fields['coupon_mode'] = $this->field_coupon_mode();
72
  $form_fields['stock_reduce_mode'] = $this->field_stock_reduce_mode();
73
  $form_fields['date_expiration'] = $this->field_date_expiration();
 
74
  foreach ($this->field_ticket_payments() as $key => $value) {
75
  $form_fields[$key] = $value;
76
  }
@@ -88,7 +89,6 @@ class WC_WooMercadoPago_TicketGateway extends WC_WooMercadoPago_PaymentAbstract
88
 
89
  /**
90
  * get_fields_sequence
91
- *
92
  * @return array
93
  */
94
  public function get_fields_sequence()
@@ -97,7 +97,7 @@ class WC_WooMercadoPago_TicketGateway extends WC_WooMercadoPago_PaymentAbstract
97
  // Necessary to run
98
  'title',
99
  'description',
100
- // Checkout de pagos con dinero en efectivo<br> Aceptá pagos al instante y maximizá la conversión de tu negocio
101
  'checkout_ticket_header',
102
  'checkout_steps',
103
  // ¿En qué país vas a activar tu tienda?
@@ -139,6 +139,8 @@ class WC_WooMercadoPago_TicketGateway extends WC_WooMercadoPago_PaymentAbstract
139
  'checkout_payments_subtitle',
140
  'checkout_payments_description',
141
  'enabled',
 
 
142
  'date_expiration',
143
  // Advanced configuration of the personalized payment experience"
144
  'checkout_ticket_payments_advanced_title',
@@ -160,13 +162,17 @@ class WC_WooMercadoPago_TicketGateway extends WC_WooMercadoPago_PaymentAbstract
160
  public static function get_activated_payment()
161
  {
162
  $activated_payment = array();
163
- $get_payment_methods_ticket = json_decode(get_option('_all_payment_methods_ticket', ''), true);
164
 
165
  if (!empty($get_payment_methods_ticket)) {
166
  $saved_optons = get_option('woocommerce_woo-mercado-pago-ticket_settings', '');
167
 
 
 
 
 
168
  foreach ($get_payment_methods_ticket as $payment_methods_ticket) {
169
- if (isset($saved_optons['ticket_payment_' . $payment_methods_ticket['id']]) && $saved_optons['ticket_payment_' . $payment_methods_ticket['id']] == 'yes') {
170
  array_push($activated_payment, $payment_methods_ticket);
171
  }
172
  }
@@ -181,17 +187,20 @@ class WC_WooMercadoPago_TicketGateway extends WC_WooMercadoPago_PaymentAbstract
181
  {
182
  $checkout_ticket_header = array(
183
  'title' => sprintf(
184
- __('Checkout of payments with cash<br> Accept face-to-face payments, do not leave anyone out! %s', 'woocommerce-mercadopago'),
185
  '<div class="mp-row">
 
 
 
186
  <div class="mp-col-md-12">
187
- <p class="text-checkout-body mp-mb-0">
188
  ' . __('Include this preferred purchase option by some customers.', 'woocommerce-mercadopago') . '
189
  </p>
190
  </div>
191
  </div>'
192
  ),
193
  'type' => 'title',
194
- 'class' => 'mp_title_checkout'
195
  );
196
  return $checkout_ticket_header;
197
  }
@@ -202,7 +211,7 @@ class WC_WooMercadoPago_TicketGateway extends WC_WooMercadoPago_PaymentAbstract
202
  public function field_checkout_ticket_options_title()
203
  {
204
  $checkout_options_title = array(
205
- 'title' => __('Configure WooCommerce Mercado Pago', 'woocommerce-mercadopago'),
206
  'type' => 'title',
207
  'class' => 'mp_title_bd'
208
  );
@@ -222,7 +231,7 @@ class WC_WooMercadoPago_TicketGateway extends WC_WooMercadoPago_PaymentAbstract
222
  return $checkout_options_subtitle;
223
  }
224
 
225
- /**
226
  * @return array
227
  */
228
  public function field_checkout_options_description()
@@ -284,9 +293,9 @@ class WC_WooMercadoPago_TicketGateway extends WC_WooMercadoPago_PaymentAbstract
284
  public function field_date_expiration()
285
  {
286
  return array(
287
- 'title' => __( 'Payment Due', 'woocommerce-mercadopago' ),
288
  'type' => 'number',
289
- 'description' => __( 'In how many days will cash payments expire.', 'woocommerce-mercadopago' ),
290
  'default' => ''
291
  );
292
  }
@@ -299,12 +308,15 @@ class WC_WooMercadoPago_TicketGateway extends WC_WooMercadoPago_PaymentAbstract
299
  $ticket_payments = array();
300
  $ticket_payments_sort = array();
301
 
302
- $get_payment_methods_ticket = json_decode(get_option('_all_payment_methods_ticket', '[]'), true);
303
 
304
  $count_payment = 0;
305
 
306
- foreach ($get_payment_methods_ticket as $payment_method_ticket) {
 
 
307
 
 
308
  $element = array(
309
  'label' => $payment_method_ticket['name'],
310
  'id' => 'woocommerce_mercadopago_' . $payment_method_ticket['id'],
@@ -320,7 +332,7 @@ class WC_WooMercadoPago_TicketGateway extends WC_WooMercadoPago_PaymentAbstract
320
 
321
  if ($count_payment == 1) {
322
  $element['title'] = __('Payment methods', 'woocommerce-mercadopago');
323
- $element['desc_tip'] = __('Select the payment methods available in your store.', 'woocommerce-services');
324
  }
325
  if ($count_payment == count($get_payment_methods_ticket)) {
326
  $element['description'] = __('Enable the payment methods available to your customers.', 'woocommerce-mercadopago');
@@ -330,7 +342,15 @@ class WC_WooMercadoPago_TicketGateway extends WC_WooMercadoPago_PaymentAbstract
330
  $ticket_payments_sort[] = "ticket_payment_" . $payment_method_ticket['id'];
331
  }
332
 
333
- array_splice($this->field_forms_order, 37, 0, $ticket_payments_sort);
 
 
 
 
 
 
 
 
334
 
335
  return $ticket_payments;
336
  }
@@ -347,30 +367,25 @@ class WC_WooMercadoPago_TicketGateway extends WC_WooMercadoPago_PaymentAbstract
347
  );
348
 
349
  $amount = $this->get_order_total();
 
 
 
 
350
  $logged_user_email = (wp_get_current_user()->ID != 0) ? wp_get_current_user()->user_email : null;
351
- $discount_action_url = get_site_url() . '/index.php/woocommerce-mercadopago/?wc-api=WC_WooMercadoPago_TicketGateway';
352
- $address = get_user_meta(wp_get_current_user()->ID, 'shipping_address_1', true);
353
- $address_2 = get_user_meta(wp_get_current_user()->ID, 'shipping_address_2', true);
354
  $address .= (!empty($address_2) ? ' - ' . $address_2 : '');
355
- $country = get_user_meta(wp_get_current_user()->ID, 'shipping_country', true);
356
  $address .= (!empty($country) ? ' - ' . $country : '');
357
 
358
- $currency_ratio = 1;
359
- $_mp_currency_conversion_v1 = $this->getOption('_mp_currency_conversion_v1', '');
360
- if (!empty($_mp_currency_conversion_v1)) {
361
- $currency_ratio = WC_WooMercadoPago_Module::get_conversion_rate($this->site_data['currency']);
362
- $currency_ratio = $currency_ratio > 0 ? $currency_ratio : 1;
363
- }
364
-
365
  $parameters = array(
366
  'amount' => $amount,
367
  'payment_methods' => $this->activated_payment,
368
  'site_id' => $this->getOption('_site_id_v1'),
369
  'coupon_mode' => isset($logged_user_email) ? $this->coupon_mode : 'no',
370
- 'discount_action_url' => $discount_action_url,
371
  'payer_email' => $logged_user_email,
372
- 'images_path' => plugins_url('../assets/images/', plugin_dir_path(__FILE__)),
373
- 'currency_ratio' => $currency_ratio,
374
  'woocommerce_currency' => get_woocommerce_currency(),
375
  'account_currency' => $this->site_data['currency'],
376
  'febraban' => (wp_get_current_user()->ID != 0) ?
@@ -380,14 +395,21 @@ class WC_WooMercadoPago_TicketGateway extends WC_WooMercadoPago_PaymentAbstract
380
  'docNumber' => '',
381
  'address' => $address,
382
  'number' => '',
383
- 'city' => get_user_meta(wp_get_current_user()->ID, 'shipping_city', true),
384
- 'state' => get_user_meta(wp_get_current_user()->ID, 'shipping_state', true),
385
- 'zipcode' => get_user_meta(wp_get_current_user()->ID, 'shipping_postcode', true)
386
  ) :
387
  array(
388
- 'firstname' => '', 'lastname' => '', 'docNumber' => '', 'address' => '', 'number' => '', 'city' => '', 'state' => '', 'zipcode' => ''
 
 
 
 
 
 
 
389
  ),
390
- 'path_to_javascript' => plugins_url('../assets/js/ticket.js', plugin_dir_path(__FILE__))
391
  );
392
 
393
  wc_get_template('checkout/ticket_checkout.php', $parameters, 'woo/mercado/pago/module/', WC_WooMercadoPago_Module::get_templates_path());
@@ -403,11 +425,31 @@ class WC_WooMercadoPago_TicketGateway extends WC_WooMercadoPago_PaymentAbstract
403
  $this->log->write_log(__FUNCTION__, 'Ticket POST: ' . json_encode($ticket_checkout, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
404
 
405
  $order = wc_get_order($order_id);
 
406
  if (method_exists($order, 'update_meta_data')) {
407
  $order->update_meta_data('_used_gateway', get_class($this));
 
 
 
 
 
 
 
 
 
408
  $order->save();
409
  } else {
410
  update_post_meta($order_id, '_used_gateway', get_class($this));
 
 
 
 
 
 
 
 
 
 
411
  }
412
 
413
  // Check for brazilian FEBRABAN rules.
@@ -437,6 +479,7 @@ class WC_WooMercadoPago_TicketGateway extends WC_WooMercadoPago_PaymentAbstract
437
  if (isset($ticket_checkout['amount']) && !empty($ticket_checkout['amount']) &&
438
  isset($ticket_checkout['paymentMethodId']) && !empty($ticket_checkout['paymentMethodId'])) {
439
  $response = $this->create_preference($order, $ticket_checkout);
 
440
  if (is_array($response) && array_key_exists('status', $response)) {
441
  if ($response['status'] == 'pending') {
442
  if ($response['status_detail'] == 'pending_waiting_payment') {
@@ -544,4 +587,13 @@ class WC_WooMercadoPago_TicketGateway extends WC_WooMercadoPago_PaymentAbstract
544
 
545
  return true;
546
  }
547
- }
 
 
 
 
 
 
 
 
 
23
  return;
24
  }
25
 
26
+ $this->description = __('Accept cash payments within the custom checkout and expand your customers purchase options.', 'woocommerce-mercadopago');
27
  $this->form_fields = array();
28
  $this->method_title = __('Mercado Pago - Custom Checkout', 'woocommerce-mercadopago');
29
  $this->title = __('Pay with cash', 'woocommerce-mercadopago');
30
+ $this->method_description = $this->getMethodDescription($this->description);
31
  $this->coupon_mode = $this->getOption('coupon_mode', 'no');
32
  $this->stock_reduce_mode = $this->getOption('stock_reduce_mode', 'no');
33
  $this->date_expiration = $this->getOption('date_expiration', 3);
40
  $this->form_fields = $this->getFormFields('Ticket');
41
  $this->hook = new WC_WooMercadoPago_Hook_Ticket($this);
42
  $this->notification = new WC_WooMercadoPago_Notification_Webhook($this);
43
+ $this->currency_convertion = true;
44
  }
45
 
46
  /**
49
  */
50
  public function getFormFields($label)
51
  {
52
+ if (is_admin() && $this->isManageSection()) {
53
  wp_enqueue_script('woocommerce-mercadopago-ticket-config-script', plugins_url('../assets/js/ticket_config_mercadopago.js', plugin_dir_path(__FILE__)));
54
  }
55
 
71
  $form_fields['coupon_mode'] = $this->field_coupon_mode();
72
  $form_fields['stock_reduce_mode'] = $this->field_stock_reduce_mode();
73
  $form_fields['date_expiration'] = $this->field_date_expiration();
74
+ $form_fields[WC_WooMercadoPago_Helpers_CurrencyConverter::CONFIG_KEY] = $this->field_currency_conversion($this);
75
  foreach ($this->field_ticket_payments() as $key => $value) {
76
  $form_fields[$key] = $value;
77
  }
89
 
90
  /**
91
  * get_fields_sequence
 
92
  * @return array
93
  */
94
  public function get_fields_sequence()
97
  // Necessary to run
98
  'title',
99
  'description',
100
+ // Checkout de pagos con dinero en efectivo<br> Aceptá pagos al instante y maximizá la conversión de tu negocio
101
  'checkout_ticket_header',
102
  'checkout_steps',
103
  // ¿En qué país vas a activar tu tienda?
139
  'checkout_payments_subtitle',
140
  'checkout_payments_description',
141
  'enabled',
142
+ WC_WooMercadoPago_Helpers_CurrencyConverter::CONFIG_KEY,
143
+ 'field_ticket_payments',
144
  'date_expiration',
145
  // Advanced configuration of the personalized payment experience"
146
  'checkout_ticket_payments_advanced_title',
162
  public static function get_activated_payment()
163
  {
164
  $activated_payment = array();
165
+ $get_payment_methods_ticket = get_option('_all_payment_methods_ticket', '');
166
 
167
  if (!empty($get_payment_methods_ticket)) {
168
  $saved_optons = get_option('woocommerce_woo-mercado-pago-ticket_settings', '');
169
 
170
+ if (!is_array($get_payment_methods_ticket)) {
171
+ $get_payment_methods_ticket = json_decode($get_payment_methods_ticket, true);
172
+ }
173
+
174
  foreach ($get_payment_methods_ticket as $payment_methods_ticket) {
175
+ if (!isset($saved_optons['ticket_payment_' . $payment_methods_ticket['id']]) || $saved_optons['ticket_payment_' . $payment_methods_ticket['id']] == 'yes') {
176
  array_push($activated_payment, $payment_methods_ticket);
177
  }
178
  }
187
  {
188
  $checkout_ticket_header = array(
189
  'title' => sprintf(
190
+ __('Checkout of payments with cash %s', 'woocommerce-mercadopago'),
191
  '<div class="mp-row">
192
+ <div class="mp-col-md-12 mp_subtitle_header">
193
+ ' . __('Accept face-to-face payments, do not leave anyone out!', 'woocommerce-mercadopago') . '
194
+ </div>
195
  <div class="mp-col-md-12">
196
+ <p class="mp-text-checkout-body mp-mb-0">
197
  ' . __('Include this preferred purchase option by some customers.', 'woocommerce-mercadopago') . '
198
  </p>
199
  </div>
200
  </div>'
201
  ),
202
  'type' => 'title',
203
+ 'class' => 'mp_title_header'
204
  );
205
  return $checkout_ticket_header;
206
  }
211
  public function field_checkout_ticket_options_title()
212
  {
213
  $checkout_options_title = array(
214
+ 'title' => __('Configure Mercado Pago for WooCommerce', 'woocommerce-mercadopago'),
215
  'type' => 'title',
216
  'class' => 'mp_title_bd'
217
  );
231
  return $checkout_options_subtitle;
232
  }
233
 
234
+ /**
235
  * @return array
236
  */
237
  public function field_checkout_options_description()
293
  public function field_date_expiration()
294
  {
295
  return array(
296
+ 'title' => __('Payment Due', 'woocommerce-mercadopago'),
297
  'type' => 'number',
298
+ 'description' => __('In how many days will cash payments expire.', 'woocommerce-mercadopago'),
299
  'default' => ''
300
  );
301
  }
308
  $ticket_payments = array();
309
  $ticket_payments_sort = array();
310
 
311
+ $get_payment_methods_ticket = get_option('_all_payment_methods_ticket', '[]');
312
 
313
  $count_payment = 0;
314
 
315
+ if (!is_array($get_payment_methods_ticket)) {
316
+ $get_payment_methods_ticket = json_decode($get_payment_methods_ticket, true);
317
+ }
318
 
319
+ foreach ($get_payment_methods_ticket as $payment_method_ticket) {
320
  $element = array(
321
  'label' => $payment_method_ticket['name'],
322
  'id' => 'woocommerce_mercadopago_' . $payment_method_ticket['id'],
332
 
333
  if ($count_payment == 1) {
334
  $element['title'] = __('Payment methods', 'woocommerce-mercadopago');
335
+ $element['desc_tip'] = __('Select the payment methods available in your store.', 'woocommerce-mercadopago');
336
  }
337
  if ($count_payment == count($get_payment_methods_ticket)) {
338
  $element['description'] = __('Enable the payment methods available to your customers.', 'woocommerce-mercadopago');
342
  $ticket_payments_sort[] = "ticket_payment_" . $payment_method_ticket['id'];
343
  }
344
 
345
+ $index = 0;
346
+ foreach ($this->field_forms_order as $k => $field) {
347
+ $index ++;
348
+ if ($field == 'field_ticket_payments') {
349
+ unset($this->field_forms_order[$k]);
350
+ array_splice($this->field_forms_order, $index, 0, $ticket_payments_sort);
351
+ break;
352
+ }
353
+ }
354
 
355
  return $ticket_payments;
356
  }
367
  );
368
 
369
  $amount = $this->get_order_total();
370
+ $discount = $amount * ($this->gateway_discount / 100);
371
+ $comission = $amount * ($this->commission / 100);
372
+ $amount = $amount - $discount + $comission;
373
+
374
  $logged_user_email = (wp_get_current_user()->ID != 0) ? wp_get_current_user()->user_email : null;
375
+ $address = get_user_meta(wp_get_current_user()->ID, 'billing_address_1', true);
376
+ $address_2 = get_user_meta(wp_get_current_user()->ID, 'billing_address_2', true);
 
377
  $address .= (!empty($address_2) ? ' - ' . $address_2 : '');
378
+ $country = get_user_meta(wp_get_current_user()->ID, 'billing_country', true);
379
  $address .= (!empty($country) ? ' - ' . $country : '');
380
 
 
 
 
 
 
 
 
381
  $parameters = array(
382
  'amount' => $amount,
383
  'payment_methods' => $this->activated_payment,
384
  'site_id' => $this->getOption('_site_id_v1'),
385
  'coupon_mode' => isset($logged_user_email) ? $this->coupon_mode : 'no',
386
+ 'discount_action_url' => $this->discount_action_url,
387
  'payer_email' => $logged_user_email,
388
+ 'currency_ratio' => WC_WooMercadoPago_Helpers_CurrencyConverter::getInstance()->ratio($this),
 
389
  'woocommerce_currency' => get_woocommerce_currency(),
390
  'account_currency' => $this->site_data['currency'],
391
  'febraban' => (wp_get_current_user()->ID != 0) ?
395
  'docNumber' => '',
396
  'address' => $address,
397
  'number' => '',
398
+ 'city' => get_user_meta(wp_get_current_user()->ID, 'billing_city', true),
399
+ 'state' => get_user_meta(wp_get_current_user()->ID, 'billing_state', true),
400
+ 'zipcode' => get_user_meta(wp_get_current_user()->ID, 'billing_postcode', true)
401
  ) :
402
  array(
403
+ 'firstname' => '',
404
+ 'lastname' => '',
405
+ 'docNumber' => '',
406
+ 'address' => '',
407
+ 'number' => '',
408
+ 'city' => '',
409
+ 'state' => '',
410
+ 'zipcode' => '',
411
  ),
412
+ 'images_path' => plugins_url('../assets/images/', plugin_dir_path(__FILE__)),
413
  );
414
 
415
  wc_get_template('checkout/ticket_checkout.php', $parameters, 'woo/mercado/pago/module/', WC_WooMercadoPago_Module::get_templates_path());
425
  $this->log->write_log(__FUNCTION__, 'Ticket POST: ' . json_encode($ticket_checkout, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
426
 
427
  $order = wc_get_order($order_id);
428
+ $amount = $this->get_order_total();
429
  if (method_exists($order, 'update_meta_data')) {
430
  $order->update_meta_data('_used_gateway', get_class($this));
431
+ if (!empty($this->gateway_discount)) {
432
+ $discount = $amount * ($this->gateway_discount / 100);
433
+ $order->update_meta_data('Mercado Pago: discount', __('discount of', 'woocommerce-mercadopago') . ' ' . $this->gateway_discount . '% / ' . __('discount of', 'woocommerce-mercadopago') . ' = ' . $discount);
434
+ }
435
+
436
+ if (!empty($this->commission)) {
437
+ $comission = $amount * ($this->commission / 100);
438
+ $order->update_meta_data('Mercado Pago: comission', __('fee of', 'woocommerce-mercadopago') . ' ' . $this->commission . '% / ' . __('fee of', 'woocommerce-mercadopago') . ' = ' . $comission);
439
+ }
440
  $order->save();
441
  } else {
442
  update_post_meta($order_id, '_used_gateway', get_class($this));
443
+
444
+ if (!empty($this->gateway_discount)) {
445
+ $discount = $amount * ($this->gateway_discount / 100);
446
+ update_post_meta($order_id,'Mercado Pago: discount', __('discount of', 'woocommerce-mercadopago') . ' ' . $this->gateway_discount . '% / ' . __('discount of', 'woocommerce-mercadopago') . ' = ' . $discount);
447
+ }
448
+
449
+ if (!empty($this->commission)) {
450
+ $comission = $amount * ($this->commission / 100);
451
+ update_post_meta($order_id,'Mercado Pago: comission', __('fee of', 'woocommerce-mercadopago') . ' ' . $this->commission . '% / ' . __('fee of', 'woocommerce-mercadopago') . ' = ' . $comission);
452
+ }
453
  }
454
 
455
  // Check for brazilian FEBRABAN rules.
479
  if (isset($ticket_checkout['amount']) && !empty($ticket_checkout['amount']) &&
480
  isset($ticket_checkout['paymentMethodId']) && !empty($ticket_checkout['paymentMethodId'])) {
481
  $response = $this->create_preference($order, $ticket_checkout);
482
+
483
  if (is_array($response) && array_key_exists('status', $response)) {
484
  if ($response['status'] == 'pending') {
485
  if ($response['status_detail'] == 'pending_waiting_payment') {
587
 
588
  return true;
589
  }
590
+
591
+ /**
592
+ * @return string
593
+ */
594
+ public static function getId()
595
+ {
596
+ return WC_WooMercadoPago_TicketGateway::ID;
597
+ }
598
+ }
599
+
includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php CHANGED
@@ -37,6 +37,10 @@ abstract class WC_WooMercadoPago_Hook_Abstract
37
  add_action('woocommerce_cart_calculate_fees', array($this, 'add_discount'), 10);
38
  add_filter('woocommerce_gateway_title', array($this, 'get_payment_method_title'), 10, 2);
39
 
 
 
 
 
40
  if (!empty($this->payment->settings['enabled']) && $this->payment->settings['enabled'] == 'yes') {
41
  add_action('woocommerce_after_checkout_form', array($this, 'add_mp_settings_script'));
42
  add_action('woocommerce_thankyou', array($this, 'update_mp_settings_script'));
@@ -63,7 +67,7 @@ abstract class WC_WooMercadoPago_Hook_Abstract
63
  */
64
  public function send_settings_mp()
65
  {
66
- if (!empty($this->siteId)) {
67
  if (!$this->testUser) {
68
  $this->payment->mp->analytics_save_settings($this->define_settings_to_send());
69
  }
@@ -92,18 +96,6 @@ abstract class WC_WooMercadoPago_Hook_Abstract
92
  return $infra_data;
93
  }
94
 
95
- /**
96
- * ADD Checkout Scripts
97
- */
98
- public function add_checkout_scripts()
99
- {
100
- if (is_checkout() && $this->payment->is_available()) {
101
- if (!get_query_var('order-received')) {
102
- wp_enqueue_script('mercado-pago-module-custom-js', 'https://secure.mlstatic.com/sdk/javascript/v1/mercadopago.js');
103
- }
104
- }
105
- }
106
-
107
  /**
108
  * @param $title
109
  * @return string
@@ -133,11 +125,11 @@ abstract class WC_WooMercadoPago_Hook_Abstract
133
  $price_commission = $total * ($this->payment->commission / 100);
134
 
135
  if ($this->payment->gateway_discount > 0 && $this->payment->commission > 0) {
136
- $title .= ' (' . __('Discount of', 'woocommerce-mercadopago') . ' ' . strip_tags(wc_price($price_discount)) . __(' and Rate of', 'woocommerce-mercadopago') . ' ' . strip_tags(wc_price($price_commission)) . ')';
137
  } elseif ($this->payment->gateway_discount > 0) {
138
- $title .= ' (' . __('Discount of', 'woocommerce-mercadopago') . ' ' . strip_tags(wc_price($price_discount)) . ')';
139
  } elseif ($this->payment->commission > 0) {
140
- $title .= ' (' . __('Fee of', 'woocommerce-mercadopago') . ' ' . strip_tags(wc_price($price_commission)) . ')';
141
  }
142
  return $title;
143
  }
@@ -191,12 +183,15 @@ abstract class WC_WooMercadoPago_Hook_Abstract
191
  */
192
  public function custom_process_admin_options()
193
  {
 
 
194
  $valueCredentialProduction = null;
195
  $this->payment->init_settings();
196
  $post_data = $this->payment->get_post_data();
197
  foreach ($this->payment->get_form_fields() as $key => $field) {
198
  if ('title' !== $this->payment->get_field_type($field)) {
199
  $value = $this->payment->get_field_value($key, $field, $post_data);
 
200
  if ($key == 'checkout_credential_production') {
201
  $valueCredentialProduction = $value;
202
  }
@@ -215,7 +210,15 @@ abstract class WC_WooMercadoPago_Hook_Abstract
215
  }
216
  $this->send_settings_mp();
217
 
218
- return update_option($this->payment->get_option_key(), apply_filters('woocommerce_settings_api_sanitized_fields_' . $this->payment->id, $this->payment->settings));
 
 
 
 
 
 
 
 
219
  }
220
 
221
  /**
@@ -302,7 +305,7 @@ abstract class WC_WooMercadoPago_Hook_Abstract
302
  }
303
 
304
  if (empty($isProduction)) {
305
- $isProduction = $this->payment->checkout_credential_token_production;
306
  }
307
 
308
  if (WC_WooMercadoPago_Credentials::access_token_is_valid($value)) {
@@ -312,7 +315,7 @@ abstract class WC_WooMercadoPago_Hook_Abstract
312
  $homolog_validate = $this->mpInstance->homologValidate($value);
313
  update_option('homolog_validate', $homolog_validate, true);
314
  if ($isProduction == 'yes' && $homolog_validate == 0) {
315
- add_action('admin_notices', array(get_class($this->payment), 'enablePaymentNotice'));
316
  }
317
  }
318
 
@@ -343,9 +346,9 @@ abstract class WC_WooMercadoPago_Hook_Abstract
343
  */
344
  public function noticeInvalidProdCredentials()
345
  {
346
- echo '<div class="error is-dismissible">
347
- <p><strong>MERCADO PAGO: </strong>' . __('Credentials for invalid production!', 'woocommerce-mercadopago') . '</p>
348
- </div>';
349
  }
350
 
351
  /**
@@ -353,8 +356,20 @@ abstract class WC_WooMercadoPago_Hook_Abstract
353
  */
354
  public function noticeInvalidTestCredentials()
355
  {
356
- echo '<div class="error is-dismissible">
357
- <p><strong>MERCADO PAGO: </strong>' . __('Invalid test credentials!', 'woocommerce-mercadopago') . '</p>
358
- </div>';
 
 
 
 
 
 
 
 
 
 
359
  }
 
 
360
  }
37
  add_action('woocommerce_cart_calculate_fees', array($this, 'add_discount'), 10);
38
  add_filter('woocommerce_gateway_title', array($this, 'get_payment_method_title'), 10, 2);
39
 
40
+ add_action('admin_notices', function() {
41
+ WC_WooMercadoPago_Helpers_CurrencyConverter::getInstance()->notices($this->payment);
42
+ });
43
+
44
  if (!empty($this->payment->settings['enabled']) && $this->payment->settings['enabled'] == 'yes') {
45
  add_action('woocommerce_after_checkout_form', array($this, 'add_mp_settings_script'));
46
  add_action('woocommerce_thankyou', array($this, 'update_mp_settings_script'));
67
  */
68
  public function send_settings_mp()
69
  {
70
+ if (!empty($this->payment->getAccessToken()) && !empty($this->siteId)) {
71
  if (!$this->testUser) {
72
  $this->payment->mp->analytics_save_settings($this->define_settings_to_send());
73
  }
96
  return $infra_data;
97
  }
98
 
 
 
 
 
 
 
 
 
 
 
 
 
99
  /**
100
  * @param $title
101
  * @return string
125
  $price_commission = $total * ($this->payment->commission / 100);
126
 
127
  if ($this->payment->gateway_discount > 0 && $this->payment->commission > 0) {
128
+ $title .= ' (' . __('discount of', 'woocommerce-mercadopago') . ' ' . strip_tags(wc_price($price_discount)) . __(' and fee of', 'woocommerce-mercadopago') . ' ' . strip_tags(wc_price($price_commission)) . ')';
129
  } elseif ($this->payment->gateway_discount > 0) {
130
+ $title .= ' (' . __('discount of', 'woocommerce-mercadopago') . ' ' . strip_tags(wc_price($price_discount)) . ')';
131
  } elseif ($this->payment->commission > 0) {
132
+ $title .= ' (' . __('fee of', 'woocommerce-mercadopago') . ' ' . strip_tags(wc_price($price_commission)) . ')';
133
  }
134
  return $title;
135
  }
183
  */
184
  public function custom_process_admin_options()
185
  {
186
+ $oldData = array();
187
+
188
  $valueCredentialProduction = null;
189
  $this->payment->init_settings();
190
  $post_data = $this->payment->get_post_data();
191
  foreach ($this->payment->get_form_fields() as $key => $field) {
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_production') {
196
  $valueCredentialProduction = $value;
197
  }
210
  }
211
  $this->send_settings_mp();
212
 
213
+ $result = update_option($this->payment->get_option_key(), apply_filters('woocommerce_settings_api_sanitized_fields_' . $this->payment->id, $this->payment->settings));
214
+
215
+ WC_WooMercadoPago_Helpers_CurrencyConverter::getInstance()->scheduleNotice(
216
+ $this->payment,
217
+ $oldData,
218
+ $this->payment->settings
219
+ );
220
+
221
+ return $result;
222
  }
223
 
224
  /**
305
  }
306
 
307
  if (empty($isProduction)) {
308
+ $isProduction = $this->payment->isProductionMode();
309
  }
310
 
311
  if (WC_WooMercadoPago_Credentials::access_token_is_valid($value)) {
315
  $homolog_validate = $this->mpInstance->homologValidate($value);
316
  update_option('homolog_validate', $homolog_validate, true);
317
  if ($isProduction == 'yes' && $homolog_validate == 0) {
318
+ add_action('admin_notices', array($this, 'enablePaymentNotice'));
319
  }
320
  }
321
 
346
  */
347
  public function noticeInvalidProdCredentials()
348
  {
349
+ $type = 'error';
350
+ $message = __('Credentials for invalid production!', 'woocommerce-mercadopago');
351
+ echo WC_WooMercadoPago_Configs::getAlertFrame($message, $type);
352
  }
353
 
354
  /**
356
  */
357
  public function noticeInvalidTestCredentials()
358
  {
359
+ $type = 'error';
360
+ $message = __('Invalid test credentials!', 'woocommerce-mercadopago');
361
+ echo WC_WooMercadoPago_Configs::getAlertFrame($message, $type);
362
+ }
363
+
364
+ /**
365
+ * Enable Payment Notice
366
+ */
367
+ public function enablePaymentNotice()
368
+ {
369
+ $type = 'notice-warning';
370
+ $message = __('Complete your credentials to enable the payment of method.', 'woocommerce-mercadopago');
371
+ echo WC_WooMercadoPago_Configs::getAlertFrame($message, $type);
372
  }
373
+
374
+
375
  }
includes/payments/hooks/WC_WooMercadoPago_Hook_Basic.php CHANGED
@@ -55,11 +55,6 @@ class WC_WooMercadoPago_Hook_Basic extends WC_WooMercadoPago_Hook_Abstract
55
  $order = wc_get_order($order_id);
56
  $url = $this->payment->create_preference($order);
57
 
58
- $banner_url = $this->payment->getOption('_mp_custom_banner');
59
- if (!isset($banner_url) || empty($banner_url)) {
60
- $banner_url = $this->payment->site_data['checkout_banner'];
61
- }
62
-
63
  if ('modal' == $this->payment->method && $url) {
64
  $this->payment->log->write_log(__FUNCTION__, 'rendering Mercado Pago lightbox (modal window).');
65
  $html = '<style type="text/css">
@@ -69,12 +64,7 @@ class WC_WooMercadoPago_Hook_Basic extends WC_WooMercadoPago_Hook_Abstract
69
  <script type="text/javascript">
70
  (function() { $MPC.openCheckout({ url: "' . esc_url($url) . '", mode: "modal" }); })();
71
  </script>';
72
- $html .= '<img width="468" height="60" src="' . $banner_url . '">';
73
- $html .= '<p></p><p>' . wordwrap(
74
- __('Thanks for your purchase. Please continue to the payment page by clicking on the button below.', 'woocommerce-mercadopago'),
75
- 60, '<br>'
76
- ) . '</p>
77
- <a id="submit-payment" href="' . esc_url($url) . '" name="MP-Checkout" class="button alt" mp-mode="modal">' .
78
  __('Pay with Mercado Pago', 'woocommerce-mercadopago') .
79
  '</a> <a class="button cancel" href="' . esc_url($order->get_cancel_order_url()) . '">' .
80
  __('Cancel &amp; Clear Cart', 'woocommerce-mercadopago') .
@@ -113,7 +103,7 @@ class WC_WooMercadoPago_Hook_Basic extends WC_WooMercadoPago_Hook_Abstract
113
  }
114
 
115
  /**
116
- *
117
  */
118
  public function update_mp_settings_script_basic($order_id)
119
  {
55
  $order = wc_get_order($order_id);
56
  $url = $this->payment->create_preference($order);
57
 
 
 
 
 
 
58
  if ('modal' == $this->payment->method && $url) {
59
  $this->payment->log->write_log(__FUNCTION__, 'rendering Mercado Pago lightbox (modal window).');
60
  $html = '<style type="text/css">
64
  <script type="text/javascript">
65
  (function() { $MPC.openCheckout({ url: "' . esc_url($url) . '", mode: "modal" }); })();
66
  </script>';
67
+ $html .= '<a id="submit-payment" href="' . esc_url($url) . '" name="MP-Checkout" class="button alt" mp-mode="modal">' .
 
 
 
 
 
68
  __('Pay with Mercado Pago', 'woocommerce-mercadopago') .
69
  '</a> <a class="button cancel" href="' . esc_url($order->get_cancel_order_url()) . '">' .
70
  __('Cancel &amp; Clear Cart', 'woocommerce-mercadopago') .
103
  }
104
 
105
  /**
106
+ * @param $order_id
107
  */
108
  public function update_mp_settings_script_basic($order_id)
109
  {
includes/payments/hooks/WC_WooMercadoPago_Hook_Custom.php CHANGED
@@ -17,9 +17,8 @@ class WC_WooMercadoPago_Hook_Custom extends WC_WooMercadoPago_Hook_Abstract
17
  public function loadHooks()
18
  {
19
  parent::loadHooks();
20
- add_action('wp_enqueue_scripts', array($this, 'add_checkout_scripts'));
21
-
22
  if (!empty($this->payment->settings['enabled']) && $this->payment->settings['enabled'] == 'yes') {
 
23
  add_action('woocommerce_after_checkout_form', array($this, 'add_mp_settings_script_custom'));
24
  add_action('woocommerce_thankyou', array($this, 'update_mp_settings_script_custom'));
25
  }
@@ -50,6 +49,42 @@ class WC_WooMercadoPago_Hook_Custom extends WC_WooMercadoPago_Hook_Abstract
50
  return $updateOptions;
51
  }
52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
 
54
  /**
55
  *
@@ -66,4 +101,4 @@ class WC_WooMercadoPago_Hook_Custom extends WC_WooMercadoPago_Hook_Abstract
66
  {
67
  echo parent::update_mp_settings_script($order_id);
68
  }
69
- }
17
  public function loadHooks()
18
  {
19
  parent::loadHooks();
 
 
20
  if (!empty($this->payment->settings['enabled']) && $this->payment->settings['enabled'] == 'yes') {
21
+ add_action('wp_enqueue_scripts', array($this, 'add_checkout_scripts_custom'));
22
  add_action('woocommerce_after_checkout_form', array($this, 'add_mp_settings_script_custom'));
23
  add_action('woocommerce_thankyou', array($this, 'update_mp_settings_script_custom'));
24
  }
49
  return $updateOptions;
50
  }
51
 
52
+ /**
53
+ * Add Checkout Scripts
54
+ */
55
+ public function add_checkout_scripts_custom()
56
+ {
57
+ if (is_checkout() && $this->payment->is_available() && !get_query_var('order-received')) {
58
+ wp_enqueue_script('mercado-pago-module-custom-js', 'https://secure.mlstatic.com/sdk/javascript/v1/mercadopago.js');
59
+ wp_enqueue_script('woocommerce-mercadopago-checkout', plugins_url('../../assets/js/credit-card.js', plugin_dir_path(__FILE__)), array('jquery'), null, true);
60
+
61
+ wp_localize_script(
62
+ 'woocommerce-mercadopago-checkout',
63
+ 'wc_mercadopago_params',
64
+ array(
65
+ 'site_id' => $this->payment->getOption('_site_id_v1'),
66
+ 'public_key' => $this->payment->getPublicKey(),
67
+ 'coupon_mode' => isset($this->payment->logged_user_email) ? $this->payment->coupon_mode : 'no',
68
+ 'discount_action_url' => $this->payment->discount_action_url,
69
+ 'payer_email' => $this->payment->logged_user_email,
70
+ 'apply' => __('Apply', 'woocommerce-mercadopago'),
71
+ 'remove' => __('Remove', 'woocommerce-mercadopago'),
72
+ 'coupon_empty' => __('Please, inform your coupon code', 'woocommerce-mercadopago'),
73
+ 'choose' => __('To choose', 'woocommerce-mercadopago'),
74
+ 'other_bank' => __('Other bank', 'woocommerce-mercadopago'),
75
+ 'discount_info1' => __('You will save', 'woocommerce-mercadopago'),
76
+ 'discount_info2' => __('with discount of', 'woocommerce-mercadopago'),
77
+ 'discount_info3' => __('Total of your purchase:', 'woocommerce-mercadopago'),
78
+ 'discount_info4' => __('Total of your purchase with discount:', 'woocommerce-mercadopago'),
79
+ 'discount_info5' => __('*After payment approval', 'woocommerce-mercadopago'),
80
+ 'discount_info6' => __('Terms and conditions of use', 'woocommerce-mercadopago'),
81
+ 'loading' => plugins_url('../../assets/images/', plugin_dir_path(__FILE__)) . 'loading.gif',
82
+ 'check' => plugins_url('../../assets/images/', plugin_dir_path(__FILE__)) . 'check.png',
83
+ 'error' => plugins_url('../../assets/images/', plugin_dir_path(__FILE__)) . 'error.png'
84
+ )
85
+ );
86
+ }
87
+ }
88
 
89
  /**
90
  *
101
  {
102
  echo parent::update_mp_settings_script($order_id);
103
  }
104
+ }
includes/payments/hooks/WC_WooMercadoPago_Hook_Ticket.php CHANGED
@@ -20,8 +20,8 @@ class WC_WooMercadoPago_Hook_Ticket extends WC_WooMercadoPago_Hook_Abstract
20
  public function loadHooks()
21
  {
22
  parent::loadHooks();
23
- add_action('wp_enqueue_scripts', array($this, 'add_checkout_scripts'));
24
  if (!empty($this->payment->settings['enabled']) && $this->payment->settings['enabled'] == 'yes') {
 
25
  add_action('woocommerce_after_checkout_form', array($this, 'add_mp_settings_script_ticket'));
26
  add_action('woocommerce_thankyou_' . $this->payment->id, array($this, 'update_mp_settings_script_ticket'));
27
  }
@@ -52,6 +52,41 @@ class WC_WooMercadoPago_Hook_Ticket extends WC_WooMercadoPago_Hook_Abstract
52
  return $updateOptions;
53
  }
54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  /**
56
  * MP Settings Ticket
57
  */
@@ -74,14 +109,14 @@ class WC_WooMercadoPago_Hook_Ticket extends WC_WooMercadoPago_Hook_Abstract
74
  }
75
 
76
  $html = '<p>' .
77
- __('Thanks for your order. Please pay the ticket to have your order approved.', 'woocommerce-mercadopago') .
78
  '</p>' .
79
  '<p><iframe src="' . $transaction_details . '" style="width:100%; height:1000px;"></iframe></p>' .
80
  '<a id="submit-payment" target="_blank" href="' . $transaction_details . '" class="button alt"' .
81
  ' style="font-size:1.25rem; width:75%; height:48px; line-height:24px; text-align:center;">' .
82
- __('Print the ticket', 'woocommerce-mercadopago') .
83
  '</a> ';
84
  $added_text = '<p>' . $html . '</p>';
85
  echo $added_text;
86
  }
87
- }
20
  public function loadHooks()
21
  {
22
  parent::loadHooks();
 
23
  if (!empty($this->payment->settings['enabled']) && $this->payment->settings['enabled'] == 'yes') {
24
+ add_action('wp_enqueue_scripts', array($this, 'add_checkout_scripts_ticket'));
25
  add_action('woocommerce_after_checkout_form', array($this, 'add_mp_settings_script_ticket'));
26
  add_action('woocommerce_thankyou_' . $this->payment->id, array($this, 'update_mp_settings_script_ticket'));
27
  }
52
  return $updateOptions;
53
  }
54
 
55
+ /**
56
+ * Add Checkout Scripts
57
+ */
58
+ public function add_checkout_scripts_ticket()
59
+ {
60
+ if (is_checkout() && $this->payment->is_available() && !get_query_var('order-received')) {
61
+ wp_enqueue_script('woocommerce-mercadopago-ticket-checkout', plugins_url('../../assets/js/ticket.js', plugin_dir_path(__FILE__)), array('jquery'), null, true);
62
+
63
+ wp_localize_script(
64
+ 'woocommerce-mercadopago-ticket-checkout',
65
+ 'wc_mercadopago_ticket_params',
66
+ array(
67
+ 'site_id' => $this->payment->getOption('_site_id_v1'),
68
+ 'coupon_mode' => isset($this->payment->logged_user_email) ? $this->payment->coupon_mode : 'no',
69
+ 'discount_action_url' => $this->payment->discount_action_url,
70
+ 'payer_email' => $this->payment->logged_user_email,
71
+ 'apply' => __('Apply', 'woocommerce-mercadopago'),
72
+ 'remove' => __('Remove', 'woocommerce-mercadopago'),
73
+ 'coupon_empty' => __('Please, inform your coupon code', 'woocommerce-mercadopago'),
74
+ 'choose' => __('To choose', 'woocommerce-mercadopago'),
75
+ 'other_bank' => __('Other bank', 'woocommerce-mercadopago'),
76
+ 'discount_info1' => __('You will save', 'woocommerce-mercadopago'),
77
+ 'discount_info2' => __('with discount of', 'woocommerce-mercadopago'),
78
+ 'discount_info3' => __('Total of your purchase:', 'woocommerce-mercadopago'),
79
+ 'discount_info4' => __('Total of your purchase with discount:', 'woocommerce-mercadopago'),
80
+ 'discount_info5' => __('*After payment approval', 'woocommerce-mercadopago'),
81
+ 'discount_info6' => __('Terms and conditions of use', 'woocommerce-mercadopago'),
82
+ 'loading' => plugins_url('../../assets/images/', plugin_dir_path(__FILE__)) . 'loading.gif',
83
+ 'check' => plugins_url('../../assets/images/', plugin_dir_path(__FILE__)) . 'check.png',
84
+ 'error' => plugins_url('../../assets/images/', plugin_dir_path(__FILE__)) . 'error.png'
85
+ )
86
+ );
87
+ }
88
+ }
89
+
90
  /**
91
  * MP Settings Ticket
92
  */
109
  }
110
 
111
  $html = '<p>' .
112
+ __('Great, we processed your purchase order. Complete the payment with ticket so that we finish approving it.', 'woocommerce-mercadopago') .
113
  '</p>' .
114
  '<p><iframe src="' . $transaction_details . '" style="width:100%; height:1000px;"></iframe></p>' .
115
  '<a id="submit-payment" target="_blank" href="' . $transaction_details . '" class="button alt"' .
116
  ' style="font-size:1.25rem; width:75%; height:48px; line-height:24px; text-align:center;">' .
117
+ __('Print ticket', 'woocommerce-mercadopago') .
118
  '</a> ';
119
  $added_text = '<p>' . $html . '</p>';
120
  echo $added_text;
121
  }
122
+ }
includes/payments/mercadoenvios/WC_WooMercadoPago_Product_Recurrent.php DELETED
@@ -1,241 +0,0 @@
1
- <?php
2
- if (!defined('ABSPATH')) {
3
- exit;
4
- }
5
-
6
- /**
7
- * Class WC_WooMercadoPago_Product_Recurrent
8
- */
9
- class WC_WooMercadoPago_Product_Recurrent
10
- {
11
- /**
12
- * WC_WooMercadoPago_Product_Recurrent constructor.
13
- */
14
- public function __construct()
15
- {
16
- add_action('add_meta_boxes', array($this, 'add_meta_boxes'));
17
- add_filter('woocommerce_is_sold_individually', array($this, 'default_no_quantities'), 10, 2);
18
- add_action('woocommerce_check_cart_items', array($this, 'check_recurrent_product_singularity'));
19
- add_filter('woocommerce_is_purchasable', array($this, 'filter_woocommerce_is_purchasable'), 10, 2);
20
- add_action('woocommerce_product_options_general_product_data', array($this, 'mp_add_recurrent_settings'));
21
- add_action('woocommerce_process_product_meta', array($this, 'mp_save_recurrent_settings'));
22
- }
23
-
24
- /**
25
- * Add Meta Boxes
26
- */
27
- public function add_meta_boxes()
28
- {
29
- // Get order.
30
- global $post;
31
- $order = wc_get_order($post->ID);
32
- if (!isset($order) || $order == false) {
33
- return;
34
- }
35
- $order_id = trim(str_replace('#', '', $order->get_order_number()));
36
- $payments = get_post_meta($order_id, '_Mercado_Pago_Sub_Payment_IDs', true);
37
- if (isset($payments) && !empty($payments)) {
38
- add_meta_box(
39
- 'woocommerce-mp-order-action-refund',
40
- __('Subscription Mercado Pago', 'woocommerce-mercadopago'),
41
- 'mp_subscription_order_refund_cancel_box',
42
- 'shop_order',
43
- 'side',
44
- 'default'
45
- );
46
- }
47
- }
48
-
49
- /**
50
- * Refound Cancel
51
- */
52
- public function mp_subscription_order_refund_cancel_box()
53
- {
54
- // Get order.
55
- global $post;
56
- $order = wc_get_order($post->ID);
57
- if (!isset($order) || $order == false) {
58
- return;
59
- }
60
- $order_id = trim(str_replace('#', '', $order->get_order_number()));
61
- // Get payment information for the order.
62
- $payments = get_post_meta($order_id, '_Mercado_Pago_Sub_Payment_IDs', true);
63
- $options = '';
64
- if (!empty($payments)) {
65
- $payment_structs = array();
66
- $payment_ids = explode(', ', $payments);
67
- foreach ($payment_ids as $p_id) {
68
- $options .= '<option value="' . $p_id . '">' . $p_id . '</option>';
69
- }
70
- }
71
- if ($options == '') {
72
- return;
73
- }
74
- // Build javascript for the window.
75
- $domain = get_site_url() . '/index.php' . '/woocommerce-mercadopago/';
76
- $domain .= '?wc-api=WC_WooMercadoPago_SubscriptionGateway';
77
- echo WC_WooMercadoPago_Module::generate_refund_cancel_subscription(
78
- $domain,
79
- __('The operation was successful.', 'woocommerce-mercadopago'),
80
- __('This operation cannot be completed.', 'woocommerce-mercadopago'),
81
- $options,
82
- __('Payment ID:', 'woocommerce-mercadopago'),
83
- __('Quantity:', 'woocommerce-mercadopago'),
84
- __('Payment Refund', 'woocommerce-mercadopago'),
85
- __('Cancel Payment', 'woocommerce-mercadopago')
86
- );
87
- }
88
-
89
- /**
90
- * @param $individually
91
- * @param $product
92
- * @return bool
93
- */
94
- public function default_no_quantities($individually, $product)
95
- {
96
- $product_id = (method_exists($product, 'get_id')) ?
97
- $product->get_id() :
98
- $product->id;
99
- $is_recurrent = get_post_meta($product_id, '_mp_recurring_is_recurrent', true);
100
- if ($is_recurrent == 'yes') {
101
- $individually = true;
102
- }
103
- return $individually;
104
- }
105
-
106
- /**
107
- * Recurrent Product
108
- */
109
- public function check_recurrent_product_singularity()
110
- {
111
- global $woocommerce;
112
- $w_cart = $woocommerce->cart;
113
- if (!isset($w_cart)) {
114
- return;
115
- }
116
- $items = $w_cart->get_cart();
117
- if (sizeof($items) > 1) {
118
- foreach ($items as $cart_item_key => $cart_item) {
119
- $is_recurrent = get_post_meta($cart_item['product_id'], '_mp_recurring_is_recurrent', true);
120
- if ($is_recurrent == 'yes') {
121
- wc_add_notice(
122
- __('A recurring product is a subscription that must be purchased separately in your cart. Please place orders separately.', 'woocommerce-mercadopago'),
123
- 'error'
124
- );
125
- }
126
- }
127
- }
128
- }
129
-
130
- /**
131
- * @param $purchasable
132
- * @param $product
133
- * @return bool
134
- */
135
- public function filter_woocommerce_is_purchasable($purchasable, $product)
136
- {
137
- $product_id = (method_exists($product, 'get_id')) ?
138
- $product->get_id() :
139
- $product->id;
140
- // skip this check if product is not a subscription
141
- $is_recurrent = get_post_meta($product_id, '_mp_recurring_is_recurrent', true);
142
- if ($is_recurrent !== 'yes') {
143
- return $purchasable;
144
- }
145
- $today_date = date('Y-m-d');
146
- $end_date = get_post_meta($product_id, '_mp_recurring_end_date', true);
147
- // If there is no date, we should just return the original value.
148
- if (!isset($end_date) || empty($end_date)) {
149
- return $purchasable;
150
- }
151
- // If end date had passed, this product is no longer available.
152
- $days_diff = (strtotime($today_date) - strtotime($end_date)) / 86400;
153
- if ($days_diff >= 0) {
154
- return false;
155
- }
156
- return $purchasable;
157
- }
158
-
159
- /**
160
- * ADD SETTINGS
161
- */
162
- public function mp_add_recurrent_settings()
163
- {
164
- wp_nonce_field('woocommerce_save_data', 'woocommerce_meta_nonce');
165
- echo '<div class="options_group show_if_simple">';
166
- woocommerce_wp_checkbox(
167
- array(
168
- 'id' => '_mp_recurring_is_recurrent',
169
- 'label' => __('Recurring Product', 'woocommerce-mercadopago'),
170
- 'description' => __('Make this product a subscription.', 'woocommerce-mercadopago')
171
- )
172
- );
173
- woocommerce_wp_text_input(
174
- array(
175
- 'id' => '_mp_recurring_frequency',
176
- 'label' => __('Frequency', 'woocommerce-mercadopago'),
177
- 'placeholder' => '1',
178
- 'desc_tip' => 'true',
179
- 'description' => __('Amount of time (in days or months) for the execution of the next payment.', 'woocommerce-mercadopago'),
180
- 'type' => 'number'
181
- )
182
- );
183
- woocommerce_wp_select(
184
- array(
185
- 'id' => '_mp_recurring_frequency_type',
186
- 'label' => __('Frequency type', 'woocommerce-mercadopago'),
187
- 'desc_tip' => 'true',
188
- 'description' => __('Indicates the period of time.', 'woocommerce-mercadopago'),
189
- 'options' => array(
190
- 'days' => __('Days', 'woocommerce-mercadopago'),
191
- 'months' => __('Months', 'woocommerce-mercadopago')
192
- )
193
- )
194
- );
195
- woocommerce_wp_text_input(
196
- array(
197
- 'id' => '_mp_recurring_end_date',
198
- 'label' => __('Final date', 'woocommerce-mercadopago'),
199
- 'placeholder' => _x('YYYY-MM-DD', 'placeholder', 'woocommerce-mercadopago'),
200
- 'desc_tip' => 'true',
201
- 'description' => __('Deadline to generate new charges. By default as never, if it is blank.', 'woocommerce-mercadopago'),
202
- 'class' => 'date-picker',
203
- 'custom_attributes' => array('pattern' => "[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])")
204
- )
205
- );
206
- echo '</div>';
207
- }
208
-
209
- /**
210
- * @param $post_id
211
- */
212
- public function mp_save_recurrent_settings($post_id)
213
- {
214
- $_mp_recurring_is_recurrent = isset($_POST['_mp_recurring_is_recurrent']) ? $_POST['_mp_recurring_is_recurrent'] : '';
215
- if (!empty($_mp_recurring_is_recurrent)) {
216
- update_post_meta($post_id, '_mp_recurring_is_recurrent', esc_attr($_mp_recurring_is_recurrent));
217
- } else {
218
- update_post_meta($post_id, '_mp_recurring_is_recurrent', esc_attr(null));
219
- }
220
- $_mp_recurring_frequency = $_POST['_mp_recurring_frequency'];
221
- if (!empty($_mp_recurring_frequency)) {
222
- update_post_meta($post_id, '_mp_recurring_frequency', esc_attr($_mp_recurring_frequency));
223
- } else {
224
- update_post_meta($post_id, '_mp_recurring_frequency', esc_attr(1));
225
- }
226
- $_mp_recurring_frequency_type = $_POST['_mp_recurring_frequency_type'];
227
- if (!empty($_mp_recurring_frequency_type)) {
228
- update_post_meta($post_id, '_mp_recurring_frequency_type', esc_attr($_mp_recurring_frequency_type));
229
- } else {
230
- update_post_meta($post_id, '_mp_recurring_frequency_type', esc_attr('days'));
231
- }
232
- $_mp_recurring_end_date = $_POST['_mp_recurring_end_date'];
233
- if (!empty($_mp_recurring_end_date)) {
234
- update_post_meta($post_id, '_mp_recurring_end_date', esc_attr($_mp_recurring_end_date));
235
- } else {
236
- update_post_meta($post_id, '_mp_recurring_end_date', esc_attr(null));
237
- }
238
- }
239
- }
240
-
241
- new WC_WooMercadoPago_Product_Recurrent();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/shipment/WC_MercadoEnvios_Package.php DELETED
@@ -1,266 +0,0 @@
1
- <?php
2
- /**
3
- * Mercado Envios Package.
4
- * @since 3.0.0
5
- * @version 3.0.0
6
- * @reference WooCommerce Correios
7
- */
8
-
9
- if (!defined('ABSPATH')) {
10
- exit; // Exit if accessed directly.
11
- }
12
-
13
- /**
14
- * WC_Mercado_Envios_Package class.
15
- */
16
- class WC_MercadoEnvios_Package
17
- {
18
-
19
- /**
20
- * Order package.
21
- *
22
- * @var array
23
- */
24
- protected $package = array();
25
-
26
- /**
27
- * Sets the package.
28
- *
29
- * @param array $package Package to calcule.
30
- *
31
- * @return array
32
- */
33
- public function __construct($package = array())
34
- {
35
- $this->package = $package;
36
- }
37
-
38
- /**
39
- * Replace comma by dot.
40
- *
41
- * @param mixed $value Value to fix.
42
- *
43
- * @return mixed
44
- */
45
- private function fix_format($value)
46
- {
47
- $value = str_replace(',', '.', $value);
48
-
49
- return $value;
50
- }
51
-
52
- /**
53
- * Extracts the weight and dimensions from the package.
54
- *
55
- * @return array
56
- */
57
- protected function get_package_data()
58
- {
59
- $count = 0;
60
- $height = array();
61
- $width = array();
62
- $length = array();
63
- $weight = array();
64
-
65
- // Shipping per item.
66
- foreach ($this->package['contents'] as $item_id => $values) {
67
- $product = $values['data'];
68
- $qty = $values['quantity'];
69
-
70
- if ($qty > 0 && $product->needs_shipping()) {
71
-
72
- // WooCommerce 3.0 or later.
73
- if (method_exists($product, 'get_height')) {
74
- $_height = wc_get_dimension($this->fix_format($product->get_height()), 'cm');
75
- $_width = wc_get_dimension($this->fix_format($product->get_width()), 'cm');
76
- $_length = wc_get_dimension($this->fix_format($product->get_length()), 'cm');
77
- $_weight = wc_get_weight($this->fix_format($product->get_weight()), 'kg');
78
- } else {
79
- $_height = wc_get_dimension($this->fix_format($product->height), 'cm');
80
- $_width = wc_get_dimension($this->fix_format($product->width), 'cm');
81
- $_length = wc_get_dimension($this->fix_format($product->length), 'cm');
82
- $_weight = wc_get_weight($this->fix_format($product->weight), 'kg');
83
- }
84
-
85
- $height[$count] = $_height;
86
- $width[$count] = $_width;
87
- $length[$count] = $_length;
88
- $weight[$count] = $_weight;
89
-
90
- if ($qty > 1) {
91
- $n = $count;
92
- for ($i = 0; $i < $qty; $i++) {
93
- $height[$n] = $_height;
94
- $width[$n] = $_width;
95
- $length[$n] = $_length;
96
- $weight[$n] = $_weight;
97
- $n++;
98
- }
99
- $count = $n;
100
- }
101
-
102
- $count++;
103
- }
104
- }
105
-
106
- return array(
107
- 'height' => array_values($height),
108
- 'length' => array_values($length),
109
- 'width' => array_values($width),
110
- 'weight' => array_sum($weight),
111
- );
112
- }
113
-
114
- /**
115
- * Calculates the cubage of all products.
116
- *
117
- * @param array $height Package height.
118
- * @param array $width Package width.
119
- * @param array $length Package length.
120
- *
121
- * @return int
122
- */
123
- protected function cubage_total($height, $width, $length)
124
- {
125
- // Sets the cubage of all products.
126
- $all = array();
127
- $total = 0;
128
- $total_items = count($height);
129
-
130
- for ($i = 0; $i < $total_items; $i++) {
131
- $all[$i] = $height[$i] * $width[$i] * $length[$i];
132
- }
133
-
134
- foreach ($all as $value) {
135
- $total += $value;
136
- }
137
-
138
- return $total;
139
- }
140
-
141
- /**
142
- * Get the max values.
143
- *
144
- * @param array $height Package height.
145
- * @param array $width Package width.
146
- * @param array $length Package length.
147
- *
148
- * @return array
149
- */
150
- protected function get_max_values($height, $width, $length)
151
- {
152
- $find = array(
153
- 'height' => max($height),
154
- 'width' => max($width),
155
- 'length' => max($length),
156
- );
157
-
158
- return $find;
159
- }
160
-
161
- /**
162
- * Calculates the square root of the scaling of all products.
163
- *
164
- * @param array $height Package height.
165
- * @param array $width Package width.
166
- * @param array $length Package length.
167
- * @param array $max_values Package bigger values.
168
- *
169
- * @return float
170
- */
171
- protected function calculate_root($height, $width, $length, $max_values)
172
- {
173
- $cubage_total = $this->cubage_total($height, $width, $length);
174
- $root = 0;
175
- $biggest = max($max_values);
176
-
177
- if (0 !== $cubage_total && 0 !== $biggest) {
178
- // Dividing the value of scaling of all products.
179
- // With the measured value of greater.
180
- $division = $cubage_total / $biggest;
181
- // Total square root.
182
- $root = round(sqrt($division), 1);
183
- }
184
-
185
- return $root;
186
- }
187
-
188
- /**
189
- * Sets the final cubage.
190
- *
191
- * @param array $height Package height.
192
- * @param array $width Package width.
193
- * @param array $length Package length.
194
- *
195
- * @return array
196
- */
197
- protected function get_cubage($height, $width, $length)
198
- {
199
- $cubage = array();
200
- $max_values = $this->get_max_values($height, $width, $length);
201
- $root = $this->calculate_root($height, $width, $length, $max_values);
202
- $greatest = array_search(max($max_values), $max_values, true);
203
-
204
- switch ($greatest) {
205
- case 'height' :
206
- $cubage = array(
207
- 'height' => max($height),
208
- 'width' => $root,
209
- 'length' => $root,
210
- );
211
- break;
212
- case 'width' :
213
- $cubage = array(
214
- 'height' => $root,
215
- 'width' => max($width),
216
- 'length' => $root,
217
- );
218
- break;
219
- case 'length' :
220
- $cubage = array(
221
- 'height' => $root,
222
- 'width' => $root,
223
- 'length' => max($length),
224
- );
225
- break;
226
-
227
- default :
228
- $cubage = array(
229
- 'height' => 0,
230
- 'width' => 0,
231
- 'length' => 0,
232
- );
233
- break;
234
- }
235
-
236
- return $cubage;
237
- }
238
-
239
- /**
240
- * Get the package data.
241
- *
242
- * @return array
243
- */
244
- public function get_data()
245
- {
246
- // Get the package data.
247
- $data = apply_filters('woocommerce_mercado_envios_default_package', $this->get_package_data());
248
-
249
- if (!empty($data['height']) && !empty($data['width']) && !empty($data['length'])) {
250
- $cubage = $this->get_cubage($data['height'], $data['width'], $data['length']);
251
- } else {
252
- $cubage = array(
253
- 'height' => 0,
254
- 'width' => 0,
255
- 'length' => 0,
256
- );
257
- }
258
-
259
- return array(
260
- 'height' => apply_filters('woocommerce_mercado_envios_package_height', $cubage['height']),
261
- 'width' => apply_filters('woocommerce_mercado_envios_package_width', $cubage['width']),
262
- 'length' => apply_filters('woocommerce_mercado_envios_package_length', $cubage['length']),
263
- 'weight' => apply_filters('woocommerce_mercado_envios_package_weight', $data['weight']),
264
- );
265
- }
266
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/shipment/WC_MercadoEnvios_Shipping_Abstract.php DELETED
@@ -1,330 +0,0 @@
1
- <?php
2
-
3
- if (!defined('ABSPATH')) {
4
- exit;
5
- }
6
-
7
- /**
8
- * Mercado Envios Shipping Method for Mercado Pago.
9
- *
10
- * A simple shipping method allowing free pickup as a shipping method for Mercado Pago.
11
- *
12
- * @class WC_MercadoPago_Shipping_MercadoEnvios
13
- * @version 3.0.0
14
- * @package WooCommerce/Classes/Shipping
15
- * @author Mercado Pago
16
- */
17
- abstract class WC_MercadoEnvios_Shipping_Abstract extends WC_Shipping_Method
18
- {
19
- protected $shipments_id = array();
20
-
21
- /**
22
- * Constructor.
23
- */
24
- public function __construct($instance_id = 0)
25
- {
26
-
27
- add_action('init', array($this, 'load_plugin_textdomain'));
28
-
29
- $this->instance_id = absint($instance_id);
30
- $this->method_description = __('Mercado Envios is a shipping method available only for payments with Mercado Pago.', 'woocommerce-mercadopago');
31
- $this->supports = array(
32
- 'shipping-zones',
33
- 'instance-settings',
34
- 'instance-settings-modal',
35
- );
36
-
37
- // Logging and debug.
38
- $_mp_debug_mode = get_option('_mp_debug_mode', '');
39
- if (!empty ($_mp_debug_mode)) {
40
- if (class_exists('WC_Logger')) {
41
- $this->log = new WC_Logger();
42
- } else {
43
- $this->log = WC_WooMercadoPago_Module::woocommerce_instance()->logger();
44
- }
45
- }
46
-
47
- $this->init();
48
- }
49
-
50
- // Write log.
51
- private function write_log($function, $message)
52
- {
53
- $_mp_debug_mode = get_option('_mp_debug_mode', '');
54
- if (!empty ($_mp_debug_mode)) {
55
- $this->log->add($this->id, '[' . $function . ']: ' . $message);
56
- }
57
- }
58
-
59
- /**
60
- * Initialize local pickup.
61
- */
62
- public function init()
63
- {
64
- // Load the settings.
65
- $this->init_form_fields();
66
- $this->init_settings();
67
- // Define user set variables.
68
- $this->title = $this->get_option('title');
69
- $this->tax_status = $this->get_option('tax_status');
70
- $this->cost = $this->get_option('cost');
71
- $this->free_shipping = $this->get_option('free_shipping');
72
- $this->show_delivery_time = $this->get_option('show_delivery_time');
73
- // Actions.
74
- add_action('woocommerce_update_options_shipping_' . $this->id, array($this, 'process_admin_options'));
75
- }
76
-
77
- // Multi-language plugin.
78
- public function load_plugin_textdomain()
79
- {
80
- load_plugin_textdomain(
81
- 'woocommerce-mercadopago',
82
- false,
83
- dirname(plugin_basename(__FILE__)) . '/i18n/languages/'
84
- );
85
- }
86
-
87
- /**
88
- * @param array $package
89
- * @throws WC_WooMercadoPago_Exception
90
- */
91
- public function calculate_shipping($package = array())
92
- {
93
- // Check if Basic Checkout is enabled.
94
- $basic = new WC_WooMercadoPago_BasicGateway();
95
- if ($basic->get_option('enabled') != 'yes') {
96
- $this->write_log(__FUNCTION__, 'mercado pago standard needs to be active... ');
97
- return;
98
- }
99
-
100
- // Object package and zipcode.
101
- $me_package = new WC_MercadoEnvios_Package($package);
102
- $dimensions = $me_package->get_data();
103
- $zip_code = $package['destination']['postcode'];
104
- if (empty($zip_code)) {
105
- return;
106
- }
107
-
108
- // Check validity of dimensions
109
- if (!is_numeric($dimensions['height']) || !is_numeric($dimensions['width']) ||
110
- !is_numeric($dimensions['length']) || !is_numeric($dimensions['weight'])) {
111
- return;
112
- }
113
-
114
- $site_id = get_option('_site_id_v1', '');
115
- $shipping_method_id = $this->get_shipping_method_id($site_id);
116
- $mp = $basic->mp;
117
-
118
- // Height x width x length (centimeters), weight (grams).
119
- $params = array(
120
- 'dimensions' => (int)$dimensions['height'] . 'x' . (int)$dimensions['width'] . 'x' .
121
- (int)$dimensions['length'] . ',' . $dimensions['weight'] * 1000,
122
- 'zip_code' => preg_replace('([^0-9])', '', sanitize_text_field($zip_code)),
123
- 'item_price' => $package['contents_cost'],
124
- 'access_token' => $mp->get_access_token()
125
- );
126
-
127
- if ($this->get_option('free_shipping') == 'yes') {
128
- $params['free_method'] = $shipping_method_id;
129
- } else {
130
- $list_shipping_methods = $this->get_shipping_methods_zone_by_shipping_id($this->instance_id);
131
- foreach ($list_shipping_methods as $key => $shipping_object) {
132
- if ($key == 'woo-mercado-pago-me-normal' || $key == 'woo-mercado-pago-me-express') {
133
- // WTF?
134
- $shipping_object = new $shipping_object($shipping_object->instance_id);
135
- if ($shipping_object->get_option('free_shipping') == 'yes') {
136
- $temp_shipping_method_id = $shipping_object->get_shipping_method_id($site_id);
137
- $params['free_method'] = $temp_shipping_method_id;
138
- }
139
- }
140
- }
141
- }
142
-
143
- $response = $mp->get('/shipping_options', $params);
144
- $this->write_log(__FUNCTION__, 'params sent: ' . json_encode($params, JSON_PRETTY_PRINT));
145
- $this->write_log(__FUNCTION__, 'shipments response API: ' . json_encode($response, JSON_PRETTY_PRINT));
146
-
147
- if ($response['status'] != 200) {
148
- $this->write_log(__FUNCTION__, 'got response different of 200... returning false.');
149
- return false;
150
- }
151
-
152
- foreach ($response['response']['options'] as $shipping) {
153
- if ($shipping_method_id == $shipping['shipping_method_id']) {
154
- $label_free_shipping = '';
155
- if ($this->get_option('free_shipping') == 'yes' || $shipping['cost'] == 0) {
156
- $label_free_shipping = __('Free shipping', 'woocommerce-mercadopago');
157
- }
158
- $label_delivery_time = '';
159
- if ($this->get_option('show_delivery_time') == 'yes') {
160
- $days = $shipping['estimated_delivery_time']['shipping'] / 24;
161
- if ($days <= 1) {
162
- $label_delivery_time = $days . ' ' . __('Day', 'woocommerce-mercadopago');
163
- } else {
164
- $label_delivery_time = $days . ' ' . __('Days', 'woocommerce-mercadopago');
165
- }
166
- }
167
- $separator = '';
168
- if ($label_free_shipping != '' && $label_delivery_time != '') {
169
- $separator = ' - ';
170
- }
171
- $label_info = '';
172
- if ($label_free_shipping != '' || $label_delivery_time) {
173
- $label_info = ' (' . $label_delivery_time . $separator . $label_free_shipping . ')';
174
- }
175
- $option = array(
176
- 'label' => 'Mercado Envios - ' . $shipping['name'] . $label_info,
177
- 'package' => $package,
178
- 'cost' => (float)$shipping['cost'],
179
- 'meta_data' => array(
180
- 'dimensions' => $params['dimensions'],
181
- 'shipping_method_id' => $shipping_method_id,
182
- 'free_shipping' => $this->get_option('free_shipping')
183
- )
184
- );
185
-
186
- $this->write_log(__FUNCTION__, 'optiond added: ' . json_encode($option, JSON_PRETTY_PRINT));
187
-
188
- $this->add_rate($option);
189
- }
190
- }
191
- }
192
-
193
- /**
194
- * Replace comma by dot.
195
- * @param mixed $value Value to fix.
196
- * @return mixed
197
- */
198
- private function fix_format($value)
199
- {
200
- $value = str_replace(',', '.', $value);
201
- return $value;
202
- }
203
-
204
- /**
205
- * Init form fields.
206
- */
207
- public function init_form_fields()
208
- {
209
- // Force quit loop.
210
- $mp = WC_WooMercadoPago_Module::init_mercado_pago_class();
211
- if (isset($mp->mercado_envios_loop) && $mp->mercado_envios_loop) {
212
- return false;
213
- }
214
- $warning_active_shipping_methods = '';
215
- if ($this->show_message_shipping_methods()) {
216
- $warning_active_shipping_methods = '<img width="14" height="14" src="' .
217
- plugins_url('assets/images/warning.png', dirname(dirname(__FILE__))) . '">' . ' ' .
218
- __('Enable the two shipping methods: Mercado Envios (Express and Normal) for the correct operation of the module.', 'woocommerce-mercadopago');
219
- }
220
- $this->instance_form_fields = array(
221
- 'mercado_envios_title' => array(
222
- 'title' => __('Mercado Envios', 'woocommerce-mercadopago'),
223
- 'type' => 'title',
224
- 'description' => sprintf('%s', $warning_active_shipping_methods)
225
- ),
226
- 'title' => array(
227
- 'title' => __('Mercado Envios', 'woocommerce-mercadopago'),
228
- 'type' => 'text',
229
- 'description' => __('This controls the title that the user sees during the payment process.', 'woocommerce-mercadopago'),
230
- 'default' => __('Mercado Envios', 'woocommerce-mercadopago'),
231
- 'desc_tip' => true,
232
- ),
233
- 'free_shipping' => array(
234
- 'title' => __('Free shipping', 'woocommerce-mercadopago'),
235
- 'type' => 'checkbox',
236
- 'label' => __('nable free shipping for this shipping method', 'woocommerce-mercadopago'),
237
- 'default' => 'no',
238
- ),
239
- 'show_delivery_time' => array(
240
- 'title' => __('Delivery time', 'woocommerce-mercadopago'),
241
- 'type' => 'checkbox',
242
- 'label' => __('Show estimated delivery time', 'woocommerce-mercadopago'),
243
- 'description' => __('Show the estimated delivery time in working days.', 'woocommerce-mercadopago'),
244
- 'desc_tip' => true,
245
- 'default' => 'no',
246
- )
247
- );
248
-
249
- }
250
-
251
- /**
252
- * Return shipping methods by zone and shipping id.
253
- */
254
- public function get_shipping_methods_zone_by_shipping_id($shipping_id)
255
- {
256
- $shipping_zone = WC_Shipping_Zones::get_zone_by('instance_id', $shipping_id);
257
- // Set looping shipping methods.
258
- $mp = WC_WooMercadoPago_Module::init_mercado_pago_class();
259
- $mp->mercado_envios_loop = true;
260
- $shipping_methods_list = array();
261
- foreach ($shipping_zone->get_shipping_methods() as $key => $shipping_object) {
262
- $shipping_methods_list[$shipping_object->id] = $shipping_object;
263
- }
264
- $mp->mercado_envios_loop = false;
265
- return $shipping_methods_list;
266
- }
267
-
268
- /**
269
- * Validate if it is necessary to enable message.
270
- */
271
- public function show_message_shipping_methods()
272
- {
273
- // Check if is admin.
274
- if (is_admin()) {
275
- if ($this->instance_id > 0) {
276
- $shipping_methods_list = $this->get_shipping_methods_zone_by_shipping_id($this->instance_id);
277
- $shipping_methods = array();
278
- foreach ($shipping_methods_list as $key => $shipping_object) {
279
- $shipping_methods[$shipping_object->id] = $shipping_object->is_enabled();
280
- }
281
- if (isset($shipping_methods['woo-mercado-pago-me-normal']) && isset($shipping_methods['woo-mercado-pago-me-express'])) {
282
- if ($shipping_methods['woo-mercado-pago-me-normal'] === true && $shipping_methods['woo-mercado-pago-me-express'] === true) {
283
- // Add settings.
284
- /**PERFOMANCE*/
285
- //$this->update_settings_api( 'true' );
286
- // Not display message.
287
- return false;
288
- } elseif ($shipping_methods['woo-mercado-pago-me-normal'] === false && $shipping_methods['woo-mercado-pago-me-express'] === false) {
289
- // Remove settings.
290
- /**PERFOMANCE*/
291
- //$this->update_settings_api( 'false' );
292
- // Not display message.
293
- return false;
294
- }
295
- }
296
- // Show message.
297
- return true;
298
- } else {
299
- return false;
300
- }
301
- }
302
- }
303
-
304
- /**
305
- * Return shipping method id Mercado Envios.
306
- */
307
- public function get_shipping_method_id($site_id)
308
- {
309
- if (array_key_exists($site_id, $this->shipments_id)) {
310
- return $this->shipments_id[$site_id];
311
- } else {
312
- return 0;
313
- }
314
- }
315
-
316
- /**
317
- * @param $status
318
- * @throws WC_WooMercadoPago_Exception
319
- */
320
- public function update_settings_api($status)
321
- {
322
- $infra_data = WC_WooMercadoPago_Module::get_common_settings();
323
- $infra_data['mercado_envios'] = $status;
324
-
325
- $mp = WC_WooMercadoPago_Module::getMpInstanceSingleton();
326
- $response = $mp->analytics_save_settings($infra_data);
327
- $this->write_log(__FUNCTION__, 'analytics response: ' . json_encode($response, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
328
- }
329
-
330
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/shipment/WC_MercadoEnvios_Shipping_Express.php DELETED
@@ -1,35 +0,0 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
- }
6
-
7
- /**
8
- * Mercado Envios Shipping Method for Mercado Pago.
9
- *
10
- * A simple shipping method allowing free pickup as a shipping method for Mercado Pago.
11
- *
12
- * @class WC_MercadoEnvios_Shipping_Express
13
- * @version 3.0.0
14
- * @package WooCommerce/Classes/Shipping
15
- * @author Mercado Pago
16
- */
17
-
18
- class WC_MercadoEnvios_Shipping_Express extends WC_MercadoEnvios_Shipping_Abstract {
19
-
20
- protected $shipments_id = array(
21
- 'MLA' => 73330,
22
- 'MLB' => 182,
23
- 'MLM' => 501345
24
- );
25
-
26
- /**
27
- * Constructor.
28
- */
29
- public function __construct( $instance_id = 0 ) {
30
- $this->id = 'woo-mercado-pago-me-express';
31
- $this->method_title = 'Mercado Envios - Express';
32
- parent::__construct( $instance_id );
33
- }
34
-
35
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/shipment/WC_MercadoEnvios_Shipping_Normal.php DELETED
@@ -1,35 +0,0 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
- }
6
-
7
- /**
8
- * Mercado Envios Shipping Method for Mercado Pago.
9
- *
10
- * A simple shipping method allowing free pickup as a shipping method for Mercado Pago.
11
- *
12
- * @class WC_MercadoEnvios_Shipping_Normal
13
- * @version 3.0.0
14
- * @package WooCommerce/Classes/Shipping
15
- * @author Mercado Pago
16
- */
17
-
18
- class WC_MercadoEnvios_Shipping_Normal extends WC_MercadoEnvios_Shipping_Abstract {
19
-
20
- protected $shipments_id = array(
21
- 'MLA' => 73328,
22
- 'MLB' => 100009,
23
- 'MLM' => 501245
24
- );
25
-
26
- /**
27
- * Constructor.
28
- */
29
- public function __construct( $instance_id = 0 ) {
30
- $this->id = 'woo-mercado-pago-me-normal';
31
- $this->method_title = 'Mercado Envios - Normal';
32
- parent::__construct( $instance_id );
33
- }
34
-
35
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
- === WooCommerce Mercado Pago ===
2
  Contributors: mercadopago, mercadolivre, claudiosanches, marcelohama
3
  Tags: ecommerce, mercadopago, woocommerce
4
  Requires at least: 4.9.10
5
- Tested up to: 5.2.2
6
  Requires PHP: 5.6
7
- Stable tag: 4.0.8
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -42,24 +42,28 @@ You can trust us as you trust a strategic partner. Use the money from your sales
42
 
43
  == Screenshots ==
44
 
45
- 1. `Pay with the payment method you prefer`
46
- 2. `Pay with the payment method you prefer`
47
- 3. `Pay with debit and credit cards`
48
- 4. `Pay with debit and credit cards`
49
- 5. `Pay with money and cash`
50
- 6. `Pay with ticket and Loterica`
 
51
 
52
  == Frequently Asked Questions ==
53
 
54
  = How do we protect the sellers =
 
55
  We take care of the money with maximum security
56
  We help you in case of problems
57
  We protect your sales against chargebacks
58
 
59
  = Where can I find the documentation? =
 
60
  Check out our official documentation for installing and configuring the Mercado Pago plugin in your store.
61
 
62
  = Where and how can I contribute? =
 
63
  Suggest documentation improvement on [our website](https://www.mercadopago.com.br/developers/es/plugins_sdks/plugins/official/woo-commerce/) for integrators and developers,
64
  Subscribe to the [development log](https://plugins.trac.wordpress.org/log/woocommerce-mercadopago/) by [RSS](https://plugins.trac.wordpress.org/log/woocommerce-mercadopago/?limit=100&mode=stop_on_copy&format=rss),
65
  [Review the code](https://plugins.trac.wordpress.org/browser/woocommerce-mercadopago/) and visit the [SVN repository](https://plugins.svn.wordpress.org/woocommerce-mercadopago/),
@@ -78,13 +82,13 @@ Install the module in two different ways: automatically, from the “Plugins”
78
 
79
  Automatic Installation by WordPress admin
80
  1. Access "Plugins" from the navigation side menu of your WordPress administrator.
81
- 2. Once inside Plugins, click on 'Add New' and search for 'Mercado Pago WooCommerce' in the WordPress Plugin list
82
  3. Click on "Install."
83
 
84
- Done! It will be in the "Installed Plugins" section and from there you can activate it.
85
 
86
  Manual Installation
87
- 1. Download the zip now or from the o WordPress Module Directory
88
  2. Unzip the folder and rename it to ”woocommerce-mercadopago”
89
  3. Copy the "woocommerce-mercadopago" file into your WordPress directory, inside the "Plugins" folder.
90
 
@@ -112,6 +116,35 @@ Set up both the plugin and the checkouts you want to activate on your payment av
112
  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.
113
 
114
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  = v4.0.8 (13/09/2019) =
116
  * Bug fixes
117
  - Fixed mercado envios
1
+ === Mercado Pago payments for WooCommerce ===
2
  Contributors: mercadopago, mercadolivre, claudiosanches, marcelohama
3
  Tags: ecommerce, mercadopago, woocommerce
4
  Requires at least: 4.9.10
5
+ Tested up to: 5.3
6
  Requires PHP: 5.6
7
+ Stable tag: 4.1.0
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
42
 
43
  == Screenshots ==
44
 
45
+ 1. `High approval rates.`
46
+ 2. `Your money available instantly.`
47
+ 3. `All payment methods.`
48
+ 4. `You do not need to write a single line of code to receive payments.`
49
+ 5. `01 Create an account in Mercado Pago.`
50
+ 6. `02 Activate the module in your store.`
51
+ 7. `03 Receive the money from your sales.`
52
 
53
  == Frequently Asked Questions ==
54
 
55
  = How do we protect the sellers =
56
+
57
  We take care of the money with maximum security
58
  We help you in case of problems
59
  We protect your sales against chargebacks
60
 
61
  = Where can I find the documentation? =
62
+
63
  Check out our official documentation for installing and configuring the Mercado Pago plugin in your store.
64
 
65
  = Where and how can I contribute? =
66
+
67
  Suggest documentation improvement on [our website](https://www.mercadopago.com.br/developers/es/plugins_sdks/plugins/official/woo-commerce/) for integrators and developers,
68
  Subscribe to the [development log](https://plugins.trac.wordpress.org/log/woocommerce-mercadopago/) by [RSS](https://plugins.trac.wordpress.org/log/woocommerce-mercadopago/?limit=100&mode=stop_on_copy&format=rss),
69
  [Review the code](https://plugins.trac.wordpress.org/browser/woocommerce-mercadopago/) and visit the [SVN repository](https://plugins.svn.wordpress.org/woocommerce-mercadopago/),
82
 
83
  Automatic Installation by WordPress admin
84
  1. Access "Plugins" from the navigation side menu of your WordPress administrator.
85
+ 2. Once inside Plugins, click on 'Add New' and search for 'Mercado Pago payments for WooCommerce' in the WordPress Plugin list
86
  3. Click on "Install."
87
 
88
+ Done! It will be in the "Installed Plugins" section and from there you can activate it.
89
 
90
  Manual Installation
91
+ 1. Download the [zip] (https://github.com/mercadopago/cart-woocommerce/archive/master.zip) now or from the o WordPress Module [Directory] (https://br.wordpress.org/plugins/woocommerce-mercadopago/)
92
  2. Unzip the folder and rename it to ”woocommerce-mercadopago”
93
  3. Copy the "woocommerce-mercadopago" file into your WordPress directory, inside the "Plugins" folder.
94
 
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.0 (06/01/2020) =
120
+ * Feature
121
+ - Updated plugin name from "WooCommerce Mercado Pago" to "Mercado Pago payments for WooCommerce".
122
+ - Feature currency conversion returned.
123
+ - New feature to check if cURL is installed
124
+ - Refactored Javascript code for custom checkout Debit and credit card. Performance improvement, reduced number of SDK calls. Fixed validation errors. Javascript code refactored to the order review page. Removed select from mexico payment method.
125
+
126
+ * Bug fixes
127
+ - Fixed credential issue when the plugin is upgraded from version 3.x.x to 4xx. Unable to save empty credential.
128
+ - Fixed issue to validate credential when checkout is active. The same problem occurs when removing the enabled checkout credential.
129
+ - Fixed error: Undefined index: MLA in WC_WooMercadoPago_Credentials.php on line 163.
130
+ - Fixed error: Call to a member function analytics_save_settings() in WC_WooMercadoPago_Hook_Abstract.php on line 68. Has affected users that cleared the credential and filled new credential production.
131
+ - Fixed load of WC_WooMercadoPago_Module.php file.
132
+ - Fixed error Uncaught Error: Call to a member function homologValidate().
133
+ - Fixed error Undefined index: section in WC_WooMercadoPago_PaymentAbstract.php on line 303. Affected users who did not have homologous accounts
134
+ - Fixed issue to validate credential when checkout is active. The same problem occurs when removing the enabled checkout credential.
135
+ - Fixed issue to calculate commission and discount.
136
+ - Fixed Layout of checkout custom input.
137
+ - Fixed translation ES of Modo Producción, Habilitá and definí
138
+ - Fixed Uncaught Error call to a member function update_status() in WC_WooMercadoPago_Notification_Abstract.php. Handle Mercado Pago Notification Failures and Exceptions.
139
+ - Fix PT-BR debit card translation on admin.
140
+ - Fix PT-BR debit card translation on checkout.
141
+ - Remove "One Step Checkout" from CHO Custom Off.
142
+ - Remove Mercado Creditos from Custom CHO OFF.
143
+ - Fixed issue to check if WooCommerce plugin is installed
144
+
145
+ * Break change
146
+ - Removed feature and support to Mercado Envios shipping. Before install the plugin verify if your store has another method of shipping configured.
147
+
148
  = v4.0.8 (13/09/2019) =
149
  * Bug fixes
150
  - Fixed mercado envios
templates/checkout/basic_checkout.php CHANGED
@@ -50,12 +50,14 @@ if (!defined('ABSPATH')) {
50
  </div>
51
  <?php endif; ?>
52
 
 
53
  <div class="mp-col-md-12 mp-pt-20">
54
  <div class="mp-redirect-frame">
55
  <img src="<?= $cho_image ?>" class="mp-img-fluid mp-img-redirect" alt=""/>
56
  <p><?=__('We take you to our site to complete the payment', 'woocommerce-mercadopago')?></p>
57
  </div>
58
  </div>
 
59
 
60
  </div>
61
  </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">
56
  <img src="<?= $cho_image ?>" class="mp-img-fluid mp-img-redirect" alt=""/>
57
  <p><?=__('We take you to our site to complete the payment', 'woocommerce-mercadopago')?></p>
58
  </div>
59
  </div>
60
+ <?php endif; ?>
61
 
62
  </div>
63
  </div>
templates/checkout/custom_checkout.php CHANGED
@@ -3,18 +3,24 @@ if (!defined('ABSPATH')) {
3
  exit;
4
  }
5
  ?>
 
6
  <div class="mp-panel-custom-checkout">
7
  <div class="mp-row-checkout">
 
 
8
  <div class="mp-frame-links">
9
  <a class="mp-checkout-link mp-pr-10" id="button-show-payments">
10
  <?= __('With what cards can I pay', 'woocommerce-mercadopago') ?> ⌵
11
  </a>
12
- <span id="mp_promotion_link"> | </span>
13
- <a href="https://www.mercadopago.com.ar/cuotas" id="mp_checkout_link" class="mp-checkout-link mp-pl-10" target="_blank">
14
- <?= __('See current promotions', 'woocommerce-mercadopago') ?>
15
- </a>
 
 
16
  </div>
17
 
 
18
  <div class="mp-frame-payments" id="mp-frame-payments">
19
  <div class="mp-col-md-12">
20
  <div class="frame-tarjetas">
@@ -35,127 +41,92 @@ if (!defined('ABSPATH')) {
35
  </div>
36
  </div>
37
 
38
- <div class="mp-col-md-12" id="mercadopago-form-coupon">
39
- <div class="frame-tarjetas mp-text-justify">
40
- <p class="mp-subtitle-custom-checkout"><?= __('Enter your discount coupon', 'woocommerce-mercadopago') ?></p>
 
 
41
 
42
- <div class="mp-row-checkout mp-pt-10">
43
- <div class="mp-col-md-9 mp-pr-15">
44
- <input type="text" class="mp-form-control" id="couponCode" name="mercadopago_custom[coupon_code]" autocomplete="off" maxlength="24" placeholder="<?= __('Enter your coupon', 'woocommerce-mercadopago') ?>" />
45
- </div>
46
 
47
- <div class="mp-col-md-3">
48
- <input type="button" class="mp-button mp-pointer" id="applyCoupon" value="<?= esc_html__('Apply', 'woocommerce-mercadopago'); ?>">
 
 
 
49
  </div>
50
  </div>
51
-
52
- <span class="mp-discount" id="mpCouponApplyed"></span>
53
- <span class="mp-error" id="mpCouponError"><?= __('The code you entered is incorrect', 'woocommerce-mercadopago') ?></span>
54
  </div>
55
- </div>
56
 
57
  <div class="mp-col-md-12">
58
  <div class="frame-tarjetas">
 
59
  <p class="mp-subtitle-custom-checkout"><?= __('Enter your card details', 'woocommerce-mercadopago') ?></p>
60
 
61
- <!-- saved cards -->
62
- <div id="mercadopago-form-customer-and-card">
63
- <div class="mp-row-checkout mp-pt-10">
64
- <div class="mp-col-md-12">
65
- <label for="paymentMethodIdSelector" class="mp-label-form"><?= esc_html__('Payment Method', 'woocommerce-mercadopago'); ?> <em>*</em></label>
66
- <select id="paymentMethodSelector" class="mp-form-control mp-pointer" name="mercadopago_custom[paymentMethodSelector]" data-checkout="cardId">
67
- <optgroup label="<?= esc_html__('Your card', 'woocommerce-mercadopago'); ?>" id="payment-methods-for-customer-and-cards">
68
- <?php foreach ($customer_cards as $card) : ?>
69
- <option value="<?= $card['id']; ?>
70
- first_six_digits=<?= $card['first_six_digits']; ?>
71
- last_four_digits=<?= $card['last_four_digits']; ?>
72
- security_code_length=<?= $card['security_code']['length']; ?>
73
- type_checkout='customer_and_card'
74
- payment_method_id=<?= $card['payment_method']['id']; ?>">
75
- <?= ucfirst($card['payment_method']['name']); ?>
76
- <?= esc_html__('finished in', 'woocommerce-mercadopago'); ?>
77
- <?= $card['last_four_digits']; ?>
78
- </option>
79
- <?php endforeach; ?>
80
- </optgroup>
81
-
82
- <optgroup label="<?= esc_html__('Other cards', 'woocommerce-mercadopago'); ?>" id="payment-methods-list-other-cards">
83
- <option value="-1"><?= esc_html__('Another card', 'woocommerce-mercadopago'); ?></option>
84
- </optgroup>
85
- </select>
86
- </div>
87
-
88
- <div class="mp-col-md-4">
89
- <div id="mp-securityCode-customer-and-card">
90
- <div class="mp-box-inputs mp-col-45">
91
- <label for="customer-and-card-securityCode" class="mp-label-form"><?= esc_html__('CVV', 'woocommerce-mercadopago'); ?> <em>*</em></label>
92
- <input type="text" onkeyup="maskDate(this, minteger);" class="mp-form-control" id="customer-and-card-securityCode" data-checkout="securityCode" autocomplete="off" maxlength="4" />
93
-
94
- <span class="mp-error" id="mp-error-224" data-main="#customer-and-card-securityCode"><?= esc_html__('Card number', 'woocommerce-mercadopago'); ?></span>
95
- <span class="mp-error" id="mp-error-E302" data-main="#customer-and-card-securityCode"><?= esc_html__('Invalid Card Number', 'woocommerce-mercadopago'); ?></span>
96
- <span class="mp-error" id="mp-error-E203" data-main="#customer-and-card-securityCode"><?= esc_html__('Invalid Card Number', 'woocommerce-mercadopago'); ?></span>
97
- </div>
98
- </div>
99
- </div>
100
- </div>
101
- </div>
102
- <!-- end saved cards -->
103
-
104
- <!-- new card -->
105
  <div id="mercadopago-form">
 
106
  <div class="mp-row-checkout mp-pt-10">
107
  <div class="mp-col-md-12">
108
- <label for="cardNumber" class="mp-label-form"><?= esc_html__('Card number', 'woocommerce-mercadopago'); ?> <em>*</em></label>
109
- <input type="text" onkeyup="maskDate(this, mcc);" class="mp-form-control mp-mt-5" id="cardNumber" data-checkout="cardNumber" autocomplete="off" maxlength="23" />
110
 
111
- <span class="mp-error mp-mt-5" id="mp-error-205" data-main="#cardNumber"><?= esc_html__('Card number', 'woocommerce-mercadopago'); ?></span>
112
- <span class="mp-error mp-mt-5" id="mp-error-E301" data-main="#cardNumber"><?= esc_html__('Invalid Card Number', 'woocommerce-mercadopago'); ?></span>
113
  </div>
114
  </div>
115
-
116
  <div class="mp-row-checkout mp-pt-10">
117
  <div class="mp-col-md-12">
118
- <label for="cardholderName" class="mp-label-form"><?= esc_html__('Name and surname of the cardholder', 'woocommerce-mercadopago'); ?> <em>*</em></label>
119
- <input type="text" class="mp-form-control mp-mt-5" id="cardholderName" name="mercadopago_custom[cardholderName]" data-checkout="cardholderName" autocomplete="off" />
120
 
121
- <span class="mp-error mp-mt-5" id="mp-error-221" data-main="#cardholderName"><?= esc_html__('Card number', 'woocommerce-mercadopago'); ?></span>
122
- <span class="mp-error mp-mt-5" id="mp-error-316" data-main="#cardholderName"><?= esc_html__('Invalid cardholder name', 'woocommerce-mercadopago'); ?></span>
123
  </div>
124
  </div>
125
 
126
  <div class="mp-row-checkout mp-pt-10">
 
127
  <div class="mp-col-md-6 mp-pr-15">
128
- <label for="cardholderName" class="mp-label-form"><?= esc_html__('Expiration date', 'woocommerce-mercadopago'); ?> <em>*</em></label>
129
- <input type="text" onkeyup="maskDate(this, mdate);" onblur="validateMonthYear()" class="mp-form-control mp-mt-5" id="cardExpirationDate" data-checkout="cardExpirationDate" name="mercadopago_custom[cardExpirationDate]" autocomplete="off" placeholder="MM/AAAA" maxlength="7" />
130
- <input type="hidden" id="cardExpirationMonth" name="mercadopago_custom[cardExpirationMonth]" data-checkout="cardExpirationMonth">
131
- <input type="hidden" id="cardExpirationYear" name="mercadopago_custom[cardExpirationYear]" data-checkout="cardExpirationYear">
132
-
133
- <span class="mp-error mp-mt-5" id="mp-error-208" data-main="#cardExpirationDate"><?= esc_html__('Invalid Expiration Date', 'woocommerce-mercadopago'); ?></span>
 
 
134
  </div>
135
-
136
  <div class="mp-col-md-6">
137
- <label for="securityCode" class="mp-label-form"><?= esc_html__('Last 3 numbers on the back', 'woocommerce-mercadopago'); ?> <em>*</em></label>
138
- <input type="text" onkeyup="maskDate(this, minteger);" class="mp-form-control mp-mt-5" id="securityCode" data-checkout="securityCode" autocomplete="off" maxlength="4" />
139
-
140
- <p class="mp-desc mp-mt-5 mp-mb-0" data-main="#securityCode"><?= esc_html__('Last 3 numbers on the back', 'woocommerce-mercadopago'); ?></p>
141
- <span class="mp-error mp-mt-5" id="mp-error-224" data-main="#securityCode"><?= esc_html__('Card number', 'woocommerce-mercadopago'); ?></span>
142
- <span class="mp-error mp-mt-5" id="mp-error-E302" data-main="#securityCode"><?= esc_html__('Invalid Card Number', 'woocommerce-mercadopago'); ?></span>
143
  </div>
144
  </div>
145
 
146
  <div class="mp-col-md-12">
147
  <div class="frame-tarjetas">
148
- <p class="mp-subtitle-custom-checkout"><?= __('In how many installments do you want to pay?', 'woocommerce-mercadopago') ?></p>
 
149
 
 
150
  <div class="mp-row-checkout mp-pt-10">
151
- <div class="mp-col-md-4 mp-pr-15">
152
  <div class="mp-issuer">
153
- <label for="issuer" class="mp-label-form"><?= esc_html__('Issuer', 'woocommerce-mercadopago'); ?> </label>
154
- <select class="mp-form-control mp-pointer mp-mt-5" id="issuer" data-checkout="issuer" name="mercadopago_custom[issuer]"></select>
155
  </div>
156
  </div>
157
 
158
- <div id="installments-div" class="mp-col-md-8">
 
159
  <?php if ($currency_ratio != 1) : ?>
160
  <label for="installments" class="mp-label-form">
161
  <div class="mp-tooltip">
@@ -171,10 +142,10 @@ if (!defined('ABSPATH')) {
171
  <em>*</em>
172
  </label>
173
  <?php else : ?>
174
- <label for="installments" class="mp-label-form"><?= __('Select the number of installment', 'woocommerce-mercadopago') ?></label>
175
  <?php endif; ?>
176
 
177
- <select class="mp-form-control mp-pointer mp-mt-5" id="installments" data-checkout="installments" name="mercadopago_custom[installments]"></select>
178
 
179
  <div id="mp-box-input-tax-cft">
180
  <div id="mp-box-input-tax-tea">
@@ -189,21 +160,23 @@ if (!defined('ABSPATH')) {
189
 
190
  <div id="mp-doc-div" class="mp-col-md-12 mp-doc">
191
  <div class="frame-tarjetas">
 
192
  <p class="mp-subtitle-custom-checkout"><?= __('Enter your document number', 'woocommerce-mercadopago') ?></p>
193
 
194
- <div class="mp-row-checkout mp-pt-10">
195
- <div class="mp-col-md-4 mp-pr-15 mp-pt-5">
196
- <label for="docType" class="mp-label-form"><?= esc_html__('Type', 'woocommerce-mercadopago'); ?></label>
197
- <select id="docType" class="mp-form-control mp-pointer mp-mt-06rem" data-checkout="docType" name="mercadopago_custom[docType]"></select>
 
198
  </div>
199
 
200
- <div class="mp-col-md-8">
 
201
  <label for="docNumber" class="mp-label-form"><?= esc_html__('Document number', 'woocommerce-mercadopago'); ?> <em>*</em></label>
202
- <input type="text" class="mp-form-control mp-mt-5" id="docNumber" data-checkout="docNumber" name="mercadopago_custom[docNumber]" autocomplete="off" />
203
- <p class="mp-desc mp-mt-5 mp-mb-0" data-main="#securityCode"><?= esc_html__('Only numbers', 'woocommerce-mercadopago'); ?></p>
204
-
205
- <span class="mp-error mp-mt-5" id="mp-error-214" data-main="#docNumber"><?= esc_html__('Card number', 'woocommerce-mercadopago'); ?></span>
206
  <span class="mp-error mp-mt-5" id="mp-error-324" data-main="#docNumber"><?= esc_html__('Invalid Document Number', 'woocommerce-mercadopago'); ?></span>
 
207
  </div>
208
  </div>
209
  </div>
@@ -211,17 +184,14 @@ if (!defined('ABSPATH')) {
211
 
212
  <div class="mp-col-md-12 mp-pt-10">
213
  <div class="frame-tarjetas">
214
- <div class="mp-row-checkout mp-pt-10">
215
- <label for="doNotSaveCard" class="mp-label-form-check mp-pointer" style="display: inline;">
216
- <input class="mp-form-control-check" type="checkbox" name="mercadopago_custom[doNotSaveCard]" id="doNotSaveCard" value="yes">
217
- <?= esc_html__('Do not save card', 'woocommerce-mercadopago'); ?>
218
- </label>
219
- <p class="mp-obrigatory"><em>*</em> <?= esc_html__('Obligatory field', 'woocommerce-mercadopago'); ?></p>
220
  </div>
221
  </div>
222
  </div>
223
  </div>
224
- <!-- end new card -->
225
 
226
  <!-- NOT DELETE LOADING-->
227
  <div id="mp-box-loading"></div>
@@ -230,44 +200,36 @@ if (!defined('ABSPATH')) {
230
  </div>
231
 
232
  <div id="mercadopago-utilities">
233
- <input type="hidden" id="site_id" name="mercadopago_custom[site_id]" />
234
- <input type="hidden" id="amount" value='<?php echo $amount; ?>' name="mercadopago_custom[amount]" />
235
  <input type="hidden" id="currency_ratio" value='<?php echo $currency_ratio; ?>' name="mercadopago_custom[currency_ratio]" />
236
  <input type="hidden" id="campaign_id" name="mercadopago_custom[campaign_id]" />
237
  <input type="hidden" id="campaign" name="mercadopago_custom[campaign]" />
238
- <input type="hidden" id="discount" name="mercadopago_custom[discount]" />
239
  <input type="hidden" id="paymentMethodId" name="mercadopago_custom[paymentMethodId]" />
240
  <input type="hidden" id="token" name="mercadopago_custom[token]" />
241
- <input type="hidden" id="cardTruncated" name="mercadopago_custom[cardTruncated]" />
242
- <input type="hidden" id="CustomerAndCard" name="mercadopago_custom[CustomerAndCard]" />
243
- <input type="hidden" id="CustomerId" value='<?php echo $customerId; ?>' name="mercadopago_custom[CustomerId]" />
244
  </div>
245
 
246
  </div>
247
  </div>
248
 
249
  <script type="text/javascript">
250
- //collapsible payments
251
- var show_payments = document.querySelector("#button-show-payments")
252
- var frame_payments = document.querySelector("#mp-frame-payments");
253
-
254
- show_payments.onclick = function() {
255
- if (frame_payments.style.display == "inline-block") {
256
- frame_payments.style.display = "none";
257
- } else {
258
- frame_payments.style.display = "inline-block";
259
- }
260
- };
261
 
262
- //mask date input
263
  function maskDate(o, f) {
264
  v_obj = o
265
  v_fun = f
266
- setTimeout("execmascara()", 1)
267
  }
268
 
269
- function execmascara() {
270
- v_obj.value = v_fun(v_obj.value)
 
 
 
 
271
  }
272
 
273
  function mdate(v) {
@@ -277,1109 +239,14 @@ if (!defined('ABSPATH')) {
277
  return v;
278
  }
279
 
280
- function minteger(v) {
281
- return v.replace(/\D/g, "")
282
- }
283
-
284
- function mcc(v) {
285
- v = v.replace(/\D/g, "");
286
- v = v.replace(/^(\d{4})(\d)/g, "$1 $2");
287
- v = v.replace(/^(\d{4})\s(\d{4})(\d)/g, "$1 $2 $3");
288
- v = v.replace(/^(\d{4})\s(\d{4})\s(\d{4})(\d)/g, "$1 $2 $3 $4");
289
- return v;
290
- }
291
-
292
- //explode date to month and year
293
  function validateMonthYear() {
294
- var date = document.getElementById('cardExpirationDate').value.split('/');
295
  document.getElementById('cardExpirationMonth').value = date[0];
296
  document.getElementById('cardExpirationYear').value = date[1];
297
  }
298
 
299
- //mercadopago function
300
- (function($) {
301
-
302
- var mercado_pago = false;
303
- var MPv1 = {
304
- debug: true,
305
- add_truncated_card: true,
306
- site_id: "",
307
- public_key: "",
308
- coupon_of_discounts: {
309
- discount_action_url: "",
310
- payer_email: "",
311
- default: true,
312
- status: false
313
- },
314
- customer_and_card: {
315
- default: true,
316
- status: true
317
- },
318
- inputs_to_create_discount: [
319
- "couponCode",
320
- "applyCoupon"
321
- ],
322
- inputs_to_create_token: [
323
- "cardNumber",
324
- "cardExpirationDate",
325
- "cardholderName",
326
- "securityCode",
327
- "docType",
328
- "docNumber"
329
- ],
330
- inputs_to_create_token_customer_and_card: [
331
- "paymentMethodSelector",
332
- "securityCode"
333
- ],
334
- selectors: {
335
- // others
336
- mp_doc_div: "#mp-doc-div",
337
- mpCheckoutLink: "#mp_checkout_link",
338
- mpPromotionLink: "#mp_promotion_link",
339
- // currency
340
- currency_ratio: "#currency_ratio",
341
- // coupom
342
- couponCode: "#couponCode",
343
- applyCoupon: "#applyCoupon",
344
- mpCouponApplyed: "#mpCouponApplyed",
345
- mpCouponError: "#mpCouponError",
346
- campaign_id: "#campaign_id",
347
- campaign: "#campaign",
348
- discount: "#discount",
349
- // customer cards
350
- paymentMethodSelector: "#paymentMethodSelector",
351
- pmCustomerAndCards: "#payment-methods-for-customer-and-cards",
352
- pmListOtherCards: "#payment-methods-list-other-cards",
353
- // card data
354
- mpSecurityCodeCustomerAndCard: "#mp-securityCode-customer-and-card",
355
- cardNumber: "#cardNumber",
356
- cardExpirationMonth: "#cardExpirationMonth",
357
- cardExpirationYear: "#cardExpirationYear",
358
- cardholderName: "#cardholderName",
359
- securityCode: "#securityCode",
360
- docType: "#docType",
361
- docNumber: "#docNumber",
362
- issuer: "#issuer",
363
- installments: "#installments",
364
- // document
365
- mpDoc: ".mp-doc",
366
- mpIssuer: ".mp-issuer",
367
- mpDocType: ".mp-docType",
368
- mpDocNumber: ".mp-docNumber",
369
- // payment method and checkout
370
- paymentMethodId: "#paymentMethodId",
371
- amount: "#amount",
372
- token: "#token",
373
- cardTruncated: "#cardTruncated",
374
- site_id: "#site_id",
375
- CustomerAndCard: "#CustomerAndCard",
376
- box_loading: "#mp-box-loading",
377
- submit: "#submit",
378
- // tax resolution AG 51/2017
379
- boxInstallments: "#mp-box-installments",
380
- boxInstallmentsSelector: "#mp-box-installments-selector",
381
- taxCFT: "#mp-box-input-tax-cft",
382
- taxTEA: "#mp-box-input-tax-tea",
383
- taxTextCFT: "#mp-tax-cft-text",
384
- taxTextTEA: "#mp-tax-tea-text",
385
- // form
386
- form: "#mercadopago-form",
387
- formCoupon: "#mercadopago-form-coupon",
388
- formCustomerAndCard: "#mercadopago-form-customer-and-card",
389
- utilities_fields: "#mercadopago-utilities"
390
- },
391
- text: {
392
- choose: "Choose",
393
- other_bank: "Other Bank",
394
- discount_info1: "You will save",
395
- discount_info2: "with discount from",
396
- discount_info3: "Total of your purchase:",
397
- discount_info4: "Total of your purchase with discount:",
398
- discount_info5: "*Uppon payment approval",
399
- discount_info6: "Terms and Conditions of Use",
400
- coupon_empty: "Please, inform your coupon code",
401
- apply: "Apply",
402
- remove: "Remove"
403
- },
404
- paths: {
405
- loading: "images/loading.gif",
406
- check: "images/check.png",
407
- error: "images/error.png"
408
- }
409
- }
410
-
411
- // === Coupon of Discounts
412
- MPv1.currencyIdToCurrency = function(currency_id) {
413
- if (currency_id == "ARS") {
414
- return "$";
415
- } else if (currency_id == "BRL") {
416
- return "R$";
417
- } else if (currency_id == "COP") {
418
- return "$";
419
- } else if (currency_id == "CLP") {
420
- return "$";
421
- } else if (currency_id == "MXN") {
422
- return "$";
423
- } else if (currency_id == "VEF") {
424
- return "Bs";
425
- } else if (currency_id == "PEN") {
426
- return "S/";
427
- } else if (currency_id == "UYU") {
428
- return "$U";
429
- } else {
430
- return "$";
431
- }
432
- }
433
-
434
- MPv1.checkCouponEligibility = function() {
435
- if (document.querySelector(MPv1.selectors.couponCode).value == "") {
436
- // Coupon code is empty.
437
- document.querySelector(MPv1.selectors.mpCouponApplyed).style.display = "none";
438
- document.querySelector(MPv1.selectors.mpCouponError).style.display = "block";
439
- document.querySelector(MPv1.selectors.mpCouponError).innerHTML = MPv1.text.coupon_empty;
440
- MPv1.coupon_of_discounts.status = false;
441
- document.querySelector(MPv1.selectors.couponCode).style.background = null;
442
- document.querySelector(MPv1.selectors.applyCoupon).value = MPv1.text.apply;
443
- document.querySelector(MPv1.selectors.discount).value = 0;
444
- MPv1.cardsHandler();
445
- } else if (MPv1.coupon_of_discounts.status) {
446
- // We already have a coupon set, so we remove it.
447
- document.querySelector(MPv1.selectors.mpCouponApplyed).style.display = "none";
448
- document.querySelector(MPv1.selectors.mpCouponError).style.display = "none";
449
- MPv1.coupon_of_discounts.status = false;
450
- document.querySelector(MPv1.selectors.applyCoupon).style.background = null;
451
- document.querySelector(MPv1.selectors.applyCoupon).value = MPv1.text.apply;
452
- document.querySelector(MPv1.selectors.couponCode).value = "";
453
- document.querySelector(MPv1.selectors.couponCode).style.background = null;
454
- document.querySelector(MPv1.selectors.discount).value = 0;
455
- MPv1.cardsHandler();
456
- } else {
457
- // Set loading.
458
- document.querySelector(MPv1.selectors.mpCouponApplyed).style.display = "none";
459
- document.querySelector(MPv1.selectors.mpCouponError).style.display = "none";
460
- document.querySelector(MPv1.selectors.couponCode).style.background = "url(" + MPv1.paths.loading + ") 98% 50% no-repeat #fff";
461
- document.querySelector(MPv1.selectors.couponCode).style.border = "1px solid #cecece";
462
- document.querySelector(MPv1.selectors.applyCoupon).disabled = true;
463
-
464
- // Check if there are params in the url.
465
- var url = MPv1.coupon_of_discounts.discount_action_url;
466
- var sp = "?";
467
- if (url.indexOf("?") >= 0) {
468
- sp = "&";
469
- }
470
- url += sp + "site_id=" + MPv1.site_id;
471
- url += "&coupon_id=" + document.querySelector(MPv1.selectors.couponCode).value;
472
- url += "&amount=" + document.querySelector(MPv1.selectors.amount).value;
473
- url += "&payer=" + MPv1.coupon_of_discounts.payer_email;
474
- //url += "&payer=" + document.getElementById( "billing_email" ).value;
475
-
476
- MPv1.AJAX({
477
- url: url,
478
- method: "GET",
479
- timeout: 5000,
480
- error: function() {
481
- // Request failed.
482
- document.querySelector(MPv1.selectors.mpCouponApplyed).style.display = "none";
483
- document.querySelector(MPv1.selectors.mpCouponError).style.display = "none";
484
- MPv1.coupon_of_discounts.status = false;
485
- document.querySelector(MPv1.selectors.applyCoupon).style.background = null;
486
- document.querySelector(MPv1.selectors.applyCoupon).value = MPv1.text.apply;
487
- document.querySelector(MPv1.selectors.couponCode).value = "";
488
- document.querySelector(MPv1.selectors.couponCode).style.background = null;
489
- document.querySelector(MPv1.selectors.discount).value = 0;
490
- MPv1.cardsHandler();
491
- },
492
- success: function(status, response) {
493
- if (response.status == 200) {
494
- document.querySelector(MPv1.selectors.mpCouponApplyed).style.display =
495
- "block";
496
- document.querySelector(MPv1.selectors.discount).value =
497
- response.response.coupon_amount;
498
- document.querySelector(MPv1.selectors.mpCouponApplyed).innerHTML =
499
- //"<div style='border-style: solid; border-width:thin; " +
500
- //"border-color: #009EE3; padding: 8px 8px 8px 8px; margin-top: 4px;'>" +
501
- MPv1.text.discount_info1 + " <strong>" +
502
- MPv1.currencyIdToCurrency(response.response.currency_id) + " " +
503
- Math.round(response.response.coupon_amount * 100) / 100 +
504
- "</strong> " + MPv1.text.discount_info2 + " " +
505
- response.response.name + ".<br>" + MPv1.text.discount_info3 + " <strong>" +
506
- MPv1.currencyIdToCurrency(response.response.currency_id) + " " +
507
- Math.round(MPv1.getAmountWithoutDiscount() * 100) / 100 +
508
- "</strong><br>" + MPv1.text.discount_info4 + " <strong>" +
509
- MPv1.currencyIdToCurrency(response.response.currency_id) + " " +
510
- Math.round(MPv1.getAmount() * 100) / 100 + "*</strong><br>" +
511
- "<i>" + MPv1.text.discount_info5 + "</i><br>" +
512
- "<a href='https://api.mercadolibre.com/campaigns/" +
513
- response.response.id +
514
- "/terms_and_conditions?format_type=html' target='_blank'>" +
515
- MPv1.text.discount_info6 + "</a>";
516
- document.querySelector(MPv1.selectors.mpCouponError).style.display = "none";
517
- MPv1.coupon_of_discounts.status = true;
518
- document.querySelector(MPv1.selectors.couponCode).style.background =
519
- null;
520
- document.querySelector(MPv1.selectors.couponCode).style.background =
521
- "url(" + MPv1.paths.check + ") 98% 50% no-repeat #fff";
522
- document.querySelector(MPv1.selectors.couponCode).style.border = "1px solid #cecece";
523
- document.querySelector(MPv1.selectors.applyCoupon).value =
524
- MPv1.text.remove;
525
- MPv1.cardsHandler();
526
- document.querySelector(MPv1.selectors.campaign_id).value =
527
- response.response.id;
528
- document.querySelector(MPv1.selectors.campaign).value =
529
- response.response.name;
530
- } else {
531
- document.querySelector(MPv1.selectors.mpCouponApplyed).style.display = "none";
532
- document.querySelector(MPv1.selectors.mpCouponError).style.display = "block";
533
- document.querySelector(MPv1.selectors.mpCouponError).innerHTML = response.response.message;
534
- MPv1.coupon_of_discounts.status = false;
535
- document.querySelector(MPv1.selectors.couponCode).style.background = null;
536
- document.querySelector(MPv1.selectors.couponCode).style.background = "url(" + MPv1.paths.error + ") 98% 50% no-repeat #fff";
537
- document.querySelector(MPv1.selectors.applyCoupon).value = MPv1.text.apply;
538
- document.querySelector(MPv1.selectors.discount).value = 0;
539
- MPv1.cardsHandler();
540
- }
541
- document.querySelector(MPv1.selectors.applyCoupon).disabled = false;
542
- }
543
- });
544
- }
545
- }
546
-
547
- MPv1.getBin = function() {
548
-
549
- var cardSelector = document.querySelector(MPv1.selectors.paymentMethodSelector);
550
-
551
- // if (cardSelector && cardSelector[cardSelector.options.selectedIndex].value != "-1") {
552
- // return cardSelector[cardSelector.options.selectedIndex]
553
- // .getAttribute("first_six_digits");
554
- // }
555
-
556
- var ccNumber = document.querySelector(MPv1.selectors.cardNumber);
557
- return ccNumber.value.replace(/[ .-]/g, "").slice(0, 6);
558
-
559
- }
560
-
561
- MPv1.clearOptions = function() {
562
-
563
- var bin = MPv1.getBin();
564
-
565
- if (bin.length == 0) {
566
- MPv1.resetBackgroundCard();
567
-
568
- MPv1.hideIssuer();
569
-
570
- var selectorInstallments = document.querySelector(MPv1.selectors.installments),
571
- fragment = document.createDocumentFragment(),
572
- option = new Option(MPv1.text.choose + "...", "-1");
573
-
574
- selectorInstallments.options.length = 0;
575
- fragment.appendChild(option);
576
- selectorInstallments.appendChild(fragment);
577
- selectorInstallments.setAttribute("disabled", "disabled");
578
-
579
- }
580
-
581
- }
582
-
583
- MPv1.guessingPaymentMethod = function(event) {
584
- var bin = MPv1.getBin();
585
- var amount = MPv1.getAmount();
586
-
587
- if (event.type == "keyup") {
588
- if (bin != null && bin.length == 6) {
589
- Mercadopago.getPaymentMethod({
590
- "bin": bin
591
- }, MPv1.setPaymentMethodInfo);
592
- }
593
- } else {
594
- setTimeout(function() {
595
- if (bin.length >= 6) {
596
- Mercadopago.getPaymentMethod({
597
- "bin": bin
598
- }, MPv1.setPaymentMethodInfo);
599
- }
600
- }, 100);
601
- }
602
-
603
- };
604
-
605
- MPv1.setPaymentMethodInfo = function(status, response) {
606
-
607
- if (status == 200) {
608
-
609
- if (MPv1.site_id != "MLM") {
610
- // Guessing...
611
- document.querySelector(MPv1.selectors.paymentMethodId).value = response[0].id;
612
- if (MPv1.customer_and_card.status) {
613
- document.querySelector(MPv1.selectors.paymentMethodSelector)
614
- .style.background = "url(" + response[0].secure_thumbnail + ") 90% 50% no-repeat #fff";
615
- } else {
616
- document.querySelector(MPv1.selectors.cardNumber).style.background = "url(" +
617
- response[0].secure_thumbnail + ") 98% 50% no-repeat #fff";
618
- }
619
- }
620
-
621
- // Check if the security code (ex: Tarshop) is required.
622
- var cardConfiguration = response[0].settings;
623
- var bin = MPv1.getBin();
624
- var amount = MPv1.getAmount();
625
-
626
- Mercadopago.getInstallments({
627
- "bin": bin,
628
- "amount": amount
629
- },
630
- MPv1.setInstallmentInfo
631
- );
632
-
633
- // Check if the issuer is necessary to pay.
634
- var issuerMandatory = false,
635
- additionalInfo = response[0].additional_info_needed;
636
-
637
- for (var i = 0; i < additionalInfo.length; i++) {
638
- if (additionalInfo[i] == "issuer_id") {
639
- issuerMandatory = true;
640
- }
641
- };
642
-
643
- if (issuerMandatory && MPv1.site_id != "MLM") {
644
- var payment_method_id = response[0].id;
645
- MPv1.getIssuersPaymentMethod(payment_method_id);
646
- } else {
647
- MPv1.hideIssuer();
648
- }
649
-
650
- }
651
-
652
- }
653
-
654
- MPv1.changePaymetMethodSelector = function() {
655
- var payment_method_id =
656
- document.querySelector(MPv1.selectors.paymentMethodSelector).value;
657
- MPv1.getIssuersPaymentMethod(payment_method_id);
658
- }
659
-
660
- // === Issuers
661
- MPv1.getIssuersPaymentMethod = function(payment_method_id) {
662
-
663
- var amount = MPv1.getAmount();
664
-
665
- // flow: MLM mercadopagocard
666
- if (payment_method_id == "mercadopagocard") {
667
- Mercadopago.getInstallments({
668
- "payment_method_id": payment_method_id,
669
- "amount": amount
670
- },
671
- MPv1.setInstallmentInfo
672
- );
673
- }
674
-
675
- Mercadopago.getIssuers(payment_method_id, MPv1.showCardIssuers);
676
- MPv1.addListenerEvent(
677
- document.querySelector(MPv1.selectors.issuer),
678
- "change",
679
- MPv1.setInstallmentsByIssuerId
680
- );
681
-
682
- }
683
-
684
- MPv1.showCardIssuers = function(status, issuers) {
685
-
686
- // If the API does not return any bank.
687
- if (issuers.length > 0) {
688
- var issuersSelector = document.querySelector(MPv1.selectors.issuer);
689
- var fragment = document.createDocumentFragment();
690
-
691
- issuersSelector.options.length = 0;
692
- var option = new Option(MPv1.text.choose + "...", "-1");
693
- fragment.appendChild(option);
694
-
695
- for (var i = 0; i < issuers.length; i++) {
696
- if (issuers[i].name != "default") {
697
- option = new Option(issuers[i].name, issuers[i].id);
698
- } else {
699
- option = new Option("Otro", issuers[i].id);
700
- }
701
- fragment.appendChild(option);
702
- }
703
-
704
- issuersSelector.appendChild(fragment);
705
- issuersSelector.removeAttribute("disabled");
706
- } else {
707
- MPv1.hideIssuer();
708
- }
709
-
710
- }
711
-
712
- MPv1.setInstallmentsByIssuerId = function(status, response) {
713
-
714
- var issuerId = document.querySelector(MPv1.selectors.issuer).value;
715
- var amount = MPv1.getAmount();
716
-
717
- if (issuerId === "-1") {
718
- return;
719
- }
720
-
721
- var params_installments = {
722
- "bin": MPv1.getBin(),
723
- "amount": amount,
724
- "issuer_id": issuerId
725
- }
726
-
727
- if (MPv1.site_id == "MLM") {
728
- params_installments = {
729
- "payment_method_id": document.querySelector(
730
- MPv1.selectors.paymentMethodSelector
731
- ).value,
732
- "amount": amount,
733
- "issuer_id": issuerId
734
- }
735
- }
736
- Mercadopago.getInstallments(params_installments, MPv1.setInstallmentInfo);
737
-
738
- }
739
-
740
- MPv1.hideIssuer = function() {
741
- var $issuer = document.querySelector(MPv1.selectors.issuer);
742
- var opt = document.createElement("option");
743
- opt.value = "-1";
744
- opt.innerHTML = MPv1.text.other_bank;
745
- opt.style = "font-size: 12px;";
746
-
747
- $issuer.innerHTML = "";
748
- $issuer.appendChild(opt);
749
- $issuer.setAttribute("disabled", "disabled");
750
- }
751
-
752
- // === Installments
753
- MPv1.setInstallmentInfo = function(status, response) {
754
-
755
- var selectorInstallments = document.querySelector(MPv1.selectors.installments);
756
-
757
- if (response.length > 0) {
758
-
759
- var html_option = "<option value='-1'>" + MPv1.text.choose + "...</option>";
760
- payerCosts = response[0].payer_costs;
761
-
762
- // fragment.appendChild(option);
763
- for (var i = 0; i < payerCosts.length; i++) {
764
- // Resolution 51/2017
765
- var dataInput = "";
766
- if (MPv1.site_id == "MLA") {
767
- var tax = payerCosts[i].labels;
768
- if (tax.length > 0) {
769
- for (var l = 0; l < tax.length; l++) {
770
- if (tax[l].indexOf("CFT_") !== -1) {
771
- dataInput = "data-tax='" + tax[l] + "'";
772
- }
773
- }
774
- }
775
- }
776
- html_option += "<option value='" + payerCosts[i].installments + "' " + dataInput + ">" +
777
- (payerCosts[i].recommended_message || payerCosts[i].installments) +
778
- "</option>";
779
- }
780
-
781
- // Not take the user's selection if equal.
782
- if (selectorInstallments.innerHTML != html_option) {
783
- selectorInstallments.innerHTML = html_option;
784
- }
785
-
786
- selectorInstallments.removeAttribute("disabled");
787
- MPv1.showTaxes();
788
-
789
- }
790
-
791
- }
792
-
793
- MPv1.showTaxes = function() {
794
- var selectorIsntallments = document.querySelector(MPv1.selectors.installments);
795
- var tax = selectorIsntallments.options[selectorIsntallments.selectedIndex].getAttribute("data-tax");
796
- var cft = "";
797
- var tea = "";
798
- if (tax != null) {
799
- var tax_split = tax.split("|");
800
- cft = tax_split[0].replace("_", " ");
801
- tea = tax_split[1].replace("_", " ");
802
- if (cft == "CFT 0,00%" && tea == "TEA 0,00%") {
803
- cft = "";
804
- tea = "";
805
- }
806
- }
807
- document.querySelector(MPv1.selectors.taxTextCFT).innerHTML = cft;
808
- document.querySelector(MPv1.selectors.taxTextTEA).innerHTML = tea;
809
- }
810
-
811
- // === Customer & Cards
812
- MPv1.cardsHandler = function() {
813
-
814
- var cardSelector = document.querySelector(MPv1.selectors.paymentMethodSelector);
815
- var type_checkout =
816
- cardSelector[cardSelector.options.selectedIndex].getAttribute("type_checkout");
817
- var amount = MPv1.getAmount();
818
-
819
- if (MPv1.customer_and_card.default) {
820
-
821
- if (cardSelector &&
822
- cardSelector[cardSelector.options.selectedIndex].value != "-1" &&
823
- type_checkout == "customer_and_card") {
824
-
825
- document.querySelector(MPv1.selectors.paymentMethodId)
826
- .value = cardSelector[cardSelector.options.selectedIndex]
827
- .getAttribute("payment_method_id");
828
-
829
- MPv1.clearOptions();
830
-
831
- MPv1.customer_and_card.status = true;
832
-
833
- var _bin = cardSelector[cardSelector.options.selectedIndex]
834
- .getAttribute("first_six_digits");
835
-
836
- Mercadopago.getPaymentMethod({
837
- "bin": _bin
838
- },
839
- MPv1.setPaymentMethodInfo
840
- );
841
-
842
- } else {
843
-
844
- document.querySelector(MPv1.selectors.paymentMethodId)
845
- .value = cardSelector.value != -1 ? cardSelector.value : "";
846
- MPv1.customer_and_card.status = false;
847
- MPv1.resetBackgroundCard();
848
- MPv1.guessingPaymentMethod({
849
- type: "keyup"
850
- });
851
-
852
- }
853
-
854
- MPv1.setForm();
855
-
856
- }
857
-
858
- }
859
-
860
- // === Payment Methods
861
- MPv1.getPaymentMethods = function() {
862
-
863
- var fragment = document.createDocumentFragment();
864
- var paymentMethodsSelector =
865
- document.querySelector(MPv1.selectors.paymentMethodSelector)
866
- var mainPaymentMethodSelector =
867
- document.querySelector(MPv1.selectors.paymentMethodSelector)
868
-
869
- // Set loading.
870
- mainPaymentMethodSelector.style.background =
871
- "url(" + MPv1.paths.loading + ") 95% 50% no-repeat #fff";
872
- mainPaymentMethodSelector.style.border = "1px solid #cecece";
873
-
874
- // If customer and card.
875
- if (MPv1.customer_and_card.status) {
876
- paymentMethodsSelector = document.querySelector(MPv1.selectors.pmListOtherCards)
877
- // Clean payment methods.
878
- paymentMethodsSelector.innerHTML = "";
879
- } else {
880
- paymentMethodsSelector.innerHTML = "";
881
- option = new Option(MPv1.text.choose + "...", "-1");
882
- fragment.appendChild(option);
883
- }
884
-
885
- Mercadopago.getAllPaymentMethods(function(code, payment_methods) {
886
-
887
- for (var x = 0; x < payment_methods.length; x++) {
888
-
889
- var pm = payment_methods[x];
890
-
891
- if ((pm.payment_type_id == "credit_card" || pm.payment_type_id == "debit_card" ||
892
- pm.payment_type_id == "prepaid_card") && pm.status == "active") {
893
-
894
- option = new Option(pm.name, pm.id);
895
- option.setAttribute("type_checkout", "custom");
896
- fragment.appendChild(option);
897
-
898
- }
899
-
900
- }
901
-
902
- paymentMethodsSelector.appendChild(fragment);
903
- mainPaymentMethodSelector.style.background = "#fff";
904
-
905
- });
906
-
907
- }
908
-
909
- MPv1.validateInputsCreateToken = function() {
910
- var $inputs = MPv1.getForm().querySelectorAll("[data-checkout]");
911
- var $inputs_to_create_token = MPv1.getInputsToCreateToken();
912
-
913
- for (var x = 0; x < $inputs.length; x++) {
914
-
915
- var element = $inputs[x];
916
-
917
- // Check is a input to create token.
918
- if ($inputs_to_create_token
919
- .indexOf(element.getAttribute("data-checkout")) > -1) {
920
-
921
- if (element.value == -1 || element.value == "") {
922
- element.focus();
923
- return false;
924
- }
925
- }
926
- }
927
- return true;
928
- }
929
-
930
- MPv1.createToken = function() {
931
- MPv1.hideErrors();
932
-
933
- // Show loading.
934
- document.querySelector(MPv1.selectors.box_loading).style.background =
935
- "url(" + MPv1.paths.loading + ") 0 50% no-repeat #fff";
936
-
937
- // Form.
938
- var $form = MPv1.getForm();
939
-
940
- Mercadopago.createToken($form, MPv1.sdkResponseHandler);
941
-
942
- return false;
943
- }
944
-
945
- MPv1.sdkResponseHandler = function(status, response) {
946
- // Hide loading.
947
- document.querySelector(MPv1.selectors.box_loading).style.background = "";
948
-
949
- if (status != 200 && status != 201) {
950
- MPv1.showErrors(response);
951
- } else {
952
- var token = document.querySelector(MPv1.selectors.token);
953
- token.value = response.id;
954
-
955
- if (MPv1.add_truncated_card) {
956
- var card = MPv1.truncateCard(response);
957
- document.querySelector(MPv1.selectors.cardTruncated).value = card;
958
- }
959
-
960
- mercado_pago = true;
961
- $('form.checkout, form#order_review').submit();
962
- }
963
- }
964
-
965
- // === Useful functions
966
- MPv1.resetBackgroundCard = function() {
967
- document.querySelector(MPv1.selectors.paymentMethodSelector).style.background =
968
- "no-repeat #fff";
969
- document.querySelector(MPv1.selectors.paymentMethodSelector).style.border =
970
- "1px solid #cecece";
971
- document.querySelector(MPv1.selectors.cardNumber).style.background =
972
- "no-repeat #fff";
973
- document.querySelector(MPv1.selectors.cardNumber).style.border =
974
- "1px solid #cecece";
975
- }
976
-
977
- MPv1.setForm = function() {
978
- if (MPv1.customer_and_card.status) {
979
- document.querySelector(MPv1.selectors.formDiv).style.display = "none";
980
- document.querySelector(MPv1.selectors.mpSecurityCodeCustomerAndCard).removeAttribute("style");
981
- } else {
982
- document.querySelector(MPv1.selectors.mpSecurityCodeCustomerAndCard).style.display = "none";
983
- document.querySelector(MPv1.selectors.formDiv).removeAttribute("style");
984
- }
985
-
986
- Mercadopago.clearSession();
987
-
988
- document.querySelector(MPv1.selectors.CustomerAndCard).value =
989
- MPv1.customer_and_card.status;
990
- }
991
-
992
- MPv1.getForm = function() {
993
- if (MPv1.customer_and_card.status) {
994
- return document.querySelector(MPv1.selectors.formCustomerAndCard);
995
- } else {
996
- return document.querySelector(MPv1.selectors.form);
997
- }
998
- }
999
-
1000
- MPv1.getInputsToCreateToken = function() {
1001
- if (MPv1.customer_and_card.status) {
1002
- return MPv1.inputs_to_create_token_customer_and_card;
1003
- } else {
1004
- return MPv1.inputs_to_create_token;
1005
- }
1006
- }
1007
-
1008
- MPv1.truncateCard = function(response_card_token) {
1009
-
1010
- var first_six_digits;
1011
- var last_four_digits;
1012
-
1013
- if (MPv1.customer_and_card.status) {
1014
- var cardSelector = document.querySelector(MPv1.selectors.paymentMethodSelector);
1015
- first_six_digits = cardSelector[cardSelector.options.selectedIndex]
1016
- .getAttribute("first_six_digits").match(/.{1,4}/g)
1017
- last_four_digits = cardSelector[cardSelector.options.selectedIndex]
1018
- .getAttribute("last_four_digits")
1019
- } else {
1020
- first_six_digits = response_card_token.first_six_digits.match(/.{1,4}/g)
1021
- last_four_digits = response_card_token.last_four_digits
1022
- }
1023
-
1024
- var card = first_six_digits[0] + " " +
1025
- first_six_digits[1] + "** **** " + last_four_digits;
1026
-
1027
- return card;
1028
-
1029
- }
1030
-
1031
- MPv1.getAmount = function() {
1032
- return document.querySelector(MPv1.selectors.amount).value;
1033
- }
1034
-
1035
- MPv1.hideErrors = function() {
1036
-
1037
- for (var x = 0; x < document.querySelectorAll("[data-checkout]").length; x++) {
1038
- var $field = document.querySelectorAll("[data-checkout]")[x];
1039
- $field.classList.remove("mp-error-input");
1040
- } // end for
1041
-
1042
- for (var x = 0; x < document.querySelectorAll(".mp-error").length; x++) {
1043
- var $span = document.querySelectorAll(".mp-error")[x];
1044
- $span.style.display = "none";
1045
- }
1046
-
1047
- return;
1048
-
1049
- }
1050
-
1051
- // === Add events to guessing
1052
- MPv1.addListenerEvent = function(el, eventName, handler) {
1053
- if (el.addEventListener) {
1054
- el.addEventListener(eventName, handler);
1055
- } else {
1056
- el.attachEvent("on" + eventName, function() {
1057
- handler.call(el);
1058
- });
1059
- }
1060
- };
1061
-
1062
- $('body').on('focusout', '#cardNumber', MPv1.guessingPaymentMethod);
1063
-
1064
-
1065
- MPv1.addListenerEvent(
1066
- document.querySelector(MPv1.selectors.cardNumber),
1067
- "keyup", MPv1.clearOptions
1068
- );
1069
-
1070
- MPv1.referer = (function() {
1071
- var referer = window.location.protocol + "//" +
1072
- window.location.hostname + (window.location.port ? ":" + window.location.port : "");
1073
- return referer;
1074
- })();
1075
-
1076
- MPv1.AJAX = function(options) {
1077
- var useXDomain = !!window.XDomainRequest;
1078
- var req = useXDomain ? new XDomainRequest() : new XMLHttpRequest()
1079
- var data;
1080
- options.url += (options.url.indexOf("?") >= 0 ? "&" : "?") + "referer=" + escape(MPv1.referer);
1081
- options.requestedMethod = options.method;
1082
- if (useXDomain && options.method == "PUT") {
1083
- options.method = "POST";
1084
- options.url += "&_method=PUT";
1085
- }
1086
- req.open(options.method, options.url, true);
1087
- req.timeout = options.timeout || 1000;
1088
- if (window.XDomainRequest) {
1089
- req.onload = function() {
1090
- data = JSON.parse(req.responseText);
1091
- if (typeof options.success === "function") {
1092
- options.success(options.requestedMethod === "POST" ? 201 : 200, data);
1093
- }
1094
- };
1095
- req.onerror = req.ontimeout = function() {
1096
- if (typeof options.error === "function") {
1097
- options.error(400, {
1098
- user_agent: window.navigator.userAgent,
1099
- error: "bad_request",
1100
- cause: []
1101
- });
1102
- }
1103
- };
1104
- req.onprogress = function() {};
1105
- } else {
1106
- req.setRequestHeader("Accept", "application/json");
1107
- if (options.contentType) {
1108
- req.setRequestHeader("Content-Type", options.contentType);
1109
- } else {
1110
- req.setRequestHeader("Content-Type", "application/json");
1111
- }
1112
- req.onreadystatechange = function() {
1113
- if (this.readyState === 4) {
1114
- try {
1115
- if (this.status >= 200 && this.status < 400) {
1116
- // Success!
1117
- data = JSON.parse(this.responseText);
1118
- if (typeof options.success === "function") {
1119
- options.success(this.status, data);
1120
- }
1121
- } else if (this.status >= 400) {
1122
- data = JSON.parse(this.responseText);
1123
- if (typeof options.error === "function") {
1124
- options.error(this.status, data);
1125
- }
1126
- } else if (typeof options.error === "function") {
1127
- options.error(503, {});
1128
- }
1129
- } catch (e) {
1130
- options.error(503, {});
1131
- }
1132
- }
1133
- };
1134
- }
1135
- if (options.method === "GET" || options.data == null || options.data == undefined) {
1136
- req.send();
1137
- } else {
1138
- req.send(JSON.stringify(options.data));
1139
- }
1140
- }
1141
-
1142
- // === Initialization function
1143
- MPv1.Initialize = function(site_id, public_key, coupon_mode, discount_action_url, payer_email) {
1144
-
1145
- // Sets
1146
- MPv1.site_id = site_id;
1147
- MPv1.public_key = public_key;
1148
- MPv1.coupon_of_discounts.default = coupon_mode;
1149
- MPv1.coupon_of_discounts.discount_action_url = discount_action_url;
1150
- MPv1.coupon_of_discounts.payer_email = payer_email;
1151
-
1152
- //hide errors
1153
- MPv1.hideErrors();
1154
-
1155
- //promotion link
1156
- if (MPv1.site_id != "MLA") {
1157
- document.querySelector(MPv1.selectors.mpCheckoutLink).style.display = "none";
1158
- document.querySelector(MPv1.selectors.mpPromotionLink).style.display = "none";
1159
- }
1160
-
1161
- Mercadopago.setPublishableKey(MPv1.public_key);
1162
-
1163
- // flow coupon of discounts
1164
- if (MPv1.coupon_of_discounts.default) {
1165
- MPv1.addListenerEvent(
1166
- document.querySelector(MPv1.selectors.applyCoupon),
1167
- "click",
1168
- MPv1.checkCouponEligibility
1169
- );
1170
- document.querySelector(MPv1.selectors.formCoupon).style.marginBottom = "20px";
1171
- } else {
1172
- document.querySelector(MPv1.selectors.formCoupon).style.display = "none";
1173
- }
1174
-
1175
- // Flow: customer & cards.
1176
- var selectorPmCustomerAndCards = document.querySelector(MPv1.selectors.pmCustomerAndCards);
1177
- if (MPv1.customer_and_card.default && selectorPmCustomerAndCards.childElementCount > 0) {
1178
- MPv1.addListenerEvent(
1179
- document.querySelector(MPv1.selectors.paymentMethodSelector),
1180
- "change", MPv1.cardsHandler
1181
- );
1182
- MPv1.cardsHandler();
1183
- } else {
1184
- // If customer & cards is disabled or customer does not have cards.
1185
- MPv1.customer_and_card.status = false;
1186
- document.querySelector(MPv1.selectors.formCustomerAndCard).style.display = "none";
1187
- }
1188
-
1189
- // flow: MLM
1190
- if (MPv1.site_id != "MLM") {
1191
- Mercadopago.getIdentificationTypes();
1192
- }
1193
-
1194
- if (MPv1.site_id == "MLM") {
1195
- document.querySelector(MPv1.selectors.mpDoc).style.display = "none";
1196
- document.querySelector(MPv1.selectors.formCustomerAndCard).removeAttribute("style");
1197
- document.querySelector(MPv1.selectors.mpSecurityCodeCustomerAndCard).style.display = "none";
1198
-
1199
- // Removing not used fields for this country.
1200
- MPv1.inputs_to_create_token.splice(
1201
- MPv1.inputs_to_create_token.indexOf("docType"),
1202
- 1);
1203
- MPv1.inputs_to_create_token.splice(
1204
- MPv1.inputs_to_create_token.indexOf("docNumber"),
1205
- 1);
1206
-
1207
- MPv1.addListenerEvent(
1208
- document.querySelector(MPv1.selectors.paymentMethodSelector),
1209
- "change",
1210
- MPv1.changePaymetMethodSelector
1211
- );
1212
-
1213
- // Get payment methods and populate selector.
1214
- MPv1.getPaymentMethods();
1215
-
1216
- }
1217
-
1218
- // flow: MLB AND MCO
1219
- if (MPv1.site_id == "MLB") {
1220
- document.querySelector(MPv1.selectors.mpIssuer).style.display = "none";
1221
- document.getElementById('installments-div').classList.remove('mp-col-md-8');
1222
- document.getElementById('installments-div').classList.add('mp-col-md-12');
1223
- } else if (MPv1.site_id == "MCO") {
1224
- document.querySelector(MPv1.selectors.mpIssuer).style.display = "none";
1225
- document.getElementById('installments-div').classList.remove('mp-col-md-8');
1226
- document.getElementById('installments-div').classList.add('mp-col-md-12');
1227
- } else if (MPv1.site_id == "MLA") {
1228
- document.querySelector(MPv1.selectors.mpIssuer).style.display = "block";
1229
- document.querySelector(MPv1.selectors.taxCFT).style.display = "block";
1230
- document.querySelector(MPv1.selectors.taxTEA).style.display = "block";
1231
- MPv1.addListenerEvent(document.querySelector(MPv1.selectors.installments), "change", MPv1.showTaxes);
1232
- } else if (MPv1.site_id == "MLC") {
1233
- document.querySelector(MPv1.selectors.mpIssuer).style.display = "none";
1234
- document.getElementById('installments-div').classList.remove('mp-col-md-8');
1235
- document.getElementById('installments-div').classList.add('mp-col-md-12');
1236
- }
1237
-
1238
- if (MPv1.debug) {
1239
- document.querySelector(MPv1.selectors.utilities_fields).style.display = "inline-block";
1240
- }
1241
-
1242
- document.querySelector(MPv1.selectors.site_id).value = MPv1.site_id;
1243
-
1244
- return;
1245
-
1246
- }
1247
-
1248
- this.MPv1 = MPv1;
1249
-
1250
-
1251
-
1252
- $('body').on('updated_checkout', function() {
1253
- var field = $('body #cardNumber');
1254
-
1255
- if (0 < field.length) {
1256
- field.focusout();
1257
- }
1258
- });
1259
-
1260
- // get action button submit
1261
- $('form.checkout').on('checkout_place_order_woo-mercado-pago-custom', function() {
1262
- if (mercado_pago) {
1263
- mercado_pago = false;
1264
-
1265
- return true;
1266
- }
1267
-
1268
- if (!document.getElementById('payment_method_woo-mercado-pago-custom').checked) {
1269
- return true;
1270
- }
1271
-
1272
- if (MPv1.validateInputsCreateToken()) {
1273
- return MPv1.createToken();
1274
- }
1275
-
1276
- return false;
1277
- });
1278
-
1279
- $('form#order_review').submit(function() {
1280
- if (mercado_pago) {
1281
- mercado_pago = false;
1282
-
1283
- return true;
1284
- }
1285
-
1286
- if (!document.getElementById('payment_method_woo-mercado-pago-custom').checked) {
1287
- return true;
1288
- }
1289
-
1290
- if (MPv1.validateInputsCreateToken()) {
1291
- return MPv1.createToken();
1292
- }
1293
-
1294
- return false;
1295
- });
1296
-
1297
- }(jQuery));
1298
-
1299
- // Overriding this function to give form padding attribute.
1300
- MPv1.setForm = function() {
1301
- if (MPv1.customer_and_card.status) {
1302
- document.querySelector(MPv1.selectors.form).style.display = "none";
1303
- document.querySelector(MPv1.selectors.mpSecurityCodeCustomerAndCard).removeAttribute("style");
1304
- } else {
1305
- document.querySelector(MPv1.selectors.mpSecurityCodeCustomerAndCard).style.display = "none";
1306
- document.querySelector(MPv1.selectors.form).removeAttribute("style");
1307
- document.querySelector(MPv1.selectors.form).style.padding = "0px 12px 0px 12px";
1308
- }
1309
- Mercadopago.clearSession();
1310
- document.querySelector(MPv1.selectors.CustomerAndCard).value = MPv1.customer_and_card.status;
1311
- }
1312
-
1313
- MPv1.getAmount = function() {
1314
- return document.querySelector(MPv1.selectors.amount).value - document.querySelector(MPv1.selectors.discount).value;
1315
- }
1316
-
1317
- MPv1.getAmountWithoutDiscount = function() {
1318
- return document.querySelector(MPv1.selectors.amount).value;
1319
- }
1320
-
1321
- MPv1.showErrors = function(response) {
1322
- var $form = MPv1.getForm();
1323
- for (var x = 0; x < response.cause.length; x++) {
1324
- var error = response.cause[x];
1325
-
1326
- if (error.code == 208 || error.code == 209 || error.code == 325 || error.code == 326) {
1327
- var $span = $form.querySelector("#mp-error-208");
1328
- } else {
1329
- var $span = $form.querySelector("#mp-error-" + error.code);
1330
- }
1331
-
1332
- if ($span != undefined) {
1333
- var $input = $form.querySelector($span.getAttribute("data-main"));
1334
- $span.style.display = "inline-block";
1335
- $input.classList.add("mp-form-control-error");
1336
- }
1337
- }
1338
- return;
1339
- }
1340
-
1341
- MPv1.hideErrors = function() {
1342
-
1343
- for (var x = 0; x < document.querySelectorAll("[data-checkout]").length; x++) {
1344
- var $field = document.querySelectorAll("[data-checkout]")[x];
1345
- $field.classList.remove("mp-error-input");
1346
- $field.classList.remove("mp-form-control-error");
1347
- }
1348
-
1349
- for (var x = 0; x < document.querySelectorAll(".mp-error").length; x++) {
1350
- var $span = document.querySelectorAll(".mp-error")[x];
1351
- $span.style.display = "none";
1352
- }
1353
-
1354
- return;
1355
-
1356
  }
1357
-
1358
- /*
1359
- * END Customization
1360
- */
1361
-
1362
- MPv1.text.apply = "<?php echo __('Apply', 'woocommerce-mercadopago'); ?>";
1363
- MPv1.text.remove = "<?php echo __('Remove', 'woocommerce-mercadopago'); ?>";
1364
- MPv1.text.coupon_empty = "<?php echo __('Please, inform your coupon code', 'woocommerce-mercadopago'); ?>";
1365
- MPv1.text.choose = "<?php echo __('To choose', 'woocommerce-mercadopago'); ?>";
1366
- MPv1.text.other_bank = "<?php echo __('Other bank', 'woocommerce-mercadopago'); ?>";
1367
- MPv1.text.discount_info1 = "<?php echo __('You will save', 'woocommerce-mercadopago'); ?>";
1368
- MPv1.text.discount_info2 = "<?php echo __('with discount of', 'woocommerce-mercadopago'); ?>";
1369
- MPv1.text.discount_info3 = "<?php echo __('Total of your purchase:', 'woocommerce-mercadopago'); ?>";
1370
- MPv1.text.discount_info4 = "<?php echo __('Total of your purchase with discount:', 'woocommerce-mercadopago'); ?>";
1371
- MPv1.text.discount_info5 = "<?php echo __('*After payment approval', 'woocommerce-mercadopago'); ?>";
1372
- MPv1.text.discount_info6 = "<?php echo __('Terms and conditions of use', 'woocommerce-mercadopago'); ?>";
1373
-
1374
- MPv1.paths.loading = "<?php echo ($images_path . 'loading.gif'); ?>";
1375
- MPv1.paths.check = "<?php echo ($images_path . 'check.png'); ?>";
1376
- MPv1.paths.error = "<?php echo ($images_path . 'error.png'); ?>";
1377
-
1378
- MPv1.Initialize(
1379
- "<?php echo $site_id; ?>",
1380
- "<?php echo $public_key; ?>",
1381
- "<?php echo $coupon_mode; ?>" == "yes",
1382
- "<?php echo $discount_action_url; ?>",
1383
- "<?php echo $payer_email; ?>"
1384
- );
1385
  </script>
3
  exit;
4
  }
5
  ?>
6
+
7
  <div class="mp-panel-custom-checkout">
8
  <div class="mp-row-checkout">
9
+
10
+ <!-- Links cards can pay | current promotions only Argentina -->
11
  <div class="mp-frame-links">
12
  <a class="mp-checkout-link mp-pr-10" id="button-show-payments">
13
  <?= __('With what cards can I pay', 'woocommerce-mercadopago') ?> ⌵
14
  </a>
15
+ <?php if ($site_id == 'MLA') : ?>
16
+ <span id="mp_promotion_link"> | </span>
17
+ <a href="https://www.mercadopago.com.ar/cuotas" id="mp_checkout_link" class="mp-checkout-link mp-pl-10" target="_blank">
18
+ <?= __('See current promotions', 'woocommerce-mercadopago') ?>
19
+ </a>
20
+ <?php endif; ?>
21
  </div>
22
 
23
+ <!-- Frame with cards acepteds -->
24
  <div class="mp-frame-payments" id="mp-frame-payments">
25
  <div class="mp-col-md-12">
26
  <div class="frame-tarjetas">
41
  </div>
42
  </div>
43
 
44
+ <!-- Cupom mode, creat a campaign on mercado pago -->
45
+ <?php if ($coupon_mode == 'yes') : ?>
46
+ <div class="mp-col-md-12" id="mercadopago-form-coupon">
47
+ <div class="frame-tarjetas mp-text-justify">
48
+ <p class="mp-subtitle-custom-checkout"><?= __('Enter your discount coupon', 'woocommerce-mercadopago') ?></p>
49
 
50
+ <div class="mp-row-checkout mp-pt-10">
51
+ <div class="mp-col-md-9 mp-pr-15">
52
+ <input type="text" class="mp-form-control" id="couponCode" name="mercadopago_custom[coupon_code]" autocomplete="off" maxlength="24" placeholder="<?= __('Enter your coupon', 'woocommerce-mercadopago') ?>" />
53
+ </div>
54
 
55
+ <div class="mp-col-md-3">
56
+ <input type="button" class="mp-button mp-pointer" id="applyCoupon" value="<?= esc_html__('Apply', 'woocommerce-mercadopago'); ?>">
57
+ </div>
58
+ <div class="mp-discount mp-col-md-9 mp-pr-15" id="mpCouponApplyed"></div>
59
+ <span class="mp-error" id="mpCouponError"><?= __('The code you entered is incorrect', 'woocommerce-mercadopago') ?></span>
60
  </div>
61
  </div>
 
 
 
62
  </div>
63
+ <?php endif; ?>
64
 
65
  <div class="mp-col-md-12">
66
  <div class="frame-tarjetas">
67
+ <!-- Title enter your card details -->
68
  <p class="mp-subtitle-custom-checkout"><?= __('Enter your card details', 'woocommerce-mercadopago') ?></p>
69
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  <div id="mercadopago-form">
71
+ <!-- Input Card number -->
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="maskDate(this, mcc);" 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">
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" />
86
 
87
+ <span class="mp-error mp-mt-5" id="mp-error-221" data-main="#mp-card-holder-name"><?= esc_html__('Invalid Card Number', 'woocommerce-mercadopago'); ?></span>
88
+ <span class="mp-error mp-mt-5" id="mp-error-E301" data-main="#mp-card-holder-name"><?= esc_html__('Invalid Card Number', 'woocommerce-mercadopago'); ?></span>
89
  </div>
90
  </div>
91
 
92
  <div class="mp-row-checkout mp-pt-10">
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="maskDate(this, mdate);" onblur="validateMonthYear()" 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
+ <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__('Last 3 numbers on the back', 'woocommerce-mercadopago'); ?> <em>*</em></label>
107
+ <input type="text" onkeyup="maskDate(this, minteger);" class="mp-form-control mp-mt-5" id="mp-security-code" data-checkout="securityCode" autocomplete="off" maxlength="4" />
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>
 
111
  </div>
112
  </div>
113
 
114
  <div class="mp-col-md-12">
115
  <div class="frame-tarjetas">
116
+ <!-- Title installments -->
117
+ <p class="mp-subtitle-custom-checkout"><?= __('In how many installments do you want to pay', 'woocommerce-mercadopago') ?></p>
118
 
119
+ <!-- Select issuer -->
120
  <div class="mp-row-checkout mp-pt-10">
121
+ <div id="mp-issuer-div" class="mp-col-md-4 mp-pr-15">
122
  <div class="mp-issuer">
123
+ <label for="mp-issuer" class="mp-label-form"><?= esc_html__('Issuer', 'woocommerce-mercadopago'); ?> </label>
124
+ <select class="mp-form-control mp-pointer mp-mt-5" id="mp-issuer" data-checkout="issuer" name="mercadopago_custom[issuer]"></select>
125
  </div>
126
  </div>
127
 
128
+ <!-- Select installments -->
129
+ <div id="installments-div" class="mp-col-md-12">
130
  <?php if ($currency_ratio != 1) : ?>
131
  <label for="installments" class="mp-label-form">
132
  <div class="mp-tooltip">
142
  <em>*</em>
143
  </label>
144
  <?php else : ?>
145
+ <label for="mp-installments" class="mp-label-form"><?= __('Select the number of installment', 'woocommerce-mercadopago') ?></label>
146
  <?php endif; ?>
147
 
148
+ <select class="mp-form-control mp-pointer mp-mt-5" id="mp-installments" data-checkout="installments" name="mercadopago_custom[installments]"></select>
149
 
150
  <div id="mp-box-input-tax-cft">
151
  <div id="mp-box-input-tax-tea">
160
 
161
  <div id="mp-doc-div" class="mp-col-md-12 mp-doc">
162
  <div class="frame-tarjetas">
163
+ <!-- Title document -->
164
  <p class="mp-subtitle-custom-checkout"><?= __('Enter your document number', 'woocommerce-mercadopago') ?></p>
165
 
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 mp-pt-5"><?= esc_html__('Type', 'woocommerce-mercadopago'); ?></label>
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-5" id="docNumber" data-checkout="docNumber" autocomplete="off" />
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>
180
  </div>
181
  </div>
182
  </div>
184
 
185
  <div class="mp-col-md-12 mp-pt-10">
186
  <div class="frame-tarjetas">
187
+ <div class="mp-row-checkout">
188
+ <p class="mp-obrigatory">
189
+ <em>*</em> <?= esc_html__('Obligatory field', 'woocommerce-mercadopago'); ?>
190
+ </p>
 
 
191
  </div>
192
  </div>
193
  </div>
194
  </div>
 
195
 
196
  <!-- NOT DELETE LOADING-->
197
  <div id="mp-box-loading"></div>
200
  </div>
201
 
202
  <div id="mercadopago-utilities">
203
+ <input type="hidden" id="mp-amount" value='<?php echo $amount; ?>' name="mercadopago_custom[amount]" />
 
204
  <input type="hidden" id="currency_ratio" value='<?php echo $currency_ratio; ?>' name="mercadopago_custom[currency_ratio]" />
205
  <input type="hidden" id="campaign_id" name="mercadopago_custom[campaign_id]" />
206
  <input type="hidden" id="campaign" name="mercadopago_custom[campaign]" />
207
+ <input type="hidden" id="mp-discount" name="mercadopago_custom[discount]" />
208
  <input type="hidden" id="paymentMethodId" name="mercadopago_custom[paymentMethodId]" />
209
  <input type="hidden" id="token" name="mercadopago_custom[token]" />
 
 
 
210
  </div>
211
 
212
  </div>
213
  </div>
214
 
215
  <script type="text/javascript">
216
+ function execmascara() {
217
+ v_obj.value = v_fun(v_obj.value)
218
+ }
 
 
 
 
 
 
 
 
219
 
220
+ //Card mask date input
221
  function maskDate(o, f) {
222
  v_obj = o
223
  v_fun = f
224
+ setTimeout("execmascara()", 1);
225
  }
226
 
227
+ function mcc(value) {
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");
231
+ value = value.replace(/^(\d{4})\s(\d{4})\s(\d{4})(\d)/g, "$1 $2 $3 $4");
232
+ return value;
233
  }
234
 
235
  function mdate(v) {
239
  return v;
240
  }
241
 
242
+ // Explode date to month and year
 
 
 
 
 
 
 
 
 
 
 
 
243
  function validateMonthYear() {
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 minteger(v) {
250
+ return v.replace(/\D/g, "")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
251
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
252
  </script>
templates/checkout/pse_checkout.php DELETED
File without changes
templates/checkout/ticket_checkout.php CHANGED
@@ -7,7 +7,9 @@ if (!defined('ABSPATH')) {
7
  <div class="mp-panel-custom-checkout">
8
  <div class="mp-row-checkout">
9
 
10
- <div id="mercadopago-form-coupon-ticket" class="mp-col-md-12">
 
 
11
  <div class="frame-tarjetas mp-text-justify">
12
  <p class="mp-subtitle-ticket-checkout"><?=__('Enter your discount coupon', 'woocommerce-mercadopago')?></p>
13
 
@@ -19,80 +21,82 @@ if (!defined('ABSPATH')) {
19
  <div class="mp-col-md-3">
20
  <input type="button" class="mp-button mp-pointer" id="applyCouponTicket" value="<?= esc_html__('Apply', 'woocommerce-mercadopago'); ?>">
21
  </div>
 
 
22
  </div>
23
-
24
- <span class="mp-discount" id="mpCouponApplyedTicket"></span>
25
- <span class="mp-erro_febraban" id="mpCouponErrorTicket"><?=__('The code you entered is incorrect', 'woocommerce-mercadopago')?></span>
26
  </div>
27
  </div>
 
28
 
29
  <div class="mp-col-md-12">
30
  <div class="frame-tarjetas">
31
  <div id="mercadopago-form-ticket">
32
 
 
33
  <div id="form-ticket">
34
  <div class="mp-row-checkout">
35
  <div class="mp-col-md-6">
36
- <label for="MPv1Ticket-docType-fisica" class="mp-label-form-check mp-pointer">
37
- <input type="radio" name="mercadopago_ticket[docType]" class="mp-form-control-check" id="MPv1Ticket-docType-fisica" value="CPF" checked="checked" />
38
  <?= esc_html__('Physical person', 'woocommerce-mercadopago'); ?>
39
  </label>
40
  </div>
41
 
42
  <div class="mp-col-md-6">
43
- <label for="MPv1Ticket-docType-juridica" class="mp-label-form-check mp-pointer">
44
- <input type="radio" name="mercadopago_ticket[docType]" class="mp-form-control-check" id="MPv1Ticket-docType-juridica" value="CNPJ">
45
  <?= esc_html__('Legal person', 'woocommerce-mercadopago'); ?>
46
  </label>
47
  </div>
48
  </div>
49
 
50
  <div class="mp-row-checkout mp-pt-10">
51
- <div class="mp-col-md-4 mp-pr-15" id="box-firstname">
52
- <label for="firstname" class="mp-label-form title-name"><?= esc_html__('Name', 'woocommerce-mercadopago'); ?> <em>*</em></label>
53
- <label for="firstname" class="title-razao-social mp-label-form"><?= esc_html__('Social reason', 'woocommerce-mercadopago'); ?> <em>*</em></label>
54
- <input type="text" class="mp-form-control" value="<?= $febraban['firstname']; ?>" id="firstname" name="mercadopago_ticket[firstname]">
55
- <span class="mp-erro_febraban" data-main="#firstname" id="error_firstname"><?= esc_html__('You must inform your name', 'woocommerce-mercadopago'); ?></span>
56
  </div>
57
 
58
- <div class="mp-col-md-4 mp-pr-15" id="box-lastname">
59
- <label for="lastname" class="mp-label-form title-name mp-mt-03rem"><?= esc_html__('Surname', 'woocommerce-mercadopago'); ?> <em>*</em></label>
60
- <input type="text" class="mp-form-control" value="<?= $febraban['lastname']; ?>" id="lastname" name="mercadopago_ticket[lastname]">
61
- <span class="mp-erro_febraban" data-main="#lastname" id="error_lastname"><?= esc_html__('You must inform your last name', 'woocommerce-mercadopago'); ?></span>
62
  </div>
63
 
64
  <div class="mp-col-md-4" id="box-docnumber">
65
- <label for="cpfcnpj" class="mp-label-form title-cpf"><?= esc_html__('CPF', 'woocommerce-mercadopago'); ?> <em>*</em></label>
66
- <label for="cpfcnpj" class="title-cnpj mp-label-form"><?= esc_html__('CNPJ', 'woocommerce-mercadopago'); ?><em>*</em></label>
67
- <input type="text" value="<?= $febraban['docNumber']; ?>" id="cpfcnpj" class="mp-form-control" name="mercadopago_ticket[docNumber]" maxlength="14">
68
- <span class="mp-erro_febraban" data-main="#cpfcnpj" id="error_docNumber"><?= esc_html__('You must provide your document number', 'woocommerce-mercadopago'); ?></span>
 
69
  </div>
70
  </div>
71
 
72
  <div class="mp-row-checkout mp-pt-10">
73
  <div class="mp-col-md-8 mp-pr-15" id="box-firstname">
74
  <label for="address" class="mp-label-form"><?= esc_html__('Address', 'woocommerce-mercadopago'); ?> <em>*</em></label>
75
- <input type="text" value="<?= $febraban['address']; ?>" id="address" class="mp-form-control" name="mercadopago_ticket[address]">
76
- <span class="mp-erro_febraban" data-main="#address" id="error_address"><?= esc_html__('You must inform your address', 'woocommerce-mercadopago'); ?></span>
77
  </div>
78
 
79
- <div class="mp-col-md-4" id="box-lastname">
80
  <label for="number" class="mp-label-form"><?= esc_html__('Number', 'woocommerce-mercadopago'); ?> <em>*</em></label>
81
- <input type="text" value="<?= $febraban['number']; ?>" id="number" class="mp-form-control" name="mercadopago_ticket[number]">
82
- <span class="mp-erro_febraban" data-main="#number" id="error_number"><?= esc_html__('You must provide your address number', 'woocommerce-mercadopago'); ?></span>
83
  </div>
84
  </div>
85
 
86
  <div class="mp-row-checkout mp-pt-10">
87
  <div class="mp-col-md-4 mp-pr-15">
88
  <label for="city" class="mp-label-form"><?= esc_html__('City', 'woocommerce-mercadopago'); ?> <em>*</em></label>
89
- <input type="text" value="<?= $febraban['city']; ?>" id="city" class="mp-form-control" name="mercadopago_ticket[city]">
90
- <span class="mp-erro_febraban" data-main="#city" id="error_city"><?= esc_html__('You must inform your city', 'woocommerce-mercadopago'); ?></span>
91
  </div>
92
 
93
  <div class="mp-col-md-4 mp-pr-15">
94
  <label for="state" class="mp-label-form"><?= esc_html__('State', 'woocommerce-mercadopago'); ?> <em>*</em></label>
95
- <select name="mercadopago_ticket[state]" id="state" class="mp-form-control mp-pointer">
96
  <option value="" <?php if ($febraban['state'] == '') { echo 'selected="selected"'; } ?>>
97
  <?= esc_html__('Select state"', 'woocommerce-mercadopago'); ?>
98
  </option>
@@ -124,13 +128,13 @@ if (!defined('ABSPATH')) {
124
  <option value="SE" <?php if ($febraban['state'] == 'SE') { echo 'selected="selected"'; } ?>>Sergipe</option>
125
  <option value="TO" <?php if ($febraban['state'] == 'TO') { echo 'selected="selected"'; } ?>>Tocantins</option>
126
  </select>
127
- <span class="mp-erro_febraban" data-main="#state" id="error_state"><?php echo esc_html__('You must inform your status', 'woocommerce-mercadopago'); ?></span>
128
  </div>
129
 
130
  <div class="mp-col-md-4">
131
  <label for="zipcode" class="mp-label-form"><?= esc_html__('Postal Code', 'woocommerce-mercadopago'); ?> <em>*</em></label>
132
- <input type="text" value="<?= $febraban['zipcode']; ?>" id="zipcode" class="mp-form-control" name="mercadopago_ticket[zipcode]">
133
- <span class="mp-erro_febraban" data-main="#zipcode" id="error_zipcode"><?= esc_html__('You must provide your zip code', 'woocommerce-mercadopago'); ?></span>
134
  </div>
135
  </div>
136
 
@@ -142,28 +146,29 @@ if (!defined('ABSPATH')) {
142
  </div>
143
  </div>
144
  </div>
145
-
146
- <div class="mp-col-md-12 <?= $site_id == 'MLB' ? 'mp-pt-20' : ''; ?>">
147
- <div class="frame-tarjetas">
148
- <p class="mp-subtitle-ticket-checkout"><?=__('Select the issuer with whom you want to process the payment', 'woocommerce-mercadopago')?></p>
149
-
150
- <div class="mp-row-checkout mp-pt-10">
151
- <?php $atFirst = true; ?>
152
- <?php foreach ($payment_methods as $payment) : ?>
153
- <div id="frameTicket" class="mp-col-md-6 mp-pb-15 mp-min-hg">
154
- <div id="paymentMethodIdTicket" class="mp-ticket-payments">
155
- <label for="<?= $payment['id']; ?>" class="mp-label-form mp-pointer">
156
- <input type="radio" class="mp-form-control-check" name="mercadopago_ticket[paymentMethodId]" id="<?= $payment['id'] ?>" value="<?= $payment['id']; ?>" <?php if ($atFirst) : ?> checked="checked" <?php endif; ?> />
157
- <img src="<?= $payment['secure_thumbnail'] ?>" class="mp-img-ticket" alt="<?php echo $payment['name']; ?>" />
158
- <span class="mp-ticket-name"><?= $payment['name'] ?></span>
159
- </label>
160
- </div>
161
- <?php $atFirst = false; ?>
162
  </div>
163
- <?php endforeach; ?>
164
- </div>
 
165
  </div>
166
  </div>
 
167
  </div>
168
  </div>
169
  </div>
@@ -184,27 +189,42 @@ if (!defined('ABSPATH')) {
184
  </div>
185
  </div>
186
 
187
- <script type="text/javascript" src="<?php echo $path_to_javascript; ?>"></script>
188
  <script type="text/javascript">
189
- MPv1Ticket.text.apply = "<?php echo __('Apply', 'woocommerce-mercadopago'); ?>";
190
- MPv1Ticket.text.remove = "<?php echo __('Remove', 'woocommerce-mercadopago'); ?>";
191
- MPv1Ticket.text.coupon_empty = "<?php echo __('Please, inform your coupon code', 'woocommerce-mercadopago'); ?>";
192
- MPv1Ticket.text.choose = "<?php echo __('To choose', 'woocommerce-mercadopago'); ?>";
193
- MPv1Ticket.text.other_bank = "<?php echo __('Other bank', 'woocommerce-mercadopago'); ?>";
194
- MPv1Ticket.text.discount_info1 = "<?php echo __('You will save', 'woocommerce-mercadopago'); ?>";
195
- MPv1Ticket.text.discount_info2 = "<?php echo __('with discount of', 'woocommerce-mercadopago'); ?>";
196
- MPv1Ticket.text.discount_info3 = "<?php echo __('Total of your purchase:', 'woocommerce-mercadopago'); ?>";
197
- MPv1Ticket.text.discount_info4 = "<?php echo __('Total of your purchase with discount:', 'woocommerce-mercadopago'); ?>";
198
- MPv1Ticket.text.discount_info5 = "<?php echo __('*After payment approval', 'woocommerce-mercadopago'); ?>";
199
- MPv1Ticket.text.discount_info6 = "<?php echo __('Terms and conditions of use', 'woocommerce-mercadopago'); ?>";
200
- MPv1Ticket.paths.loading = "<?php echo ($images_path . 'loading.gif'); ?>";
201
- MPv1Ticket.paths.check = "<?php echo ($images_path . 'check.png'); ?>";
202
- MPv1Ticket.paths.error = "<?php echo ($images_path . 'error.png'); ?>";
203
-
204
- MPv1Ticket.Initialize(
205
- "<?php echo $site_id; ?>",
206
- "<?php echo $coupon_mode; ?>" == "yes",
207
- "<?php echo $discount_action_url; ?>",
208
- "<?php echo $payer_email; ?>"
209
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
  </script>
7
  <div class="mp-panel-custom-checkout">
8
  <div class="mp-row-checkout">
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
 
21
  <div class="mp-col-md-3">
22
  <input type="button" class="mp-button mp-pointer" id="applyCouponTicket" value="<?= esc_html__('Apply', 'woocommerce-mercadopago'); ?>">
23
  </div>
24
+ <div class="mp-discount mp-col-md-9 mp-pr-15" id="mpCouponApplyedTicket"></div>
25
+ <span class="mp-erro_febraban" id="mpCouponErrorTicket"><?=__('The code you entered is incorrect', 'woocommerce-mercadopago')?></span>
26
  </div>
 
 
 
27
  </div>
28
  </div>
29
+ <?php endif; ?>
30
 
31
  <div class="mp-col-md-12">
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">
38
  <div class="mp-col-md-6">
39
+ <label for="mp_cpf_doc_type" class="mp-label-form-check mp-pointer">
40
+ <input type="radio" name="mercadopago_ticket[docType]" class="mp-form-control-check" id="mp_cpf_doc_type" value="CPF" checked="checked" />
41
  <?= esc_html__('Physical person', 'woocommerce-mercadopago'); ?>
42
  </label>
43
  </div>
44
 
45
  <div class="mp-col-md-6">
46
+ <label for="mp_cnpj_doc_type" class="mp-label-form-check mp-pointer">
47
+ <input type="radio" name="mercadopago_ticket[docType]" class="mp-form-control-check" id="mp_cnpj_doc_type" value="CNPJ">
48
  <?= esc_html__('Legal person', 'woocommerce-mercadopago'); ?>
49
  </label>
50
  </div>
51
  </div>
52
 
53
  <div class="mp-row-checkout mp-pt-10">
54
+ <div class="mp-col-md-4 mp-pr-15" id="mp_box_firstname">
55
+ <label for="firstname" id="mp_firstname_label" class="mp-label-form title-name"><?= esc_html__('Name', 'woocommerce-mercadopago'); ?> <em>*</em></label>
56
+ <label for="firstname" id="mp_socialname_label" class="title-razao-social mp-label-form"><?= esc_html__('Social reason', 'woocommerce-mercadopago'); ?> <em>*</em></label>
57
+ <input type="text" class="mp-form-control" value="<?= $febraban['firstname']; ?>" id="mp_firstname" data-checkout="mp_firstname" name="mercadopago_ticket[firstname]">
58
+ <span class="mp-erro_febraban" data-main="#mp_firstname" id="error_firstname"><?= esc_html__('You must inform your name', 'woocommerce-mercadopago'); ?></span>
59
  </div>
60
 
61
+ <div class="mp-col-md-4 mp-pr-15" id="mp_box_lastname">
62
+ <label for="lastname" class="mp-label-form title-name"><?= esc_html__('Surname', 'woocommerce-mercadopago'); ?> <em>*</em></label>
63
+ <input type="text" class="mp-form-control" value="<?= $febraban['lastname']; ?>" id="mp_lastname" data-checkout="mp_lastname" name="mercadopago_ticket[lastname]">
64
+ <span class="mp-erro_febraban" data-main="#mp_lastname" id="error_lastname"><?= esc_html__('You must inform your last name', 'woocommerce-mercadopago'); ?></span>
65
  </div>
66
 
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="maskinput(this, mcpf);" maxlength="14">
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__('The document must be valid', 'woocommerce-mercadopago'); ?></span>
73
  </div>
74
  </div>
75
 
76
  <div class="mp-row-checkout mp-pt-10">
77
  <div class="mp-col-md-8 mp-pr-15" id="box-firstname">
78
  <label for="address" class="mp-label-form"><?= esc_html__('Address', 'woocommerce-mercadopago'); ?> <em>*</em></label>
79
+ <input type="text" value="<?= $febraban['address']; ?>" class="mp-form-control" id="mp_address" data-checkout="mp_address" name="mercadopago_ticket[address]">
80
+ <span class="mp-erro_febraban" data-main="#mp_address" id="error_address"><?= esc_html__('You must inform your address', 'woocommerce-mercadopago'); ?></span>
81
  </div>
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="maskinput(this, minteger);">
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>
89
 
90
  <div class="mp-row-checkout mp-pt-10">
91
  <div class="mp-col-md-4 mp-pr-15">
92
  <label for="city" class="mp-label-form"><?= esc_html__('City', 'woocommerce-mercadopago'); ?> <em>*</em></label>
93
+ <input type="text" value="<?= $febraban['city']; ?>" class="mp-form-control" id="mp_city" data-checkout="mp_city" name="mercadopago_ticket[city]">
94
+ <span class="mp-erro_febraban" data-main="#mp_city" id="error_city"><?= esc_html__('You must inform your city', 'woocommerce-mercadopago'); ?></span>
95
  </div>
96
 
97
  <div class="mp-col-md-4 mp-pr-15">
98
  <label for="state" class="mp-label-form"><?= esc_html__('State', 'woocommerce-mercadopago'); ?> <em>*</em></label>
99
+ <select name="mercadopago_ticket[state]" id="mp_state" data-checkout="mp_state" class="mp-form-control mp-pointer">
100
  <option value="" <?php if ($febraban['state'] == '') { echo 'selected="selected"'; } ?>>
101
  <?= esc_html__('Select state"', 'woocommerce-mercadopago'); ?>
102
  </option>
128
  <option value="SE" <?php if ($febraban['state'] == 'SE') { echo 'selected="selected"'; } ?>>Sergipe</option>
129
  <option value="TO" <?php if ($febraban['state'] == 'TO') { echo 'selected="selected"'; } ?>>Tocantins</option>
130
  </select>
131
+ <span class="mp-erro_febraban" data-main="#mp_state" id="error_state"><?php echo esc_html__('You must inform your status', 'woocommerce-mercadopago'); ?></span>
132
  </div>
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="maskinput(this, mcep);">
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>
140
 
146
  </div>
147
  </div>
148
  </div>
149
+ <?php endif; ?>
150
+
151
+ <div class="mp-col-md-12 <?= ($site_id == 'MLB') ? 'mp-pt-20' : ''; ?>">
152
+ <div class="frame-tarjetas">
153
+ <p class="mp-subtitle-ticket-checkout"><?=__('Select the issuer with whom you want to process the payment', 'woocommerce-mercadopago')?></p>
154
+
155
+ <div class="mp-row-checkout mp-pt-10">
156
+ <?php $atFirst = true; ?>
157
+ <?php foreach ($payment_methods as $payment) : ?>
158
+ <div id="frameTicket" class="mp-col-md-6 mp-pb-15 mp-min-hg">
159
+ <div id="paymentMethodIdTicket" class="mp-ticket-payments">
160
+ <label for="<?= $payment['id']; ?>" class="mp-label-form mp-pointer">
161
+ <input type="radio" class="mp-form-control-check" name="mercadopago_ticket[paymentMethodId]" id="<?= $payment['id'] ?>" value="<?= $payment['id']; ?>" <?php if ($atFirst) : ?> checked="checked" <?php endif; ?> />
162
+ <img src="<?= $payment['secure_thumbnail'] ?>" class="mp-img-ticket" alt="<?= $payment['name']; ?>" />
163
+ <span class="mp-ticket-name"><?= $payment['name'] ?></span>
164
+ </label>
 
165
  </div>
166
+ <?php $atFirst = false; ?>
167
+ </div>
168
+ <?php endforeach; ?>
169
  </div>
170
  </div>
171
+ </div>
172
  </div>
173
  </div>
174
  </div>
189
  </div>
190
  </div>
191
 
 
192
  <script type="text/javascript">
193
+ //Card mask date input
194
+ function maskinput(o, f) {
195
+ v_obj = o
196
+ v_fun = f
197
+ setTimeout("execmascara()", 1);
198
+ }
199
+
200
+ function execmascara() {
201
+ v_obj.value = v_fun(v_obj.value)
202
+ }
203
+
204
+ function minteger(v) {
205
+ return v.replace(/\D/g, "")
206
+ }
207
+
208
+ function mcpf(v){
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 mcnpj(v){
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 mcep(v){
226
+ v=v.replace(/D/g,"")
227
+ v=v.replace(/^(\d{5})(\d)/,"$1-$2")
228
+ return v
229
+ }
230
  </script>
woocommerce-mercadopago.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  /**
3
- * Plugin Name: WooCommerce Mercado Pago
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.0.8
7
  * Author: Mercado Pago
8
  * Author URI: https://www.mercadopago.com.br/developers/
9
  * Text Domain: woocommerce-mercadopago
@@ -53,7 +53,9 @@ add_action( 'plugins_loaded', 'woocommerce_mercadopago_load_plugin_textdomain' )
53
  */
54
  function wc_mercado_pago_unsupported_php_version_notice()
55
  {
56
- echo '<div class="error"><p>' . esc_html__('WooCommerce Mercado Pago requires PHP version 5.6 or later. Please update your PHP version.', 'woocommerce-mercadopago') . '</p></div>';
 
 
57
  }
58
 
59
  // Check for PHP version and throw notice.
@@ -62,6 +64,41 @@ if (version_compare(PHP_VERSION, '5.6', '<=')) {
62
  return;
63
  }
64
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  /**
66
  * Summary: Places a warning error to notify user that other older versions are active.
67
  * Description: Places a warning error to notify user that other older versions are active.
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.1.0
7
  * Author: Mercado Pago
8
  * Author URI: https://www.mercadopago.com.br/developers/
9
  * Text Domain: woocommerce-mercadopago
53
  */
54
  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 WC_WooMercadoPago_Configs::getAlertFrame($message, $type);
59
  }
60
 
61
  // Check for PHP version and throw notice.
64
  return;
65
  }
66
 
67
+ /**
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 WC_WooMercadoPago_Configs::getAlertFrame($message, $type);
75
+ }
76
+
77
+ if (!in_array('curl', get_loaded_extensions())) {
78
+ add_action('admin_notices', 'wc_mercado_pago_notify_curl_error');
79
+ return;
80
+ }
81
+
82
+ /**
83
+ * Summary: Places a warning error to notify user that WooCommerce is missing.
84
+ * Description: Places a warning error to notify user that WooCommerce is missing.
85
+ */
86
+ function notify_woocommerce_miss()
87
+ {
88
+ $type = 'error';
89
+ $message = sprintf(
90
+ __('The payment module of Woo Mercado depends on the latest version of %s to run!', 'woocommerce-mercadopago'),
91
+ ' <a href="https://wordpress.org/extend/plugins/woocommerce/">WooCommerce</a>'
92
+ );
93
+ echo WC_WooMercadoPago_Configs::getAlertFrame($message, $type);
94
+ }
95
+
96
+ $all_plugins = apply_filters('active_plugins', get_option('active_plugins'));
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.