WooCommerce MercadoPago - Version 4.1.1

Version Description

Download this release

Release Info

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

Code changes from version 4.1.0 to 4.1.1

Files changed (29) hide show
  1. i18n/languages/woocommerce-mercadopago-es_AR.mo +0 -0
  2. i18n/languages/woocommerce-mercadopago-es_AR.po +2 -2
  3. i18n/languages/woocommerce-mercadopago-es_CL.mo +0 -0
  4. i18n/languages/woocommerce-mercadopago-es_CL.po +2 -2
  5. i18n/languages/woocommerce-mercadopago-es_CO.mo +0 -0
  6. i18n/languages/woocommerce-mercadopago-es_CO.po +2 -2
  7. i18n/languages/woocommerce-mercadopago-es_ES.mo +0 -0
  8. i18n/languages/woocommerce-mercadopago-es_ES.po +2 -2
  9. i18n/languages/woocommerce-mercadopago-es_MX.mo +0 -0
  10. i18n/languages/woocommerce-mercadopago-es_MX.po +2 -2
  11. i18n/languages/woocommerce-mercadopago-es_PE.mo +0 -0
  12. i18n/languages/woocommerce-mercadopago-es_PE.po +2 -2
  13. i18n/languages/woocommerce-mercadopago-es_UY.mo +0 -0
  14. i18n/languages/woocommerce-mercadopago-es_UY.po +2 -2
  15. i18n/languages/woocommerce-mercadopago-es_VE.mo +0 -0
  16. i18n/languages/woocommerce-mercadopago-es_VE.po +2 -2
  17. i18n/languages/woocommerce-mercadopago-pt_BR.mo +0 -0
  18. i18n/languages/woocommerce-mercadopago-pt_BR.po +2 -2
  19. i18n/languages/woocommerce-mercadopago.pot +1 -1
  20. includes/module/config/WC_WooMercadoPago_Constants.php +1 -1
  21. includes/module/preference/WC_WooMercadoPago_PreferenceAbstract.php +10 -6
  22. includes/module/preference/WC_WooMercadoPago_PreferenceBasic.php +0 -29
  23. includes/module/preference/WC_WooMercadoPago_PreferenceCustom.php +1 -1
  24. includes/payments/WC_WooMercadoPago_BasicGateway.php +2 -1
  25. includes/payments/WC_WooMercadoPago_CustomGateway.php +1 -2
  26. includes/payments/WC_WooMercadoPago_PaymentAbstract.php +1 -0
  27. includes/payments/WC_WooMercadoPago_TicketGateway.php +0 -1
  28. readme.txt +11 -1
  29. woocommerce-mercadopago.php +2 -2
i18n/languages/woocommerce-mercadopago-es_AR.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_AR.po CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Mercado Pago payments for WooCommerce 4.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
- "PO-Revision-Date: 2019-12-23 17:10-0300\n"
13
  "X-Generator: Poedit 2.2.4\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Mercado Pago payments for WooCommerce 4.1.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
+ "PO-Revision-Date: 2020-01-10 16:09-0300\n"
13
  "X-Generator: Poedit 2.2.4\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
i18n/languages/woocommerce-mercadopago-es_CL.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_CL.po CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Mercado Pago payments for WooCommerce 4.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
- "PO-Revision-Date: 2019-12-23 17:11-0300\n"
13
  "X-Generator: Poedit 2.2.4\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Mercado Pago payments for WooCommerce 4.1.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
+ "PO-Revision-Date: 2020-01-10 16:09-0300\n"
13
  "X-Generator: Poedit 2.2.4\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
i18n/languages/woocommerce-mercadopago-es_CO.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_CO.po CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Mercado Pago payments for WooCommerce 4.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
- "PO-Revision-Date: 2019-12-23 17:11-0300\n"
13
  "X-Generator: Poedit 2.2.4\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Mercado Pago payments for WooCommerce 4.1.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
+ "PO-Revision-Date: 2020-01-10 16:09-0300\n"
13
  "X-Generator: Poedit 2.2.4\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
i18n/languages/woocommerce-mercadopago-es_ES.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_ES.po CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Mercado Pago payments for WooCommerce 4.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
- "PO-Revision-Date: 2019-12-23 17:11-0300\n"
13
  "X-Generator: Poedit 2.2.4\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Mercado Pago payments for WooCommerce 4.1.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
