-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add uncaptured transactions count badge to Transactions menu (#5046)
* Add badge for uncaptured transactions count in Payments menu This is a basic implementation without caching, which will come a bit later. * Display badge only when manual capture is enabled This will save us a tonne of unnecessary API calls to get authorizations count. * Cache authorization summary data We use Database_Cache to store authorization summary data (including uncaptured count) as an option in database. Justification for caching: * Uncaptured transactions count is fetched via API when the Payments menu is created in WP Admin, which is essentially on each page load of WP Admin. * Not all merchants will receive multiple orders every minute. * Invalidate auth summary cache based on webhook events * Add changelog * Invalidate cache based on intent rather than charge events This will be things consistent with server. Besides, charge suceeded and captured events are not currently being forwarded to the plugin. * Remove duplicate badge format constant * Add count badge to Uncaptured tab button Without a proper support for badges in WP's TabPanel component, implementing this barebones but functional approach. * Fix duplicate import that came with merge with develop * Add tests for badge in Transactions menu item * Remove count badge from Uncaptured tab button We'll revisit this later when we have a better solution. * Hide the badge under a feature flag * Minor refactors for stricter typing * Remove empty line between variable and condition * Fix tests breaking because of feature flag * Update changelog Co-authored-by: Miguel Gasca <miguel.gasca@automattic.com>
- Loading branch information
Showing
6 changed files
with
200 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: add | ||
|
||
Add uncaptured transactions count badge to Transactions menu. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters