-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show deposit schedule message if account's deposits are unrestricted #7875
Show deposit schedule message if account's deposits are unrestricted #7875
Conversation
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: +29 B (0%) Total Size: 1.44 MB
ℹ️ View Unchanged
|
This comment was marked as outdated.
This comment was marked as outdated.
@@ -35,6 +35,9 @@ const DepositsOverview: React.FC = () => { | |||
overview, | |||
isLoading: isLoadingOverview, | |||
} = useSelectedCurrencyOverview(); | |||
const isDepositsUnrestricted = | |||
wcpaySettings.accountStatus.deposits?.restrictions === |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you check for wcpaySettings.accountStatus.deposits.restrictions
instead of account.deposits_blocked
?
If I understand it correctly, account.deposits_blocked
takes account new account waiting period and wcpaySettings.accountStatus.deposits.restrictions
does not.
Just curious.
Current code would work because the deposits card won't show if available balance is 0 and there is no deposits anyway. When in waiting period, merchant won't have deposits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAICT account.deposits_blocked
only checks for deposits blocked, and doesn't take into consideration schedule restrictions.
In this case, we want to check for both schedule restrictions and blocked deposits, which wcpaySettings.accountStatus.deposits.restrictions === 'deposits_unrestricted'
covers.
I could include a check for wcpaySettings.accountStatus.deposits.completed_waiting_period === true
, that might be more explicit. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for explaining. I don't think it's necessary to check waiting period.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good and tested well per testing instructions.
I have a question when available balance is negative, why the next date string shows up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good and tested well per testing instructions.
I have a question when available balance is negative, why the next date string shows up.
34215f7
to
9cec48f
Compare
Co-authored-by: Shendy <[email protected]>
f6135dd
to
ed4a651
Compare
…-zero-available-balance
Rebased to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Retested to make sure and everything looks good.
Also, I made sure the rebase went OK by comparing with the PR branch before rebased, https://github.com/Automattic/woocommerce-payments/pull/7896/files. I still had it on my local minus your latest commit.
Fixes #7874
Changes proposed in this Pull Request
This helps communicate to merchants that they have an expected upcoming deposit, even if their available balance <= 0.
Testing instructions
npm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge