From 1a9caf96f1483b342c01d1986023d9f114940a25 Mon Sep 17 00:00:00 2001 From: Luana Tammy Uchida Ogawa Date: Thu, 26 Aug 2021 15:17:46 -0300 Subject: [PATCH 1/2] returning title and description before validation to be used on Point of Sale application --- includes/payments/class-wc-woomercadopago-basic-gateway.php | 5 ++--- includes/payments/class-wc-woomercadopago-custom-gateway.php | 4 ++-- includes/payments/class-wc-woomercadopago-pix-gateway.php | 3 ++- includes/payments/class-wc-woomercadopago-ticket-gateway.php | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/includes/payments/class-wc-woomercadopago-basic-gateway.php b/includes/payments/class-wc-woomercadopago-basic-gateway.php index 085abc594..0698f4e60 100755 --- a/includes/payments/class-wc-woomercadopago-basic-gateway.php +++ b/includes/payments/class-wc-woomercadopago-basic-gateway.php @@ -26,17 +26,16 @@ class WC_WooMercadoPago_Basic_Gateway extends WC_WooMercadoPago_Payment_Abstract */ public function __construct() { $this->id = self::ID; + $this->description = __( 'It offers all means of payment: credit and debit cards, cash and account money. Your customers choose whether they pay as guests or from their Mercado Pago account.', 'woocommerce-mercadopago' ); + $this->title = $this->get_option_mp( 'title', __( 'Pay with the payment method you prefer', 'woocommerce-mercadopago' ) ); if ( ! $this->validate_section() ) { return; } - $this->description = __( 'It offers all means of payment: credit and debit cards, cash and account money. Your customers choose whether they pay as guests or from their Mercado Pago account.', 'woocommerce-mercadopago' ); - $this->form_fields = array(); $this->method_title = __( 'Mercado Pago - Checkout Pro', 'woocommerce-mercadopago' ); $this->method = $this->get_option_mp( 'method', 'redirect' ); - $this->title = $this->get_option_mp( 'title', __( 'Pay with the payment method you prefer', 'woocommerce-mercadopago' ) ); $this->method_description = $this->description; $this->auto_return = $this->get_option_mp( 'auto_return', 'yes' ); $this->success_url = $this->get_option_mp( 'success_url', '' ); diff --git a/includes/payments/class-wc-woomercadopago-custom-gateway.php b/includes/payments/class-wc-woomercadopago-custom-gateway.php index 15943e32d..2551ab02f 100755 --- a/includes/payments/class-wc-woomercadopago-custom-gateway.php +++ b/includes/payments/class-wc-woomercadopago-custom-gateway.php @@ -34,15 +34,15 @@ class WC_WooMercadoPago_Custom_Gateway extends WC_WooMercadoPago_Payment_Abstrac */ public function __construct() { $this->id = self::ID; + $this->description = __( 'Accept card payments on your website with the best possible financing and maximize the conversion of your business. With personalized checkout your customers pay without leaving your store!', 'woocommerce-mercadopago' ); + $this->title = $this->get_option_mp( 'title', __( 'Pay with debit and credit cards', 'woocommerce-mercadopago' ) ); if ( ! $this->validate_section() ) { return; } - $this->description = __( 'Accept card payments on your website with the best possible financing and maximize the conversion of your business. With personalized checkout your customers pay without leaving your store!', 'woocommerce-mercadopago' ); $this->form_fields = array(); $this->method_title = __( 'Mercado Pago - Custom Checkout', 'woocommerce-mercadopago' ); - $this->title = $this->get_option_mp( 'title', __( 'Pay with debit and credit cards', 'woocommerce-mercadopago' ) ); $this->method_description = $this->description; $this->coupon_mode = $this->get_option_mp( 'coupon_mode', 'no' ); $this->wallet_button = $this->get_option_mp( 'wallet_button', 'yes' ); diff --git a/includes/payments/class-wc-woomercadopago-pix-gateway.php b/includes/payments/class-wc-woomercadopago-pix-gateway.php index 4ab75f961..88bdabd75 100755 --- a/includes/payments/class-wc-woomercadopago-pix-gateway.php +++ b/includes/payments/class-wc-woomercadopago-pix-gateway.php @@ -27,12 +27,13 @@ class WC_WooMercadoPago_Pix_Gateway extends WC_WooMercadoPago_Payment_Abstract { */ public function __construct() { $this->id = self::ID; + $this->description = __( 'Accept payments via Pix Transfer and receive the funds instantly. Your customers can pay at any time, without date or time restrictions.', 'woocommerce-mercadopago' ); + $this->title = __( 'Pay with PIX ', 'woocommerce-mercadopago' ); if ( ! $this->validate_section() ) { return; } - $this->description = __( 'Accept payments via Pix Transfer and receive the funds instantly. Your customers can pay at any time, without date or time restrictions.', 'woocommerce-mercadopago' ); $this->form_fields = array(); $this->method_title = __( 'Mercado Pago - Custom Checkout', 'woocommerce-mercadopago' ); $this->title = $this->get_option_mp( 'title', __( 'Pay with PIX ', 'woocommerce-mercadopago' ) ); diff --git a/includes/payments/class-wc-woomercadopago-ticket-gateway.php b/includes/payments/class-wc-woomercadopago-ticket-gateway.php index 905cc9614..6035e7cae 100755 --- a/includes/payments/class-wc-woomercadopago-ticket-gateway.php +++ b/includes/payments/class-wc-woomercadopago-ticket-gateway.php @@ -27,15 +27,15 @@ class WC_WooMercadoPago_Ticket_Gateway extends WC_WooMercadoPago_Payment_Abstrac */ public function __construct() { $this->id = self::ID; + $this->description = __( 'Accept cash payments within the custom checkout and expand your customers purchase options.', 'woocommerce-mercadopago' ); + $this->title = $this->get_option_mp( 'title', __( 'Pay with cash', 'woocommerce-mercadopago' ) ); if ( ! $this->validate_section() ) { return; } - $this->description = __( 'Accept cash payments within the custom checkout and expand your customers purchase options.', 'woocommerce-mercadopago' ); $this->form_fields = array(); $this->method_title = __( 'Mercado Pago - Custom Checkout', 'woocommerce-mercadopago' ); - $this->title = $this->get_option_mp( 'title', __( 'Pay with cash', 'woocommerce-mercadopago' ) ); $this->method_description = $this->description; $this->coupon_mode = $this->get_option_mp( 'coupon_mode', 'no' ); $this->stock_reduce_mode = $this->get_option_mp( 'stock_reduce_mode', 'no' ); From ebc1636ccd3adf82768fb72c8bbad50ac3cf26ed Mon Sep 17 00:00:00 2001 From: Luana Tammy Uchida Ogawa Date: Thu, 26 Aug 2021 16:53:08 -0300 Subject: [PATCH 2/2] resolving code sniffer --- includes/payments/class-wc-woomercadopago-basic-gateway.php | 4 ++-- includes/payments/class-wc-woomercadopago-custom-gateway.php | 4 ++-- includes/payments/class-wc-woomercadopago-pix-gateway.php | 4 ++-- includes/payments/class-wc-woomercadopago-ticket-gateway.php | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/includes/payments/class-wc-woomercadopago-basic-gateway.php b/includes/payments/class-wc-woomercadopago-basic-gateway.php index 0698f4e60..e28111b75 100755 --- a/includes/payments/class-wc-woomercadopago-basic-gateway.php +++ b/includes/payments/class-wc-woomercadopago-basic-gateway.php @@ -25,9 +25,9 @@ class WC_WooMercadoPago_Basic_Gateway extends WC_WooMercadoPago_Payment_Abstract * @throws WC_WooMercadoPago_Exception On load payment exception. */ public function __construct() { - $this->id = self::ID; + $this->id = self::ID; $this->description = __( 'It offers all means of payment: credit and debit cards, cash and account money. Your customers choose whether they pay as guests or from their Mercado Pago account.', 'woocommerce-mercadopago' ); - $this->title = $this->get_option_mp( 'title', __( 'Pay with the payment method you prefer', 'woocommerce-mercadopago' ) ); + $this->title = $this->get_option_mp( 'title', __( 'Pay with the payment method you prefer', 'woocommerce-mercadopago' ) ); if ( ! $this->validate_section() ) { return; diff --git a/includes/payments/class-wc-woomercadopago-custom-gateway.php b/includes/payments/class-wc-woomercadopago-custom-gateway.php index 2551ab02f..3c22977d4 100755 --- a/includes/payments/class-wc-woomercadopago-custom-gateway.php +++ b/includes/payments/class-wc-woomercadopago-custom-gateway.php @@ -33,9 +33,9 @@ class WC_WooMercadoPago_Custom_Gateway extends WC_WooMercadoPago_Payment_Abstrac * @throws WC_WooMercadoPago_Exception Exception load payment. */ public function __construct() { - $this->id = self::ID; + $this->id = self::ID; $this->description = __( 'Accept card payments on your website with the best possible financing and maximize the conversion of your business. With personalized checkout your customers pay without leaving your store!', 'woocommerce-mercadopago' ); - $this->title = $this->get_option_mp( 'title', __( 'Pay with debit and credit cards', 'woocommerce-mercadopago' ) ); + $this->title = $this->get_option_mp( 'title', __( 'Pay with debit and credit cards', 'woocommerce-mercadopago' ) ); if ( ! $this->validate_section() ) { return; diff --git a/includes/payments/class-wc-woomercadopago-pix-gateway.php b/includes/payments/class-wc-woomercadopago-pix-gateway.php index 88bdabd75..7403633c9 100755 --- a/includes/payments/class-wc-woomercadopago-pix-gateway.php +++ b/includes/payments/class-wc-woomercadopago-pix-gateway.php @@ -26,9 +26,9 @@ class WC_WooMercadoPago_Pix_Gateway extends WC_WooMercadoPago_Payment_Abstract { * @throws WC_WooMercadoPago_Exception Load payment exception. */ public function __construct() { - $this->id = self::ID; + $this->id = self::ID; $this->description = __( 'Accept payments via Pix Transfer and receive the funds instantly. Your customers can pay at any time, without date or time restrictions.', 'woocommerce-mercadopago' ); - $this->title = __( 'Pay with PIX ', 'woocommerce-mercadopago' ); + $this->title = __( 'Pay with PIX ', 'woocommerce-mercadopago' ); if ( ! $this->validate_section() ) { return; diff --git a/includes/payments/class-wc-woomercadopago-ticket-gateway.php b/includes/payments/class-wc-woomercadopago-ticket-gateway.php index 6035e7cae..5f1cb38a4 100755 --- a/includes/payments/class-wc-woomercadopago-ticket-gateway.php +++ b/includes/payments/class-wc-woomercadopago-ticket-gateway.php @@ -26,9 +26,9 @@ class WC_WooMercadoPago_Ticket_Gateway extends WC_WooMercadoPago_Payment_Abstrac * @throws WC_WooMercadoPago_Exception Load payment exception. */ public function __construct() { - $this->id = self::ID; + $this->id = self::ID; $this->description = __( 'Accept cash payments within the custom checkout and expand your customers purchase options.', 'woocommerce-mercadopago' ); - $this->title = $this->get_option_mp( 'title', __( 'Pay with cash', 'woocommerce-mercadopago' ) ); + $this->title = $this->get_option_mp( 'title', __( 'Pay with cash', 'woocommerce-mercadopago' ) ); if ( ! $this->validate_section() ) { return;