+ "PO-Revision-Date: 2020-01-10 16:09-0300\n"
13
  "X-Generator: Poedit 2.2.4\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
i18n/languages/woocommerce-mercadopago-es_MX.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_MX.po CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Mercado Pago payments for WooCommerce 4.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
- "PO-Revision-Date: 2019-12-23 17:11-0300\n"
13
  "X-Generator: Poedit 2.2.4\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Mercado Pago payments for WooCommerce 4.1.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
+ "PO-Revision-Date: 2020-01-10 16:10-0300\n"
13
  "X-Generator: Poedit 2.2.4\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
i18n/languages/woocommerce-mercadopago-es_PE.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_PE.po CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Mercado Pago payments for WooCommerce 4.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
- "PO-Revision-Date: 2019-12-23 17:11-0300\n"
13
  "X-Generator: Poedit 2.2.4\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Mercado Pago payments for WooCommerce 4.1.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
+ "PO-Revision-Date: 2020-01-10 16:10-0300\n"
13
  "X-Generator: Poedit 2.2.4\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
i18n/languages/woocommerce-mercadopago-es_UY.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_UY.po CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Mercado Pago payments for WooCommerce 4.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
- "PO-Revision-Date: 2019-12-23 17:12-0300\n"
13
  "X-Generator: Poedit 2.2.4\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Mercado Pago payments for WooCommerce 4.1.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
+ "PO-Revision-Date: 2020-01-10 16:10-0300\n"
13
  "X-Generator: Poedit 2.2.4\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
i18n/languages/woocommerce-mercadopago-es_VE.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_VE.po CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Mercado Pago payments for WooCommerce 4.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
- "PO-Revision-Date: 2019-12-23 17:12-0300\n"
13
  "X-Generator: Poedit 2.2.4\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Mercado Pago payments for WooCommerce 4.1.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
+ "PO-Revision-Date: 2020-01-10 16:10-0300\n"
13
  "X-Generator: Poedit 2.2.4\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
i18n/languages/woocommerce-mercadopago-pt_BR.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-pt_BR.po CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Mercado Pago payments for WooCommerce 4.1.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
- "PO-Revision-Date: 2019-12-23 17:12-0300\n"
13
  "X-Generator: Poedit 2.2.4\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
2
  # This file is distributed under the same license as the Mercado Pago payments for WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Mercado Pago payments for WooCommerce 4.1.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
7
  "Language-Team: \n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "POT-Creation-Date: 2019-09-05T23:48:06-04:00\n"
12
+ "PO-Revision-Date: 2020-01-10 16:10-0300\n"
13
  "X-Generator: Poedit 2.2.4\n"
14
  "X-Domain: woocommerce-mercadopago\n"
15
  "Last-Translator: \n"
i18n/languages/woocommerce-mercadopago.pot CHANGED
@@ -3,7 +3,7 @@
3
  #, fuzzy
4
  msgid ""
5
  msgstr ""
6
- "Project-Id-Version: Mercado Pago payments for WooCommerce 4.1.0\n"
7
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
8
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
9
  "Language-Team: LANGUAGE <LL@li.org>\n"
3
  #, fuzzy
4
  msgid ""
5
  msgstr ""
6
+ "Project-Id-Version: Mercado Pago payments for WooCommerce 4.1.1\n"
7
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-mercadopago\n"
8
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
9
  "Language-Team: LANGUAGE <LL@li.org>\n"
includes/module/config/WC_WooMercadoPago_Constants.php CHANGED
@@ -11,7 +11,7 @@ class WC_WooMercadoPago_Constants
11
  {
12
  const PRODUCT_ID = 'BC32CPFTRPP001U8NHRG';
13
  const PLATAFORM_ID = 'bo2hnr2ic4p001kbgpt0';
14
- const VERSION = '4.1.0';
15
  const MIN_PHP = 5.6;
16
  const API_MP_BASE_URL = 'https://api.mercadopago.com';
17
  }
