-
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
Pass currency and do not pass transaction_ids parameter to create instant deposit #7828
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: -25 B (0%) Total Size: 1.27 MB
ℹ️ View Unchanged
|
Significance: minor | ||
Type: update | ||
|
||
Pass currency parameter and not transaction_ids parameter when creating instant deposit. |
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.
Should we add a changelog entry for this kind of change, one that is not user facing and a change that is only 'in the background'?
I assume yes but like a confirmation.
@@ -235,18 +235,18 @@ export const useDepositsSummary = ( { | |||
}; | |||
|
|||
export const useInstantDeposit = ( | |||
transactionIds: string[] | |||
currency: string | |||
): { inProgress: boolean; submit: () => void; deposit: unknown } => { |
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.
Thought (out of scope of this PR): we should use an interface from deposits.d.ts
here.
However, low priority, since this value from this hook is actually not currently used in our codebase (we only use inProgress
and submit
).
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.
I was wondering about that actually, whether it's necessary to return deposit
since it's not used anywhere.
Do you think I should delete deposit
, inProgress
from the return value, and getInstantDeposit
?
I tried to do that and there are a lot of things can be deleted. However, I thought they are necessary to keep the state of the button so we can use it to remove the button after an instant deposit is created but actually, even after preserving them (deposit
and inProgress
), the button still does not disappear after an instant deposit is created. I created #7841 for that.
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 @shendy-a8c!
I've tested this as per instructions with the server branch from PR 4061.
I suggest we add I've added the blocked
label to indicate that this PR should not be merged until server PR 4061 is merged!
Created #7841. |
@@ -54,7 +54,6 @@ export interface InstantBalance { | |||
fee: number; | |||
net: number; | |||
fee_percentage: number; | |||
transaction_ids: Array< string >; |
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.
👍
Removing |
Failed e2e tests are not related to this PR's changes. Merging. |
Fixes #7711
Changes proposed in this Pull Request
When creating instant deposit:
currency
parameter.transaction_ids
parameter.Testing instructions
/wp-json/wc/v3/payments/deposits
./wp-json/wc/v3/payments/deposits
hascurrency
parameter and nottransaction_ids
.ps: after a successful instant deposit, the 'Deposit available funds' button state does not get updated, ie if user has exceed daily limit, the button should be hidden, etc. I'll create a separate issue for this.
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