WooCommerce MercadoPago - Version 3.0.8

Version Description

Download this release

Release Info

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

Code changes from version 3.0.7 to 3.0.8

i18n/languages/woocommerce-mercadopago-es_AR.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_AR.po CHANGED
@@ -1017,3 +1017,15 @@ msgstr "Hay un o más productos que tienen dimensiones invalidas."
1017
 
1018
  msgid "It seems you have <strong>Woo Mercado Pago Module</strong> installed. Please, uninstall it before using this version."
1019
  msgstr "Parece que tienes el módulo <strong>Woo Mercado Pago Module</strong> instalado. Por favor, desinstálelo antes de usar esta versión."
 
 
 
 
 
 
 
 
 
 
 
 
1017
 
1018
  msgid "It seems you have <strong>Woo Mercado Pago Module</strong> installed. Please, uninstall it before using this version."
1019
  msgstr "Parece que tienes el módulo <strong>Woo Mercado Pago Module</strong> instalado. Por favor, desinstálelo antes de usar esta versión."
1020
+
1021
+ msgid "Custom URL for IPN"
1022
+ msgstr "URL customizada para IPN"
1023
+
1024
+ msgid "If you want to use a custom URL for IPN inform it here.<br>Format should be as: <code>https://yourdomain.com/yoursubdomain</code>."
1025
+ msgstr "Si quieres usar una URL customizada para IPN colóquela acá.<br>El formato debe ser: <code>https://yourdomain.com/yoursubdomain</code>."
1026
+
1027
+ msgid "Address Number"
1028
+ msgstr "Número"
1029
+
1030
+ msgid "Address Additional Info"
1031
+ msgstr "Complemento"
i18n/languages/woocommerce-mercadopago-es_CL.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_CL.po CHANGED
@@ -1017,3 +1017,15 @@ msgstr "Hay un o más productos que tienen dimensiones invalidas."
1017
 
1018
  msgid "It seems you have <strong>Woo Mercado Pago Module</strong> installed. Please, uninstall it before using this version."
1019
  msgstr "Parece que tienes el módulo <strong>Woo Mercado Pago Module</strong> instalado. Por favor, desinstálelo antes de usar esta versión."
 
 
 
 
 
 
 
 
 
 
 
 
1017
 
1018
  msgid "It seems you have <strong>Woo Mercado Pago Module</strong> installed. Please, uninstall it before using this version."
1019
  msgstr "Parece que tienes el módulo <strong>Woo Mercado Pago Module</strong> instalado. Por favor, desinstálelo antes de usar esta versión."
1020
+
1021
+ msgid "Custom URL for IPN"
1022
+ msgstr "URL customizada para IPN"
1023
+
1024
+ msgid "If you want to use a custom URL for IPN inform it here.<br>Format should be as: <code>https://yourdomain.com/yoursubdomain</code>."
1025
+ msgstr "Si quieres usar una URL customizada para IPN colóquela acá.<br>El formato debe ser: <code>https://yourdomain.com/yoursubdomain</code>."
1026
+
1027
+ msgid "Address Number"
1028
+ msgstr "Número"
1029
+
1030
+ msgid "Address Additional Info"
1031
+ msgstr "Complemento"
i18n/languages/woocommerce-mercadopago-es_CO.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_CO.po CHANGED
@@ -1017,3 +1017,15 @@ msgstr "Hay un o más productos que tienen dimensiones invalidas."
1017
 
1018
  msgid "It seems you have <strong>Woo Mercado Pago Module</strong> installed. Please, uninstall it before using this version."
1019
  msgstr "Parece que tienes el módulo <strong>Woo Mercado Pago Module</strong> instalado. Por favor, desinstálelo antes de usar esta versión."
 
 
 
 
 
 
 
 
 
 
 
 
1017
 
1018
  msgid "It seems you have <strong>Woo Mercado Pago Module</strong> installed. Please, uninstall it before using this version."
1019
  msgstr "Parece que tienes el módulo <strong>Woo Mercado Pago Module</strong> instalado. Por favor, desinstálelo antes de usar esta versión."
1020
+
1021
+ msgid "Custom URL for IPN"
1022
+ msgstr "URL customizada para IPN"
1023
+
1024
+ msgid "If you want to use a custom URL for IPN inform it here.<br>Format should be as: <code>https://yourdomain.com/yoursubdomain</code>."
1025
+ msgstr "Si quieres usar una URL customizada para IPN colóquela acá.<br>El formato debe ser: <code>https://yourdomain.com/yoursubdomain</code>."
1026
+
1027
+ msgid "Address Number"
1028
+ msgstr "Número"
1029
+
1030
+ msgid "Address Additional Info"
1031
+ msgstr "Complemento"
i18n/languages/woocommerce-mercadopago-es_ES.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_ES.po CHANGED
@@ -1017,3 +1017,15 @@ msgstr "Hay un o más productos que tienen dimensiones invalidas."
1017
 
