WooCommerce MercadoPago - Version 4.0.7

Version Description

Download this release

Release Info

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

Code changes from version 4.0.6 to 4.0.7

Files changed (42) hide show
  1. assets/css/basic_checkout_mercadopago.css +16 -8
  2. assets/css/config_mercadopago.css +9 -9
  3. assets/js/basic_config_mercadopago.js +6 -6
  4. assets/js/ticket_config_mercadopago.js +4 -4
  5. i18n/languages/woocommerce-mercadopago-es_AR.mo +0 -0
  6. i18n/languages/woocommerce-mercadopago-es_AR.po +6 -10
  7. i18n/languages/woocommerce-mercadopago-es_CL.mo +0 -0
  8. i18n/languages/woocommerce-mercadopago-es_CL.po +6 -10
  9. i18n/languages/woocommerce-mercadopago-es_CO.mo +0 -0
  10. i18n/languages/woocommerce-mercadopago-es_CO.po +6 -10
  11. i18n/languages/woocommerce-mercadopago-es_ES.mo +0 -0
  12. i18n/languages/woocommerce-mercadopago-es_ES.po +6 -10
  13. i18n/languages/woocommerce-mercadopago-es_MX.mo +0 -0
  14. i18n/languages/woocommerce-mercadopago-es_MX.po +6 -10
  15. i18n/languages/woocommerce-mercadopago-es_PE.mo +0 -0
  16. i18n/languages/woocommerce-mercadopago-es_PE.po +6 -10
  17. i18n/languages/woocommerce-mercadopago-es_UY.mo +0 -0
  18. i18n/languages/woocommerce-mercadopago-es_UY.po +6 -10
  19. i18n/languages/woocommerce-mercadopago-es_VE.mo +0 -0
  20. i18n/languages/woocommerce-mercadopago-es_VE.po +6 -10
  21. i18n/languages/woocommerce-mercadopago-pt_BR.mo +0 -0
  22. i18n/languages/woocommerce-mercadopago-pt_BR.po +5 -9
  23. i18n/languages/woocommerce-mercadopago.pot +2 -2
  24. includes/module/WC_WooMercadoPago_Configs.php +6 -4
  25. includes/module/WC_WooMercadoPago_Module.php +13 -17
  26. includes/module/config/WC_WooMercadoPago_Constants.php +17 -0
  27. includes/module/preference/WC_WooMercadoPago_PreferenceAbstract.php +34 -1
  28. includes/module/preference/WC_WooMercadoPago_PreferenceBasic.php +18 -0
  29. includes/module/preference/WC_WooMercadoPago_PreferenceCustom.php +17 -1
  30. includes/module/preference/WC_WooMercadoPago_PreferenceTicket.php +21 -2
  31. includes/module/sdk/lib/MP.php +34 -38
  32. includes/module/sdk/lib/RestClient/AbstractRestClient.php +19 -32
  33. includes/module/sdk/lib/RestClient/MpRestClient.php +8 -14
  34. includes/payments/WC_WooMercadoPago_BasicGateway.php +1 -1
  35. includes/payments/WC_WooMercadoPago_CustomGateway.php +1 -1
  36. includes/payments/WC_WooMercadoPago_PaymentAbstract.php +26 -22
  37. includes/payments/WC_WooMercadoPago_TicketGateway.php +2 -2
  38. includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php +11 -28
  39. readme.txt +13 -2
  40. templates/checkout/custom_checkout.php +87 -216
  41. templates/checkout/ticket_checkout.php +4 -2
  42. woocommerce-mercadopago.php +1 -1
assets/css/basic_checkout_mercadopago.css CHANGED
@@ -6,7 +6,6 @@
6
  padding-top: 5px !important;
7
  }
8
 
9
-
10
  .mp-pt-15 {
11
  padding-top: 15px !important;
12
  }
@@ -51,6 +50,14 @@
51
  margin-top: 5px !important;
52
  }
53
 
 
 
 
 
 
 
 
 
54
  .mp-mb-0 {
55
  margin-bottom: 0px !important;
56
  }
@@ -257,7 +264,7 @@
257
 
258
  .mp-panel-custom-checkout {
259
  background-color: #fff;
260
- padding: 10px 15px 0px;
261
  }
262
 
263
  .mp-subtitle-custom-checkout {
@@ -270,7 +277,7 @@
270
  }
271
 
272
  .mp-subtitle-ticket-checkout {
273
- font-size: 17px !important;
274
  font-family: sans-serif !important;
275
  color: #04204c;
276
  font-weight: 600;
@@ -282,12 +289,13 @@
282
  .mp-form-control {
283
  font-family: sans-serif !important;
284
  width: 100%;
285
- height: 40px;
286
  border-radius: 5px !important;
287
  font-size: 13px !important;
288
  padding: 0 10px !important;
289
  background-color: #fff !important;
290
  border: 1px solid #d1d1d1 !important;
 
291
  }
292
 
293
  .mp-form-control-error {
@@ -295,7 +303,7 @@
295
  }
296
 
297
  .mp-form-control-check {
298
- margin: 5px 10px 0 0 !important;
299
  font-family: sans-serif !important;
300
  border-radius: 5px !important;
301
  font-size: 13px !important;
@@ -361,13 +369,13 @@
361
 
362
  .mp-label-form {
363
  font-family: sans-serif !important;
364
- font-size: 14px !important;
365
  font-weight: normal !important;
366
  font-style: normal;
367
  font-stretch: normal;
368
  line-height: 1;
369
  letter-spacing: normal;
370
- color: rgba(0, 0, 0, 0.45) !important;
371
  }
372
 
373
  .mp-label-form em {
@@ -473,7 +481,7 @@
473
  }
474
 
475
  .mp-subtitle-ticket-checkout {
476
- font-size: 17px !important;
477
  font-family: sans-serif !important;
478
  color: #04204c;
479
  font-weight: 600;
6
  padding-top: 5px !important;
7
  }
8
 
 
9
  .mp-pt-15 {
10
  padding-top: 15px !important;
11
  }
50
  margin-top: 5px !important;
51
  }
52
 
53
+ .mp-mt-03rem{
54
+ margin-top: 0.3rem !important;
55
+ }
56
+
57
+ .mp-mt-06rem{
58
+ margin-top: 0.6rem !important;
59
+ }
60
+
61
  .mp-mb-0 {
62
  margin-bottom: 0px !important;
63
  }
264
 
265
  .mp-panel-custom-checkout {
266
  background-color: #fff;
267
+ padding: 20px 15px 0px;
268
  }
269
 
270
  .mp-subtitle-custom-checkout {
277
  }
278
 
279
  .mp-subtitle-ticket-checkout {
280
+ font-size: 16px !important;
281
  font-family: sans-serif !important;
282
  color: #04204c;
283
  font-weight: 600;
289
  .mp-form-control {
290
  font-family: sans-serif !important;
291
  width: 100%;
292
+ height: 40px !important;
293
  border-radius: 5px !important;
294
  font-size: 13px !important;
295
  padding: 0 10px !important;
296
  background-color: #fff !important;
297
  border: 1px solid #d1d1d1 !important;
298
+ margin-bottom: 0 !important;
299
  }
300
 
301
  .mp-form-control-error {
303
  }
304
 
305
  .mp-form-control-check {
306
+ margin: 0px 10px 0 0 !important;
307
  font-family: sans-serif !important;
308
  border-radius: 5px !important;
309
  font-size: 13px !important;
369
 
370
  .mp-label-form {
371
  font-family: sans-serif !important;
372
+ font-size: 13px !important;
373
  font-weight: normal !important;
374
  font-style: normal;
375
  font-stretch: normal;
376
  line-height: 1;
377
  letter-spacing: normal;
378
+ color: rgba(0, 0, 0, 0.7) !important;
379
  }
380
 
381
  .mp-label-form em {
481
  }
482
 
483
  .mp-subtitle-ticket-checkout {
484
+ font-size: 16px !important;
485
  font-family: sans-serif !important;
486
  color: #04204c;
487
  font-weight: 600;
assets/css/config_mercadopago.css CHANGED
@@ -1,4 +1,4 @@
1
- .px-20 {
2
  padding-left: 20px !important;
3
  padding-right: 20px !important;
4
  }
@@ -7,7 +7,7 @@
7
  padding-top: 10px !important;
8
  }
9
 
10
- .pb-10 {
11
  padding-bottom: 10px !important;
12
  }
13
 
@@ -15,7 +15,7 @@
15
  padding-bottom: 20px !important;
16
  }
17
 
18
- .mt--10 {
19
  margin-top: -10px !important;
20
  }
21
 
@@ -27,11 +27,11 @@
27
  margin-bottom: 0px !important;
28
  }
29
 
30
- .mg-0 {
31
  margin: 0px !important;
32
  }
33
 
34
- .fw-400 {
35
  font-weight: 400 !important;
36
  }
37
 
@@ -39,7 +39,7 @@
39
  text-align: center !important;
40
  }
41
 
42
- .row {
43
  width: 100%;
44
  display: inline-block;
45
  }
@@ -60,7 +60,7 @@
60
  float: left;
61
  }
62
 
63
- .mouse_pointe {
64
  cursor: pointer;
65
  }
66
 
@@ -75,7 +75,7 @@
75
  color: #555555 !important;
76
  }
77
 
78
- #input_payments {
79
  border: 1px solid #ccc;
80
  padding: 15px;
81
  width: 365px;
@@ -84,7 +84,7 @@
84
  margin-bottom: 37px !important;
85
  }
86
 
87
- #input_payments_mt {
88
  border: 1px solid #ccc;
89
  padding: 15px;
90
  width: 365px;
1
+ .mp-px-20 {
2
  padding-left: 20px !important;
3
  padding-right: 20px !important;
4
  }
7
  padding-top: 10px !important;
8
  }
9
 
10
+ .mp-pb-10 {
11
  padding-bottom: 10px !important;
12
  }
13
 
15
  padding-bottom: 20px !important;
16
  }
17
 
18
+ .mp-mt--10 {
19
  margin-top: -10px !important;
20
  }
21
 
27
  margin-bottom: 0px !important;
28
  }
29
 
30
+ .mp-mg-0 {
31
  margin: 0px !important;
32
  }
33
 
34
+ .mp-fw-400 {
35
  font-weight: 400 !important;
36
  }
37
 
39
  text-align: center !important;
40
  }
41
 
42
+ .mp-row {
43
  width: 100%;
44
  display: inline-block;
45
  }
60
  float: left;
61
  }
62
 
63
+ .mp-mouse_pointer {
64
  cursor: pointer;
65
  }
66
 
75
  color: #555555 !important;
76
  }
77
 
78
+ #mp_input_payments {
79
  border: 1px solid #ccc;
80
  padding: 15px;
81
  width: 365px;
84
  margin-bottom: 37px !important;
85
  }
86
 
87
+ #mp_input_payments_mt {
88
  border: 1px solid #ccc;
89
  padding: 15px;
90
  width: 365px;