11
  {
12
  const PRODUCT_ID = 'BC32CPFTRPP001U8NHRG';
13
  const PLATAFORM_ID = 'bo2hnr2ic4p001kbgpt0';
14
+ const VERSION = '4.1.1';
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
@@ -62,6 +62,7 @@ abstract class WC_WooMercadoPago_PreferenceAbstract extends WC_Payment_Gateway
62
  if (!$this->test_user_v1 && !$this->sandbox) {
63
  $this->preference['sponsor_id'] = $this->get_sponsor_id();
64
  }
 
65
  if (sizeof($this->order->get_items()) > 0) {
66
  $this->items = $this->get_items_build_array();
67
  }
@@ -162,7 +163,7 @@ abstract class WC_WooMercadoPago_PreferenceAbstract extends WC_Payment_Gateway
162
  $line_amount = $item['line_total'] + $item['line_tax'];
163
  $discount_by_gateway = (float)$line_amount * ($this->gateway_discount / 100);
164
  $commission_by_gateway = (float)$line_amount * ($this->commission / 100);
165
- $item_amount = $line_amount - $discount_by_gateway + $commission_by_gateway;
166
  $this->order_total += $item_amount;
167
 
168
  // Add the item.
@@ -178,7 +179,7 @@ abstract class WC_WooMercadoPago_PreferenceAbstract extends WC_Payment_Gateway
178
  plugins_url('assets/images/cart.png', plugin_dir_path(__FILE__)) : wp_get_attachment_url($product->get_image_id()),
179
  'category_id' => get_option('_mp_category_id', 'others'),
180
  'quantity' => 1,
181
- 'unit_price' => $this->calculate_price($item_amount),
182
  'currency_id' => $this->site_data[$this->site_id]['currency']
183
  ));
184
  }
@@ -191,12 +192,15 @@ abstract class WC_WooMercadoPago_PreferenceAbstract extends WC_Payment_Gateway
191
  */
192
  public function ship_cost_item()
193
  {
 
 
 
194
  return array(
195
  'title' => method_exists($this->order, 'get_id') ? $this->order->get_shipping_method() : $this->order->shipping_method,
196
  'description' => __('Shipping service used by the store.', 'woocommerce-mercadopago'),
197
  'category_id' => get_option('_mp_category_id', 'others'),
198
  'quantity' => 1,
199
- 'unit_price' => $this->calculate_price($this->ship_cost),
200
  );
201
  }
202
 
@@ -300,7 +304,7 @@ abstract class WC_WooMercadoPago_PreferenceAbstract extends WC_Payment_Gateway
300
  */
301
  public function get_transaction_amount()
302
  {
303
- return $this->calculate_price($this->order_total);
304
  }
305
 
306
  /**
@@ -353,9 +357,9 @@ abstract class WC_WooMercadoPago_PreferenceAbstract extends WC_Payment_Gateway
353
  $w = WC_WooMercadoPago_Module::woocommerce_instance();
354
  $internal_metadata = array(
355
  "platform" => WC_WooMercadoPago_Constants::PLATAFORM_ID,
356
- "plataform_version" => $w->version,
357
  "module_version" => WC_WooMercadoPago_Constants::VERSION,
358
- "site" => get_option('_site_id_v1'),
359
  "sponsor_id" => $this->get_sponsor_id(),
360
  "collector" => end($seller),
361
  "test_mode" => $test_mode,
62
  if (!$this->test_user_v1 && !$this->sandbox) {
63
  $this->preference['sponsor_id'] = $this->get_sponsor_id();
64
  }
65
+
66
  if (sizeof($this->order->get_items()) > 0) {
67
  $this->items = $this->get_items_build_array();
68
  }
163
  $line_amount = $item['line_total'] + $item['line_tax'];
164
  $discount_by_gateway = (float)$line_amount * ($this->gateway_discount / 100);
165
  $commission_by_gateway = (float)$line_amount * ($this->commission / 100);
166
+ $item_amount = $this->calculate_price($line_amount - $discount_by_gateway + $commission_by_gateway);
167
  $this->order_total += $item_amount;
168
 
169
  // Add the item.
179
  plugins_url('assets/images/cart.png', plugin_dir_path(__FILE__)) : wp_get_attachment_url($product->get_image_id()),
180
  'category_id' => get_option('_mp_category_id', 'others'),
181
  'quantity' => 1,
182
+ 'unit_price' => $item_amount,
183
  'currency_id' => $this->site_data[$this->site_id]['currency']
184
  ));
185
  }
192
  */
193
  public function ship_cost_item()
194
  {
195
+ $ship_cost = $this->calculate_price($this->ship_cost);
196
+ $this->order_total += $ship_cost;
197
+
198
  return array(
199
  'title' => method_exists($this->order, 'get_id') ? $this->order->get_shipping_method() : $this->order->shipping_method,
200
  'description' => __('Shipping service used by the store.', 'woocommerce-mercadopago'),
201
  'category_id' => get_option('_mp_category_id', 'others'),
202
  'quantity' => 1,
203
+ 'unit_price' => $ship_cost,
204
  );
205
  }