1018
  msgid "It seems you have <strong>Woo Mercado Pago Module</strong> installed. Please, uninstall it before using this version."
1019
  msgstr "Parece que tienes el módulo <strong>Woo Mercado Pago Module</strong> instalado. Por favor, desinstálelo antes de usar esta versión."
 
 
 
 
 
 
 
 
 
 
 
 
1017
 
1018
  msgid "It seems you have <strong>Woo Mercado Pago Module</strong> installed. Please, uninstall it before using this version."
1019
  msgstr "Parece que tienes el módulo <strong>Woo Mercado Pago Module</strong> instalado. Por favor, desinstálelo antes de usar esta versión."
1020
+
1021
+ msgid "Custom URL for IPN"
1022
+ msgstr "URL customizada para IPN"
1023
+
1024
+ msgid "If you want to use a custom URL for IPN inform it here.<br>Format should be as: <code>https://yourdomain.com/yoursubdomain</code>."
1025
+ msgstr "Si quieres usar una URL customizada para IPN colóquela acá.<br>El formato debe ser: <code>https://yourdomain.com/yoursubdomain</code>."
1026
+
1027
+ msgid "Address Number"
1028
+ msgstr "Número"
1029
+
1030
+ msgid "Address Additional Info"
1031
+ msgstr "Complemento"
i18n/languages/woocommerce-mercadopago-es_MX.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_MX.po CHANGED
@@ -1017,3 +1017,15 @@ msgstr "Hay un o más productos que tienen dimensiones invalidas."
1017
 
1018
  msgid "It seems you have <strong>Woo Mercado Pago Module</strong> installed. Please, uninstall it before using this version."
1019
  msgstr "Parece que tienes el módulo <strong>Woo Mercado Pago Module</strong> instalado. Por favor, desinstálelo antes de usar esta versión."
 
 
 
 
 
 
 
 
 
 
 
 
1017
 
1018
  msgid "It seems you have <strong>Woo Mercado Pago Module</strong> installed. Please, uninstall it before using this version."
1019
  msgstr "Parece que tienes el módulo <strong>Woo Mercado Pago Module</strong> instalado. Por favor, desinstálelo antes de usar esta versión."
1020
+
1021
+ msgid "Custom URL for IPN"
1022
+ msgstr "URL customizada para IPN"
1023
+
1024
+ msgid "If you want to use a custom URL for IPN inform it here.<br>Format should be as: <code>https://yourdomain.com/yoursubdomain</code>."
1025
+ msgstr "Si quieres usar una URL customizada para IPN colóquela acá.<br>El formato debe ser: <code>https://yourdomain.com/yoursubdomain</code>."
1026
+
1027
+ msgid "Address Number"
1028
+ msgstr "Número"
1029
+
1030
+ msgid "Address Additional Info"
1031
+ msgstr "Complemento"
i18n/languages/woocommerce-mercadopago-es_PE.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_PE.po CHANGED
@@ -1017,3 +1017,15 @@ msgstr "Hay un o más productos que tienen dimensiones invalidas."
1017
 
1018
  msgid "It seems you have <strong>Woo Mercado Pago Module</strong> installed. Please, uninstall it before using this version."
1019
  msgstr "Parece que tienes el módulo <strong>Woo Mercado Pago Module</strong> instalado. Por favor, desinstálelo antes de usar esta versión."
 
 
 
 
 
 
 
 
 
 
 
 
1017
 
1018
  msgid "It seems you have <strong>Woo Mercado Pago Module</strong> installed. Please, uninstall it before using this version."
1019
  msgstr "Parece que tienes el módulo <strong>Woo Mercado Pago Module</strong> instalado. Por favor, desinstálelo antes de usar esta versión."
1020
+
1021
+ msgid "Custom URL for IPN"
1022
+ msgstr "URL customizada para IPN"
1023
+
1024
+ msgid "If you want to use a custom URL for IPN inform it here.<br>Format should be as: <code>https://yourdomain.com/yoursubdomain</code>."
1025
+ msgstr "Si quieres usar una URL customizada para IPN colóquela acá.<br>El formato debe ser: <code>https://yourdomain.com/yoursubdomain</code>."
1026
+
1027
+ msgid "Address Number"
1028
+ msgstr "Número"
1029
+
1030
+ msgid "Address Additional Info"
1031
+ msgstr "Complemento"
i18n/languages/woocommerce-mercadopago-es_UY.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_UY.po CHANGED
@@ -1017,3 +1017,15 @@ msgstr "Hay un o más productos que tienen dimensiones invalidas."
1017
 