assets/js/basic_config_mercadopago.js CHANGED
@@ -96,9 +96,9 @@ window.onload = function () {
96
 
97
  //payment methods
98
  var tablePayments = document.querySelector("#woocommerce_woo-mercado-pago-basic_checkout_payments_description").nextElementSibling.getAttribute('class');
99
- var input_payments = document.querySelectorAll('.' + tablePayments + ' td.forminp label');
100
- for (i = 0; i < input_payments.length; i++) {
101
- input_payments[i].id = "input_payments_mt";
102
  }
103
 
104
  //online payments
@@ -119,7 +119,7 @@ window.onload = function () {
119
  for (var ion = 0; ion < onlineInputs.length; ion++) {
120
  if (ion == 0) {
121
  var checkbox_online_prepend = "<div class='all_checkbox'>\
122
- <label for='checkmeon' id='input_payments'>\
123
  <input type='checkbox' name='checkmeon' id='checkmeon' "+ onlineChecked + " onclick='completeOnlineCheckbox()'>\
124
  "+ online_payment_translate + "\
125
  </label>\
@@ -147,7 +147,7 @@ window.onload = function () {
147
  for (var ideb = 0; ideb < debitInputs.length; ideb++) {
148
  if (ideb == 0) {
149
  var checkbox_debit_prepend = "<div class='all_checkbox'>\
150
- <label for='checkmedeb' id='input_payments'>\
151
  <input type='checkbox' name='checkmedeb' id='checkmedeb' "+ debitChecked + " onclick='completeDebitCheckbox()'>\
152
  "+ debit_payment_translate + "\
153
  </label>\
@@ -175,7 +175,7 @@ window.onload = function () {
175
  for (ioff = 0; ioff < offlineInputs.length; ioff++) {
176
  if (ioff == 0) {
177
  var checkbox_offline_prepend = "<div class='all_checkbox'>\
178
- <label for='checkmeoff' id='input_payments' style='margin-bottom: 37px !important;'>\
179
  <input type='checkbox' name='checkmeoff' id='checkmeoff' "+ offlineChecked + " onclick='completeOfflineCheckbox()'>\
180
  "+ offline_payment_translate + "\
181
  </label>\
96
 
97
  //payment methods
98
  var tablePayments = document.querySelector("#woocommerce_woo-mercado-pago-basic_checkout_payments_description").nextElementSibling.getAttribute('class');
99
+ var mp_input_payments = document.querySelectorAll('.' + tablePayments + ' td.forminp label');
100
+ for (i = 0; i < mp_input_payments.length; i++) {
101
+ mp_input_payments[i].id = "mp_input_payments_mt";
102
  }
103
 
104
  //online payments
119
  for (var ion = 0; ion < onlineInputs.length; ion++) {
120
  if (ion == 0) {
121
  var checkbox_online_prepend = "<div class='all_checkbox'>\
122
+ <label for='checkmeon' id='mp_input_payments'>\
123
  <input type='checkbox' name='checkmeon' id='checkmeon' "+ onlineChecked + " onclick='completeOnlineCheckbox()'>\
124
  "+ online_payment_translate + "\
125
  </label>\
147
  for (var ideb = 0; ideb < debitInputs.length; ideb++) {
148
  if (ideb == 0) {
149
  var checkbox_debit_prepend = "<div class='all_checkbox'>\
150
+ <label for='checkmedeb' id='mp_input_payments'>\
151
  <input type='checkbox' name='checkmedeb' id='checkmedeb' "+ debitChecked + " onclick='completeDebitCheckbox()'>\
152
  "+ debit_payment_translate + "\
153
  </label>\
175
  for (ioff = 0; ioff < offlineInputs.length; ioff++) {
176
  if (ioff == 0) {
177
  var checkbox_offline_prepend = "<div class='all_checkbox'>\
178
+ <label for='checkmeoff' id='mp_input_payments' style='margin-bottom: 37px !important;'>\
179
  <input type='checkbox' name='checkmeoff' id='checkmeoff' "+ offlineChecked + " onclick='completeOfflineCheckbox()'>\
180
  "+ offline_payment_translate + "\
181
  </label>\
assets/js/ticket_config_mercadopago.js CHANGED
@@ -95,9 +95,9 @@ document.getElementById("woocommerce_woo-mercado-pago-ticket_checkout_payments_a
95
 
96
  //payment methods
97
  var tablePayments = document.querySelector("#woocommerce_woo-mercado-pago-ticket_checkout_payments_description").nextElementSibling.getAttribute('class');
98
- var input_payments = document.querySelectorAll( '.'+ tablePayments + ' td.forminp label');
99
- for (i = 0; i < input_payments.length; i++) {
100
- input_payments[i].id = "input_payments_mt";
101
  }
102
 
103
  //offline payments configuration form
@@ -118,7 +118,7 @@ document.getElementById("woocommerce_woo-mercado-pago-ticket_checkout_payments_a
118
  for (ioff = 0; ioff < offlineInputs.length; ioff++) {
119
  if (ioff == 0) {
120
  var checkbox_offline_prepend = "<div class='all_checkbox'>\
121
- <label for='checkmeoff' id='input_payments' style='margin-bottom: 37px !important;'>\
122
  <input type='checkbox' name='checkmeoff' id='checkmeoff' "+ offlineChecked + " onclick='completeOfflineCheckbox()'>\
123
  "+ offline_payment_translate + "\
124
  </label>\
95
 
96
  //payment methods
97
  var tablePayments = document.querySelector("#woocommerce_woo-mercado-pago-ticket_checkout_payments_description").nextElementSibling.getAttribute('class');
98
+ var mp_input_payments = document.querySelectorAll( '.'+ tablePayments + ' td.forminp label');
99
+ for (i = 0; i < mp_input_payments.length; i++) {
100
+ mp_input_payments[i].id = "mp_input_payments_mt";
101
  }
102
 
103
  //offline payments configuration form
118
  for (ioff = 0; ioff < offlineInputs.length; ioff++) {
119
  if (ioff == 0) {
120
  var checkbox_offline_prepend = "<div class='all_checkbox'>\
121
+ <label for='checkmeoff' id='mp_input_payments' style='margin-bottom: 37px !important;'>\
122
  <input type='checkbox' name='checkmeoff' id='checkmeoff' "+ offlineChecked + " onclick='completeOfflineCheckbox()'>\
123
  "+ offline_payment_translate + "\
124
  </label>\
i18n/languages/woocommerce-mercadopago-es_AR.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_AR.po CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the WooCommerce Mercado Pago plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WooCommerce Mercado Pago 4.0.6\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-06 19:19-0300\n"
13
  "X-Generator: Poedit 2.2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
@@ -992,12 +992,8 @@ 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 ""
996
- "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 "
997
- "shopping experience.."
998
- msgstr ""
999
- "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 "
1000
- "online."
1001
 
1002
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1124
1003
  msgid ""
@@ -1242,7 +1238,7 @@ msgstr "Seleccione el número de cotas"
1242
 
1243
  #: templates/checkout/custom_checkout.php:192
1244
  msgid "Enter your document number"
1245
- msgstr "Enter your document number"
1246
 
1247
  #: templates/checkout/custom_checkout.php:196
1248
  msgid "Type"
@@ -1378,7 +1374,7 @@ msgstr "Estado"
1378
 
1379
  #: templates/checkout/ticket_checkout.php:96
1380
  msgid "Select state\""
1381
- msgstr "Seleccione estado"
1382
 
1383
  #: templates/checkout/ticket_checkout.php:125
1384
  msgid "You must inform your status"
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.7\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-12 17:56-0300\n"
13
  "X-Generator: Poedit 2.2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
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 ""
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"
1374
 
1375
  #: templates/checkout/ticket_checkout.php:96
1376
  msgid "Select state\""
1377
+ msgstr "Seleccione"
1378
 
1379
  #: templates/checkout/ticket_checkout.php:125
1380
  msgid "You must inform your status"
i18n/languages/woocommerce-mercadopago-es_CL.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_CL.po CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the WooCommerce Mercado Pago plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WooCommerce Mercado Pago 4.0.6\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-06 19:19-0300\n"
13
  "X-Generator: Poedit 2.2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
@@ -992,12 +992,8 @@ 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 ""
996
- "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 "
997
- "shopping experience.."
998
- msgstr ""
999
- "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 "
1000
- "online."
1001
 
1002
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1124
1003
  msgid ""
@@ -1242,7 +1238,7 @@ msgstr "Seleccione el número de cotas"
1242
 
1243
  #: templates/checkout/custom_checkout.php:192
1244
  msgid "Enter your document number"
1245
- msgstr "Enter your document number"
1246
 
1247
  #: templates/checkout/custom_checkout.php:196
1248
  msgid "Type"
@@ -1378,7 +1374,7 @@ msgstr "Estado"
1378
 
1379
  #: templates/checkout/ticket_checkout.php:96
1380
  msgid "Select state\""
1381
- msgstr "Seleccione estado"
1382
 
1383
  #: templates/checkout/ticket_checkout.php:125
1384
  msgid "You must inform your status"
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.7\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-12 17:56-0300\n"
13
  "X-Generator: Poedit 2.2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
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 ""
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"
1374
 
1375
  #: templates/checkout/ticket_checkout.php:96
1376
  msgid "Select state\""
1377
+ msgstr "Seleccione"
1378
 
1379
  #: templates/checkout/ticket_checkout.php:125
1380
  msgid "You must inform your status"
i18n/languages/woocommerce-mercadopago-es_CO.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_CO.po CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the WooCommerce Mercado Pago plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WooCommerce Mercado Pago 4.0.6\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-06 19:19-0300\n"
13
  "X-Generator: Poedit 2.2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
@@ -992,12 +992,8 @@ 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 ""
996
- "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 "
997
- "shopping experience.."
998
- msgstr ""
999
- "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 "
1000
- "online."
1001
 
1002
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1124
1003
  msgid ""
@@ -1242,7 +1238,7 @@ msgstr "Seleccione el número de cotas"
1242
 
1243
  #: templates/checkout/custom_checkout.php:192
1244
  msgid "Enter your document number"
1245
- msgstr "Enter your document number"
1246
 
1247
  #: templates/checkout/custom_checkout.php:196
1248
  msgid "Type"
@@ -1378,7 +1374,7 @@ msgstr "Estado"
1378
 
1379
  #: templates/checkout/ticket_checkout.php:96
1380
  msgid "Select state\""
1381
- msgstr "Seleccione estado"
1382
 
1383
  #: templates/checkout/ticket_checkout.php:125
1384
  msgid "You must inform your status"
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.7\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-12 17:57-0300\n"
13
  "X-Generator: Poedit 2.2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
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 ""
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"
1374
 
1375
  #: templates/checkout/ticket_checkout.php:96
1376
  msgid "Select state\""
1377
+ msgstr "Seleccione"
1378
 
1379
  #: templates/checkout/ticket_checkout.php:125
1380
  msgid "You must inform your status"
i18n/languages/woocommerce-mercadopago-es_ES.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_ES.po CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the WooCommerce Mercado Pago plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WooCommerce Mercado Pago 4.0.6\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-06 18:51-0300\n"
13
  "X-Generator: Poedit 2.2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
@@ -992,12 +992,8 @@ 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 ""
996
- "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 "
997
- "shopping experience.."
998
- msgstr ""
999
- "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 "
1000
- "online."
1001
 
1002
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1124
1003
  msgid ""
@@ -1242,7 +1238,7 @@ msgstr "Seleccione el número de cotas"
1242
 
1243
  #: templates/checkout/custom_checkout.php:192
1244
  msgid "Enter your document number"
1245
- msgstr "Enter your document number"
1246
 
1247
  #: templates/checkout/custom_checkout.php:196
1248
  msgid "Type"
@@ -1378,7 +1374,7 @@ msgstr "Estado"
1378
 
1379
  #: templates/checkout/ticket_checkout.php:96
1380
  msgid "Select state\""
1381
- msgstr "Seleccione estado"
1382
 
1383
  #: templates/checkout/ticket_checkout.php:125
1384
  msgid "You must inform your status"
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.7\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-12 17:57-0300\n"
13
  "X-Generator: Poedit 2.2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
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 ""
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"
1374
 
1375
  #: templates/checkout/ticket_checkout.php:96
1376
  msgid "Select state\""
1377
+ msgstr "Seleccione"
1378
 
1379
  #: templates/checkout/ticket_checkout.php:125
1380
  msgid "You must inform your status"
i18n/languages/woocommerce-mercadopago-es_MX.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_MX.po CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the WooCommerce Mercado Pago plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WooCommerce Mercado Pago 4.0.6\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-06 19:01-0300\n"
13
  "X-Generator: Poedit 2.2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
@@ -992,12 +992,8 @@ 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 ""
996
- "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 "
997
- "shopping experience.."
998
- msgstr ""
999
- "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 "
1000
- "online."
1001
 
1002
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1124
1003
  msgid ""
@@ -1242,7 +1238,7 @@ msgstr "Seleccione el número de cotas"
1242
 
1243
  #: templates/checkout/custom_checkout.php:192
1244
  msgid "Enter your document number"
1245
- msgstr "Enter your document number"
1246
 
1247
  #: templates/checkout/custom_checkout.php:196
1248
  msgid "Type"
@@ -1378,7 +1374,7 @@ msgstr "Estado"
1378
 
1379
  #: templates/checkout/ticket_checkout.php:96
1380
  msgid "Select state\""
1381
- msgstr "Seleccione estado"
1382
 
1383
  #: templates/checkout/ticket_checkout.php:125
1384
  msgid "You must inform your status"
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.7\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-12 17:58-0300\n"
13
  "X-Generator: Poedit 2.2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
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 ""
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"
1374
 
1375
  #: templates/checkout/ticket_checkout.php:96
1376
  msgid "Select state\""
1377
+ msgstr "Seleccione"
1378
 
1379
  #: templates/checkout/ticket_checkout.php:125
1380
  msgid "You must inform your status"
i18n/languages/woocommerce-mercadopago-es_PE.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_PE.po CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the WooCommerce Mercado Pago plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WooCommerce Mercado Pago 4.0.6\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-06 18:49-0300\n"
13
  "X-Generator: Poedit 2.2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
@@ -992,12 +992,8 @@ 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 ""
996
- "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 "
997
- "shopping experience.."
998
- msgstr ""
999
- "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 "
1000
- "online."
1001
 
1002
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1124
1003
  msgid ""
@@ -1242,7 +1238,7 @@ msgstr "Seleccione el número de cotas"
1242
 
1243
  #: templates/checkout/custom_checkout.php:192
1244
  msgid "Enter your document number"
1245
- msgstr "Enter your document number"
1246
 
1247
  #: templates/checkout/custom_checkout.php:196
1248
  msgid "Type"
@@ -1378,7 +1374,7 @@ msgstr "Estado"
1378
 
1379
  #: templates/checkout/ticket_checkout.php:96
1380
  msgid "Select state\""
1381
- msgstr "Seleccione estado"
1382
 
1383
  #: templates/checkout/ticket_checkout.php:125
1384
  msgid "You must inform your status"
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.7\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-12 17:58-0300\n"
13
  "X-Generator: Poedit 2.2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
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 ""
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"
1374
 
1375
  #: templates/checkout/ticket_checkout.php:96
1376
  msgid "Select state\""
1377
+ msgstr "Seleccione"
1378
 
1379
  #: templates/checkout/ticket_checkout.php:125
1380
  msgid "You must inform your status"
i18n/languages/woocommerce-mercadopago-es_UY.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_UY.po CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the WooCommerce Mercado Pago plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WooCommerce Mercado Pago 4.0.6\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-06 18:49-0300\n"
13
  "X-Generator: Poedit 2.2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
@@ -992,12 +992,8 @@ 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 ""
996
- "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 "
997
- "shopping experience.."
998
- msgstr ""
999
- "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 "
1000
- "online."
1001
 
1002
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1124
1003
  msgid ""
@@ -1242,7 +1238,7 @@ msgstr "Seleccione el número de cotas"
1242
 
1243
  #: templates/checkout/custom_checkout.php:192
1244
  msgid "Enter your document number"
1245
- msgstr "Enter your document number"
1246
 
1247
  #: templates/checkout/custom_checkout.php:196
1248
  msgid "Type"
@@ -1378,7 +1374,7 @@ msgstr "Estado"
1378
 
1379
  #: templates/checkout/ticket_checkout.php:96
1380
  msgid "Select state\""
1381
- msgstr "Seleccione estado"
1382
 
1383
  #: templates/checkout/ticket_checkout.php:125
1384
  msgid "You must inform your status"
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.7\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-12 17:58-0300\n"
13
  "X-Generator: Poedit 2.2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
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 ""
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"
1374
 
1375
  #: templates/checkout/ticket_checkout.php:96
1376
  msgid "Select state\""
1377
+ msgstr "Seleccione"
1378
 
1379
  #: templates/checkout/ticket_checkout.php:125
1380
  msgid "You must inform your status"
i18n/languages/woocommerce-mercadopago-es_VE.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_VE.po CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the WooCommerce Mercado Pago plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WooCommerce Mercado Pago 4.0.6\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-06 18:46-0300\n"
13
  "X-Generator: Poedit 2.2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
@@ -992,12 +992,8 @@ 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 ""
996
- "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 "
997
- "shopping experience.."
998
- msgstr ""
999
- "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 "
1000
- "online."
1001
 
1002
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1124
1003
  msgid ""
@@ -1242,7 +1238,7 @@ msgstr "Seleccione el número de cotas"
1242
 
1243
  #: templates/checkout/custom_checkout.php:192
1244
  msgid "Enter your document number"
1245
- msgstr "Enter your document number"
1246
 
1247
  #: templates/checkout/custom_checkout.php:196
1248
  msgid "Type"
@@ -1378,7 +1374,7 @@ msgstr "Estado"
1378
 
1379
  #: templates/checkout/ticket_checkout.php:96
1380
  msgid "Select state\""
1381
- msgstr "Seleccione estado"
1382
 
1383
  #: templates/checkout/ticket_checkout.php:125
1384
  msgid "You must inform your status"
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.7\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-12 17:58-0300\n"
13
  "X-Generator: Poedit 2.2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
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 ""
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"
1374
 
1375
  #: templates/checkout/ticket_checkout.php:96
1376
  msgid "Select state\""
1377
+ msgstr "Seleccione"
1378
 
1379
  #: templates/checkout/ticket_checkout.php:125
1380
  msgid "You must inform your status"
i18n/languages/woocommerce-mercadopago-pt_BR.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-pt_BR.po CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the WooCommerce Mercado Pago plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WooCommerce Mercado Pago 4.0.6\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-06 18:46-0300\n"
13
  "X-Generator: Poedit 2.2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
@@ -992,12 +992,8 @@ 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 ""
996
- "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 "
997
- "shopping experience.."
998
- msgstr ""
999
- "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 "
1000
- "compra on-line."
1001
 
1002
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1124
1003
  msgid ""
@@ -1378,7 +1374,7 @@ msgstr "Estado"
1378
 
1379
  #: templates/checkout/ticket_checkout.php:96
1380
  msgid "Select state\""
1381
- msgstr "Selecione o estado"
1382
 
1383
  #: templates/checkout/ticket_checkout.php:125
1384
  msgid "You must inform your status"
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.7\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-12 17:59-0300\n"
13
  "X-Generator: Poedit 2.2.3\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
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 ""
1374
 
1375
  #: templates/checkout/ticket_checkout.php:96
1376
  msgid "Select state\""
1377
+ msgstr "Selecione"
1378
 
1379
  #: templates/checkout/ticket_checkout.php:125
1380
  msgid "You must inform your status"
i18n/languages/woocommerce-mercadopago.pot CHANGED
@@ -2,7 +2,7 @@
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.6\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"
@@ -1025,7 +1025,7 @@ msgid "Everything set up? Go to your store in Sandbox mode"
1025
  msgstr ""
1026
 
1027
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1122
1028
- 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.."
1029
  msgstr ""
1030
 
1031
  #: includes/payments/WC_WooMercadoPago_PaymentAbstract.php:1124
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.7\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"
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
includes/module/WC_WooMercadoPago_Configs.php CHANGED
@@ -250,10 +250,12 @@ class WC_WooMercadoPago_Configs
250
  public function setPaymentGateway($methods = null)
251
  {
252
  global $wp;
253
- $api_request = strtolower(wc_clean($wp->query_vars['wc-api']));
254
- if (!empty($api_request)) {
255
- $methods[] = $api_request;
256
- return $methods;
 
 
257
  }
258
 
259
  $methods[] = 'WC_WooMercadoPago_BasicGateway';
250
  public function setPaymentGateway($methods = null)
251
  {
252
  global $wp;
253
+ if (!empty($wp) && isset($wp->query_vars['wc-api'])) {
254
+ $api_request = strtolower(wc_clean($wp->query_vars['wc-api']));
255
+ if (!empty($api_request)) {
256
+ $methods[] = $api_request;
257
+ return $methods;
258
+ }
259
  }
260
 
261
  $methods[] = 'WC_WooMercadoPago_BasicGateway';
includes/module/WC_WooMercadoPago_Module.php CHANGED
@@ -8,9 +8,6 @@ if (!defined('ABSPATH')) {
8
  */
9
  class WC_WooMercadoPago_Module extends WC_WooMercadoPago_Configs
10
  {
11
- const VERSION = '4.0.6';
12
- const MIN_PHP = 5.6;
13
-
14
  public static $categories = array();
15
  public static $country_configs = array();
16
  public static $site_data;
@@ -31,6 +28,7 @@ class WC_WooMercadoPago_Module extends WC_WooMercadoPago_Configs
31
 
32
  $this->loadConfigs();
33
  $this->loadLog();
 
34
  $this->loadHooks();
35
  $this->loadPreferences();
36
  $this->loadPayments();
@@ -64,11 +62,11 @@ class WC_WooMercadoPago_Module extends WC_WooMercadoPago_Configs
64
  $credentials = new WC_WooMercadoPago_Credentials($payment);
65
  $validateCredentialsType = $credentials->validateCredentialsType();
66
  if ($validateCredentialsType == WC_WooMercadoPago_Credentials::TYPE_ACCESS_TOKEN) {
67
- $mp = new MP(self::get_module_version(), $credentials->accessToken);
68
  $mp->setPaymentClass($payment);
69
  }
70
  if ($validateCredentialsType == WC_WooMercadoPago_Credentials::TYPE_ACCESS_CLIENT) {
71
- $mp = new MP(self::get_module_version(), $credentials->clientId, $credentials->clientSecret);
72
  $mp->setPaymentClass($payment);
73
  if (!empty($payment)) {
74
  $payment->sandbox = false;
@@ -191,6 +189,14 @@ class WC_WooMercadoPago_Module extends WC_WooMercadoPago_Configs
191
  {
192
  include_once dirname(__FILE__) . '/log/WC_WooMercadoPago_Log.php';
193
  }
 
 
 
 
 
 
 
 
194
 
195
  /**
196
  * Load Shipment Types
@@ -398,7 +404,7 @@ class WC_WooMercadoPago_Module extends WC_WooMercadoPago_Configs
398
  'from=' . get_woocommerce_currency() .
399
  '&to=' . $used_currency
400
  ),
401
- WC_WooMercadoPago_Module::get_module_version()
402
  );
403
  if (isset($currency_obj['response'])) {
404
  $currency_obj = $currency_obj['response'];
@@ -417,7 +423,7 @@ class WC_WooMercadoPago_Module extends WC_WooMercadoPago_Configs
417
  {
418
  $w = WC_WooMercadoPago_Module::woocommerce_instance();
419
  $infra_data = array(
420
- 'module_version' => WC_WooMercadoPago_Module::VERSION,
421
  'platform' => 'WooCommerce',
422
  'platform_version' => $w->version,
423
  'code_version' => phpversion(),
@@ -476,16 +482,6 @@ class WC_WooMercadoPago_Module extends WC_WooMercadoPago_Configs
476
  return plugin_dir_path(__FILE__) . '../../templates/';
477
  }
478
 
479
- /**
480
- * Summary: Get module's version.
481
- * Description: Get module's version.
482
- * @return a string with the given version.
483
- */
484
- public static function get_module_version()
485
- {
486
- return WC_WooMercadoPago_Module::VERSION;
487
- }
488
-
489
  /**
490
  * Summary: Get client id from access token.
491
  * Description: Get client id from access token.
8
  */
9
  class WC_WooMercadoPago_Module extends WC_WooMercadoPago_Configs
10
  {
 
 
 
11
  public static $categories = array();
12
  public static $country_configs = array();
13
  public static $site_data;
28
 
29
  $this->loadConfigs();
30
  $this->loadLog();
31
+ $this->loadConstants();
32
  $this->loadHooks();
33
  $this->loadPreferences();
34
  $this->loadPayments();
62
  $credentials = new WC_WooMercadoPago_Credentials($payment);
63
  $validateCredentialsType = $credentials->validateCredentialsType();
64
  if ($validateCredentialsType == WC_WooMercadoPago_Credentials::TYPE_ACCESS_TOKEN) {
65
+ $mp = new MP($credentials->accessToken);
66
  $mp->setPaymentClass($payment);
67
  }
68
  if ($validateCredentialsType == WC_WooMercadoPago_Credentials::TYPE_ACCESS_CLIENT) {
69
+ $mp = new MP($credentials->clientId, $credentials->clientSecret);
70
  $mp->setPaymentClass($payment);
71
  if (!empty($payment)) {
72
  $payment->sandbox = false;
189
  {
190
  include_once dirname(__FILE__) . '/log/WC_WooMercadoPago_Log.php';
191
  }
192
+
193
+ /**
194
+ *
195
+ */
196
+ public function loadConstants()
197
+ {
198
+ include_once dirname(__FILE__) . '/config/WC_WooMercadoPago_Constants.php';
199
+ }
200
 
201
  /**
202
  * Load Shipment Types
404
  'from=' . get_woocommerce_currency() .
405
  '&to=' . $used_currency
406
  ),
407
+ WC_WooMercadoPago_Constants::VERSION
408
  );
409
  if (isset($currency_obj['response'])) {
410
  $currency_obj = $currency_obj['response'];
423
  {
424
  $w = WC_WooMercadoPago_Module::woocommerce_instance();
425
  $infra_data = array(
426
+ 'module_version' => WC_WooMercadoPago_Constants::VERSION,
427
  'platform' => 'WooCommerce',
428
  'platform_version' => $w->version,
429
  'code_version' => phpversion(),
482
  return plugin_dir_path(__FILE__) . '../../templates/';
483
  }
484
 
 
 
 
 
 
 
 
 
 
 
485
  /**
486
  * Summary: Get client id from access token.
487
  * Description: Get client id from access token.
includes/module/config/WC_WooMercadoPago_Constants.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if (!defined('ABSPATH')) {
4
+ exit;
5
+ }
6
+
7
+ /**
8
+ * Class WC_WooMercadoPago_Constants
9
+ */
10
+ class WC_WooMercadoPago_Constants
11
+ {
12
+ const PRODUCT_ID = 'BC32CPFTRPP001U8NHRG';
13
+ const PLATAFORM_ID = 'WooCommerce';
14
+ const VERSION = '4.0.2';
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
@@ -316,4 +316,37 @@ abstract class WC_WooMercadoPago_PreferenceAbstract extends WC_Payment_Gateway
316
  $this->preference['coupon_code'] = strtoupper($this->checkout['coupon_code']);
317
  }
318
  }
319
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
316
  $this->preference['coupon_code'] = strtoupper($this->checkout['coupon_code']);
317
  }
318
  }
319
+
320
+ /**
321
+ * @return array
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,
341
+ "module_version" => WC_WooMercadoPago_Constants::VERSION,
342
+ "site" => get_option('_site_id_v1'),
343
+ "sponsor_id" => $this->get_sponsor_id(),
344
+ "collector" => end($seller),
345
+ "test_mode" => $test_mode,
346
+ "details" => ""
347
+ );
348
+
349
+ return $internal_metadata;
350
+ }
351
+
352
+ }
includes/module/preference/WC_WooMercadoPago_PreferenceBasic.php CHANGED
@@ -33,6 +33,11 @@ class WC_WooMercadoPago_PreferenceBasic extends WC_WooMercadoPago_PreferenceAbst
33
 
34
  $this->preference['payment_methods'] = $this->get_payment_methods($this->ex_payments, $this->installments);
35
  $this->preference['auto_return'] = $this->auto_return();
 
 
 
 
 
36
  }
37
 
38
  /**
@@ -153,4 +158,17 @@ class WC_WooMercadoPago_PreferenceBasic extends WC_WooMercadoPago_PreferenceAbst
153
  }
154
  }
155
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
156
  }
33
 
34
  $this->preference['payment_methods'] = $this->get_payment_methods($this->ex_payments, $this->installments);
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
  /**
158
  }
159
  }
160
  }
161
+
162
+ /**
163
+ * @return array
164
+ */
165
+ public function get_internal_metadata_basic()
166
+ {
167
+ $internal_metadata = array(
168
+ "checkout" => "smart",
169
+ "checkout_type" => "",
170
+ );
171
+
172
+ return $internal_metadata;
173
+ }
174
  }
includes/module/preference/WC_WooMercadoPago_PreferenceCustom.php CHANGED
@@ -34,6 +34,7 @@ class WC_WooMercadoPago_PreferenceCustom extends WC_WooMercadoPago_PreferenceAbs
34
  $this->preference['issuer_id'] = (integer)$this->checkout['issuer'];
35
  }
36
  }
 
37
  $this->preference['additional_info']['items'] = $this->items;
38
  $this->preference['additional_info']['payer'] = $this->get_payer_custom();
39
  $this->preference['additional_info']['shipments'] = $this->shipments_receiver_address();
@@ -42,7 +43,6 @@ class WC_WooMercadoPago_PreferenceCustom extends WC_WooMercadoPago_PreferenceAbs
42
  $this->preference['additional_info']['items'][] = $shipCost;
43
  if (isset($shipCost['unit_price']) && $shipCost['unit_price'] > 0) {
44
  $sumTransaction = $this->preference['transaction_amount'] + $shipCost['unit_price'];
45
- //$this->preference['transaction_amount'] = $sumTransaction;
46
  }
47
  }
48
  if (
@@ -54,6 +54,9 @@ class WC_WooMercadoPago_PreferenceCustom extends WC_WooMercadoPago_PreferenceAbs
54
  }
55
  $this->add_discounts_campaign();
56
 
 
 
 
57
 
58
  }
59
 
@@ -99,4 +102,17 @@ class WC_WooMercadoPago_PreferenceCustom extends WC_WooMercadoPago_PreferenceAbs
99
 
100
  return $items;
101
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  }
34
  $this->preference['issuer_id'] = (integer)$this->checkout['issuer'];
35
  }
36
  }
37
+
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();
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 (
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
 
102
 
103
  return $items;
104
  }
105
+
106
+ /**
107
+ * @return array
108
+ */
109
+ public function get_internal_metadata_custom()
110
+ {
111
+ $internal_metadata = array(
112
+ "checkout" => "custom",
113
+ "checkout_type" => "credit_cart",
114
+ );
115
+
116
+ return $internal_metadata;
117
+ }
118
  }
includes/module/preference/WC_WooMercadoPago_PreferenceTicket.php CHANGED
@@ -42,6 +42,12 @@ 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
 
47
  /**
@@ -51,8 +57,10 @@ class WC_WooMercadoPago_PreferenceTicket extends WC_WooMercadoPago_PreferenceAbs
51
  */
52
  public function get_date_of_expiration()
53
  {
54
- $date_expiration = $this->get_option('date_expiration', 3);
55
- return date('Y-m-d', strtotime('+' . $date_expiration . ' days')) . 'T00:00:00.000-00:00';
 
 
56
  }
57
 
58
  /**
@@ -77,4 +85,15 @@ class WC_WooMercadoPago_PreferenceTicket extends WC_WooMercadoPago_PreferenceAbs
77
  {
78
  return true;
79
  }
 
 
 
 
 
 
 
 
 
 
 
80
  }
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
  /**
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
+ }
64
  }
65
 
66
  /**
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
  }
includes/module/sdk/lib/MP.php CHANGED
@@ -11,8 +11,6 @@ $GLOBALS['LIB_LOCATION'] = dirname(__FILE__);
11
  */
12
  class MP
13
  {
14
-
15
- private $version = '4.0.6';
16
  private $client_id;
17
  private $client_secret;
18
  private $ll_access_token;
@@ -32,19 +30,17 @@ class MP
32
  require_once($includes_path . '/RestClient/MpRestClient.php');
33
 
34
  $i = func_num_args();
35
- if ($i > 3 || $i < 2) {
36
  throw new WC_WooMercadoPago_Exception('Invalid arguments. Use CLIENT_ID and CLIENT SECRET, or ACCESS_TOKEN');
37
  }
38
 
39
- if ($i == 2) {
40
- $this->version = func_get_arg(0);
41
- $this->ll_access_token = func_get_arg(1);
42
  }
43
 
44
- if ($i == 3) {
45
- $this->version = func_get_arg(0);
46
- $this->client_id = func_get_arg(1);
47
- $this->client_secret = func_get_arg(2);
48
  }
49
  }
50
 
@@ -107,7 +103,7 @@ class MP
107
  'content-type' => 'application/x-www-form-urlencoded'
108
  )
109
  ),
110
- $this->version
111
  );
112
 
113
  if ($access_data['status'] != 200) {
@@ -132,7 +128,7 @@ class MP
132
  'params' => array('access_token' => $this->get_access_token())
133
  );
134
 
135
- $payment = MPRestClient::get($request, $this->version);
136
  return $payment;
137
  }
138
 
@@ -175,7 +171,7 @@ class MP
175
  )
176
  );
177
 
178
- $customer = MPRestClient::post($request, $this->version);
179
  return $customer;
180
 
181
  }
@@ -195,7 +191,7 @@ class MP
195
  )
196
  );
197
 
198
- $customer = MPRestClient::get($request, $this->version);
199
  return $customer;
200
 
201
  }
@@ -223,7 +219,7 @@ class MP
223
  )
224
  );
225
 
226
- $card = MPRestClient::post($request, $this->version);
227
  return $card;
228
 
229
  }
@@ -243,7 +239,7 @@ class MP
243
  )
244
  );
245
 
246
- $cards = MPRestClient::get($request, $this->version);
247
  return $cards;
248
 
249
  }
@@ -269,7 +265,7 @@ class MP
269
  )
270
  );
271
 
272
- $discount_info = MPRestClient::get($request, $this->version);
273
  return $discount_info;
274
 
275
  }
