From 2581e51c6523edd8370e498ca40e053fee870535 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Wed, 13 Dec 2023 00:16:40 +0000
Subject: [PATCH 01/13] Update version and add changelog entries for release
6.9.2
---
changelog.txt | 2 ++
package-lock.json | 4 ++--
package.json | 2 +-
readme.txt | 5 ++++-
woocommerce-payments.php | 2 +-
5 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/changelog.txt b/changelog.txt
index 18c98319d74..67743c9648d 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -1,5 +1,7 @@
*** WooPayments Changelog ***
+= 6.9.2 - 2023-12-14 =
+
= 6.9.1 - 2023-12-07 =
* Fix - Display Klarna & Afterpay on the checkout for UK based stores
diff --git a/package-lock.json b/package-lock.json
index ff4e80d88e2..a6d52f964c4 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "woocommerce-payments",
- "version": "6.9.1",
+ "version": "6.9.2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "woocommerce-payments",
- "version": "6.9.1",
+ "version": "6.9.2",
"hasInstallScript": true,
"license": "GPL-3.0-or-later",
"dependencies": {
diff --git a/package.json b/package.json
index 905e6bbbe01..d80cfbe4bd0 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "woocommerce-payments",
- "version": "6.9.1",
+ "version": "6.9.2",
"main": "webpack.config.js",
"author": "Automattic",
"license": "GPL-3.0-or-later",
diff --git a/readme.txt b/readme.txt
index e7f21908b84..e4fbfff8edc 100644
--- a/readme.txt
+++ b/readme.txt
@@ -4,7 +4,7 @@ Tags: woocommerce payments, apple pay, credit card, google pay, payment, payment
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.3
-Stable tag: 6.9.1
+Stable tag: 6.9.2
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -94,6 +94,9 @@ Please note that our support for the checkout block is still experimental and th
== Changelog ==
+= 6.9.2 - 2023-12-14 =
+
+
= 6.9.1 - 2023-12-07 =
* Fix - Display Klarna & Afterpay on the checkout for UK based stores
diff --git a/woocommerce-payments.php b/woocommerce-payments.php
index e135eef1a56..df1a348ec90 100644
--- a/woocommerce-payments.php
+++ b/woocommerce-payments.php
@@ -12,7 +12,7 @@
* WC tested up to: 8.3.1
* Requires at least: 6.0
* Requires PHP: 7.3
- * Version: 6.9.1
+ * Version: 6.9.2
*
* @package WooCommerce\Payments
*/
From c0e6cf5c3536c628184c99f4ceec1598ccb1eb33 Mon Sep 17 00:00:00 2001
From: Eric Jinks <3147296+Jinksi@users.noreply.github.com>
Date: Wed, 13 Dec 2023 15:21:45 +1000
Subject: [PATCH 02/13] Show deposit schedule message if account's deposits are
unrestricted (#7875)
Co-authored-by: Shendy <73803630+shendy-a8c@users.noreply.github.com>
---
...posit-schedule-when-zero-available-balance | 4 ++
.../deposits-overview/deposit-schedule.tsx | 36 ++++++++----
client/components/deposits-overview/index.tsx | 16 +++---
.../test/__snapshots__/index.tsx.snap | 56 ++++++++++++++++++-
.../deposits-overview/test/index.tsx | 2 +
client/globals.d.ts | 4 ++
6 files changed, 96 insertions(+), 22 deletions(-)
create mode 100644 changelog/fix-7874-show-deposit-schedule-when-zero-available-balance
diff --git a/changelog/fix-7874-show-deposit-schedule-when-zero-available-balance b/changelog/fix-7874-show-deposit-schedule-when-zero-available-balance
new file mode 100644
index 00000000000..bbc503c7a72
--- /dev/null
+++ b/changelog/fix-7874-show-deposit-schedule-when-zero-available-balance
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fix
+
+Show deposit schedule message when deposits are unrestricted
diff --git a/client/components/deposits-overview/deposit-schedule.tsx b/client/components/deposits-overview/deposit-schedule.tsx
index c7eae7bca78..8ae6546655c 100644
--- a/client/components/deposits-overview/deposit-schedule.tsx
+++ b/client/components/deposits-overview/deposit-schedule.tsx
@@ -17,6 +17,7 @@ import type * as AccountOverview from 'wcpay/types/account-overview';
interface DepositScheduleProps {
depositsSchedule: AccountOverview.Account[ 'deposits_schedule' ];
+ showNextDepositDate?: boolean;
}
/**
* Renders the Deposit Schedule details component.
@@ -25,19 +26,30 @@ interface DepositScheduleProps {
*/
const DepositSchedule: React.FC< DepositScheduleProps > = ( {
depositsSchedule,
+ showNextDepositDate,
} ) => {
const nextDepositDate = getNextDepositDate( depositsSchedule );
+ const nextDepositDateString = showNextDepositDate
+ ? sprintf(
+ /** translators: %s: is the date of the next deposit, e.g. "January 1st, 2023". */
+ __(
+ ' – your next deposit is scheduled for {{strong}}%s{{/strong}}',
+ 'woocommerce-payments'
+ ),
+ nextDepositDate
+ )
+ : '';
switch ( depositsSchedule.interval ) {
case 'daily':
return interpolateComponents( {
mixedString: sprintf(
- /** translators: {{strong}}: placeholders are opening and closing strong tags. %s: is the date of the next deposit, e.g. "January 1st, 2023". */
+ /** translators: {{strong}}: placeholders are opening and closing strong tags. %s: is an optional next deposit date message. */
__(
- 'Available funds are automatically dispatched {{strong}}every day{{/strong}} – your next deposit is scheduled for {{strong}}%s{{/strong}}.',
+ 'Available funds are automatically dispatched {{strong}}every day{{/strong}}%s.',
'woocommerce-payments'
),
- nextDepositDate
+ nextDepositDateString
),
components: {
strong: ,
@@ -52,13 +64,13 @@ const DepositSchedule: React.FC< DepositScheduleProps > = ( {
return interpolateComponents( {
mixedString: sprintf(
- /** translators: %1$s: is the day of the week. eg "Friday". %2$s: is the date of the next deposit, e.g. "January 1st, 2023". {{strong}}: placeholders are opening and closing strong tags. */
+ /** translators: %1$s: is the day of the week. eg "Friday". %2$s: is an optional next deposit date message. {{strong}}: placeholders are opening and closing strong tags. */
__(
- 'Available funds are automatically dispatched {{strong}}every %1$s{{/strong}} – your next deposit is scheduled for {{strong}}%2$s{{/strong}}.',
+ 'Available funds are automatically dispatched {{strong}}every %1$s{{/strong}}%2$s.',
'woocommerce-payments'
),
dayOfWeek,
- nextDepositDate
+ nextDepositDateString
),
components: {
strong: ,
@@ -71,12 +83,12 @@ const DepositSchedule: React.FC< DepositScheduleProps > = ( {
if ( monthlyAnchor === 31 ) {
return interpolateComponents( {
mixedString: sprintf(
- /** translators: {{strong}}: placeholders are opening and closing strong tags. %s: is the date of the next deposit, e.g. "January 1st, 2023". */
+ /** translators: {{strong}}: placeholders are opening and closing strong tags. %s: is an optional next deposit date message. */
__(
- 'Available funds are automatically dispatched {{strong}}on the last day of every month{{/strong}} – your next deposit is scheduled for {{strong}}%s{{/strong}}.',
+ 'Available funds are automatically dispatched {{strong}}on the last day of every month{{/strong}}%s.',
'woocommerce-payments'
),
- nextDepositDate
+ nextDepositDateString
),
components: {
strong: ,
@@ -86,16 +98,16 @@ const DepositSchedule: React.FC< DepositScheduleProps > = ( {
return interpolateComponents( {
mixedString: sprintf(
- /** translators: {{strong}}: placeholders are opening and closing strong tags. %1$s: is the day of the month. eg "31st". %2$s: is the date of the next deposit, e.g. "January 1st, 2023". */
+ /** translators: {{strong}}: placeholders are opening and closing strong tags. %1$s: is the day of the month. eg "31st". %2$s: is an optional next deposit date message. */
__(
- 'Available funds are automatically dispatched {{strong}}on the %1$s of every month{{/strong}} – your next deposit is scheduled for {{strong}}%2$s{{/strong}}.',
+ 'Available funds are automatically dispatched {{strong}}on the %1$s of every month{{/strong}}%2$s.',
'woocommerce-payments'
),
getDepositMonthlyAnchorLabel( {
monthlyAnchor: monthlyAnchor,
capitalize: false,
} ),
- nextDepositDate
+ nextDepositDateString
),
components: {
strong: ,
diff --git a/client/components/deposits-overview/index.tsx b/client/components/deposits-overview/index.tsx
index 27c754c0640..f7c318126fb 100644
--- a/client/components/deposits-overview/index.tsx
+++ b/client/components/deposits-overview/index.tsx
@@ -35,6 +35,9 @@ const DepositsOverview: React.FC = () => {
overview,
isLoading: isLoadingOverview,
} = useSelectedCurrencyOverview();
+ const isDepositsUnrestricted =
+ wcpaySettings.accountStatus.deposits?.restrictions ===
+ 'deposits_unrestricted';
const selectedCurrency =
overview?.currency || wcpaySettings.accountDefaultCurrency;
const { isLoading: isLoadingDeposits, deposits } = useRecentDeposits(
@@ -45,19 +48,13 @@ const DepositsOverview: React.FC = () => {
const availableFunds = overview?.available?.amount ?? 0;
- // If the account has deposits blocked, there is no available balance or it is negative, there is no future deposit expected.
- const isNextDepositExpected =
- ! account?.deposits_blocked && availableFunds > 0;
// If the available balance is negative, deposits may be paused.
const isNegativeBalanceDepositsPaused = availableFunds < 0;
const hasCompletedWaitingPeriod =
wcpaySettings.accountStatus.deposits?.completed_waiting_period;
// Only show the deposit history section if the page is finished loading and there are deposits. */ }
const showRecentDeposits =
- ! isLoading &&
- deposits?.length > 0 &&
- !! account &&
- ! account?.deposits_blocked;
+ ! isLoading && deposits?.length > 0 && !! account;
// Show a loading state if the page is still loading.
if ( isLoading ) {
@@ -98,10 +95,11 @@ const DepositsOverview: React.FC = () => {
{ /* Deposit schedule message */ }
- { isNextDepositExpected && !! account && (
+ { isDepositsUnrestricted && !! account && (
0 }
/>
) }
@@ -112,7 +110,7 @@ const DepositsOverview: React.FC = () => {
) : (
<>
- { isNextDepositExpected && (
+ { isDepositsUnrestricted && (
) }
{ ! hasCompletedWaitingPeriod && (
diff --git a/client/components/deposits-overview/test/__snapshots__/index.tsx.snap b/client/components/deposits-overview/test/__snapshots__/index.tsx.snap
index 9dcdb85548d..6b4db19d73c 100644
--- a/client/components/deposits-overview/test/__snapshots__/index.tsx.snap
+++ b/client/components/deposits-overview/test/__snapshots__/index.tsx.snap
@@ -17,11 +17,65 @@ exports[`Deposits Overview information Component Renders 1`] = `
>
Deposits
+
+ Available funds are automatically dispatched
+
+ every Monday
+
+ .
+
+ >
+
+
+
+
+
+
+
+ It may take 1-3 business days for deposits to reach your bank account.
+
+
+
+
+
+
{
global.wcpaySettings = {
accountStatus: {
deposits: {
+ restrictions: 'deposits_unrestricted',
completed_waiting_period: true,
},
},
diff --git a/client/globals.d.ts b/client/globals.d.ts
index eaffe24b8b6..3d85e8d5918 100644
--- a/client/globals.d.ts
+++ b/client/globals.d.ts
@@ -31,6 +31,10 @@ declare global {
paymentsEnabled?: boolean;
deposits?: {
status: string;
+ restrictions:
+ | 'deposits_unrestricted'
+ | 'deposits_blocked'
+ | 'schedule_restricted';
interval: string;
weekly_anchor: string;
monthly_anchor: null | number;
From a81f3689e871dd915f2dae8c3ac19bc10c7b34b1 Mon Sep 17 00:00:00 2001
From: Eric Jinks <3147296+Jinksi@users.noreply.github.com>
Date: Wed, 13 Dec 2023 15:49:13 +1000
Subject: [PATCH 03/13] Transactions List - indicate when a transaction is
expected to be included in a future deposit (#7878)
---
changelog/add-transaction-list-future-deposit | 4 +
client/transactions/list/deposit.tsx | 38 ++-
client/transactions/list/index.tsx | 21 +-
client/transactions/list/style.scss | 5 +
.../list/test/__snapshots__/deposit.tsx.snap | 101 +++++-
.../list/test/__snapshots__/index.tsx.snap | 310 +++++++++++++++++-
client/transactions/list/test/deposit.tsx | 10 -
7 files changed, 449 insertions(+), 40 deletions(-)
create mode 100644 changelog/add-transaction-list-future-deposit
diff --git a/changelog/add-transaction-list-future-deposit b/changelog/add-transaction-list-future-deposit
new file mode 100644
index 00000000000..1f657c0b7af
--- /dev/null
+++ b/changelog/add-transaction-list-future-deposit
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fix
+
+Transactions List - indicate when a transaction is expected to be included in a future deposit
diff --git a/client/transactions/list/deposit.tsx b/client/transactions/list/deposit.tsx
index c0604f0b097..09ceb108ca9 100644
--- a/client/transactions/list/deposit.tsx
+++ b/client/transactions/list/deposit.tsx
@@ -3,18 +3,27 @@
/**
* External dependencies
*/
-import { dateI18n } from '@wordpress/date';
+import React from 'react';
import moment from 'moment';
+import { dateI18n } from '@wordpress/date';
+import { __ } from '@wordpress/i18n';
+import interpolateComponents from '@automattic/interpolate-components';
+import { ExternalLink } from '@wordpress/components';
import { Link } from '@woocommerce/components';
-import React from 'react';
-import { getAdminUrl } from 'wcpay/utils';
+import InfoOutlineIcon from 'gridicons/dist/info-outline';
+
+/**
+ * Internal dependencies
+ */
+import { getAdminUrl } from 'utils';
+import { ClickTooltip } from 'components/tooltip';
interface DepositProps {
depositId?: string;
dateAvailable?: string;
}
-const Deposit = ( { depositId, dateAvailable }: DepositProps ): JSX.Element => {
+const Deposit: React.FC< DepositProps > = ( { depositId, dateAvailable } ) => {
if (
depositId &&
dateAvailable &&
@@ -35,7 +44,26 @@ const Deposit = ( { depositId, dateAvailable }: DepositProps ): JSX.Element => {
return { formattedDateAvailable };
}
- return <>>;
+ // Show an icon with a tooltip to communicate that the deposit will be available in the future.
+ return (
+ <>
+ { __( 'Future deposit', 'woocommerce-payments' ) }
+
+ ),
+ },
+ } ) }
+ buttonIcon={ }
+ />
+ >
+ );
};
export default Deposit;
diff --git a/client/transactions/list/index.tsx b/client/transactions/list/index.tsx
index df9d360b11d..47b893fa22e 100644
--- a/client/transactions/list/index.tsx
+++ b/client/transactions/list/index.tsx
@@ -329,12 +329,6 @@ export const TransactionsList = (
txn.customer_email
);
- const deposit = (
-
- );
const currency = txn.currency.toUpperCase();
const dataType = txn.metadata ? txn.metadata.charge_type : txn.type;
@@ -372,14 +366,21 @@ export const TransactionsList = (
};
};
- const depositStatus = txn.deposit_status
- ? displayDepositStatus[ txn.deposit_status ]
- : '';
-
const isFinancingType =
-1 !==
[ 'financing_payout', 'financing_paydown' ].indexOf( txn.type );
+ const deposit = ! isFinancingType && (
+
+ );
+
+ const depositStatus = txn.deposit_status
+ ? displayDepositStatus[ txn.deposit_status ]
+ : '';
+
// Map transaction into table row.
const data = {
transaction_id: {
diff --git a/client/transactions/list/style.scss b/client/transactions/list/style.scss
index e33b7755e91..3c876b115c3 100644
--- a/client/transactions/list/style.scss
+++ b/client/transactions/list/style.scss
@@ -46,6 +46,11 @@ $space-header-item: 12px;
top: 3px;
left: 8px;
}
+ .woocommerce-table__item {
+ .wcpay-tooltip__content-wrapper {
+ white-space: normal;
+ }
+ }
}
/**
diff --git a/client/transactions/list/test/__snapshots__/deposit.tsx.snap b/client/transactions/list/test/__snapshots__/deposit.tsx.snap
index ff5e2f4fb9d..5aae20de2e7 100644
--- a/client/transactions/list/test/__snapshots__/deposit.tsx.snap
+++ b/client/transactions/list/test/__snapshots__/deposit.tsx.snap
@@ -11,10 +11,101 @@ exports[`Deposit renders with date and deposit available 1`] = `
`;
-exports[`Deposit renders with date available but no deposit 1`] = ``;
-
-exports[`Deposit renders with deposit but no date available 1`] = ``;
+exports[`Deposit renders with date available but no deposit 1`] = `
+
+ Future deposit
+
+
+`;
-exports[`Deposit renders with estimated date and deposit available 1`] = ``;
+exports[`Deposit renders with deposit but no date available 1`] = `
+
+ Future deposit
+
+
+`;
-exports[`Deposit renders with no date or deposit available 1`] = ``;
+exports[`Deposit renders with no date or deposit available 1`] = `
+
+ Future deposit
+
+
+`;
diff --git a/client/transactions/list/test/__snapshots__/index.tsx.snap b/client/transactions/list/test/__snapshots__/index.tsx.snap
index 2f460c0f997..35b86a155f7 100644
--- a/client/transactions/list/test/__snapshots__/index.tsx.snap
+++ b/client/transactions/list/test/__snapshots__/index.tsx.snap
@@ -610,7 +610,36 @@ exports[`Transactions list renders correctly when can filter by several currenci
+ >
+ Future deposit
+
+
+ >
+ Future deposit
+
+
@@ -1541,7 +1599,36 @@ exports[`Transactions list renders correctly when filtered by currency 1`] = `
- Date / Time
+ Date / Time (UTC)
- Date and time
+ Date and time in UTC
- Sort by Date and time in ascending order
+ Sort by Date and time in UTC in ascending order
- Amount
+ Amount in Deposit Curency
- Sort by Amount in descending order
+ Sort by Amount in Deposit Curency in descending order
- Date / Time
+ Date / Time (UTC)
- Date and time
+ Date and time in UTC
- Sort by Date and time in ascending order
+ Sort by Date and time in UTC in ascending order
- Amount
+ Amount in Deposit Curency
- Sort by Amount in descending order
+ Sort by Amount in Deposit Curency in descending order
- Date / Time
+ Date / Time (UTC)
- Date and time
+ Date and time in UTC
- Sort by Date and time in ascending order
+ Sort by Date and time in UTC in ascending order
- Amount
+ Amount in Deposit Curency
- Sort by Amount in descending order
+ Sort by Amount in Deposit Curency in descending order
- Date / Time
+ Date / Time (UTC)
- Date and time
+ Date and time in UTC
- Sort by Date and time in ascending order
+ Sort by Date and time in UTC in ascending order
- Amount
+ Amount in Deposit Curency
- Sort by Amount in descending order
+ Sort by Amount in Deposit Curency in descending order
- Date / Time
+ Date / Time (UTC)
- Date and time
+ Date and time in UTC
- Sort by Date and time in ascending order
+ Sort by Date and time in UTC in ascending order
- Amount
+ Amount in Deposit Curency
- Sort by Amount in descending order
+ Sort by Amount in Deposit Curency in descending order