1018
  msgid "It seems you have <strong>Woo Mercado Pago Module</strong> installed. Please, uninstall it before using this version."
1019
  msgstr "Parece que tienes el módulo <strong>Woo Mercado Pago Module</strong> instalado. Por favor, desinstálelo antes de usar esta versión."
 
 
 
 
 
 
 
 
 
 
 
 
1017
 
1018
  msgid "It seems you have <strong>Woo Mercado Pago Module</strong> installed. Please, uninstall it before using this version."
1019
  msgstr "Parece que tienes el módulo <strong>Woo Mercado Pago Module</strong> instalado. Por favor, desinstálelo antes de usar esta versión."
1020
+
1021
+ msgid "Custom URL for IPN"
1022
+ msgstr "URL customizada para IPN"
1023
+
1024
+ msgid "If you want to use a custom URL for IPN inform it here.<br>Format should be as: <code>https://yourdomain.com/yoursubdomain</code>."
1025
+ msgstr "Si quieres usar una URL customizada para IPN colóquela acá.<br>El formato debe ser: <code>https://yourdomain.com/yoursubdomain</code>."
1026
+
1027
+ msgid "Address Number"
1028
+ msgstr "Número"
1029
+
1030
+ msgid "Address Additional Info"
1031
+ msgstr "Complemento"
i18n/languages/woocommerce-mercadopago-es_VE.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-es_VE.po CHANGED
@@ -1017,3 +1017,15 @@ msgstr "Hay un o más productos que tienen dimensiones invalidas."
1017
 
1018
  msgid "It seems you have <strong>Woo Mercado Pago Module</strong> installed. Please, uninstall it before using this version."
1019
  msgstr "Parece que tienes el módulo <strong>Woo Mercado Pago Module</strong> instalado. Por favor, desinstálelo antes de usar esta versión."
 
 
 
 
 
 
 
 
 
 
 
 
1017
 
1018
  msgid "It seems you have <strong>Woo Mercado Pago Module</strong> installed. Please, uninstall it before using this version."
1019
  msgstr "Parece que tienes el módulo <strong>Woo Mercado Pago Module</strong> instalado. Por favor, desinstálelo antes de usar esta versión."
1020
+
1021
+ msgid "Custom URL for IPN"
1022
+ msgstr "URL customizada para IPN"
1023
+
1024
+ msgid "If you want to use a custom URL for IPN inform it here.<br>Format should be as: <code>https://yourdomain.com/yoursubdomain</code>."
1025
+ msgstr "Si quieres usar una URL customizada para IPN colóquela acá.<br>El formato debe ser: <code>https://yourdomain.com/yoursubdomain</code>."
1026
+
1027
+ msgid "Address Number"
1028
+ msgstr "Número"
1029
+
1030
+ msgid "Address Additional Info"
1031
+ msgstr "Complemento"
i18n/languages/woocommerce-mercadopago-pt_BR.mo CHANGED
Binary file
i18n/languages/woocommerce-mercadopago-pt_BR.po CHANGED
@@ -1017,3 +1017,15 @@ msgstr "Um ou mais de seus produtos possuem dimensões inválidas."
1017
 
1018
  msgid "It seems you have <strong>Woo Mercado Pago Module</strong> installed. Please, uninstall it before using this version."
1019
  msgstr "Parece que você possui o plugin <strong>Woo Mercado Pago Module</strong> instalado. Por favor, desinstale-o antes de usar esta versão."
 
 
 
 
 
 
 
 
 
 
 
 
1017
 
1018
  msgid "It seems you have <strong>Woo Mercado Pago Module</strong> installed. Please, uninstall it before using this version."
1019
  msgstr "Parece que você possui o plugin <strong>Woo Mercado Pago Module</strong> instalado. Por favor, desinstale-o antes de usar esta versão."
1020
+
1021
+ msgid "Custom URL for IPN"
1022
+ msgstr "URL customizada para IPN"
1023
+
1024
+ msgid "If you want to use a custom URL for IPN inform it here.<br>Format should be as: <code>https://yourdomain.com/yoursubdomain</code>."
1025
+ msgstr "Caso você queira usar uma URL customizada para IPN informe-a aqui.<br>O formato deve ser: <code>https://yourdomain.com/yoursubdomain</code>."
1026
+
1027
+ msgid "Address Number"
1028
+ msgstr "Número"
1029
+
1030
+ msgid "Address Additional Info"
1031
+ msgstr "Complemento"
i18n/languages/woocommerce-mercadopago.pot CHANGED
@@ -1017,3 +1017,15 @@ msgstr ""
1017
 
