* Update WCPay in person text

* Remove div wrapping finish setup button

* Add changelog entry

* Add US specific WooCommerce Payment suggestion

* Allow different gateway suggestion IDs for wcpay

* Add older fallback version of WCPay

* Change check to dev version of 2.9.0

* Use 5.10.0-dev for WC checks
This commit is contained in:
Joshua T Flowers 2021-11-02 09:03:04 -04:00 committed by GitHub
parent d57232719d
commit ea857c73d6
4 changed files with 97 additions and 14 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: Update
Update WC Pay card to include in-person information #7830

View File

@ -107,7 +107,6 @@ export const Action = ( {
if ( isInstalled && hasPlugins ) {
return (
<div>
<Button
className={ classes }
isPrimary={ isRecommended }
@ -118,7 +117,6 @@ export const Action = ( {
>
{ __( 'Finish setup', 'woocommerce-admin' ) }
</Button>
</div>
);
}

View File

@ -169,7 +169,8 @@ export const PaymentGatewaySuggestions = ( { onComplete, query } ) => {
// WCPay is handled separately when not installed and configured
if (
gateway.id === 'woocommerce_payments' &&
gateway.plugins?.length === 1 &&
gateway.plugins[ 0 ] === 'woocommerce-payments' &&
! ( gateway.installed && ! gateway.needsSetup )
) {
wcPay.push( gateway );

View File

@ -217,10 +217,90 @@ class DefaultPaymentGateways {
),
'image' => plugins_url( 'images/onboarding/wcpay.svg', WC_ADMIN_PLUGIN_FILE ),
'plugins' => array( 'woocommerce-payments' ),
'description' => 'Try the new way to get paid. Securely accept credit and debit cards on your site. Manage transactions without leaving your WordPress dashboard. Only with WooCommerce Payments.',
'description' => 'With WooCommerce Payments, you can securely accept major cards, Apple Pay, and payments in over 100 currencies. Track cash flow and manage recurring revenue directly from your stores dashboard - with no setup costs or monthly fees.',
'is_visible' => array(
self::get_rules_for_cbd( false ),
self::get_rules_for_countries( self::get_wcpay_countries() ),
(object) array(
'type' => 'plugin_version',
'plugin' => 'woocommerce-admin',
'version' => '2.9.0-dev',
'operator' => '<',
),
(object) array(
'type' => 'plugin_version',
'plugin' => 'woocommerce',
'version' => '5.10.0-dev',
'operator' => '<',
),
),
'recommendation_priority' => 1,
),
array(
'id' => 'woocommerce_payments:non-us',
'title' => __( 'WooCommerce Payments', 'woocommerce-admin' ),
'content' => __(
'Manage transactions without leaving your WordPress Dashboard. Only with WooCommerce Payments.',
'woocommerce-admin'
),
'image' => plugins_url( 'images/onboarding/wcpay.svg', WC_ADMIN_PLUGIN_FILE ),
'plugins' => array( 'woocommerce-payments' ),
'description' => 'With WooCommerce Payments, you can securely accept major cards, Apple Pay, and payments in over 100 currencies. Track cash flow and manage recurring revenue directly from your stores dashboard - with no setup costs or monthly fees.',
'is_visible' => array(
self::get_rules_for_cbd( false ),
self::get_rules_for_countries( array_diff( self::get_wcpay_countries(), array( 'US' ) ) ),
(object) array(
'type' => 'or',
// Older versions of WooCommerce Admin require the ID to be `woocommerce-payments` to show the suggestion card.
'operands' => (object) array(
(object) array(
'type' => 'plugin_version',
'plugin' => 'woocommerce-admin',
'version' => '2.9.0-dev',
'operator' => '>=',
),
(object) array(
'type' => 'plugin_version',
'plugin' => 'woocommerce',
'version' => '5.10.0-dev',
'operator' => '>=',
),
),
),
),
'recommendation_priority' => 1,
),
array(
'id' => 'woocommerce_payments:us',
'title' => __( 'WooCommerce Payments', 'woocommerce-admin' ),
'content' => __(
'Manage transactions without leaving your WordPress Dashboard. Only with WooCommerce Payments.',
'woocommerce-admin'
),
'image' => plugins_url( 'images/onboarding/wcpay.svg', WC_ADMIN_PLUGIN_FILE ),
'plugins' => array( 'woocommerce-payments' ),
'description' => 'With WooCommerce Payments, you can securely accept major cards, Apple Pay, and payments in over 100 currencies with no setup costs or monthly fees and you can now accept in-person payments with the Woo mobile app.',
'is_visible' => array(
self::get_rules_for_cbd( false ),
self::get_rules_for_countries( array( 'US' ) ),
(object) array(
'type' => 'or',
// Older versions of WooCommerce Admin require the ID to be `woocommerce-payments` to show the suggestion card.
'operands' => (object) array(
(object) array(
'type' => 'plugin_version',
'plugin' => 'woocommerce-admin',
'version' => '2.9.0-dev',
'operator' => '>=',
),
(object) array(
'type' => 'plugin_version',
'plugin' => 'woocommerce',
'version' => '5.10.0-dev',
'operator' => '>=',
),
),
),
),
'recommendation_priority' => 1,
),