From a89cc75ba791bc28dd8344d11643c60756efae4b Mon Sep 17 00:00:00 2001 From: Joshua Flowers Date: Wed, 19 May 2021 16:10:11 -0400 Subject: [PATCH 1/5] Add paystack to fallback payment gateways --- .../DefaultPaymentGateways.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Features/RemotePaymentMethods/DefaultPaymentGateways.php b/src/Features/RemotePaymentMethods/DefaultPaymentGateways.php index bcfd05e6e01..80efc7003c2 100644 --- a/src/Features/RemotePaymentMethods/DefaultPaymentGateways.php +++ b/src/Features/RemotePaymentMethods/DefaultPaymentGateways.php @@ -57,6 +57,22 @@ public static function get_all() { ), ), ), + array( + 'key' => 'paystack', + 'title' => __( 'Paystack', 'woocommerce-admin' ), + 'content' => __( 'Paystack helps African merchants accept one-time and recurring payments online with a modern, safe, and secure payment gateway.', 'woocommerce-admin' ), + 'image' => plugins_url( 'images/onboarding/paystack.png', WC_ADMIN_PLUGIN_FILE ), + 'plugins' => array( 'woo-paystack' ), + 'is_visible' => array( + self::get_rules_for_countries( array( 'ZA', 'GH', 'NG' ) ), + (object) array( + 'type' => 'option', + 'option_name' => 'woocommerce_onboarding_profile', + 'value' => 'cbd-other-hemp-derived-products', + 'operation' => '!contains', + ), + ), + ), array( 'key' => 'paystack', 'title' => __( 'Paystack', 'woocommerce-admin' ), From 8a439d8202297f2c16de207b798cacea8864a9fe Mon Sep 17 00:00:00 2001 From: Joshua Flowers Date: Fri, 21 May 2021 12:42:52 -0400 Subject: [PATCH 2/5] Add mercado page to fallback gateways --- .../DefaultPaymentGateways.php | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/Features/RemotePaymentMethods/DefaultPaymentGateways.php b/src/Features/RemotePaymentMethods/DefaultPaymentGateways.php index 80efc7003c2..34f0050db65 100644 --- a/src/Features/RemotePaymentMethods/DefaultPaymentGateways.php +++ b/src/Features/RemotePaymentMethods/DefaultPaymentGateways.php @@ -65,23 +65,17 @@ public static function get_all() { 'plugins' => array( 'woo-paystack' ), 'is_visible' => array( self::get_rules_for_countries( array( 'ZA', 'GH', 'NG' ) ), - (object) array( - 'type' => 'option', - 'option_name' => 'woocommerce_onboarding_profile', - 'value' => 'cbd-other-hemp-derived-products', - 'operation' => '!contains', - ), + self::get_rules_for_cbd( false ), ), ), array( - 'key' => 'paystack', - 'title' => __( 'Paystack', 'woocommerce-admin' ), - 'content' => __( 'Paystack helps African merchants accept one-time and recurring payments online with a modern, safe, and secure payment gateway.', 'woocommerce-admin' ), - 'image' => plugins_url( 'images/onboarding/paystack.png', WC_ADMIN_PLUGIN_FILE ), - 'plugins' => array( 'woo-paystack' ), + 'key' => 'mercadopago', + 'title' => __( 'Mercado Pago Checkout Pro & Custom', 'woocommerce-admin' ), + 'content' => __( 'Accept credit and debit cards, offline (cash or bank transfer) and logged-in payments with money in Mercado Pago. Safe and secure payments with the leading payment processor in LATAM.', 'woocommerce-admin' ), + 'image' => plugins_url( 'images/onboarding/mercadopago.png', WC_ADMIN_PLUGIN_FILE ), + 'plugins' => array( 'woocommerce-mercadopago' ), 'is_visible' => array( - self::get_rules_for_countries( array( 'ZA', 'GH', 'NG' ) ), - self::get_rules_for_cbd( false ), + self::get_rules_for_countries( array( 'AR', 'BR', 'CL', 'CO', 'MX', 'PE', 'UY' ) ), ), ), array( From ea332ecdb54659a879ef2102346b49d9aff8a161 Mon Sep 17 00:00:00 2001 From: Joshua Flowers Date: Fri, 21 May 2021 12:43:34 -0400 Subject: [PATCH 3/5] Move help text above submit button --- .../components/PaymentConnect.js | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/client/task-list/tasks/payments/RemotePayments/components/PaymentConnect.js b/client/task-list/tasks/payments/RemotePayments/components/PaymentConnect.js index 6826fe0bcc0..d6630c7c733 100644 --- a/client/task-list/tasks/payments/RemotePayments/components/PaymentConnect.js +++ b/client/task-list/tasks/payments/RemotePayments/components/PaymentConnect.js @@ -21,7 +21,7 @@ export const PaymentConnect = ( { const { key, oauth_connection_url: oAuthConnectionUrl, - setup_help_text: helpText, + setup_help_text: setupHelpText, required_settings_keys: settingKeys, settings, settings_url: settingsUrl, @@ -99,6 +99,9 @@ export const PaymentConnect = ( { return errors; }; + const helpText = setupHelpText && ( +

+ ); const DefaultForm = ( props ) => ( + { helpText } - { helpText && ( -

- ) } ); } @@ -140,17 +141,18 @@ export const PaymentConnect = ( { if ( fields.length ) { return ( <> + { helpText } - { helpText && ( -

- ) } ); } return ( - + <> + { helpText } + + ); }; From bd9197cde9a22299fb1817a115cb4d8305ab100f Mon Sep 17 00:00:00 2001 From: Joshua Flowers Date: Fri, 21 May 2021 12:47:36 -0400 Subject: [PATCH 4/5] Add changelog entry --- readme.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.txt b/readme.txt index 235748b26cc..29525faf77d 100644 --- a/readme.txt +++ b/readme.txt @@ -85,6 +85,7 @@ Release and roadmap notes are available on the [WooCommerce Developers Blog](htt - Add: Note date range logic for GivingFeedback, and InsightFirstSale note. #6969 - Add: Add transient notices feature #6809 - Add: Add transformers in remote inbox notifications #6948 +- Add: Add Mercado Pago as default fallback payment gateway #7043 - Add: Get post install scripts from gateway and enqueue in client #6967 - Add: Free extension list powered by remote config #6952 - Add: Add PayPal to fallback payment gateways #7001 From 2a688dc9f63885bdb87af020cb4cdb7b7b3d8f3a Mon Sep 17 00:00:00 2001 From: Joshua Flowers Date: Tue, 25 May 2021 12:40:29 -0400 Subject: [PATCH 5/5] Update gateway ID --- src/Features/RemotePaymentMethods/DefaultPaymentGateways.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Features/RemotePaymentMethods/DefaultPaymentGateways.php b/src/Features/RemotePaymentMethods/DefaultPaymentGateways.php index 34f0050db65..5dcbc39545d 100644 --- a/src/Features/RemotePaymentMethods/DefaultPaymentGateways.php +++ b/src/Features/RemotePaymentMethods/DefaultPaymentGateways.php @@ -69,7 +69,7 @@ public static function get_all() { ), ), array( - 'key' => 'mercadopago', + 'key' => 'woo-mercado-pago-custom', 'title' => __( 'Mercado Pago Checkout Pro & Custom', 'woocommerce-admin' ), 'content' => __( 'Accept credit and debit cards, offline (cash or bank transfer) and logged-in payments with money in Mercado Pago. Safe and secure payments with the leading payment processor in LATAM.', 'woocommerce-admin' ), 'image' => plugins_url( 'images/onboarding/mercadopago.png', WC_ADMIN_PLUGIN_FILE ),