@@ -290,7 +286,7 @@ class MP
290
  )
291
  );
292
 
293
- $authorized_payment_info = MPRestClient::get($request, $this->version);
294
  return $authorized_payment_info;
295
 
296
  }
@@ -308,12 +304,12 @@ class MP
308
  'access_token' => $this->get_access_token()
309
  ),
310
  'headers' => array(
311
- 'user-agent' => 'platform:desktop,type:woocommerce,so:' . $this->version
312
  ),
313
  'data' => $preference
314
  );
315
 
316
- $preference_result = MPRestClient::post($request, $this->version);
317
  return $preference_result;
318
 
319
  }
@@ -334,7 +330,7 @@ class MP
334
  'data' => $preference
335
  );
336
 
337
- $preference_result = MPRestClient::put($request, $this->version);
338
  return $preference_result;
339
 
340
  }
@@ -353,7 +349,7 @@ class MP
353
  )
354
  );
355
 
356
- $preference_result = MPRestClient::get($request, $this->version);
357
  return $preference_result;
358
 
359
  }
@@ -371,12 +367,12 @@ class MP
371
  'access_token' => $this->get_access_token()
372
  ),
373
  'headers' => array(
374
- 'X-Tracking-Id' => 'platform:v1-whitelabel,type:woocommerce,so:' . $this->version
375
  ),
