From 5c9fef73a354aeb10147f6f3f53b72617f4d97cc Mon Sep 17 00:00:00 2001 From: Fernando Lira Date: Mon, 14 Feb 2022 19:36:46 -0300 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=F0=9F=90=9B=20added=20validation=20?= =?UTF-8?q?before=20load=20js=20and=20css=20of=20pool,=20pass=20all=20paym?= =?UTF-8?q?ents=20methods=20on=20payment=20available?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../class-wc-woomercadopago-configs.php | 6 +- ...wc-woomercadopago-mercadopago-settings.php | 59 ++++++++++--------- 2 files changed, 35 insertions(+), 30 deletions(-) diff --git a/includes/module/class-wc-woomercadopago-configs.php b/includes/module/class-wc-woomercadopago-configs.php index 8c57a5770..ff87d0e1e 100755 --- a/includes/module/class-wc-woomercadopago-configs.php +++ b/includes/module/class-wc-woomercadopago-configs.php @@ -385,15 +385,17 @@ public function set_payment_gateway( $methods = null ) { return $methods; } - return $this->get_available_payment_methods(); + return $this->get_available_payment_methods($methods); } /** * Get available payment methods * + * @param array|null $methods + * * @return array */ - public function get_available_payment_methods() { + public function get_available_payment_methods($methods) { $wc_country = WC_WooMercadoPago_Module::get_woocommerce_default_country(); $site_id = strtolower(get_option( '_site_id_v1', '' )); diff --git a/includes/module/mercadopago-settings/class-wc-woomercadopago-mercadopago-settings.php b/includes/module/mercadopago-settings/class-wc-woomercadopago-mercadopago-settings.php index 61fdb11a3..2857e96d4 100644 --- a/includes/module/mercadopago-settings/class-wc-woomercadopago-mercadopago-settings.php +++ b/includes/module/mercadopago-settings/class-wc-woomercadopago-mercadopago-settings.php @@ -73,40 +73,43 @@ public function load_admin_scripts() { * Load Research JavaScripts */ public function load_research_script() { - - global $woocommerce; - wp_enqueue_script( - 'mercadopago_research_javascript', - 'https://http2.mlstatic.com/storage/v1/plugins/caronte/woocommerce.js?v=101', - array(), - WC_WooMercadoPago_Constants::VERSION, - true - ); - wp_localize_script( - 'mercadopago_research_javascript', - 'wc_mercadopago_params', - array( - 'site_id' => $this->options->get_site_id() ? strtoupper($this->options->get_site_id()) : 'MLA', - 'platform_id' => WC_WooMercadoPago_Constants::PLATAFORM_ID, - 'platform_version' => $woocommerce->version, - 'plugin_version' => WC_WooMercadoPago_Constants::VERSION, - 'public_key_element_id' => 'mp-public-key-prod', - 'reference_element_id' => 'reference' - ) - ); + if ( is_admin() && ( WC_WooMercadoPago_Helper_Current_Url::validate_page('mercadopago-settings') || WC_WooMercadoPago_Helper_Current_Url::validate_section('woo-mercado-pago') ) ) { + global $woocommerce; + wp_enqueue_script( + 'mercadopago_research_javascript', + 'https://http2.mlstatic.com/storage/v1/plugins/caronte/woocommerce.js?v=101', + array(), + WC_WooMercadoPago_Constants::VERSION, + true + ); + wp_localize_script( + 'mercadopago_research_javascript', + 'wc_mercadopago_params', + array( + 'site_id' => $this->options->get_site_id() ? strtoupper( $this->options->get_site_id() ) : 'MLA', + 'platform_id' => WC_WooMercadoPago_Constants::PLATAFORM_ID, + 'platform_version' => $woocommerce->version, + 'plugin_version' => WC_WooMercadoPago_Constants::VERSION, + 'public_key_element_id' => 'mp-public-key-prod', + 'reference_element_id' => 'reference' + ) + ); + } } /** * Load Research Style */ public function load_research_style() { - wp_register_style( - 'mercadopago_research_css', - 'https://http2.mlstatic.com/storage/v1/plugins/caronte/woocommerce.css' , - false, - WC_WooMercadoPago_Constants::VERSION - ); - wp_enqueue_style( 'mercadopago_research_css' ); + if ( is_admin() && ( WC_WooMercadoPago_Helper_Current_Url::validate_page('mercadopago-settings') || WC_WooMercadoPago_Helper_Current_Url::validate_section('woo-mercado-pago') ) ) { + wp_register_style( + 'mercadopago_research_css', + 'https://http2.mlstatic.com/storage/v1/plugins/caronte/woocommerce.css', + false, + WC_WooMercadoPago_Constants::VERSION + ); + wp_enqueue_style( 'mercadopago_research_css' ); + } } /** From 2f2a68910c79931b76d8cd4689aaeada95e5c0e5 Mon Sep 17 00:00:00 2001 From: Fernando Lira Date: Mon, 14 Feb 2022 19:38:01 -0300 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=F0=9F=90=9B=20phpcs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../class-wc-woomercadopago-configs.php | 136 ++++++------- ...wc-woomercadopago-mercadopago-settings.php | 184 +++++++++--------- 2 files changed, 163 insertions(+), 157 deletions(-) diff --git a/includes/module/class-wc-woomercadopago-configs.php b/includes/module/class-wc-woomercadopago-configs.php index ff87d0e1e..ca3dfe2cd 100755 --- a/includes/module/class-wc-woomercadopago-configs.php +++ b/includes/module/class-wc-woomercadopago-configs.php @@ -57,7 +57,7 @@ private function update_token_new_version() { $this->update_token(); } } - if ( empty( strtolower(get_option( '_site_id_v1' )) ) || empty( get_option( '_collector_id_v1' ) ) ) { + if ( empty( strtolower( get_option( '_site_id_v1' ) ) ) || empty( get_option( '_collector_id_v1' ) ) ) { WC_WooMercadoPago_Credentials::validate_credentials_v1(); } @@ -171,7 +171,7 @@ public function plugin_review() { * Saved Cards Notice * * @return false - */ + */ public function saved_cards_notice() { if ( $this->must_not_show_saved_cards_notice() ) { return false; @@ -300,57 +300,57 @@ public static function get_country_configs() { public function get_categories() { return array( 'store_categories_id' => - array( - 'art', - 'baby', - 'coupons', - 'donations', - 'computing', - 'cameras', - 'video games', - 'television', - 'car electronics', - 'electronics', - 'automotive', - 'entertainment', - 'fashion', - 'games', - 'home', - 'musical', - 'phones', - 'services', - 'learnings', - 'tickets', - 'travels', - 'virtual goods', - 'others', - ), + array( + 'art', + 'baby', + 'coupons', + 'donations', + 'computing', + 'cameras', + 'video games', + 'television', + 'car electronics', + 'electronics', + 'automotive', + 'entertainment', + 'fashion', + 'games', + 'home', + 'musical', + 'phones', + 'services', + 'learnings', + 'tickets', + 'travels', + 'virtual goods', + 'others', + ), 'store_categories_description' => - array( - 'Collectibles & Art', - 'Toys for Baby, Stroller, Stroller Accessories, Car Safety Seats', - 'Coupons', - 'Donations', - 'Computers & Tablets', - 'Cameras & Photography', - 'Video Games & Consoles', - 'LCD, LED, Smart TV, Plasmas, TVs', - 'Car Audio, Car Alarm Systems & Security, Car DVRs, Car Video Players, Car PC', - 'Audio & Surveillance, Video & GPS, Others', - 'Parts & Accessories', - 'Music, Movies & Series, Books, Magazines & Comics, Board Games & Toys', - "Men's, Women's, Kids & baby, Handbags & Accessories, Health & Beauty, Shoes, Jewelry & Watches", - 'Online Games & Credits', - 'Home appliances. Home & Garden', - 'Instruments & Gear', - 'Cell Phones & Accessories', - 'General services', - 'Trainings, Conferences, Workshops', - 'Tickets for Concerts, Sports, Arts, Theater, Family, Excursions tickets, Events & more', - 'Plane tickets, Hotel vouchers, Travel vouchers', - 'E-books, Music Files, Software, Digital Images, PDF Files and any item which can be electronically stored in a file, Mobile Recharge, DTH Recharge and any Online Recharge', - 'Other categories', - ), + array( + 'Collectibles & Art', + 'Toys for Baby, Stroller, Stroller Accessories, Car Safety Seats', + 'Coupons', + 'Donations', + 'Computers & Tablets', + 'Cameras & Photography', + 'Video Games & Consoles', + 'LCD, LED, Smart TV, Plasmas, TVs', + 'Car Audio, Car Alarm Systems & Security, Car DVRs, Car Video Players, Car PC', + 'Audio & Surveillance, Video & GPS, Others', + 'Parts & Accessories', + 'Music, Movies & Series, Books, Magazines & Comics, Board Games & Toys', + "Men's, Women's, Kids & baby, Handbags & Accessories, Health & Beauty, Shoes, Jewelry & Watches", + 'Online Games & Credits', + 'Home appliances. Home & Garden', + 'Instruments & Gear', + 'Cell Phones & Accessories', + 'General services', + 'Trainings, Conferences, Workshops', + 'Tickets for Concerts, Sports, Arts, Theater, Family, Excursions tickets, Events & more', + 'Plane tickets, Hotel vouchers, Travel vouchers', + 'E-books, Music Files, Software, Digital Images, PDF Files and any item which can be electronically stored in a file, Mobile Recharge, DTH Recharge and any Online Recharge', + 'Other categories', + ), ); } @@ -358,6 +358,7 @@ public function get_categories() { * Set payment * * @param array|null $methods Methods. + * * @return array */ public function set_payment_gateway( $methods = null ) { @@ -365,27 +366,28 @@ public function set_payment_gateway( $methods = null ) { if ( ! empty( $wp ) && isset( $wp->query_vars['wc-api'] ) ) { $api_request = wc_clean( $wp->query_vars['wc-api'] ); if ( ! empty( $api_request ) && in_array( - strtolower( $api_request ), - array( - 'wc_woomercadopago_basic_gateway', - 'wc_woomercadopago_custom_gateway', - 'wc_woomercadopago_ticket_gateway', - 'wc_woomercadopago_pix_gateway', - 'wc_woomercadopago_basicgateway', - 'wc_woomercadopago_customgateway', - 'wc_woomercadopago_ticketgateway', - ), - true - ) ) { + strtolower( $api_request ), + array( + 'wc_woomercadopago_basic_gateway', + 'wc_woomercadopago_custom_gateway', + 'wc_woomercadopago_ticket_gateway', + 'wc_woomercadopago_pix_gateway', + 'wc_woomercadopago_basicgateway', + 'wc_woomercadopago_customgateway', + 'wc_woomercadopago_ticketgateway', + ), + true + ) ) { if ( ! preg_match( '/(_gateway)/i', $api_request ) ) { $api_request = preg_replace( '/gateway/i', '_Gateway', $api_request ); } $methods[] = $api_request; } + return $methods; } - return $this->get_available_payment_methods($methods); + return $this->get_available_payment_methods( $methods ); } /** @@ -395,9 +397,9 @@ public function set_payment_gateway( $methods = null ) { * * @return array */ - public function get_available_payment_methods($methods) { + public function get_available_payment_methods( $methods ) { $wc_country = WC_WooMercadoPago_Module::get_woocommerce_default_country(); - $site_id = strtolower(get_option( '_site_id_v1', '' )); + $site_id = strtolower( get_option( '_site_id_v1', '' ) ); $methods[] = 'WC_WooMercadoPago_Basic_Gateway'; $methods[] = 'WC_WooMercadoPago_Custom_Gateway'; diff --git a/includes/module/mercadopago-settings/class-wc-woomercadopago-mercadopago-settings.php b/includes/module/mercadopago-settings/class-wc-woomercadopago-mercadopago-settings.php index 2857e96d4..a8276cb10 100644 --- a/includes/module/mercadopago-settings/class-wc-woomercadopago-mercadopago-settings.php +++ b/includes/module/mercadopago-settings/class-wc-woomercadopago-mercadopago-settings.php @@ -43,7 +43,7 @@ public function load_scripts_and_styles() { * Load CSS */ public function load_admin_style() { - if ( is_admin() && ( WC_WooMercadoPago_Helper_Current_Url::validate_page('mercadopago-settings') || WC_WooMercadoPago_Helper_Current_Url::validate_section('woo-mercado-pago') ) ) { + if ( is_admin() && ( WC_WooMercadoPago_Helper_Current_Url::validate_page( 'mercadopago-settings' ) || WC_WooMercadoPago_Helper_Current_Url::validate_section( 'woo-mercado-pago' ) ) ) { wp_register_style( 'mercadopago_settings_admin_css', $this->get_url( '../../../assets/css/mercadopago-settings/mercadopago_settings', '.css' ), @@ -58,7 +58,7 @@ public function load_admin_style() { * Load JavaScripts */ public function load_admin_scripts() { - if ( is_admin() && ( WC_WooMercadoPago_Helper_Current_Url::validate_page('mercadopago-settings') || WC_WooMercadoPago_Helper_Current_Url::validate_section('woo-mercado-pago') ) ) { + if ( is_admin() && ( WC_WooMercadoPago_Helper_Current_Url::validate_page( 'mercadopago-settings' ) || WC_WooMercadoPago_Helper_Current_Url::validate_section( 'woo-mercado-pago' ) ) ) { wp_enqueue_script( 'mercadopago_settings_javascript', $this->get_url( '../../../assets/js/mercadopago-settings/mercadopago_settings', '.js' ), @@ -73,7 +73,7 @@ public function load_admin_scripts() { * Load Research JavaScripts */ public function load_research_script() { - if ( is_admin() && ( WC_WooMercadoPago_Helper_Current_Url::validate_page('mercadopago-settings') || WC_WooMercadoPago_Helper_Current_Url::validate_section('woo-mercado-pago') ) ) { + if ( is_admin() && ( WC_WooMercadoPago_Helper_Current_Url::validate_page( 'mercadopago-settings' ) || WC_WooMercadoPago_Helper_Current_Url::validate_section( 'woo-mercado-pago' ) ) ) { global $woocommerce; wp_enqueue_script( 'mercadopago_research_javascript', @@ -101,7 +101,7 @@ public function load_research_script() { * Load Research Style */ public function load_research_style() { - if ( is_admin() && ( WC_WooMercadoPago_Helper_Current_Url::validate_page('mercadopago-settings') || WC_WooMercadoPago_Helper_Current_Url::validate_section('woo-mercado-pago') ) ) { + if ( is_admin() && ( WC_WooMercadoPago_Helper_Current_Url::validate_page( 'mercadopago-settings' ) || WC_WooMercadoPago_Helper_Current_Url::validate_section( 'woo-mercado-pago' ) ) ) { wp_register_style( 'mercadopago_research_css', 'https://http2.mlstatic.com/storage/v1/plugins/caronte/woocommerce.css', @@ -153,15 +153,15 @@ public function mercadopago_submenu_page_callback() { * Register Mercado Pago Endpoints */ public function register_endpoints() { - add_action('wp_ajax_mp_get_requirements', array($this, 'mercadopago_get_requirements')); - add_action('wp_ajax_mp_validate_credentials', array($this, 'mp_validate_credentials')); - add_action('wp_ajax_mp_update_store_information', array($this, 'mp_update_store_info')); - add_action('wp_ajax_mp_store_mode', array($this, 'mp_set_mode')); - add_action('wp_ajax_mp_get_payment_properties', array($this, 'mp_get_payment_class_properties')); - add_action('wp_ajax_mp_validate_store_tips', array($this, 'mp_validate_store_tips')); - add_action('wp_ajax_mp_validate_credentials_tips', array($this, 'mp_validate_credentials_tips')); - add_action('wp_ajax_mp_validate_payment_tips', array($this, 'mp_validate_payment_tips')); - add_action('wp_ajax_mp_update_option_credentials', array( $this, 'mp_update_option_credentials' )); + add_action( 'wp_ajax_mp_get_requirements', array( $this, 'mercadopago_get_requirements' ) ); + add_action( 'wp_ajax_mp_validate_credentials', array( $this, 'mp_validate_credentials' ) ); + add_action( 'wp_ajax_mp_update_store_information', array( $this, 'mp_update_store_info' ) ); + add_action( 'wp_ajax_mp_store_mode', array( $this, 'mp_set_mode' ) ); + add_action( 'wp_ajax_mp_get_payment_properties', array( $this, 'mp_get_payment_class_properties' ) ); + add_action( 'wp_ajax_mp_validate_store_tips', array( $this, 'mp_validate_store_tips' ) ); + add_action( 'wp_ajax_mp_validate_credentials_tips', array( $this, 'mp_validate_credentials_tips' ) ); + add_action( 'wp_ajax_mp_validate_payment_tips', array( $this, 'mp_validate_payment_tips' ) ); + add_action( 'wp_ajax_mp_update_option_credentials', array( $this, 'mp_update_option_credentials' ) ); } /** @@ -171,31 +171,31 @@ public function register_endpoints() { */ public function mp_translation_admin_header() { $translation_header = array( - 'title_head_part_one' => __('Accept ', 'woocommerce-mercadopago'), - 'title_head_part_two' => __('payments on the spot ', 'woocommerce-mercadopago'), - 'title_head_part_three' => __('with', 'woocommerce-mercadopago'), - 'title_head_part_four' => __('the ', 'woocommerce-mercadopago'), - 'title_head_part_six' => __('security ', 'woocommerce-mercadopago'), - 'title_head_part_seven' => __('from Mercado Pago', 'woocommerce-mercadopago'), - 'title_requirements' => __('Technical requirements', 'woocommerce-mercadopago'), - 'ssl' => __('SSL', 'woocommerce-mercadopago'), - 'gd_extensions' => __('GD Extensions', 'woocommerce-mercadopago'), - 'curl' => __('Curl', 'woocommerce-mercadopago'), - 'description_ssl' => __('Implementation responsible for transmitting data to Mercado Pago in a secure and encrypted way.', 'woocommerce-mercadopago'), - 'description_gd_extensions' => __('These extensions are responsible for the implementation and operation of Pix in your store.', 'woocommerce-mercadopago'), - 'description_curl' => __('It is an extension responsible for making payments via requests from the plugin to Mercado Pago.', 'woocommerce-mercadopago'), - 'title_installments' => __('Collections and installments', 'woocommerce-mercadopago'), - 'descripition_installments' => __('Choose ', 'woocommerce-mercadopago'), - 'descripition_installments_one' => __('when you want to receive the money ', 'woocommerce-mercadopago'), - 'descripition_installments_two' => __('from your sales and if you want to offer ', 'woocommerce-mercadopago'), - 'descripition_installments_three' => __('interest-free installments ', 'woocommerce-mercadopago'), - 'descripition_installments_four' => __('to your clients.', 'woocommerce-mercadopago'), - 'button_installments' => __('Set deadlines and fees', 'woocommerce-mercadopago'), - 'title_questions' => __('Questions? ', 'woocommerce-mercadopago'), - 'descripition_questions_one' => __('Review the step-by-step of ', 'woocommerce-mercadopago'), - 'descripition_questions_two' => __('how to integrate the Mercado Pago Plugin ', 'woocommerce-mercadopago'), - 'descripition_questions_three' => __('on our webiste for developers.', 'woocommerce-mercadopago'), - 'button_questions' => __('Plugin manual', 'woocommerce-mercadopago'), + 'title_head_part_one' => __( 'Accept ', 'woocommerce-mercadopago' ), + 'title_head_part_two' => __( 'payments on the spot ', 'woocommerce-mercadopago' ), + 'title_head_part_three' => __( 'with', 'woocommerce-mercadopago' ), + 'title_head_part_four' => __( 'the ', 'woocommerce-mercadopago' ), + 'title_head_part_six' => __( 'security ', 'woocommerce-mercadopago' ), + 'title_head_part_seven' => __( 'from Mercado Pago', 'woocommerce-mercadopago' ), + 'title_requirements' => __( 'Technical requirements', 'woocommerce-mercadopago' ), + 'ssl' => __( 'SSL', 'woocommerce-mercadopago' ), + 'gd_extensions' => __( 'GD Extensions', 'woocommerce-mercadopago' ), + 'curl' => __( 'Curl', 'woocommerce-mercadopago' ), + 'description_ssl' => __( 'Implementation responsible for transmitting data to Mercado Pago in a secure and encrypted way.', 'woocommerce-mercadopago' ), + 'description_gd_extensions' => __( 'These extensions are responsible for the implementation and operation of Pix in your store.', 'woocommerce-mercadopago' ), + 'description_curl' => __( 'It is an extension responsible for making payments via requests from the plugin to Mercado Pago.', 'woocommerce-mercadopago' ), + 'title_installments' => __( 'Collections and installments', 'woocommerce-mercadopago' ), + 'descripition_installments' => __( 'Choose ', 'woocommerce-mercadopago' ), + 'descripition_installments_one' => __( 'when you want to receive the money ', 'woocommerce-mercadopago' ), + 'descripition_installments_two' => __( 'from your sales and if you want to offer ', 'woocommerce-mercadopago' ), + 'descripition_installments_three' => __( 'interest-free installments ', 'woocommerce-mercadopago' ), + 'descripition_installments_four' => __( 'to your clients.', 'woocommerce-mercadopago' ), + 'button_installments' => __( 'Set deadlines and fees', 'woocommerce-mercadopago' ), + 'title_questions' => __( 'Questions? ', 'woocommerce-mercadopago' ), + 'descripition_questions_one' => __( 'Review the step-by-step of ', 'woocommerce-mercadopago' ), + 'descripition_questions_two' => __( 'how to integrate the Mercado Pago Plugin ', 'woocommerce-mercadopago' ), + 'descripition_questions_three' => __( 'on our webiste for developers.', 'woocommerce-mercadopago' ), + 'button_questions' => __( 'Plugin manual', 'woocommerce-mercadopago' ), ); return $translation_header; @@ -225,6 +225,7 @@ public function mp_translation_admin_credential() { 'button_credentials' => __( 'Save and continue', 'woocommerce-mercadopago' ), ); + return $translation_credential; } @@ -237,33 +238,34 @@ public function mp_translation_admin_store() { $translation_store = array( - 'title_store' => __('2. Customize your business', 'woocommerce-mercadopago'), - 'subtitle_store' => __('Fill out the following information to have a better experience and offer more information to your clients', 'woocommerce-mercadopago'), - 'title_info_store' => __('Your store information', 'woocommerce-mercadopago'), - 'subtitle_name_store' => __("Name of your store in your client's invoice", 'woocommerce-mercadopago'), - 'placeholder_name_store' => __("Eg: Mary's store", 'woocommerce-mercadopago'), - 'helper_name_store' => __('If this field is empty, the purchase will be identified as Mercado Pago.', 'woocommerce-mercadopago'), - 'subtitle_activities_store' => __('Identification in Activities of Mercad Pago', 'woocommerce-mercadopago'), - 'placeholder_activities_store' => __('Eg: Marystore', 'woocommerce-mercadopago'), - 'helper_activities_store' => __('In Activities, you will view this term before the order number', 'woocommerce-mercadopago'), - 'subtitle_category_store' => __('Store category', 'woocommerce-mercadopago'), - 'placeholder_category_store' => __('Select', 'woocommerce-mercadopago'), - 'helper_category_store' => __('Select ”Other” if you do not find the appropriate category.', 'woocommerce-mercadopago'), - 'title_advanced_store' => __('Advanced integration options (optional)', 'woocommerce-mercadopago'), - 'subtitle_advanced_store' => __('For further integration of your store with Mercado Pago (IPN, Certified Partners, Debug Mode)', 'woocommerce-mercadopago'), - 'accordion_advanced_store' => __('View advanced options', 'woocommerce-mercadopago'), - 'subtitle_url' => __('URL for IPN ', 'woocommerce-mercadopago'), - 'placeholder_url' => __('Eg: https://examples.com/my-custom-ipn-url', 'woocommerce-mercadopago'), - 'helper_url' => __('Add the URL to receive payments notifications. Find out more information in the ', 'woocommerce-mercadopago'), - 'helper_url_link' => __('guides.', 'woocommerce-mercadopago'), - 'subtitle_integrator' => __('integrator_id', 'woocommerce-mercadopago'), - 'placeholder_integrator' => __('Eg: 14987126498', 'woocommerce-mercadopago'), - 'helper_integrator' => __('If you are a Mercado Pago Certified Partner, make sure to add your integrator_id. If you do not have the code, please ', 'woocommerce-mercadopago'), - 'helper_integrator_link' => __('request it now. ', 'woocommerce-mercadopago'), - 'title_debug' => __('Debug and Log Mode', 'woocommerce-mercadopago'), - 'subtitle_debug' => __("We record your store's actions in order to provide a better assistance.", 'woocommerce-mercadopago'), - 'button_store' => __('Save and continue', 'woocommerce-mercadopago'), + 'title_store' => __( '2. Customize your business', 'woocommerce-mercadopago' ), + 'subtitle_store' => __( 'Fill out the following information to have a better experience and offer more information to your clients', 'woocommerce-mercadopago' ), + 'title_info_store' => __( 'Your store information', 'woocommerce-mercadopago' ), + 'subtitle_name_store' => __( "Name of your store in your client's invoice", 'woocommerce-mercadopago' ), + 'placeholder_name_store' => __( "Eg: Mary's store", 'woocommerce-mercadopago' ), + 'helper_name_store' => __( 'If this field is empty, the purchase will be identified as Mercado Pago.', 'woocommerce-mercadopago' ), + 'subtitle_activities_store' => __( 'Identification in Activities of Mercad Pago', 'woocommerce-mercadopago' ), + 'placeholder_activities_store' => __( 'Eg: Marystore', 'woocommerce-mercadopago' ), + 'helper_activities_store' => __( 'In Activities, you will view this term before the order number', 'woocommerce-mercadopago' ), + 'subtitle_category_store' => __( 'Store category', 'woocommerce-mercadopago' ), + 'placeholder_category_store' => __( 'Select', 'woocommerce-mercadopago' ), + 'helper_category_store' => __( 'Select ”Other” if you do not find the appropriate category.', 'woocommerce-mercadopago' ), + 'title_advanced_store' => __( 'Advanced integration options (optional)', 'woocommerce-mercadopago' ), + 'subtitle_advanced_store' => __( 'For further integration of your store with Mercado Pago (IPN, Certified Partners, Debug Mode)', 'woocommerce-mercadopago' ), + 'accordion_advanced_store' => __( 'View advanced options', 'woocommerce-mercadopago' ), + 'subtitle_url' => __( 'URL for IPN ', 'woocommerce-mercadopago' ), + 'placeholder_url' => __( 'Eg: https://examples.com/my-custom-ipn-url', 'woocommerce-mercadopago' ), + 'helper_url' => __( 'Add the URL to receive payments notifications. Find out more information in the ', 'woocommerce-mercadopago' ), + 'helper_url_link' => __( 'guides.', 'woocommerce-mercadopago' ), + 'subtitle_integrator' => __( 'integrator_id', 'woocommerce-mercadopago' ), + 'placeholder_integrator' => __( 'Eg: 14987126498', 'woocommerce-mercadopago' ), + 'helper_integrator' => __( 'If you are a Mercado Pago Certified Partner, make sure to add your integrator_id. If you do not have the code, please ', 'woocommerce-mercadopago' ), + 'helper_integrator_link' => __( 'request it now. ', 'woocommerce-mercadopago' ), + 'title_debug' => __( 'Debug and Log Mode', 'woocommerce-mercadopago' ), + 'subtitle_debug' => __( "We record your store's actions in order to provide a better assistance.", 'woocommerce-mercadopago' ), + 'button_store' => __( 'Save and continue', 'woocommerce-mercadopago' ), ); + return $translation_store; } @@ -275,11 +277,12 @@ public function mp_translation_admin_store() { */ public function mp_translation_admin_payment() { $translation_payment = array( - 'title_payments' => __('3. Set payment methods', 'woocommerce-mercadopago'), - 'subtitle_payments' => __('To view more options, please select a payment method below', 'woocommerce-mercadopago'), - 'settings_payment' => __('Settings', 'woocommerce-mercadopago'), - 'button_payment' => __('Continue', 'woocommerce-mercadopago'), + 'title_payments' => __( '3. Set payment methods', 'woocommerce-mercadopago' ), + 'subtitle_payments' => __( 'To view more options, please select a payment method below', 'woocommerce-mercadopago' ), + 'settings_payment' => __( 'Settings', 'woocommerce-mercadopago' ), + 'button_payment' => __( 'Continue', 'woocommerce-mercadopago' ), ); + return $translation_payment; } @@ -291,23 +294,24 @@ public function mp_translation_admin_payment() { */ public function mp_translation_admin_test_mode() { $translation_test_mode = array( - 'title_test_mode' => __('4. Test your store before you sell', 'woocommerce-mercadopago'), - 'subtitle_test_mode' => __('Test the experience in Test Mode and then enable the Sale Mode (Production) to sell.', 'woocommerce-mercadopago'), - 'title_mode' => __('Choose how you want to operate your store:', 'woocommerce-mercadopago'), - 'title_test' => __('Test Mode', 'woocommerce-mercadopago'), - 'subtitle_test' => __('Mercado Pago Checkouts disabled for real collections. ', 'woocommerce-mercadopago'), - 'subtitle_test_link' => __('Test Mode rules.', 'woocommerce-mercadopago'), - 'title_prod' => __('Sale Mode (Production)', 'woocommerce-mercadopago'), - 'subtitle_prod' => __('Mercado Pago Checkouts enabled for real collections.', 'woocommerce-mercadopago'), - 'title_message_prod' => __('Mercado Pago payment methods in Production Mode', 'woocommerce-mercadopago'), - 'subtitle_message_prod' => __('The clients can make real purchases in your store.', 'woocommerce-mercadopago'), - 'title_message_test' => __('Mercado Pago payment methods in Test Mode', 'woocommerce-mercadopago'), - 'subtitle_link_test' => __('Visit your store ', 'woocommerce-mercadopago'), - 'subtitle_message_test' => __('to test purchases', 'woocommerce-mercadopago'), - 'button_mode' => __('Save changes', 'woocommerce-mercadopago'), - 'badge_test' => __('Store under test', 'woocommerce-mercadopago'), - 'badge_mode' => __('Store in sale mode (Production)', 'woocommerce-mercadopago'), + 'title_test_mode' => __( '4. Test your store before you sell', 'woocommerce-mercadopago' ), + 'subtitle_test_mode' => __( 'Test the experience in Test Mode and then enable the Sale Mode (Production) to sell.', 'woocommerce-mercadopago' ), + 'title_mode' => __( 'Choose how you want to operate your store:', 'woocommerce-mercadopago' ), + 'title_test' => __( 'Test Mode', 'woocommerce-mercadopago' ), + 'subtitle_test' => __( 'Mercado Pago Checkouts disabled for real collections. ', 'woocommerce-mercadopago' ), + 'subtitle_test_link' => __( 'Test Mode rules.', 'woocommerce-mercadopago' ), + 'title_prod' => __( 'Sale Mode (Production)', 'woocommerce-mercadopago' ), + 'subtitle_prod' => __( 'Mercado Pago Checkouts enabled for real collections.', 'woocommerce-mercadopago' ), + 'title_message_prod' => __( 'Mercado Pago payment methods in Production Mode', 'woocommerce-mercadopago' ), + 'subtitle_message_prod' => __( 'The clients can make real purchases in your store.', 'woocommerce-mercadopago' ), + 'title_message_test' => __( 'Mercado Pago payment methods in Test Mode', 'woocommerce-mercadopago' ), + 'subtitle_link_test' => __( 'Visit your store ', 'woocommerce-mercadopago' ), + 'subtitle_message_test' => __( 'to test purchases', 'woocommerce-mercadopago' ), + 'button_mode' => __( 'Save changes', 'woocommerce-mercadopago' ), + 'badge_test' => __( 'Store under test', 'woocommerce-mercadopago' ), + 'badge_mode' => __( 'Store in sale mode (Production)', 'woocommerce-mercadopago' ), ); + return $translation_test_mode; } @@ -489,16 +493,16 @@ public function mp_set_mode() { } /** - * Update Credentials for production - */ + * Update Credentials for production + */ public function update_credential_production() { foreach ( WC_WooMercadoPago_Constants::PAYMENT_GATEWAYS as $gateway ) { $key = 'woocommerce_' . $gateway::get_id() . '_settings'; $options = get_option( $key ); if ( ! empty( $options ) ) { - $old_credential_is_prod = array_key_exists('checkout_credential_prod', $options) && isset($options['checkout_credential_prod']) ? $options['checkout_credential_prod'] : 'no'; - $has_new_key = array_key_exists('checkbox_checkout_test_mode', $options) && isset($options['checkbox_checkout_test_mode']); + $old_credential_is_prod = array_key_exists( 'checkout_credential_prod', $options ) && isset( $options['checkout_credential_prod'] ) ? $options['checkout_credential_prod'] : 'no'; + $has_new_key = array_key_exists( 'checkbox_checkout_test_mode', $options ) && isset( $options['checkbox_checkout_test_mode'] ); $options['checkbox_checkout_test_mode'] = $has_new_key && 'deprecated' === $old_credential_is_prod ? $options['checkbox_checkout_test_mode'] : ( 'yes' === $old_credential_is_prod ? 'no' : 'yes' ); @@ -510,8 +514,8 @@ public function update_credential_production() { } /** - * Get payment class properties - */ + * Get payment class properties + */ public function mp_get_payment_class_properties() { try { $payments_gateways = WC_WooMercadoPago_Constants::PAYMENT_GATEWAYS; From 962a62670c24aadb70198025890236c7c6632e39 Mon Sep 17 00:00:00 2001 From: Fernando Lira Date: Mon, 14 Feb 2022 19:43:06 -0300 Subject: [PATCH 3/3] =?UTF-8?q?build(v5.7.1):=20=F0=9F=93=A6=20new=20versi?= =?UTF-8?q?on=20with=20same=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 6 ++++++ changelog.log | 4 ++++ .../module/config/class-wc-woomercadopago-constants.php | 2 +- package.json | 2 +- readme.txt | 7 ++++++- woocommerce-mercadopago.php | 2 +- 6 files changed, 19 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 253b8f47f..0bd538d8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [5.7.1] - 2022-02-14 + +### Changed Bug fixes +- Adjusted js and css load of mercado pago pool +- Repass all active gateways + ## [5.7.0] - 2022-02-14 ### Added diff --git a/changelog.log b/changelog.log index 7f436aadc..6efceedf4 100644 --- a/changelog.log +++ b/changelog.log @@ -1,5 +1,9 @@ CHANGELOG: == Changelog == += v5.7.1 (14/02/2022) = +* Bug fixes +- Adjusted js and css load of mercado pago pool +- Repass all active gateways = v5.7.0 (14/02/2022) = * Features diff --git a/includes/module/config/class-wc-woomercadopago-constants.php b/includes/module/config/class-wc-woomercadopago-constants.php index 5f5010d1f..a5adbbf60 100644 --- a/includes/module/config/class-wc-woomercadopago-constants.php +++ b/includes/module/config/class-wc-woomercadopago-constants.php @@ -21,7 +21,7 @@ class WC_WooMercadoPago_Constants { const PRODUCT_ID_DESKTOP = 'BT7OF5FEOO6G01NJK3QG'; const PRODUCT_ID_MOBILE = 'BT7OFH09QS3001K5A0H0'; const PLATAFORM_ID = 'bo2hnr2ic4p001kbgpt0'; - const VERSION = '5.7.0'; + const VERSION = '5.7.1'; const MIN_PHP = 5.6; const API_MP_BASE_URL = 'https://api.mercadopago.com'; const PAYMENT_GATEWAYS = array( diff --git a/package.json b/package.json index c128cebaa..2f3ea00be 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "pot": "node -e 'require(\"./main.js\").generatePotFiles()'", "lint": "jshint" }, - "version": "5.7.0", + "version": "5.7.1", "repository": { "type": "git", "url": "https://github.com/mercadopago/cart-woocommerce" diff --git a/readme.txt b/readme.txt index 0a561cde5..95029354e 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: ecommerce, mercadopago, woocommerce Requires at least: 4.9.10 Tested up to: 5.9 Requires PHP: 5.6 -Stable tag: 5.7.0 +Stable tag: 5.7.1 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -133,6 +133,11 @@ Set up both the plugin and the checkouts you want to activate on your payment av Check out our official documentation for more information on the specific fields to configure. == Changelog == += v5.7.1 (14/02/2022) = +* Bug fixes +- Adjusted js and css load of mercado pago pool +- Repass all active gateways + = v5.7.0 (14/02/2022) = * Features - Redesign Admin diff --git a/woocommerce-mercadopago.php b/woocommerce-mercadopago.php index 0ca64ce94..8dad0228d 100644 --- a/woocommerce-mercadopago.php +++ b/woocommerce-mercadopago.php @@ -3,7 +3,7 @@ * Plugin Name: Mercado Pago payments for WooCommerce * Plugin URI: https://github.com/mercadopago/cart-woocommerce * Description: Configure the payment options and accept payments with cards, ticket and money of Mercado Pago account. - * Version: 5.7.0 + * Version: 5.7.1 * Author: Mercado Pago * Author URI: https://developers.mercadopago.com/ * Text Domain: woocommerce-mercadopago