206
 
304
  */
305
  public function get_transaction_amount()
306
  {
307
+ return $this->order_total;
308
  }
309
 
310
  /**
357
  $w = WC_WooMercadoPago_Module::woocommerce_instance();
358
  $internal_metadata = array(
359
  "platform" => WC_WooMercadoPago_Constants::PLATAFORM_ID,
360
+ "platform_version" => $w->version,
361
  "module_version" => WC_WooMercadoPago_Constants::VERSION,
362
+ "site_id" => get_option('_site_id_v1'),
363
  "sponsor_id" => $this->get_sponsor_id(),
364
  "collector" => end($seller),
365
  "test_mode" => $test_mode,
includes/module/preference/WC_WooMercadoPago_PreferenceBasic.php CHANGED
@@ -23,10 +23,6 @@ class WC_WooMercadoPago_PreferenceBasic extends WC_WooMercadoPago_PreferenceAbst
23
  $this->preference['back_urls'] = $this->get_back_urls();
24
  $this->preference['shipments'] = $this->shipments_receiver_address();
25
 
26
- if ($this->ship_cost > 0) {
27
- $this->shipment_info();
28
- }
29
-
30
  $this->preference['payment_methods'] = $this->get_payment_methods($this->ex_payments, $this->installments);
31
  $this->preference['auto_return'] = $this->auto_return();
32
 
@@ -126,31 +122,6 @@ class WC_WooMercadoPago_PreferenceBasic extends WC_WooMercadoPago_PreferenceAbst
126
  return;
127
  }
128
 
129
- /**
130
- * Shipment Info
131
- */
132
- public function shipment_info()
133
- {
134
- $this->preference['shipments']['mode'] = 'me2';
135
- foreach ($this->order->get_shipping_methods() as $shipping) {
136
- $this->preference['shipments']['dimensions'] = $shipping['dimensions'];
137
- $this->preference['shipments']['default_shipping_method'] = (int)$shipping['shipping_method_id'];
138
- $this->preference['shipments']['free_methods'] = array();
139
- // Get shipping method id.
140
- $prepare_method_id = explode(':', $shipping['method_id']);
141
- // Get instance_id.
142
- $shipping_id = $prepare_method_id[count($prepare_method_id) - 1];
143
- // TODO: Refactor to Get zone by instance_id.
144
- $shipping_zone = WC_Shipping_Zones::get_zone_by('instance_id', $shipping_id);
145
- foreach ($shipping_zone->get_shipping_methods() as $key => $shipping_object) {
146
- if ($shipping_object->get_option('free_shipping') == 'yes') {
147
- $shipping_method_id = $shipping_object->get_shipping_method_id($this->site_data['site_id']);
148
- $this->preference['shipments']['free_methods'][] = array('id' => (int)$shipping_method_id);
149
- }
150
- }
151
- }
152
- }
153
-
154
  /**
155
  * @return array
156
  */
23
  $this->preference['back_urls'] = $this->get_back_urls();
24
  $this->preference['shipments'] = $this->shipments_receiver_address();
25
 
 
 
 
 
26
  $this->preference['payment_methods'] = $this->get_payment_methods($this->ex_payments, $this->installments);
27
  $this->preference['auto_return'] = $this->auto_return();
28
 
122
  return;
123
  }
124
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  /**
126
  * @return array
127
  */