376
  'data' => $preference
377
  );
378
 
379
- $payment = MPRestClient::post($request, $this->version);
380
  return $payment;
381
  }
382
 
@@ -395,7 +391,7 @@ class MP
395
  'data' => $preapproval_payment
396
  );
397
 
398
- $preapproval_payment_result = MPRestClient::post($request, $this->version);
399
  return $preapproval_payment_result;
400
 
401
  }
@@ -415,7 +411,7 @@ class MP
415
  )
416
  );
417
 
418
- $preapproval_payment_result = MPRestClient::get($request, $this->version);
419
  return $preapproval_payment_result;
420
 
421
  }
@@ -437,7 +433,7 @@ class MP
437
  'data' => $preapproval_payment
438
  );
439
 
440
- $preapproval_payment_result = MPRestClient::put($request, $this->version);
441
  return $preapproval_payment_result;
442
 
443
  }
@@ -460,7 +456,7 @@ class MP
460
  )
461
  );
462
 
463
- $response = MPRestClient::put($request, $this->version);
464
  return $response;
465
 
466
  }
@@ -482,7 +478,7 @@ class MP
482
  )
483
  );
484
 
485
- $response = MPRestClient::post($request, $this->version);
486
  return $response;
487
 
488
  }
@@ -509,7 +505,7 @@ class MP
509
  )