1018
  msgid "It seems you have <strong>Woo Mercado Pago Module</strong> installed. Please, uninstall it before using this version."
1019
  msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
1017
 
1018
  msgid "It seems you have <strong>Woo Mercado Pago Module</strong> installed. Please, uninstall it before using this version."
1019
  msgstr ""
1020
+
1021
+ msgid "Custom URL for IPN"
1022
+ msgstr ""
1023
+
1024
+ msgid "If you want to use a custom URL for IPN inform it here.<br>Format should be as: <code>https://yourdomain.com/yoursubdomain</code>."
1025
+ msgstr ""
1026
+
1027
+ msgid "Address Number"
1028
+ msgstr ""
1029
+
1030
+ msgid "Address Additional Info"
1031
+ msgstr ""
includes/WC_WooMercadoPago_BasicGateway.php CHANGED
@@ -845,17 +845,17 @@ class WC_WooMercadoPago_BasicGateway extends WC_Payment_Gateway {
845
  ),
846
  'back_urls' => array(
847
  'success' => empty( $this->success_url ) ?
848
- WC_Woo_Mercado_Pago_Module::workaround_ampersand_bug(
849
  esc_url( $this->get_return_url( $order ) )
850
  ) :
851
  $this->success_url,
852
  'failure' => empty( $this->failure_url ) ?
853
- WC_Woo_Mercado_Pago_Module::workaround_ampersand_bug(
854
  esc_url( $order->get_cancel_order_url() )
855
  ) :
856
  $this->failure_url,
857
  'pending' => empty( $this->pending_url ) ?
858
- WC_Woo_Mercado_Pago_Module::workaround_ampersand_bug(
859
  esc_url( $this->get_return_url( $order) )
860
  ) : $this->pending_url
861
  ),
@@ -928,7 +928,15 @@ class WC_WooMercadoPago_BasicGateway extends WC_Payment_Gateway {
928
 
929
  // Do not set IPN url if it is a localhost.
930
  if ( ! strrpos( get_site_url(), 'localhost' ) ) {
931
- $preferences['notification_url'] = WC()->api_request_url( 'WC_WooMercadoPago_BasicGateway' );
 
 
 
 
 
 
 
 
932
  }
933
 
934
  // Set sponsor ID.
845
  ),
846
  'back_urls' => array(
847
  'success' => empty( $this->success_url ) ?
848
+ WC_Woo_Mercado_Pago_Module::fix_url_ampersand(
849
  esc_url( $this->get_return_url( $order ) )
850
  ) :
851
  $this->success_url,
852
  'failure' => empty( $this->failure_url ) ?
853
+ WC_Woo_Mercado_Pago_Module::fix_url_ampersand(
854
  esc_url( $order->get_cancel_order_url() )
855
  ) :
856
  $this->failure_url,
857
  'pending' => empty( $this->pending_url ) ?
858
+ WC_Woo_Mercado_Pago_Module::fix_url_ampersand(
859
  esc_url( $this->get_return_url( $order) )
860
  ) : $this->pending_url
861
  ),
928
 
929
  // Do not set IPN url if it is a localhost.
930
  if ( ! strrpos( get_site_url(), 'localhost' ) ) {
931
+ $notification_url = get_option( '_mp_custom_domain', '' );
932
+ // Check if we have a custom URL.
933
+ if ( empty( $notification_url ) || filter_var( $notification_url, FILTER_VALIDATE_URL ) === FALSE ) {
934
+ $preferences['notification_url'] = WC()->api_request_url( 'WC_WooMercadoPago_BasicGateway' );
935
+ } else {
936
+ $preferences['notification_url'] = WC_Woo_Mercado_Pago_Module::fix_url_ampersand( esc_url(
937
+ $notification_url . '/wc-api/WC_WooMercadoPago_BasicGateway/'
938
+ ) );
939
+ }
940
  }
941
 
942
  // Set sponsor ID.
