From b5d0f729488a15c8a618c8cc402019d31710bc03 Mon Sep 17 00:00:00 2001 From: kcppdevelopers Date: Thu, 14 Jun 2018 11:44:58 +0530 Subject: [PATCH 1/2] Express Checkout - Organize Settings, PFW-33 --- .../wc-gateway-paypal-express-angelleye.php | 197 +++++++++++------- 1 file changed, 127 insertions(+), 70 deletions(-) diff --git a/classes/wc-gateway-paypal-express-angelleye.php b/classes/wc-gateway-paypal-express-angelleye.php index 5e0a58b77..bec2b71cd 100644 --- a/classes/wc-gateway-paypal-express-angelleye.php +++ b/classes/wc-gateway-paypal-express-angelleye.php @@ -525,6 +525,11 @@ public function init_form_fields() { $this->testmode = 'yes' === $this->get_option('testmode', 'yes'); $this->paypal_marketing_solutions_cid_production = $this->get_option('paypal_marketing_solutions_cid_production', ''); $this->form_fields = array( + 'general' => array( + 'title' => __( 'General', 'paypal-for-woocommerce' ), + 'type' => 'title', + 'description' => '', + ), 'enabled' => array( 'title' => __('Enable/Disable', 'paypal-for-woocommerce'), 'label' => __('Enable PayPal Express', 'paypal-for-woocommerce'), @@ -546,6 +551,11 @@ public function init_form_fields() { 'default' => __("Pay via PayPal; you can pay with your credit card if you don't have a PayPal account", 'paypal-for-woocommerce'), 'desc_tip' => true, ), + 'api_details' => array( + 'title' => __( 'API credentials', 'paypal-for-woocommerce' ), + 'type' => 'title', + 'description' => '', + ), 'testmode' => array( 'title' => __('PayPal Sandbox', 'paypal-for-woocommerce'), 'type' => 'checkbox', @@ -591,20 +601,10 @@ public function init_form_fields() { 'default' => '', 'custom_attributes' => array( 'autocomplete' => 'off'), ), - 'error_email_notify' => array( - 'title' => __('Error Email Notifications', 'paypal-for-woocommerce'), - 'type' => 'checkbox', - 'label' => __('Enable admin email notifications for errors.', 'paypal-for-woocommerce'), - 'default' => 'yes', - 'description' => __('This will send a detailed error email to the WordPress site administrator if a PayPal API error occurs.', 'paypal-for-woocommerce'), - 'desc_tip' => true - ), - 'invoice_id_prefix' => array( - 'title' => __('Invoice ID Prefix', 'paypal-for-woocommerce'), - 'type' => 'text', - 'description' => __('Add a prefix to the invoice ID sent to PayPal. This can resolve duplicate invoice problems when working with multiple websites on the same PayPal account.', 'paypal-for-woocommerce'), - 'desc_tip' => true, - 'default' => 'WC-EC' + 'shopping_cart_checkout_page_display' => array( + 'title' => __( 'Shopping Cart, Checkout and Product Page Display', 'paypal-for-woocommerce' ), + 'type' => 'title', + 'description' => '', ), 'review_title_page' => array( 'title' => __('Order Review Page Title', 'paypal-for-woocommerce'), @@ -683,6 +683,13 @@ public function init_form_fields() { 'description' => __('Displaying the checkout button at the top of the checkout page will allow users to skip filling out the forms and can potentially increase conversion rates.'), 'desc_tip' => true, ), + 'angelleye_skip_text' => array( + 'title' => __('Express Checkout Message', 'paypal-for-woocommerce'), + 'type' => 'text', + 'description' => __('This message will be displayed next to the PayPal Express Checkout button at the top of the checkout page.'), + 'default' => __('Skip the forms and pay faster with PayPal!', 'paypal-for-woocommerce'), + 'desc_tip' => true, + ), 'show_on_product_page' => array( 'title' => __('Product Page', 'paypal-for-woocommerce'), 'type' => 'checkbox', @@ -692,6 +699,19 @@ public function init_form_fields() { 'desc_tip' => false, ), + 'show_paypal_credit' => array( + 'title' => __('Enable PayPal Credit', 'paypal-for-woocommerce'), + 'type' => 'checkbox', + 'label' => __('Show the PayPal Credit button next to the Express Checkout button.', 'paypal-for-woocommerce'), + 'default' => 'yes', + 'description' => ($this->is_paypal_credit_enable == false) ? __('Currently disabled because PayPal Credit is only available for U.S.', 'paypal-for-woocommerce') : "", + 'desc_tip' => ($this->is_paypal_credit_enable) ? true : false, + ), + 'branding' => array( + 'title' => __( 'Branding', 'paypal-for-woocommerce' ), + 'type' => 'title', + 'description' => '', + ), 'paypal_account_optional' => array( 'title' => __('PayPal Account Optional', 'paypal-for-woocommerce'), 'type' => 'checkbox', @@ -723,14 +743,7 @@ public function init_form_fields() { 'default' => 'detailed', 'desc_tip' => true, ), - 'show_paypal_credit' => array( - 'title' => __('Enable PayPal Credit', 'paypal-for-woocommerce'), - 'type' => 'checkbox', - 'label' => __('Show the PayPal Credit button next to the Express Checkout button.', 'paypal-for-woocommerce'), - 'default' => 'yes', - 'description' => ($this->is_paypal_credit_enable == false) ? __('Currently disabled because PayPal Credit is only available for U.S.', 'paypal-for-woocommerce') : "", - 'desc_tip' => ($this->is_paypal_credit_enable) ? true : false, - ), + 'use_wp_locale_code' => array( 'title' => __('Use WordPress Locale Code', 'paypal-for-woocommerce'), 'type' => 'checkbox', @@ -778,12 +791,93 @@ public function init_form_fields() { 'default' => '', 'desc_tip' => true, ), - 'angelleye_skip_text' => array( - 'title' => __('Express Checkout Message', 'paypal-for-woocommerce'), + 'tokenization_subscriptions' => array( + 'title' => __( 'Tokenization / Subscriptions', 'paypal-for-woocommerce' ), + 'type' => 'title', + 'description' => '', + ), + 'enable_tokenized_payments' => array( + 'title' => __('Enable Tokenized Payments', 'paypal-for-woocommerce'), + 'label' => __('Enable Tokenized Payments', 'paypal-for-woocommerce'), + 'type' => 'checkbox', + 'description' => __('Allow buyers to securely save payment details to their account for quick checkout / auto-ship orders in the future. (Currently considered BETA for Express Checkout.)', 'paypal-for-woocommerce'), + 'default' => 'no', + 'class' => 'enable_tokenized_payments' + ), + 'fraud_management' => array( + 'title' => __( 'Fraud Management', 'paypal-for-woocommerce' ), + 'type' => 'title', + 'description' => '', + ), + 'fraud_management_filters' => array( + 'title' => __('Fraud Management Filters ', 'paypal-for-woocommerce'), + 'label' => '', + 'description' => __('Choose how you would like to handle orders when Fraud Management Filters are flagged.', 'paypal-for-woocommerce'), + 'type' => 'select', + 'class' => 'wc-enhanced-select', + 'options' => array( + 'ignore_warnings_and_proceed_as_usual' => __('Ignore warnings and proceed as usual.', 'paypal-for-woocommerce'), + 'place_order_on_hold_for_further_review' => __('Place order On Hold for further review.', 'paypal-for-woocommerce'), + ), + 'default' => 'place_order_on_hold_for_further_review', + 'desc_tip' => true, + ), + 'email_notify_order_cancellations' => array( + 'title' => __('Order canceled/refunded Email Notifications', 'paypal-for-woocommerce'), + 'label' => __('Enable buyer email notifications for Order canceled/refunded', 'paypal-for-woocommerce'), + 'type' => 'checkbox', + 'description' => __('This will send buyer email notifications for Order canceled/refunded when Auto Cancel / Refund Orders option is selected.', 'paypal-for-woocommerce'), + 'default' => 'no', + 'class' => 'email_notify_order_cancellations', + 'desc_tip' => true, + ), + 'seller_protection' => array( + 'title' => __( 'Seller Protection', 'paypal-for-woocommerce' ), + 'type' => 'title', + 'description' => '', + ), + 'order_cancellations' => array( + 'title' => __('Auto Cancel / Refund Orders ', 'paypal-for-woocommerce'), + 'label' => '', + 'description' => __('Allows you to cancel and refund orders that do not meet PayPal\'s Seller Protection criteria.', 'paypal-for-woocommerce'), + 'type' => 'select', + 'class' => 'order_cancellations wc-enhanced-select', + 'options' => array( + 'no_seller_protection' => __('Do *not* have PayPal Seller Protection', 'paypal-for-woocommerce'), + 'no_unauthorized_payment_protection' => __('Do *not* have PayPal Unauthorized Payment Protection', 'paypal-for-woocommerce'), + 'disabled' => __('Do not cancel any orders', 'paypal-for-woocommerce'), + ), + 'default' => 'disabled', + 'desc_tip' => true, + ), + 'email_notify_order_cancellations' => array( + 'title' => __('Order canceled/refunded Email Notifications', 'paypal-for-woocommerce'), + 'label' => __('Enable buyer email notifications for Order canceled/refunded', 'paypal-for-woocommerce'), + 'type' => 'checkbox', + 'description' => __('This will send buyer email notifications for Order canceled/refunded when Auto Cancel / Refund Orders option is selected.', 'paypal-for-woocommerce'), + 'default' => 'no', + 'class' => 'email_notify_order_cancellations', + 'desc_tip' => true, + ), + 'advanced' => array( + 'title' => __( 'Advanced options', 'paypal-for-woocommerce' ), + 'type' => 'title', + 'description' => '', + ), + 'error_email_notify' => array( + 'title' => __('Error Email Notifications', 'paypal-for-woocommerce'), + 'type' => 'checkbox', + 'label' => __('Enable admin email notifications for errors.', 'paypal-for-woocommerce'), + 'default' => 'yes', + 'description' => __('This will send a detailed error email to the WordPress site administrator if a PayPal API error occurs.', 'paypal-for-woocommerce'), + 'desc_tip' => true + ), + 'invoice_id_prefix' => array( + 'title' => __('Invoice ID Prefix', 'paypal-for-woocommerce'), 'type' => 'text', - 'description' => __('This message will be displayed next to the PayPal Express Checkout button at the top of the checkout page.'), - 'default' => __('Skip the forms and pay faster with PayPal!', 'paypal-for-woocommerce'), + 'description' => __('Add a prefix to the invoice ID sent to PayPal. This can resolve duplicate invoice problems when working with multiple websites on the same PayPal account.', 'paypal-for-woocommerce'), 'desc_tip' => true, + 'default' => 'WC-EC' ), 'skip_final_review' => array( 'title' => __('Skip Final Review', 'paypal-for-woocommerce'), @@ -851,14 +945,6 @@ public function init_form_fields() { 'default' => 'yes', 'desc_tip' => true, ), - 'enable_tokenized_payments' => array( - 'title' => __('Enable Tokenized Payments', 'paypal-for-woocommerce'), - 'label' => __('Enable Tokenized Payments', 'paypal-for-woocommerce'), - 'type' => 'checkbox', - 'description' => __('Allow buyers to securely save payment details to their account for quick checkout / auto-ship orders in the future. (Currently considered BETA for Express Checkout.)', 'paypal-for-woocommerce'), - 'default' => 'no', - 'class' => 'enable_tokenized_payments' - ), 'enable_notifyurl' => array( 'title' => __('Enable PayPal IPN', 'paypal-for-woocommerce'), 'label' => __('Configure an IPN URL to be included with Express Checkout payments.', 'paypal-for-woocommerce'), @@ -884,42 +970,7 @@ public function init_form_fields() { 'class' => '', 'desc_tip' => true, ), - 'order_cancellations' => array( - 'title' => __('Auto Cancel / Refund Orders ', 'paypal-for-woocommerce'), - 'label' => '', - 'description' => __('Allows you to cancel and refund orders that do not meet PayPal\'s Seller Protection criteria.', 'paypal-for-woocommerce'), - 'type' => 'select', - 'class' => 'order_cancellations wc-enhanced-select', - 'options' => array( - 'no_seller_protection' => __('Do *not* have PayPal Seller Protection', 'paypal-for-woocommerce'), - 'no_unauthorized_payment_protection' => __('Do *not* have PayPal Unauthorized Payment Protection', 'paypal-for-woocommerce'), - 'disabled' => __('Do not cancel any orders', 'paypal-for-woocommerce'), - ), - 'default' => 'disabled', - 'desc_tip' => true, - ), - 'fraud_management_filters' => array( - 'title' => __('Fraud Management Filters ', 'paypal-for-woocommerce'), - 'label' => '', - 'description' => __('Choose how you would like to handle orders when Fraud Management Filters are flagged.', 'paypal-for-woocommerce'), - 'type' => 'select', - 'class' => 'wc-enhanced-select', - 'options' => array( - 'ignore_warnings_and_proceed_as_usual' => __('Ignore warnings and proceed as usual.', 'paypal-for-woocommerce'), - 'place_order_on_hold_for_further_review' => __('Place order On Hold for further review.', 'paypal-for-woocommerce'), - ), - 'default' => 'place_order_on_hold_for_further_review', - 'desc_tip' => true, - ), - 'email_notify_order_cancellations' => array( - 'title' => __('Order canceled/refunded Email Notifications', 'paypal-for-woocommerce'), - 'label' => __('Enable buyer email notifications for Order canceled/refunded', 'paypal-for-woocommerce'), - 'type' => 'checkbox', - 'description' => __('This will send buyer email notifications for Order canceled/refunded when Auto Cancel / Refund Orders option is selected.', 'paypal-for-woocommerce'), - 'default' => 'no', - 'class' => 'email_notify_order_cancellations', - 'desc_tip' => true, - ), + 'save_abandoned_checkout' => array( 'title' => __('Save Abandoned Checkouts', 'paypal-for-woocommerce'), 'type' => 'checkbox', @@ -945,12 +996,18 @@ public function init_form_fields() { 'class' => '', 'description' => __('', 'paypal-for-woocommerce'), ), + 'smart_buttons' => array( + 'title' => __( 'Smart Buttons', 'paypal-for-woocommerce' ), + 'type' => 'title', + 'description' => '', + ), 'enable_in_context_checkout_flow' => array( 'title' => __('Enable Smart Buttons', 'paypal-for-woocommerce'), 'type' => 'checkbox', 'label' => __('The enhanced PayPal Express Checkout with In-Context gives your customers a simplified checkout experience that keeps them at your website throughout the payment authorization process.', 'paypal-for-woocommerce'), 'default' => 'yes' ), + 'button_styles' => array( 'title' => __('', 'paypal-for-woocommerce'), 'type' => 'title', From afce63f506bd0ba7002cef72266b3a3da13d06ca Mon Sep 17 00:00:00 2001 From: angelleye Date: Mon, 18 Jun 2018 14:37:37 -0500 Subject: [PATCH 2/2] Updates verbiage, ref PFW-33 --- classes/wc-gateway-paypal-express-angelleye.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/classes/wc-gateway-paypal-express-angelleye.php b/classes/wc-gateway-paypal-express-angelleye.php index bec2b71cd..f4d6b4d5f 100644 --- a/classes/wc-gateway-paypal-express-angelleye.php +++ b/classes/wc-gateway-paypal-express-angelleye.php @@ -552,7 +552,7 @@ public function init_form_fields() { 'desc_tip' => true, ), 'api_details' => array( - 'title' => __( 'API credentials', 'paypal-for-woocommerce' ), + 'title' => __( 'API Credentials', 'paypal-for-woocommerce' ), 'type' => 'title', 'description' => '', ), @@ -851,8 +851,8 @@ public function init_form_fields() { 'desc_tip' => true, ), 'email_notify_order_cancellations' => array( - 'title' => __('Order canceled/refunded Email Notifications', 'paypal-for-woocommerce'), - 'label' => __('Enable buyer email notifications for Order canceled/refunded', 'paypal-for-woocommerce'), + 'title' => __('Order Cancelled / Refunded Email Notifications', 'paypal-for-woocommerce'), + 'label' => __('Enable buyer email notifications for Order cancelled/refunded', 'paypal-for-woocommerce'), 'type' => 'checkbox', 'description' => __('This will send buyer email notifications for Order canceled/refunded when Auto Cancel / Refund Orders option is selected.', 'paypal-for-woocommerce'), 'default' => 'no', @@ -860,7 +860,7 @@ public function init_form_fields() { 'desc_tip' => true, ), 'advanced' => array( - 'title' => __( 'Advanced options', 'paypal-for-woocommerce' ), + 'title' => __( 'Advanced Options', 'paypal-for-woocommerce' ), 'type' => 'title', 'description' => '', ), @@ -997,7 +997,7 @@ public function init_form_fields() { 'description' => __('', 'paypal-for-woocommerce'), ), 'smart_buttons' => array( - 'title' => __( 'Smart Buttons', 'paypal-for-woocommerce' ), + 'title' => __( 'Smart Payment Buttons', 'paypal-for-woocommerce' ), 'type' => 'title', 'description' => '', ),