510
  );
511
 
512
- $response = MPRestClient::post($request, $this->version);
513
  return $response;
514
 
515
  }
@@ -530,7 +526,7 @@ class MP
530
  'data' => '{"status":"cancelled"}'
531
  );
532
 
533
- $response = MPRestClient::put($request, $this->version);
534
  return $response;
535
 
536
  }
@@ -548,7 +544,7 @@ class MP
548
  )
549
  );
550
 
551
- $response = MPRestClient::get($request, $this->version);
552
 
553
  return $response;
554
  }
@@ -581,7 +577,7 @@ class MP
581
  $request['params']['access_token'] = $this->get_access_token();
582
  }
583
 
584
- $result = MPRestClient::get($request, $this->version);
585
  return $result;
586
 
587
  }
@@ -612,7 +608,7 @@ class MP
612
  $request['params']['access_token'] = $this->get_access_token();
613
  }
614
 
615
- $result = MPRestClient::post($request, $this->version);
616
  return $result;
617
 
618
  }
@@ -643,7 +639,7 @@ class MP
643
  $request['params']['access_token'] = $this->get_access_token();
644
  }
645
 
646
- $result = MPRestClient::put($request, $this->version);
647
  return $result;
648
 
649
  }
@@ -672,7 +668,7 @@ class MP
672
  $request['params']['access_token'] = $this->get_access_token();
673
  }
674
 
675
- $result = MPRestClient::delete($request, $this->version);
676
  return $result;
677
 
678
  }
@@ -692,7 +688,7 @@ class MP
692
  'data' => $module_info
693
  );
694
 
695
- $result = MPRestClient::post($request, $this->version);
696
  return $result;
697
 
698
  }
@@ -724,7 +720,7 @@ class MP
724
  $seller = explode('-', $accessToken);
725
 
726
  $response = MeliRestClient::get(
727
- array('uri' => '/applications/' . $seller[1]), WC_WooMercadoPago_Module::get_module_version()
728
  );
729
 
730
  //in case of failures
11
  */
12
  class MP
13
  {
 
 
14
  private $client_id;
15
  private $client_secret;
16
  private $ll_access_token;
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
 
103
  'content-type' => 'application/x-www-form-urlencoded'
104
  )
105
  ),
106
+ WC_WooMercadoPago_Constants::VERSION
107
  );
108
 
109
  if ($access_data['status'] != 200) {
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
 
171
  )
172
  );
173
 
174
+ $customer = MPRestClient::post($request);
175
  return $customer;
176
 
177
  }
191
  )
192
  );
193
 
194
+ $customer = MPRestClient::get($request);
195
  return $customer;
196
 
197
  }
219
  )
220
  );
221
 
222
+ $card = MPRestClient::post($request);
223
  return $card;
224
 
225
  }
239
  )
240
  );
241
 
242
+ $cards = MPRestClient::get($request);
243
  return $cards;
244
 
245
  }
265
  )
266
  );
267
 
268
+ $discount_info = MPRestClient::get($request);
269
  return $discount_info;
270
 
271
  }
286
  )
287
  );
288
 
289
+ $authorized_payment_info = MPRestClient::get($request);
290
  return $authorized_payment_info;
291
 
292
  }
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
  }
330
  'data' => $preference
331
  );
332
 
333
+ $preference_result = MPRestClient::put($request);
334
  return $preference_result;
335
 
336
  }
349
  )
350
  );
351
 
352
+ $preference_result = MPRestClient::get($request);
353
  return $preference_result;
354
 
355
  }
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
 
391
  'data' => $preapproval_payment
392
  );
393
 
394
+ $preapproval_payment_result = MPRestClient::post($request);
395
  return $preapproval_payment_result;
396
 
397
  }
411
  )
412
  );
413
 
414
+ $preapproval_payment_result = MPRestClient::get($request);
415
  return $preapproval_payment_result;
416
 
417
  }
433
  'data' => $preapproval_payment
434
  );
435
 
436
+ $preapproval_payment_result = MPRestClient::put($request);
437
  return $preapproval_payment_result;
438
 
439
  }
456
  )
457
  );
458
 
459
+ $response = MPRestClient::put($request);
460
  return $response;
461
 
462
  }
478
  )
479
  );
480
 
481
+ $response = MPRestClient::post($request);
482
  return $response;
483
 
484
  }
505
  )
506
  );
507
 
508
+ $response = MPRestClient::post($request);
509
  return $response;
510
 
511
  }
526
  'data' => '{"status":"cancelled"}'
527
  );
528
 
529
+ $response = MPRestClient::put($request);
530
  return $response;
531
 
532
  }
544
  )
545
  );
546
 
547
+ $response = MPRestClient::get($request);
548
 
549
  return $response;
550
  }
577
  $request['params']['access_token'] = $this->get_access_token();
578
  }
579
 
580
+ $result = MPRestClient::get($request);
581
  return $result;
582
 
583
  }
608
  $request['params']['access_token'] = $this->get_access_token();
609
  }
610
 
611
+ $result = MPRestClient::post($request);
612
  return $result;
613
 
614
  }
639
  $request['params']['access_token'] = $this->get_access_token();
640
  }
641
 
642
+ $result = MPRestClient::put($request);
643
  return $result;
644
 
645
  }
668
  $request['params']['access_token'] = $this->get_access_token();
669
  }
670
 
671
+ $result = MPRestClient::delete($request);
672
  return $result;
673
 
674
  }
688
  'data' => $module_info
689
  );
690
 
691
+ $result = MPRestClient::post($request);
692
  return $result;
693
 
694
  }
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
includes/module/sdk/lib/RestClient/AbstractRestClient.php CHANGED
@@ -4,34 +4,29 @@
4
  * Class AbstractRestClient
5
  */
6
  class AbstractRestClient
7
- {
8
- const PRODUCT_ID = 'BC32CPFTRPP001U8NHRG';
9
-
10
  public static $email_admin = '';
11
  public static $site_locale = '';
12
  public static $check_loop = 0;
13
 
14
  /**
15
  * @param $request
16
- * @param $version
17
- * @param $baseUrl
18
  * @return array|null
19
  * @throws WC_WooMercadoPago_Exception
20
  */
21
- public static function execAbs($request, $version, $baseUrl)
22
  {
23
- $connect = self::build_request($request, $version, $baseUrl);
24
- return self::execute($request, $version, $connect);
 
25
  }
26
-
27
  /**
28
  * @param $request
29
- * @param $version
30
- * @param $apiBaseUrl
31
  * @return false|resource
32
  * @throws WC_WooMercadoPago_Exception
33
  */
34
- public static function build_request($request, $version, $apiBaseUrl)
35
  {
36
  if (!extension_loaded('curl')) {
37
  throw new WC_WooMercadoPago_Exception('cURL extension not found. You need to enable cURL in your php.ini or another configuration you have.');
@@ -47,7 +42,9 @@ class AbstractRestClient
47
 
48
  $headers = array('accept: application/json');
49
  if ($request['method'] == 'POST' ) {
50
- $headers[] = 'x-product-id: ' . self::PRODUCT_ID;
 
 
51
  }
52
  $json_content = true;
53
  $form_content = false;
@@ -70,7 +67,7 @@ class AbstractRestClient
70
  }
71
 
72
  $connect = curl_init();
73
- curl_setopt($connect, CURLOPT_USERAGENT, 'platform:v1-whitelabel,type:woocommerce,so:' . $version);
74
  curl_setopt($connect, CURLOPT_RETURNTRANSFER, true);
75
  curl_setopt($connect, CURLOPT_SSL_VERIFYPEER, true);
76
  curl_setopt($connect, CURLOPT_CAINFO, $GLOBALS['LIB_LOCATION'] . '/cacert.pem');
@@ -84,7 +81,7 @@ class AbstractRestClient
84
  }
85
  }
86
 
87
- curl_setopt($connect, CURLOPT_URL, $apiBaseUrl . $request['uri']);
88
 
89
 
90
  if (isset($request['data'])) {
@@ -110,13 +107,11 @@ class AbstractRestClient
110
  }
111
 
112
  /**
113
- * @param $request
114
- * @param $version
115
  * @param $connect
116
  * @return array|null
117
  * @throws WC_WooMercadoPago_Exception
118
  */
119
- public static function execute($request, $version, $connect)
120
  {
121
  $response = null;
122
  $api_result = curl_exec($connect);
@@ -142,13 +137,7 @@ class AbstractRestClient
142
  $message = $response['response']['message'];
143
  }
144
  if (isset($response['response']['cause'])) {
145
- if (isset($response['response']['cause']['code']) && isset($response['response']['cause']['description'])) {
146
- $message .= ' - ' . $response['response']['cause']['code'] . ': ' . $response['response']['cause']['description'];
147
- } elseif (is_array($response['response']['cause'])) {
148
- foreach ($response['response']['cause'] as $cause) {
149
- $message .= ' - ' . $cause['code'] . ': ' . $cause['description'];
150
- }
151
- }
152
  }
153
  }
154
  if ($request != null) {
@@ -168,7 +157,7 @@ class AbstractRestClient
168
  'message' => $message,
169
  'payloads' => $payloads
170
  );
171
- self::sendErrorLog($response['status'], $errors, $version);
172
  } catch (Exception $e) {
173
  throw new WC_WooMercadoPago_Exception('Error to call API LOGS' . $e);
174
  }
@@ -182,16 +171,15 @@ class AbstractRestClient
182
  /**
183
  * @param $code
184
  * @param $errors
185
- * @param $version
186
  * @return array|null
187
  * @throws WC_WooMercadoPago_Exception
188
  */
189
- public static function sendErrorLog($code, $errors, $version)
190
  {
191
  $data = array(
192
  'code' => $code,
193
- 'module' => 'WooCommerce',
194
- 'module_version' => $version,
195
  'url_store' => $_SERVER['HTTP_HOST'],
196
  'errors' => $errors,
197
  'email_admin' => self::$email_admin,
@@ -201,7 +189,7 @@ class AbstractRestClient
201
  'uri' => '/modules/log',
202
  'data' => $data
203
  );
204
- $result_response = MeLiRestClient::post($request, $version);
205
  return $result_response;
206
  }
207
 
@@ -219,7 +207,6 @@ class AbstractRestClient
219
  }
220
  return implode('&', $elements);
221
  }
222
-
223
  }
224
 
225
  /**
4
  * Class AbstractRestClient
5
  */
6
  class AbstractRestClient
7
+ {
 
 
8
  public static $email_admin = '';
9
  public static $site_locale = '';
10
  public static $check_loop = 0;
11
 
12
  /**
13
  * @param $request
 
 
14
  * @return array|null
15
  * @throws WC_WooMercadoPago_Exception
16
  */
17
+ public static function execAbs($request)
18
  {
19
+ $connect = self::build_request($request);
20
+
21
+ return self::execute($request, $connect);
22
  }
23
+
24
  /**
25
  * @param $request
 
 
26
  * @return false|resource
27
  * @throws WC_WooMercadoPago_Exception
28
  */
29
+ public static function build_request($request)
30
  {
31
  if (!extension_loaded('curl')) {
32
  throw new WC_WooMercadoPago_Exception('cURL extension not found. You need to enable cURL in your php.ini or another configuration you have.');
42
 
43
  $headers = array('accept: application/json');
44
  if ($request['method'] == 'POST' ) {
45
+ $headers[] = 'x-product-id:' . WC_WooMercadoPago_Constants::PRODUCT_ID;
46
+ $headers[] = 'x-platform-id:' . WC_WooMercadoPago_Constants::PLATAFORM_ID;
47
+ $headers[] = 'x-integrator-id:' . WC_WooMercadoPago_Module::get_sponsor_id();
48
  }
49
  $json_content = true;
50
  $form_content = false;
67
  }
68
 
69
  $connect = curl_init();
70
+ curl_setopt($connect, CURLOPT_USERAGENT, 'platform:v1-whitelabel,type:woocommerce,so:' . WC_WooMercadoPago_Constants::VERSION);
71
  curl_setopt($connect, CURLOPT_RETURNTRANSFER, true);
72
  curl_setopt($connect, CURLOPT_SSL_VERIFYPEER, true);
73
  curl_setopt($connect, CURLOPT_CAINFO, $GLOBALS['LIB_LOCATION'] . '/cacert.pem');
81
  }
82
  }