includes/WC_WooMercadoPago_CustomGateway.php CHANGED
@@ -833,7 +833,15 @@ class WC_WooMercadoPago_CustomGateway extends WC_Payment_Gateway {
833
 
834
  // Do not set IPN url if it is a localhost.
835
  if ( ! strrpos( get_site_url(), 'localhost' ) ) {
836
- $preferences['notification_url'] = WC()->api_request_url( 'WC_WooMercadoPago_CustomGateway' );
 
 
 
 
 
 
 
 
837
  }
838
 
839
  // Discounts features.
833
 
834
  // Do not set IPN url if it is a localhost.
835
  if ( ! strrpos( get_site_url(), 'localhost' ) ) {
836
+ $notification_url = get_option( '_mp_custom_domain', '' );
837
+ // Check if we have a custom URL.
838
+ if ( empty( $notification_url ) || filter_var( $notification_url, FILTER_VALIDATE_URL ) === FALSE ) {
839
+ $preferences['notification_url'] = WC()->api_request_url( 'WC_WooMercadoPago_CustomGateway' );
840
+ } else {
841
+ $preferences['notification_url'] = WC_Woo_Mercado_Pago_Module::fix_url_ampersand( esc_url(
842
+ $notification_url . '/wc-api/WC_WooMercadoPago_CustomGateway/'
843
+ ) );
844
+ }
845
  }
846
 
847
  // Discounts features.
includes/WC_WooMercadoPago_SubscriptionGateway.php CHANGED
@@ -643,7 +643,7 @@ class WC_WooMercadoPago_SubscriptionGateway extends WC_Payment_Gateway {
643
  $order->get_billing_email() :
644
  $order->billing_email,
645
  'back_url' => ( empty( $this->success_url ) ?
646
- WC_Woo_Mercado_Pago_Module::workaround_ampersand_bug(
647
  esc_url( $this->get_return_url( $order ) )
648
  ) : $this->success_url
649
  ),
@@ -669,7 +669,15 @@ class WC_WooMercadoPago_SubscriptionGateway extends WC_Payment_Gateway {
669
 
670
  // Do not set IPN url if it is a localhost.
671
  if ( ! strrpos( get_site_url(), 'localhost' ) ) {
672
- $preferences['notification_url'] = WC()->api_request_url( 'WC_WooMercadoPago_SubscriptionGateway' );
 
 
 
 
 
 
 
 
673
  }
674
 
675
  // Set sponsor ID.
643
  $order->get_billing_email() :
644
  $order->billing_email,
645
  'back_url' => ( empty( $this->success_url ) ?
646
+ WC_Woo_Mercado_Pago_Module::fix_url_ampersand(
647
  esc_url( $this->get_return_url( $order ) )
648
  ) : $this->success_url
649
  ),
669
 
670
  // Do not set IPN url if it is a localhost.
671
  if ( ! strrpos( get_site_url(), 'localhost' ) ) {
672
+ $notification_url = get_option( '_mp_custom_domain', '' );
673
+ // Check if we have a custom URL.
674
+ if ( empty( $notification_url ) || filter_var( $notification_url, FILTER_VALIDATE_URL ) === FALSE ) {
675
+ $preferences['notification_url'] = WC()->api_request_url( 'WC_WooMercadoPago_SubscriptionGateway' );
676
+ } else {
677
+ $preferences['notification_url'] = WC_Woo_Mercado_Pago_Module::fix_url_ampersand( esc_url(
678
+ $notification_url . '/wc-api/WC_WooMercadoPago_SubscriptionGateway/'
679
+ ) );
680
+ }
681
  }
682
 
683
  // Set sponsor ID.
includes/WC_WooMercadoPago_TicketGateway.php CHANGED
@@ -864,7 +864,15 @@ class WC_WooMercadoPago_TicketGateway extends WC_Payment_Gateway {
864
 
865
  // Do not set IPN url if it is a localhost.
866
  if ( ! strrpos( get_site_url(), 'localhost' ) ) {
867
- $preferences['notification_url'] = WC()->api_request_url( 'WC_WooMercadoPago_TicketGateway' );
 
 
 
 
 
 
 
 
868
  }
869
 
870
  // Discounts features.
864
 
865
  // Do not set IPN url if it is a localhost.
866
  if ( ! strrpos( get_site_url(), 'localhost' ) ) {
867
+ $notification_url = get_option( '_mp_custom_domain', '' );
868
+ // Check if we have a custom URL.
869
+ if ( empty( $notification_url ) || filter_var( $notification_url, FILTER_VALIDATE_URL ) === FALSE ) {
870
+ $preferences['notification_url'] = WC()->api_request_url( 'WC_WooMercadoPago_TicketGateway' );
871
+ } else {
872
+ $preferences['notification_url'] = WC_Woo_Mercado_Pago_Module::fix_url_ampersand( esc_url(
873
+ $notification_url . '/wc-api/WC_WooMercadoPago_TicketGateway/'
874
+ ) );
875
+ }
876
  }
877
 
878
  // Discounts features.
includes/sdk/lib/mercadopago.php CHANGED
@@ -12,7 +12,7 @@ $GLOBALS['LIB_LOCATION'] = dirname( __FILE__ );
12
 
13
  class MP {
14
 
15
- private $version = '3.0.7';
16
  private $client_id;
17
  private $client_secret;
18
  private $ll_access_token;
12
 
13
  class MP {
14
 
15
+ private $version = '3.0.8';
16
  private $client_id;
17
  private $client_secret;
18
  private $ll_access_token;
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: ecommerce, mercadopago, woocommerce
4
  Requires at least: 4.8
5
  Tested up to: 4.8
6
  Requires PHP: 5.6
7
- Stable tag: 3.0.7
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -215,6 +215,11 @@ Features: LatAm Basic Checkout support. Great for merchants who want to get goin
215
 
216
  == Changelog ==
217
 
 
 
 
 
 
218
  = v3.0.7 (21/12/2017) =
219
  * Improvements
220
  - Checking presence of older versions to prevent inconsistences.
4
  Requires at least: 4.8
5
  Tested up to: 4.8
6
  Requires PHP: 5.6
7
+ Stable tag: 3.0.8
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
215
 
216
  == Changelog ==
217
 
218
+ = v3.0.8 (05/01/2018) =
219
+ * Improvements
220
+ - Increased support and handling to older PHP;
221
+ - IPN/Webhook now customizable.
222
+
223
  = v3.0.7 (21/12/2017) =
224
  * Improvements
225
  - Checking presence of older versions to prevent inconsistences.
templates/mp_main_settings.php CHANGED
@@ -299,17 +299,15 @@
299
  </p>
300
  </td>
301
  </tr>
302
- <!--<tr>
303
- <th scope="row"><label><?php echo __( 'Custom Domain for IPN', 'woocommerce-mercadopago' ); ?></label></th>
304
  <td>
305
  <input name="custom_domain" type="text" id="custom_domain" aria-describedby="tagline-description" value="<?php echo $custom_domain; ?>" class="regular-text"/>
306
  <p class="description" id="tagline-description">
307
- <?php echo sprintf( '%s',
308
- __( 'If your store is hosted as a subdomain, please inform the complete store URL here.<br>Format should be as: <code>https://yourdomain.com/yoursubdomain</code>.', 'woocommerce-mercadopago' )
309
- ); ?>
310
  </p>
311
  </td>
312
- </tr>-->
313
  </table>
314
 
315
  <table class="form-table" border="0.5" frame="hsides" rules="void">
299
  </p>
300
  </td>
301
  </tr>
302
+ <tr>
303
+ <th scope="row"><label><?php echo __( 'Custom URL for IPN', 'woocommerce-mercadopago' ); ?></label></th>
304
  <td>
305
  <input name="custom_domain" type="text" id="custom_domain" aria-describedby="tagline-description" value="<?php echo $custom_domain; ?>" class="regular-text"/>
306
  <p class="description" id="tagline-description">
307
+ <?php echo $custom_domain_message; ?>
 
 
308
  </p>
309
  </td>
310
+ </tr>
311
  </table>
312
 
313
  <table class="form-table" border="0.5" frame="hsides" rules="void">
woocommerce-mercadopago.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WooCommerce MercadoPago
4
  * Plugin URI: https://github.com/mercadopago/cart-woocommerce
5
  * Description: This is the <strong>oficial</strong> module of Mercado Pago for WooCommerce plugin. This module enables WooCommerce to use Mercado Pago as a payment Gateway for purchases made in your e-commerce store.
6
- * Version: 3.0.7
7
  * Author: Mercado Pago
8
  * Author URI: https://www.mercadopago.com.br/developers/
9
  * Text Domain: woocommerce-mercadopago
@@ -83,7 +83,7 @@ if ( ! class_exists( 'WC_Woo_Mercado_Pago_Module' ) ) :
83
  * - get_common_settings()
84
  * - get_categories()
85
  * - get_site_data( $is_v1 = false )
86
- * - workaround_ampersand_bug( $link )
87
  * - get_templates_path()
88
  * - get_module_version()
89
  * - get_client_id( $at )
@@ -105,7 +105,7 @@ if ( ! class_exists( 'WC_Woo_Mercado_Pago_Module' ) ) :
105
  // ============================================================
106
 
107
  // General constants.
108
- const VERSION = '3.0.7';
109
  const MIN_PHP = 5.6;
110
 
111
  // Arrays to hold configurations for LatAm environment.
@@ -544,7 +544,7 @@ if ( ! class_exists( 'WC_Woo_Mercado_Pago_Module' ) ) :
544
  }
545
 
546
  // Fix to URL Problem : #038; replaces & and breaks the navigation.
547
- public static function workaround_ampersand_bug( $link ) {
548
  return str_replace( '\/', '/', str_replace( '&#038;', '&', $link) );
549
  }
550
 
@@ -868,7 +868,11 @@ if ( ! class_exists( 'WC_Woo_Mercado_Pago_Module' ) ) :
868
  foreach ( $all_product_data as $p ) {
869
  $product = wc_get_product( $p->ID );
870
  if ( ! $product->is_virtual() ) {
 
871
  $dimensions = $product->get_dimensions( false );
 
 
 
872
  if ( ! is_numeric( $dimensions['height'] ) ) {
873
  return false;
874
  }
@@ -878,9 +882,6 @@ if ( ! class_exists( 'WC_Woo_Mercado_Pago_Module' ) ) :
878
  if ( ! is_numeric( $dimensions['length'] ) ) {
879
  return false;
880
  }
881
- if ( empty( $product->get_weight() ) || ! is_numeric( $product->get_weight() ) ) {
882
- return false;
883
- }
884
  }
885
  }
886
  return true;
@@ -996,11 +997,11 @@ if ( ! class_exists( 'WC_Woo_Mercado_Pago_Module' ) ) :
996
  } else {
997
  update_option( '_mp_store_identificator', '', true );
998
  }
999
- /*if ( isset( $_POST['custom_domain'] ) ) {
1000
  update_option( '_mp_custom_domain', $_POST['custom_domain'], true );
1001
  } else {
1002
  update_option( '_mp_custom_domain', '', true );
1003
- }*/
1004
  if ( isset( $_POST['currency_conversion_v0'] ) ) {
1005
  update_option( '_mp_currency_conversion_v0', $_POST['currency_conversion_v0'], true );
1006
  } else {
@@ -1091,7 +1092,15 @@ if ( ! class_exists( 'WC_Woo_Mercado_Pago_Module' ) ) :
1091
  // Store identification.
1092
  $store_identificator = get_option( '_mp_store_identificator', 'WC-' );
1093
  // Custom domain for IPN.
1094
- /*$custom_domain = get_option( '_mp_custom_domain', '' );*/
 
 
 
 
 
 
 
 
1095
  // Debug mode.
1096
  $_mp_debug_mode = get_option( '_mp_debug_mode', '' );
1097
  if ( empty( $_mp_debug_mode ) ) {
@@ -1246,6 +1255,51 @@ if ( ! class_exists( 'WC_Woo_Mercado_Pago_Module' ) ) :
1246
 
1247
  // ==========================================================================================
1248
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1249
  // add our own item to the order actions meta box
1250
  add_action( 'woocommerce_order_actions', 'add_mp_order_meta_box_actions' );
1251
  // define the item in the meta box by adding an item to the $actions array
3
  * Plugin Name: WooCommerce MercadoPago
4
  * Plugin URI: https://github.com/mercadopago/cart-woocommerce
5
  * Description: This is the <strong>oficial</strong> module of Mercado Pago for WooCommerce plugin. This module enables WooCommerce to use Mercado Pago as a payment Gateway for purchases made in your e-commerce store.
6
+ * Version: 3.0.8
7
  * Author: Mercado Pago
8
  * Author URI: https://www.mercadopago.com.br/developers/
9
  * Text Domain: woocommerce-mercadopago
83
  * - get_common_settings()
84
  * - get_categories()
85
  * - get_site_data( $is_v1 = false )
86
+ * - fix_url_ampersand( $link )
87
  * - get_templates_path()
88
  * - get_module_version()
89
  * - get_client_id( $at )
105
  // ============================================================
106
 
107
  // General constants.
108
+ const VERSION = '3.0.8';
109
  const MIN_PHP = 5.6;
110
 
111
  // Arrays to hold configurations for LatAm environment.
544
  }
545
 
546
  // Fix to URL Problem : #038; replaces & and breaks the navigation.
547
+ public static function fix_url_ampersand( $link ) {
548
  return str_replace( '\/', '/', str_replace( '&#038;', '&', $link) );
549
  }
550
 
868
  foreach ( $all_product_data as $p ) {
869
  $product = wc_get_product( $p->ID );
870
  if ( ! $product->is_virtual() ) {
871
+ $w = $product->get_weight();
872
  $dimensions = $product->get_dimensions( false );
873
+ if ( empty( $w ) || ! is_numeric( $w ) ) {
874
+ return false;
875
+ }
876
  if ( ! is_numeric( $dimensions['height'] ) ) {
877
  return false;
878
  }
882
  if ( ! is_numeric( $dimensions['length'] ) ) {
883
  return false;
884
  }
 
 
 
885
  }
886
  }
887
  return true;
997
  } else {
998
  update_option( '_mp_store_identificator', '', true );
999
  }
1000
+ if ( isset( $_POST['custom_domain'] ) ) {
1001
  update_option( '_mp_custom_domain', $_POST['custom_domain'], true );
1002
  } else {
1003
  update_option( '_mp_custom_domain', '', true );
1004
+ }
1005
  if ( isset( $_POST['currency_conversion_v0'] ) ) {
1006
  update_option( '_mp_currency_conversion_v0', $_POST['currency_conversion_v0'], true );
1007
  } else {
1092
  // Store identification.
1093
  $store_identificator = get_option( '_mp_store_identificator', 'WC-' );
1094
  // Custom domain for IPN.
1095
+ $custom_domain = get_option( '_mp_custom_domain', '' );
1096
+ if ( ! empty( $custom_domain ) && filter_var( $custom_domain, FILTER_VALIDATE_URL ) === FALSE ) {
1097
+ $custom_domain_message = '<img width="14" height="14" src="' . plugins_url( 'assets/images/warning.png', __FILE__ ) . '"> ' .
1098
+ __( 'This appears to be an invalid URL.', 'woocommerce-mercadopago' ) . ' ';
1099
+ } else {
1100
+ $custom_domain_message = sprintf( '%s',
1101
+ __( 'If you want to use a custom URL for IPN inform it here.<br>Format should be as: <code>https://yourdomain.com/yoursubdomain</code>.', 'woocommerce-mercadopago' )
1102
+ );
1103
+ }
1104
  // Debug mode.
1105
  $_mp_debug_mode = get_option( '_mp_debug_mode', '' );
1106
  if ( empty( $_mp_debug_mode ) ) {
1255
 
1256
  // ==========================================================================================
1257
 
1258
+ // add custom field for checkout
1259
+ /*add_filter( 'woocommerce_checkout_fields', 'custom_override_checkout_fields', 10, 2 );
1260
+ // check for specific countries to add specific custom fields
1261
+ function custom_override_checkout_fields( $fields ) {
1262
+ $fields['billing']['billing_payer_doc_type']['type'] = 'select';
1263
+ $fields['billing']['billing_payer_doc_type']['options'] = array(
1264
+ 'option_1' => 'CPF',
1265
+ 'option_2' => 'CNPJ'
1266
+ );
1267
+ $fields['billing']['billing_payer_doc_type']['label'] = esc_html__( 'Document Type', 'woocommerce-mercadopago' );
1268
+ $fields['billing']['billing_payer_doc_type']['class'] = array(
1269
+ 'form-row-first'
1270
+ );
1271
+ $fields['billing']['billing_payer_doc']['type'] = 'text';
1272
+ $fields['billing']['billing_payer_doc']['label'] = esc_html__( 'Document number', 'woocommerce-mercadopago' );
1273
+ $fields['billing']['billing_payer_doc']['required'] = true;
1274
+ $fields['billing']['billing_payer_doc']['class'] = array(
1275
+ 'form-row-last'
1276
+ );
1277
+ $fields['billing']['billing_address_number']['type'] = 'text';
1278
+ $fields['billing']['billing_address_number']['label'] = esc_html__( 'Address Number', 'woocommerce-mercadopago' );
1279
+ $fields['billing']['billing_address_number']['class'] = array(
1280
+ 'form-row-first'
1281
+ );
1282
+ $fields['billing']['billing_address_2']['class'] = array(
1283
+ 'form-row-last'
1284
+ );
1285
+ $fields['billing']['billing_address_2']['label'] = esc_html__( 'Address Additional Info', 'woocommerce-mercadopago' );'Complemento';
1286
+ $order = array(
1287
+ 'billing_first_name', 'billing_last_name',
1288
+ 'billing_payer_doc_type', 'billing_payer_doc',
1289
+ 'billing_company',
1290
+ 'billing_address_1',
1291
+ 'billing_address_number', 'billing_address_2',
1292
+ 'billing_postcode',
1293
+ 'billing_country',
1294
+ 'billing_email', 'billing_phone'
1295
+ );
1296
+ foreach( $order as $field ) {
1297
+ $ordered_fields[$field] = $fields['billing'][$field];
1298
+ }
1299
+ $fields['billing'] = $ordered_fields;
1300
+ return $fields;
1301
+ }*/
1302
+
1303
  // add our own item to the order actions meta box
1304
  add_action( 'woocommerce_order_actions', 'add_mp_order_meta_box_actions' );
1305
  // define the item in the meta box by adding an item to the $actions array