includes/module/preference/WC_WooMercadoPago_PreferenceCustom.php CHANGED
@@ -88,7 +88,7 @@ class WC_WooMercadoPago_PreferenceCustom extends WC_WooMercadoPago_PreferenceAbs
88
  {
89
  $internal_metadata = array(
90
  "checkout" => "custom",
91
- "checkout_type" => "credit_cart",
92
  );
93
 
94
  return $internal_metadata;
88
  {
89
  $internal_metadata = array(
90
  "checkout" => "custom",
91
+ "checkout_type" => "credit_card",
92
  );
93
 
94
  return $internal_metadata;
includes/payments/WC_WooMercadoPago_BasicGateway.php CHANGED
@@ -43,7 +43,7 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
43
  $this->form_fields = $this->getFormFields('Basic');
44
  $this->hook = new WC_WooMercadoPago_Hook_Basic($this);
45
  $this->notification = new WC_WooMercadoPago_Notification_IPN($this);
46
- $this->currency_convertion = false;
47
  }
48
 
49
  /**
@@ -152,6 +152,7 @@ class WC_WooMercadoPago_BasicGateway extends WC_WooMercadoPago_PaymentAbstract
152
  'checkout_payments_subtitle',
153
  'checkout_payments_description',
154
  'enabled',
 
155
  'installments',
156
  // advanced settings
157
  'checkout_payments_advanced_title',
43
  $this->form_fields = $this->getFormFields('Basic');
44
  $this->hook = new WC_WooMercadoPago_Hook_Basic($this);
45
  $this->notification = new WC_WooMercadoPago_Notification_IPN($this);
46
+ $this->currency_convertion = true;
47
  }
48
 
49
  /**
152
  'checkout_payments_subtitle',
153
  'checkout_payments_description',
154
  'enabled',
155
+ WC_WooMercadoPago_Helpers_CurrencyConverter::CONFIG_KEY,
156
  'installments',
157
  // advanced settings
158
  'checkout_payments_advanced_title',
includes/payments/WC_WooMercadoPago_CustomGateway.php CHANGED
@@ -32,7 +32,7 @@ class WC_WooMercadoPago_CustomGateway extends WC_WooMercadoPago_PaymentAbstract
32
  $this->field_forms_order = $this->get_fields_sequence();
33
  parent::__construct();
34
  $this->form_fields = $this->getFormFields('Custom');
35
- $this->customer = isset($this->logged_user_email) ? $this->mp->get_or_create_customer($this->logged_user_email) : null;
36
  $this->hook = new WC_WooMercadoPago_Hook_Custom($this);
37
  $this->notification = new WC_WooMercadoPago_Notification_Webhook($this);
38
  $this->currency_convertion = true;
@@ -64,7 +64,6 @@ class WC_WooMercadoPago_CustomGateway extends WC_WooMercadoPago_PaymentAbstract
64
  $form_fields['checkout_custom_payments_title'] = $this->field_checkout_custom_payments_title();
65
  $form_fields['checkout_payments_subtitle'] = $this->field_checkout_payments_subtitle();
66
  $form_fields['binary_mode'] = $this->field_binary_mode();
67
- $form_fields[WC_WooMercadoPago_Helpers_CurrencyConverter::CONFIG_KEY] = $this->field_currency_conversion($this);
68
  $form_fields['checkout_custom_payments_advanced_title'] = $this->field_checkout_custom_payments_advanced_title();
69
  $form_fields['coupon_mode'] = $this->field_coupon_mode();
70
  }
32
  $this->field_forms_order = $this->get_fields_sequence();
33
  parent::__construct();
34
  $this->form_fields = $this->getFormFields('Custom');
35
+ $this->customer = $this->getOrCreateCustomer();
36
  $this->hook = new WC_WooMercadoPago_Hook_Custom($this);
37
  $this->notification = new WC_WooMercadoPago_Notification_Webhook($this);
38
  $this->currency_convertion = true;
64
  $form_fields['checkout_custom_payments_title'] = $this->field_checkout_custom_payments_title();
65
  $form_fields['checkout_payments_subtitle'] = $this->field_checkout_payments_subtitle();
66
  $form_fields['binary_mode'] = $this->field_binary_mode();
 
67
  $form_fields['checkout_custom_payments_advanced_title'] = $this->field_checkout_custom_payments_advanced_title();
68
  $form_fields['coupon_mode'] = $this->field_coupon_mode();
69
  }
includes/payments/WC_WooMercadoPago_PaymentAbstract.php CHANGED
@@ -335,6 +335,7 @@ class WC_WooMercadoPago_PaymentAbstract extends WC_Payment_Gateway
335
  $form_fields['checkout_ready_title'] = $this->field_checkout_ready_title();
336
  $form_fields['checkout_ready_description'] = $this->field_checkout_ready_description();
337
  $form_fields['checkout_ready_description_link'] = $this->field_checkout_ready_description_link();
 
338
  }
339
  }
340
 
335
  $form_fields['checkout_ready_title'] = $this->field_checkout_ready_title();
336
  $form_fields['checkout_ready_description'] = $this->field_checkout_ready_description();
337
  $form_fields['checkout_ready_description_link'] = $this->field_checkout_ready_description_link();
338
+ $form_fields[WC_WooMercadoPago_Helpers_CurrencyConverter::CONFIG_KEY] = $this->field_currency_conversion($this);
339
  }
340
  }
341
 
includes/payments/WC_WooMercadoPago_TicketGateway.php CHANGED
@@ -71,7 +71,6 @@ class WC_WooMercadoPago_TicketGateway extends WC_WooMercadoPago_PaymentAbstract
71
  $form_fields['coupon_mode'] = $this->field_coupon_mode();
72
  $form_fields['stock_reduce_mode'] = $this->field_stock_reduce_mode();
73
  $form_fields['date_expiration'] = $this->field_date_expiration();
74
- $form_fields[WC_WooMercadoPago_Helpers_CurrencyConverter::CONFIG_KEY] = $this->field_currency_conversion($this);
75
  foreach ($this->field_ticket_payments() as $key => $value) {
76
  $form_fields[$key] = $value;
77
  }
71
  $form_fields['coupon_mode'] = $this->field_coupon_mode();
72
  $form_fields['stock_reduce_mode'] = $this->field_stock_reduce_mode();
73
  $form_fields['date_expiration'] = $this->field_date_expiration();
 
74
  foreach ($this->field_ticket_payments() as $key => $value) {
75
  $form_fields[$key] = $value;
76
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: ecommerce, mercadopago, woocommerce
4
  Requires at least: 4.9.10
5
  Tested up to: 5.3
6
  Requires PHP: 5.6
7
- Stable tag: 4.1.0
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -116,6 +116,16 @@ Set up both the plugin and the checkouts you want to activate on your payment av
116
  Check out our <a href="https://www.mercadopago.com.br/developers/pt/plugins_sdks/plugins/official/woo-commerce/">official documentation</a> for more information on the specific fields to configure.
117
 
118
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
119
  = v4.1.0 (06/01/2020) =
120
  * Feature
121
  - Updated plugin name from "WooCommerce Mercado Pago" to "Mercado Pago payments for WooCommerce".
4
  Requires at least: 4.9.10
5
  Tested up to: 5.3
6
  Requires PHP: 5.6
7
+ Stable tag: 4.1.1
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
116
  Check out our <a href="https://www.mercadopago.com.br/developers/pt/plugins_sdks/plugins/official/woo-commerce/">official documentation</a> for more information on the specific fields to configure.
117
 
118
  == Changelog ==
119
+ = v4.1.1 (10/01/2020) =
120
+ * Feature
121
+ - Currency Conversion in Checkout Mercado Pago added
122
+
123
+ * Bug fixes
124
+ - Currency Conversion for CHO Custom ON and OFF fixed
125
+ - Shipping Cost in the creation of Preferences fixed
126
+ - ME2 shipping mode in the creation of Preferences removed
127
+ - Checkout Mercado Pago class instance fixed when the first configurations are saved
128
+
129
  = v4.1.0 (06/01/2020) =
130
  * Feature
131
  - Updated plugin name from "WooCommerce Mercado Pago" to "Mercado Pago payments for WooCommerce".
woocommerce-mercadopago.php CHANGED
@@ -3,13 +3,13 @@
3
  * Plugin Name: Mercado Pago payments for WooCommerce
4
  * Plugin URI: https://github.com/mercadopago/cart-woocommerce
5
  * Description: Configure the payment options and accept payments with cards, ticket and money of Mercado Pago account.
6
- * Version: 4.1.0
7
  * Author: Mercado Pago
8
  * Author URI: https://www.mercadopago.com.br/developers/
9
  * Text Domain: woocommerce-mercadopago
10
  * Domain Path: /i18n/languages/
11
  * WC requires at least: 3.0.0
12
- * WC tested up to: 3.7.0
13
  *
14
  * @package MercadoPago
15
  * @category Core
3
  * Plugin Name: Mercado Pago payments for WooCommerce
4
  * Plugin URI: https://github.com/mercadopago/cart-woocommerce
5
  * Description: Configure the payment options and accept payments with cards, ticket and money of Mercado Pago account.
6
+ * Version: 4.1.1
7
  * Author: Mercado Pago
8
  * Author URI: https://www.mercadopago.com.br/developers/
9
  * Text Domain: woocommerce-mercadopago
10
  * Domain Path: /i18n/languages/
11
  * WC requires at least: 3.0.0
12
+ * WC tested up to: 3.8.1
13
  *
14
  * @package MercadoPago
15
  * @category Core