83
 
84
+ curl_setopt($connect, CURLOPT_URL, WC_WooMercadoPago_Constants::API_MP_BASE_URL . $request['uri']);
85
 
86
 
87
  if (isset($request['data'])) {
107
  }
108
 
109
  /**
 
 
110
  * @param $connect
111
  * @return array|null
112
  * @throws WC_WooMercadoPago_Exception
113
  */
114
+ public static function execute($request, $connect)
115
  {
116
  $response = null;
117
  $api_result = curl_exec($connect);
137
  $message = $response['response']['message'];
138
  }
139
  if (isset($response['response']['cause'])) {
140
+ $message .= json_encode($response['response']['cause']);
 
 
 
 
 
 
141
  }
142
  }
143
  if ($request != null) {
157
  'message' => $message,
158
  'payloads' => $payloads
159
  );
160
+ self::sendErrorLog($response['status'], $errors, WC_WooMercadoPago_Constants::VERSION);
161
  } catch (Exception $e) {
162
  throw new WC_WooMercadoPago_Exception('Error to call API LOGS' . $e);
163
  }
171
  /**
172
  * @param $code
173
  * @param $errors
 
174
  * @return array|null
175
  * @throws WC_WooMercadoPago_Exception
176
  */
177
+ public static function sendErrorLog($code, $errors)
178
  {
179
  $data = array(
180
  'code' => $code,
181
+ 'module' => WC_WooMercadoPago_Constants::PLATAFORM_ID,
182
+ 'module_version' => WC_WooMercadoPago_Constants::VERSION,
183
  'url_store' => $_SERVER['HTTP_HOST'],
184
  'errors' => $errors,
185
  'email_admin' => self::$email_admin,
189
  'uri' => '/modules/log',
190
  'data' => $data
191
  );
192
+ $result_response = MeLiRestClient::post($request, WC_WooMercadoPago_Constants::VERSION);
193
  return $result_response;
194
  }
195
 
207
  }
208
  return implode('&', $elements);
209
  }
 
210
  }
211
 
212
  /**
includes/module/sdk/lib/RestClient/MpRestClient.php CHANGED
@@ -5,54 +5,48 @@
5
  */
6
  class MPRestClient extends AbstractRestClient
7
  {
8
- const API_MP_BASE_URL = 'https://api.mercadopago.com';
9
-
10
  /**
11
  * @param $request
12
- * @param $version
13
  * @return array|null
14
  * @throws WC_WooMercadoPago_Exception
15
  */
16
- public static function get($request, $version)
17
  {
18
  $request['method'] = 'GET';
19
- return self::execAbs($request, $version, self::API_MP_BASE_URL);
20
  }
21
 
22
  /**
23
  * @param $request
24
- * @param $version
25
  * @return array|null
26
  * @throws WC_WooMercadoPago_Exception
27
  */
28
- public static function post($request, $version)
29
  {
30
  $request['method'] = 'POST';
31
- return self::execAbs($request, $version, self::API_MP_BASE_URL);
32
  }
33
 
34
  /**
35
  * @param $request
36
- * @param $version
37
  * @return array|null
38
  * @throws WC_WooMercadoPago_Exception
39
  */
40
- public static function put($request, $version)
41
  {
42
  $request['method'] = 'PUT';
43
- return self::execAbs($request, $version, self::API_MP_BASE_URL);
44
  }
45
 
46
  /**
47
  * @param $request
48
- * @param $version
49
  * @return array|null
50
  * @throws WC_WooMercadoPago_Exception
51
  */
52
- public static function delete($request, $version)
53
  {
54
  $request['method'] = 'DELETE';
55
- return self::execAbs($request, $version, self::API_MP_BASE_URL);
56
  }
57
 
58
  }
5
  */
6
  class MPRestClient extends AbstractRestClient
7
  {
 
 
8
  /**
9
  * @param $request
 
10
  * @return array|null
11
  * @throws WC_WooMercadoPago_Exception
12
  */
13
+ public static function get($request)
14
  {
15
  $request['method'] = 'GET';
16
+ return self::execAbs($request);
17
  }
18
 
19
  /**
20
  * @param $request
 
21
  * @return array|null
22
  * @throws WC_WooMercadoPago_Exception
23
  */
24
+ public static function post($request)
25
  {
26
  $request['method'] = 'POST';
27
+ return self::execAbs($request);
28
  }
29
 
30
  /**
31
  * @param $request
 
32
  * @return array|null
33
  * @throws WC_WooMercadoPago_Exception
34
  */
35
+ public static function put($request)
36
  {
37
  $request['method'] = 'PUT';
38
+ return self::execAbs($request);
39
  }
40
 
41
  /**
42
  * @param $request
 
43
  * @return array|null
44
  * @throws WC_WooMercadoPago_Exception
45
  */
46
+ public static function delete($request)
47
  {
48
  $request['method'] = 'DELETE';
49
+ return self::execAbs($request);
50
  }
51
 
52
  }
includes/payments/WC_WooMercadoPago_BasicGateway.php CHANGED
@@ -615,4 +615,4 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
615
  return false;
616
  }
617
  }
618
- }
615
  return false;
616
  }
617
  }
618
+ }
includes/payments/WC_WooMercadoPago_CustomGateway.php CHANGED
@@ -153,7 +153,7 @@ class WC_WooMercadoPago_CustomGateway extends WC_WooMercadoPago_PaymentAbstract
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="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') . '
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') . '
includes/payments/WC_WooMercadoPago_PaymentAbstract.php CHANGED
@@ -255,7 +255,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
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 .mouse_pointe"><b><u>' . __('Approve your account', 'woocommerce-mercadopago') . '</u></b></a>') . '</p>
259
  </div>';
260
  }
261
 
@@ -386,40 +386,40 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
386
  {
387
  $checkout_steps = array(
388
  'title' => sprintf(
389
- '<div class="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 pb-10">
393
  <p class="number-checkout-body">1</p>
394
- <p class="text-checkout-body mp-text-center 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 pb-10">
400
  <p class="number-checkout-body">2</p>
401
- <p class="text-checkout-body mp-text-center 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 pb-10">
407
  <p class="number-checkout-body">3</p>
408
- <p class="text-checkout-body mp-text-center 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 pb-10">
414
  <p class="number-checkout-body">4</p>
415
- <p class="text-checkout-body mp-text-center 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 pb-10">
421
  <p class="number-checkout-body">5</p>
422
- <p class="text-checkout-body mp-text-center 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>
@@ -585,7 +585,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 mt--10'
589
  );
590
  return $checkout_credential_mod_test_description;
591
  }
@@ -611,7 +611,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 mt--10'
615
  );
616
  return $checkout_credential_mod_prod_description;
617
  }
@@ -651,7 +651,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
651
  <td class="forminp">
652
  <fieldset>
653
  <a class="mp_general_links" href="https://www.mercadopago.com/' . $country . '/account/credentials" target="_blank">' . __('Search my credentials', 'woocommerce-mercadopago') . '</a>
654
- <p class="description fw-400 mp-mb-0"></p>
655
  </fieldset>
656
  </td>
657
  </tr>
@@ -683,7 +683,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 mt--10'
687
  );
688
  return $checkout_credential__description_test;
689
  }
@@ -740,7 +740,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 mt--10'
744
  );
745
  return $checkout_credential__description_prod;
746
  }
@@ -800,7 +800,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 mt--10'
804
  );
805
  return $checkout_homolog_subtitle;
806
  }
@@ -998,7 +998,7 @@ 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 mt--10'
1002
  );
1003
  return $checkout_payments_advanced_description;
1004
  }
@@ -1108,7 +1108,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
1108
  $checkout_options_title = array(
1109
  'title' => $message_ready_title,
1110
  'type' => 'title',
1111
- 'class' => 'mp_subtitle_bd_mb mg-0'
1112
  );
1113
  return $checkout_options_title;
1114
  }
@@ -1119,7 +1119,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
1119
  public function field_checkout_ready_description()
1120
  {
1121
  if($this->checkout_credential_token_production == 'yes') {
1122
- $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');
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
  }
@@ -1176,7 +1176,11 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
1176
  $_site_id_v1 = $this->getOption('_site_id_v1');
1177
 
1178
 
1179
- return ('yes' == $this->settings['enabled']) && !empty($_mp_public_key) && !empty($_mp_access_token) && !empty($_site_id_v1);
 
 
 
 
1180
  }
1181
 
1182
 
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
 
386
  {
387
  $checkout_steps = array(
388
  'title' => sprintf(
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>
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
  }
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
  }
651
  <td class="forminp">
652
  <fieldset>
653
  <a class="mp_general_links" href="https://www.mercadopago.com/' . $country . '/account/credentials" target="_blank">' . __('Search my credentials', 'woocommerce-mercadopago') . '</a>
654
+ <p class="description mp-fw-400 mp-mb-0"></p>
655
  </fieldset>
656
  </td>
657
  </tr>
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
  $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
  $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
  }
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
  }
1108
  $checkout_options_title = array(
1109
  'title' => $message_ready_title,
1110
  'type' => 'title',
1111
+ 'class' => 'mp_subtitle_bd_mb mp-mg-0'
1112
  );
1113
  return $checkout_options_title;
1114
  }
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
  }
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
 
includes/payments/WC_WooMercadoPago_TicketGateway.php CHANGED
@@ -182,7 +182,7 @@ class WC_WooMercadoPago_TicketGateway extends WC_WooMercadoPago_PaymentAbstract
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="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') . '
@@ -437,7 +437,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 (array_key_exists('status', $response)) {
441
  if ($response['status'] == 'pending') {
442
  if ($response['status_detail'] == 'pending_waiting_payment') {
443
  WC()->cart->empty_cart();
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') . '
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') {
443
  WC()->cart->empty_cart();
includes/payments/hooks/WC_WooMercadoPago_Hook_Abstract.php CHANGED
@@ -151,23 +151,6 @@ abstract class WC_WooMercadoPago_Hook_Abstract
151
  if (wp_get_current_user()->ID != 0) {
152
  $logged_user_email = wp_get_current_user()->user_email;
153
  }
154
- ?>
155
- <script src="https://secure.mlstatic.com/modules/javascript/analytics.js"></script>
156
- <script type="text/javascript">
157
- try {
158
- var MA = ModuleAnalytics;
159
- MA.setPublicKey('<?php echo $this->publicKey; ?>');
160
- MA.setPlatform('WooCommerce');
161
- MA.setPlatformVersion('<?php echo $woo->version; ?>');
162
- MA.setModuleVersion('<?php echo WC_WooMercadoPago_Module::VERSION; ?>');
163
- MA.setPayerEmail('<?php echo($logged_user_email != null ? $logged_user_email : ""); ?>');
164
- MA.setUserLogged( <?php echo(empty($logged_user_email) ? 0 : 1); ?> );
165
- MA.setInstalledModules('<?php echo $available_payments; ?>');
166
- MA.post();
167
- } catch (err) {
168
- }
169
- </script>
170
- <?php
171
  }
172
  }
173
 
@@ -178,17 +161,17 @@ abstract class WC_WooMercadoPago_Hook_Abstract
178
  public function update_mp_settings_script($order_id)
179
  {
180
  if (!empty($this->publicKey) && !$this->testUser) {
181
- $this->payment->log->write_log(__FUNCTION__, 'updating order of ID ' . $order_id);
182
- return '<script src="https://secure.mlstatic.com/modules/javascript/analytics.js"></script>
183
- <script type="text/javascript">
184
- try {
185
- var MA = ModuleAnalytics;
186
- MA.setPublicKey(' . $this->publicKey . ');
187
- MA.setPaymentType("basic");
188
- MA.setCheckoutType("basic");
189
- MA.put();
190
- } catch(err) {}
191
- </script>';
192
  }
193
  }
194
 
151
  if (wp_get_current_user()->ID != 0) {
152
  $logged_user_email = wp_get_current_user()->user_email;
153
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  }
155
  }
156
 
161
  public function update_mp_settings_script($order_id)
162
  {
163
  if (!empty($this->publicKey) && !$this->testUser) {
164
+ // $this->payment->log->write_log(__FUNCTION__, 'updating order of ID ' . $order_id);
165
+ // return '<script src="https://secure.mlstatic.com/modules/javascript/analytics.js"></script>
166
+ // <script type="text/javascript">
167
+ // try {
168
+ // var MA = ModuleAnalytics;
169
+ // MA.setPublicKey(' . $this->publicKey . ');
170
+ // MA.setPaymentType("basic");
171
+ // MA.setCheckoutType("basic");
172
+ // MA.put();
173
+ // } catch(err) {}
174
+ // </script>';
175
  }
176
  }
177
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ 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.6
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -113,7 +113,18 @@ Check out our <a href="https://www.mercadopago.com.br/developers/pt/plugins_sdks
113
 
114
  == Changelog ==
115
 
116
- = v4.0.6 (06/09/2019) =
 
 
 
 
 
 
 
 
 
 
 
117
  * Bug fixes
118
  - Problem with all translations fixed
119
 
4
  Requires at least: 4.9.10
5
  Tested up to: 5.2.2
6
  Requires PHP: 5.6
7
+ Stable tag: 4.0.7
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
113
 
114
  == Changelog ==
115
 
116
+ = v4.0.7 (12/09/2019) =
117
+
118
+ * Feature Mercado envios
119
+ - The service Mercados envios is temporary unavailable in all versions.
120
+
121
+ * Bug fixes
122
+ - Fixed layout incompatibility
123
+ - Fixed process to validate card at custom checkout
124
+ - Fixed payment due at ticket
125
+ - Fixed spanish translation
126
+
127
+ = v4.0.6 (09/09/2019) =
128
  * Bug fixes
129
  - Problem with all translations fixed
130
 
templates/checkout/custom_checkout.php CHANGED
@@ -150,8 +150,8 @@ if (!defined('ABSPATH')) {
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'); ?> <em>*</em></label>
154
- <select class="mp-form-control mp-pointer" id="issuer" data-checkout="issuer" name="mercadopago_custom[issuer]"></select>
155
  </div>
156
  </div>
157
 
@@ -194,7 +194,7 @@ if (!defined('ABSPATH')) {
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-5" data-checkout="docType" name="mercadopago_custom[docType]"></select>
198
  </div>
199
 
200
  <div class="mp-col-md-8">
@@ -247,6 +247,7 @@ if (!defined('ABSPATH')) {
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");
@@ -297,9 +298,10 @@ if (!defined('ABSPATH')) {
297
  }
298
 
299
  //mercadopago function
300
- (function() {
301
-
302
- var MPv1 = {
 
303
  debug: true,
304
  add_truncated_card: true,
305
  site_id: "",
@@ -314,16 +316,11 @@ if (!defined('ABSPATH')) {
314
  default: true,
315
  status: true
316
  },
317
- create_token_on: {
318
- event: true, //if true create token on event, if false create on click and ignore others
319
- keyup: false,
320
- paste: true
321
- },
322
  inputs_to_create_discount: [
323
  "couponCode",
324
  "applyCoupon"
325
  ],
326
- inputs_to_create_token: [
327
  "cardNumber",
328
  "cardExpirationDate",
329
  "cardholderName",
@@ -552,10 +549,10 @@ if (!defined('ABSPATH')) {
552
 
553
  var cardSelector = document.querySelector(MPv1.selectors.paymentMethodSelector);
554
 
555
- if (cardSelector && cardSelector[cardSelector.options.selectedIndex].value != "-1") {
556
- return cardSelector[cardSelector.options.selectedIndex]
557
- .getAttribute("first_six_digits");
558
- }
559
 
560
  var ccNumber = document.querySelector(MPv1.selectors.cardNumber);
561
  return ccNumber.value.replace(/[ .-]/g, "").slice(0, 6);
@@ -567,6 +564,7 @@ if (!defined('ABSPATH')) {
567
  var bin = MPv1.getBin();
568
 
569
  if (bin.length == 0) {
 
570
 
571
  MPv1.hideIssuer();
572
 
@@ -584,7 +582,6 @@ if (!defined('ABSPATH')) {
584
  }
585
 
586
  MPv1.guessingPaymentMethod = function(event) {
587
-
588
  var bin = MPv1.getBin();
589
  var amount = MPv1.getAmount();
590
 
@@ -910,62 +907,7 @@ if (!defined('ABSPATH')) {
910
 
911
  }
912
 
913
- // === Functions related to Create Tokens
914
- MPv1.createTokenByEvent = function() {
915
-
916
- var $inputs = MPv1.getForm().querySelectorAll("[data-checkout]");
917
- var $inputs_to_create_token = MPv1.getInputsToCreateToken();
918
-
919
- for (var x = 0; x < $inputs.length; x++) {
920
-
921
- var element = $inputs[x];
922
-
923
- // Add events only in the required fields.
924
- if ($inputs_to_create_token
925
- .indexOf(element.getAttribute("data-checkout")) > -1) {
926
-
927
- var event = "focusout";
928
-
929
- if (element.nodeName == "SELECT") {
930
- event = "change";
931
- }
932
-
933
- MPv1.addListenerEvent(element, event, MPv1.validateInputsCreateToken);
934
-
935
- // For firefox.
936
- MPv1.addListenerEvent(element, "blur", MPv1.validateInputsCreateToken);
937
-
938
- if (MPv1.create_token_on.keyup) {
939
- MPv1.addListenerEvent(element, "keyup", MPv1.validateInputsCreateToken);
940
- }
941
-
942
- if (MPv1.create_token_on.paste) {
943
- MPv1.addListenerEvent(element, "paste", MPv1.validateInputsCreateToken);
944
- }
945
-
946
- }
947
-
948
- }
949
-
950
- }
951
-
952
- MPv1.createTokenBySubmit = function() {
953
- MPv1.addListenerEvent(document.querySelector(MPv1.selectors.form), "submit", MPv1.doPay);
954
- }
955
-
956
- var doSubmit = false;
957
-
958
- MPv1.doPay = function(event) {
959
- event.preventDefault();
960
- if (!doSubmit) {
961
- MPv1.createToken();
962
- return false;
963
- }
964
- }
965
-
966
  MPv1.validateInputsCreateToken = function() {
967
-
968
- var valid_to_create_token = true;
969
  var $inputs = MPv1.getForm().querySelectorAll("[data-checkout]");
970
  var $inputs_to_create_token = MPv1.getInputsToCreateToken();
971
 
@@ -978,15 +920,12 @@ if (!defined('ABSPATH')) {
978
  .indexOf(element.getAttribute("data-checkout")) > -1) {
979
 
980
  if (element.value == -1 || element.value == "") {
981
- valid_to_create_token = false;
982
- } // end if check values
983
- } // end if check data-checkout
984
- } // end for
985
-
986
- if (valid_to_create_token) {
987
- MPv1.createToken();
988
- }
989
-
990
  }
991
 
992
  MPv1.createToken = function() {
@@ -1000,18 +939,18 @@ if (!defined('ABSPATH')) {
1000
  var $form = MPv1.getForm();
1001
 
1002
  Mercadopago.createToken($form, MPv1.sdkResponseHandler);
1003
-
1004
  return false;
1005
  }
1006
 
1007
  MPv1.sdkResponseHandler = function(status, response) {
1008
-
1009
  // Hide loading.
1010
  document.querySelector(MPv1.selectors.box_loading).style.background = "";
1011
 
1012
  if (status != 200 && status != 201) {
1013
  MPv1.showErrors(response);
1014
- } else {
 
1015
  var token = document.querySelector(MPv1.selectors.token);
1016
  token.value = response.id;
1017
 
@@ -1020,13 +959,9 @@ if (!defined('ABSPATH')) {
1020
  document.querySelector(MPv1.selectors.cardTruncated).value = card;
1021
  }
1022
 
1023
- if (!MPv1.create_token_on.event) {
1024
- doSubmit = true;
1025
- btn = document.querySelector(MPv1.selectors.form);
1026
- btn.submit();
1027
- }
1028
  }
1029
-
1030
  }
1031
 
1032
  // === Useful functions
@@ -1052,11 +987,6 @@ if (!defined('ABSPATH')) {
1052
 
1053
  Mercadopago.clearSession();
1054
 
1055
- if (MPv1.create_token_on.event) {
1056
- MPv1.createTokenByEvent();
1057
- MPv1.validateInputsCreateToken();
1058
- }
1059
-
1060
  document.querySelector(MPv1.selectors.CustomerAndCard).value =
1061
  MPv1.customer_and_card.status;
1062
  }
@@ -1104,22 +1034,6 @@ if (!defined('ABSPATH')) {
1104
  return document.querySelector(MPv1.selectors.amount).value;
1105
  }
1106
 
1107
- // === Show errors
1108
- MPv1.showErrors = function(response) {
1109
- var $form = MPv1.getForm();
1110
-
1111
- for (var x = 0; x < response.cause.length; x++) {
1112
- var error = response.cause[x];
1113
- var $span = $form.querySelector("#mp-error-" + error.code);
1114
- var $input = $form.querySelector($span.getAttribute("data-main"));
1115
-
1116
- $span.style.display = "inline-block";
1117
- $input.classList.add("mp-error-input");
1118
- }
1119
-
1120
- return;
1121
- }
1122
-
1123
  MPv1.hideErrors = function() {
1124
 
1125
  for (var x = 0; x < document.querySelectorAll("[data-checkout]").length; x++) {
@@ -1147,18 +1061,13 @@ if (!defined('ABSPATH')) {
1147
  }
1148
  };
1149
 
1150
- MPv1.addListenerEvent(
1151
- document.querySelector(MPv1.selectors.cardNumber),
1152
- "keyup", MPv1.guessingPaymentMethod
1153
- );
1154
  MPv1.addListenerEvent(
1155
  document.querySelector(MPv1.selectors.cardNumber),
1156
  "keyup", MPv1.clearOptions
1157
  );
1158
- MPv1.addListenerEvent(
1159
- document.querySelector(MPv1.selectors.cardNumber),
1160
- "change", MPv1.guessingPaymentMethod
1161
- );
1162
 
1163
  MPv1.referer = (function() {
1164
  var referer = window.location.protocol + "//" +
@@ -1279,12 +1188,6 @@ if (!defined('ABSPATH')) {
1279
  document.querySelector(MPv1.selectors.formCustomerAndCard).style.display = "none";
1280
  }
1281
 
1282
- if (MPv1.create_token_on.event) {
1283
- MPv1.createTokenByEvent();
1284
- } else {
1285
- MPv1.createTokenBySubmit()
1286
- }
1287
-
1288
  // flow: MLM
1289
  if (MPv1.site_id != "MLM") {
1290
  Mercadopago.getIdentificationTypes();
@@ -1346,7 +1249,57 @@ if (!defined('ABSPATH')) {
1346
 
1347
  this.MPv1 = MPv1;
1348
 
1349
- }).call();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1350
 
1351
  // Overriding this function to give form padding attribute.
1352
  MPv1.setForm = function() {
@@ -1359,10 +1312,6 @@ if (!defined('ABSPATH')) {
1359
  document.querySelector(MPv1.selectors.form).style.padding = "0px 12px 0px 12px";
1360
  }
1361
  Mercadopago.clearSession();
1362
- if (MPv1.create_token_on.event) {
1363
- MPv1.createTokenByEvent();
1364
- MPv1.validateInputsCreateToken();
1365
- }
1366
  document.querySelector(MPv1.selectors.CustomerAndCard).value = MPv1.customer_and_card.status;
1367
  }
1368
 
@@ -1384,12 +1333,14 @@ if (!defined('ABSPATH')) {
1384
  } else {
1385
  var $span = $form.querySelector("#mp-error-" + error.code);
1386
  }
1387
-
1388
- var $input = $form.querySelector($span.getAttribute("data-main"));
1389
- $span.style.display = "inline-block";
1390
- $input.classList.add("mp-form-control-error");
 
 
1391
  }
1392
- return;
1393
  }
1394
 
1395
  MPv1.hideErrors = function() {
@@ -1407,87 +1358,7 @@ if (!defined('ABSPATH')) {
1407
 
1408
  return;
1409
 
1410
- }
1411
-
1412
- /*
1413
- * Customization due to rejected payment flow
1414
- */
1415
-
1416
- //disable create token by event, to create on submit form
1417
- MPv1.create_token_on.event = false
1418
-
1419
-
1420
- var formSubmited = false;
1421
- var intent = 0;
1422
- jQuery(function($) {
1423
- var checkout_form = $('form.checkout');
1424
-
1425
- // get action button submit
1426
- checkout_form.on('checkout_place_order_woo-mercado-pago-custom', function() {
1427
- //check already submit
1428
- if (formSubmited == false) {
1429
- MPv1.createToken();
1430
- return false;
1431
- }
1432
- //check is second intent to renew token
1433
- if (intent == 2) {
1434
- intent = 0;
1435
- formSubmited = false;
1436
- Mercadopago.clearSession();
1437
- setTimeout(function() {
1438
- return MPv1.createToken();
1439
- }, 2000);
1440
- return false;
1441
- }
1442
- intent++;
1443
- return true;
1444
- });
1445
-
1446
- if (document.forms['order_review'] != undefined) {
1447
- document.forms['order_review'].onsubmit = function() {
1448
- if (document.getElementById('payment_method_woo-mercado-pago-custom').checked) {
1449
- //check already submit
1450
- if (formSubmited == false) {
1451
- MPv1.createToken();
1452
- return false;
1453
- }
1454
- //check is second intent to renew token
1455
- if (intent == 2) {
1456
- intent = 0;
1457
- formSubmited = false;
1458
- Mercadopago.clearSession();
1459
- setTimeout(function() {
1460
- return MPv1.createToken();
1461
- }, 2000);
1462
- return false;
1463
- }
1464
- intent++;
1465
- }
1466
- return true;
1467
- }
1468
- }
1469
- });
1470
- MPv1.sdkResponseHandler = function(status, response) {
1471
- // Hide loading.
1472
- document.querySelector(MPv1.selectors.box_loading).style.background = "";
1473
- if (status != 200 && status != 201) {
1474
- MPv1.showErrors(response);
1475
- } else {
1476
- var token = document.querySelector(MPv1.selectors.token);
1477
- token.value = response.id;
1478
- if (MPv1.add_truncated_card) {
1479
- var card = MPv1.truncateCard(response);
1480
- document.querySelector(MPv1.selectors.cardTruncated).value = card;
1481
- }
1482
-
1483
- //set to form submit
1484
- formSubmited = true;
1485
-
1486
- //trigger button to submit form
1487
- form = document.querySelector('#place_order');
1488
- form.click();
1489
- }
1490
- }
1491
 
1492
  /*
1493
  * END Customization
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
 
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">
247
  </div>
248
 
249
  <script type="text/javascript">
250
+
251
  //collapsible payments
252
  var show_payments = document.querySelector("#button-show-payments")
253
  var frame_payments = document.querySelector("#mp-frame-payments");
298
  }
299
 
300
  //mercadopago function
301
+ (function( $ ) {
302
+
303
+ var mercado_pago = false;
304
+ var MPv1 = {
305
  debug: true,
306
  add_truncated_card: true,
307
  site_id: "",
316
  default: true,
317
  status: true
318
  },
 
 
 
 
 
319
  inputs_to_create_discount: [
320
  "couponCode",
321
  "applyCoupon"
322
  ],
323
+ inputs_to_create_token: [
324
  "cardNumber",
325
  "cardExpirationDate",
326
  "cardholderName",
549
 
550
  var cardSelector = document.querySelector(MPv1.selectors.paymentMethodSelector);
551
 
552
+ // if (cardSelector && cardSelector[cardSelector.options.selectedIndex].value != "-1") {
553
+ // return cardSelector[cardSelector.options.selectedIndex]
554
+ // .getAttribute("first_six_digits");
555
+ // }
556
 
557
  var ccNumber = document.querySelector(MPv1.selectors.cardNumber);
558
  return ccNumber.value.replace(/[ .-]/g, "").slice(0, 6);
564
  var bin = MPv1.getBin();
565
 
566
  if (bin.length == 0) {
567
+ MPv1.resetBackgroundCard();
568
 
569
  MPv1.hideIssuer();
570
 
582
  }
583
 
584
  MPv1.guessingPaymentMethod = function(event) {
 
585
  var bin = MPv1.getBin();
586
  var amount = MPv1.getAmount();
587
 
907
 
908
  }
909
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
910
  MPv1.validateInputsCreateToken = function() {
 
 
911
  var $inputs = MPv1.getForm().querySelectorAll("[data-checkout]");
912
  var $inputs_to_create_token = MPv1.getInputsToCreateToken();
913
 
920
  .indexOf(element.getAttribute("data-checkout")) > -1) {
921
 
922
  if (element.value == -1 || element.value == "") {
923
+ element.focus();
924
+ return false;
925
+ }
926
+ }
927
+ }
928
+ return true;
 
 
 
929
  }
930
 
931
  MPv1.createToken = function() {
939
  var $form = MPv1.getForm();
940
 
941
  Mercadopago.createToken($form, MPv1.sdkResponseHandler);
942
+
943
  return false;
944
  }
945
 
946
  MPv1.sdkResponseHandler = function(status, response) {
 
947
  // Hide loading.
948
  document.querySelector(MPv1.selectors.box_loading).style.background = "";
949
 
950
  if (status != 200 && status != 201) {
951
  MPv1.showErrors(response);
952
+ }
953
+ else {
954
  var token = document.querySelector(MPv1.selectors.token);
955
  token.value = response.id;
956
 
959
  document.querySelector(MPv1.selectors.cardTruncated).value = card;
960
  }
961
 
962
+ mercado_pago = true;
963
+ $( 'form.checkout, form#order_review' ).submit();
 
 
 
964
  }
 
965
  }
966
 
967
  // === Useful functions
987
 
988
  Mercadopago.clearSession();
989
 
 
 
 
 
 
990
  document.querySelector(MPv1.selectors.CustomerAndCard).value =
991
  MPv1.customer_and_card.status;
992
  }
1034
  return document.querySelector(MPv1.selectors.amount).value;
1035
  }
1036
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1037
  MPv1.hideErrors = function() {
1038
 
1039
  for (var x = 0; x < document.querySelectorAll("[data-checkout]").length; x++) {
1061
  }
1062
  };
1063
 
1064
+ $( 'body' ).on( 'focusout', '#cardNumber', MPv1.guessingPaymentMethod);
1065
+
1066
+
 
1067
  MPv1.addListenerEvent(
1068
  document.querySelector(MPv1.selectors.cardNumber),
1069
  "keyup", MPv1.clearOptions
1070
  );
 
 
 
 
1071
 
1072
  MPv1.referer = (function() {
1073
  var referer = window.location.protocol + "//" +
1188
  document.querySelector(MPv1.selectors.formCustomerAndCard).style.display = "none";
1189
  }
1190
 
 
 
 
 
 
 
1191
  // flow: MLM
1192
  if (MPv1.site_id != "MLM") {
1193
  Mercadopago.getIdentificationTypes();
1249
 
1250
  this.MPv1 = MPv1;
1251
 
1252
+
1253
+
1254
+ $( 'body' ).on( 'updated_checkout', function() {
1255
+ var field = $( 'body #cardNumber' );
1256
+
1257
+ if ( 0 < field.length ) {
1258
+ field.focusout();
1259
+ }
1260
+ });
1261
+
1262
+ // get action button submit
1263
+ $('form.checkout').on('checkout_place_order_woo-mercado-pago-custom', function() {
1264
+ if ( mercado_pago ) {
1265
+ mercado_pago = false;
1266
+
1267
+ return true;
1268
+ }
1269
+
1270
+ if (!document.getElementById('payment_method_woo-mercado-pago-custom').checked) {
1271
+ return true;
1272
+ }
1273
+
1274
+ if(MPv1.validateInputsCreateToken()){
1275
+ return MPv1.createToken();
1276
+ }
1277
+
1278
+ return false;
1279
+ });
1280
+
1281
+ if (document.forms['order_review'] != undefined) {
1282
+ document.forms['order_review'].onsubmit = function() {
1283
+ if ( mercado_pago ) {
1284
+ mercado_pago = false;
1285
+
1286
+ return true;
1287
+ }
1288
+
1289
+ if (!document.getElementById('payment_method_woo-mercado-pago-custom').checked) {
1290
+ return true;
1291
+ }
1292
+
1293
+ if(MPv1.validateInputsCreateToken()){
1294
+ return MPv1.createToken();
1295
+ }
1296
+
1297
+ return false;
1298
+ }
1299
+ }
1300
+
1301
+
1302
+ }( jQuery ));
1303
 
1304
  // Overriding this function to give form padding attribute.
1305
  MPv1.setForm = function() {
1312
  document.querySelector(MPv1.selectors.form).style.padding = "0px 12px 0px 12px";
1313
  }
1314
  Mercadopago.clearSession();
 
 
 
 
1315
  document.querySelector(MPv1.selectors.CustomerAndCard).value = MPv1.customer_and_card.status;
1316
  }
1317
 
1333
  } else {
1334
  var $span = $form.querySelector("#mp-error-" + error.code);
1335
  }
1336
+
1337
+ if($span != undefined) {
1338
+ var $input = $form.querySelector($span.getAttribute("data-main"));
1339
+ $span.style.display = "inline-block";
1340
+ $input.classList.add("mp-form-control-error");
1341
+ }
1342
  }
1343
+ return;
1344
  }
1345
 
1346
  MPv1.hideErrors = function() {
1358
 
1359
  return;
1360
 
1361
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1362
 
1363
  /*
1364
  * END Customization
templates/checkout/ticket_checkout.php CHANGED
@@ -56,7 +56,7 @@ if (!defined('ABSPATH')) {
56
  </div>
57
 
58
  <div class="mp-col-md-4 mp-pr-15" id="box-lastname">
59
- <label for="lastname" class="mp-label-form"><?= 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>
@@ -93,7 +93,9 @@ if (!defined('ABSPATH')) {
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"'; } ?>><?= esc_html__('Select state"', 'woocommerce-mercadopago'); ?></option>
 
 
97
  <option value="AC" <?php if ($febraban['state'] == 'AC') { echo 'selected="selected"'; } ?>>Acre</option>
98
  <option value="AL" <?php if ($febraban['state'] == 'AL') { echo 'selected="selected"'; } ?>>Alagoas</option>
99
  <option value="AP" <?php if ($febraban['state'] == 'AP') { echo 'selected="selected"'; } ?>>Amapá</option>
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>
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>
99
  <option value="AC" <?php if ($febraban['state'] == 'AC') { echo 'selected="selected"'; } ?>>Acre</option>
100
  <option value="AL" <?php if ($febraban['state'] == 'AL') { echo 'selected="selected"'; } ?>>Alagoas</option>
101
  <option value="AP" <?php if ($febraban['state'] == 'AP') { echo 'selected="selected"'; } ?>>Amapá</option>
woocommerce-mercadopago.php CHANGED
@@ -3,7 +3,7 @@
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.6
7
  * Author: Mercado Pago
8
  * Author URI: https://www.mercadopago.com.br/developers/
9
  * Text Domain: woocommerce-mercadopago
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.7
7
  * Author: Mercado Pago
8
  * Author URI: https://www.mercadopago.com.br/developers/
9
  * Text Domain: woocommerce-mercadopago