Skip to content

Comments

BT followup: Add BusinessCardBadge and tax label adjustments to Billing History receipt#101863

Closed
jjchrisdiehl wants to merge 26 commits intotrunkfrom
add/business-card-badge-to-billing-history-receipt
Closed

BT followup: Add BusinessCardBadge and tax label adjustments to Billing History receipt#101863
jjchrisdiehl wants to merge 26 commits intotrunkfrom
add/business-card-badge-to-billing-history-receipt

Conversation

@jjchrisdiehl
Copy link
Contributor

This PR contains the code that adds a BusinessCardBadge to Billing History, the badge was first introduced in #101353. There is also code that adjusts the label for the receipt tax line item to better denote what the tax rate change is for (OH and CT state business tax).

The Billing History code was moved as I'll need to provide information from the me/billing-history endpoint to handle:

  • Showing/hiding the business card badge
  • Adjusting the tax rate labeling in the receipt line items

Since this relies on a backend change, I figured its better to just break it off from the other changes to unblock them.

Related to #101353 and https://github.com/Automattic/payments-shilling/issues/3239

Proposed Changes

Add a Business Card badge to Payment Method line in Billing History > View Receipt

  • This PR handles adding the cc_is_for_business value that is passed from the /me/billing-history endpoint in (coming soon)
  • Since technically the is_for_business value is saved on the tax_location of the stored_details, I decided to drop this value into the billing-history through the CC values rather than setting tax_is_for_business in me/billing-history's response. We can derive that the tax applied here is for business from the stored details, since currently there is no way to separate these two values (i.e. a receipt with a business card that doesn't have a tax using the for_business value)
  • Granted, this feels a bit flimsy so any feedback here is welcome!

Adjust the receipt tax line item label to note the OH or CT business tax applied

  • WIP

Testing Instructions

Test the business card badge

  • Sandbox wpcom
  • Use an account with a business card and a receipt with an is for business transaction on it (you could also just sandbox the API and complete a checkout with a Stripe test card, just make sure to set your country to US, and postal code to OH or CT 43010, then check off the is this purchase for business? checkbox in Billing Information during Checkout)
  • Go to me > Purchases > Billing History and from the actions column click on View Receipt
  • You should now see a BusinessCardBadge component next to the Payment Method line
image

Test the tax label adjustment

  • WIP

jjchrisdiehl and others added 26 commits March 21, 2025 17:23
The cancel purchase link was hidden for non-plans in #101493.
If this is a necessary as part of the self-service plan downgrades
feature, then the logic will need to be updated to include a check for
the `plans/self-service-downgrade` feature flag.
* Move date range header outside of card

* update styling a little

* adds percentage bar measurement rows

* fix spacing on horizontal rows + tidy up

* Indent the horizontal bar span text

* adds hover styling to rows

* align grid headings and styling

* update header cell top padding

* Update client/my-sites/stats/videopress-stats-module/style.scss

---------

Co-authored-by: Jasper Kang <jasper.kang@automattic.com>
Site slug can be incorrect for the sites where WordPress lives in a subdirectory.

Using siteId generates a correct checkout URL regardless of the environment
* Gravatar: Handle Gravatar quick editor sign-in case

* Add more props and make the tracking event not working

* Rename is_start_view to is_initial_view

* Update titles

---------

Co-authored-by: Welly Shen <welly.shen@automattic.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Kosta <heavyweight@users.noreply.github.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Kosta <heavyweight@users.noreply.github.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
#101739)

* Use the new container

* Use Step.Heading component for domain transfer step

* Adjust "transfer-or-connect" styling

* Fix transfer-or-connect layout on mobile

---------

Co-authored-by: Philip Jackson <p-jackson@live.com>
* remove query date filter from following

* remove test changes for following date cutoff

* remove following stream__caught-up component

* update empty content text for following feed

* fix unit tests
@jjchrisdiehl jjchrisdiehl requested review from a team as code owners March 25, 2025 20:51
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Mar 25, 2025
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Mar 25, 2025
@matticbot
Copy link
Contributor

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

App Entrypoints (~271 bytes added 📈 [gzipped])

Details
name                   parsed_size           gzip_size
entry-login                 +782 B  (+0.0%)     +213 B  (+0.0%)
entry-stepper               +518 B  (+0.0%)      +65 B  (+0.0%)
entry-subscriptions         +207 B  (+0.0%)       +6 B  (+0.0%)
entry-main                  +207 B  (+0.0%)       +5 B  (+0.0%)
entry-domains-landing        -13 B  (-0.0%)      -53 B  (-0.0%)
entry-browsehappy            -13 B  (-0.0%)      -53 B  (-0.1%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Sections (~2676 bytes removed 📉 [gzipped])

Details
name                             parsed_size           gzip_size
async-step-use-my-domain            +24639 B  (+4.3%)    +9687 B  (+5.8%)
site-purchases                       +1911 B  (+0.1%)     +446 B  (+0.1%)
purchases                            +1911 B  (+0.1%)     +446 B  (+0.1%)
security                             +1359 B  (+0.2%)     +527 B  (+0.2%)
media                                +1359 B  (+0.1%)     +527 B  (+0.1%)
jetpack-cloud-agency-dashboard       +1359 B  (+0.1%)     +527 B  (+0.2%)
concierge                            +1359 B  (+0.3%)     +527 B  (+0.4%)
a8c-for-agencies-sites               +1359 B  (+0.1%)     +527 B  (+0.1%)
a8c-for-agencies-signup              +1359 B  (+0.6%)     +527 B  (+0.8%)
plugins                              +1124 B  (+0.0%)     +540 B  (+0.1%)
subscribers                           +388 B  (+0.0%)      +75 B  (+0.0%)
jetpack-cloud-plugin-management       -235 B  (-0.0%)      +13 B  (+0.0%)
home                                  -235 B  (-0.0%)      +13 B  (+0.0%)
a8c-for-agencies-plugins              -235 B  (-0.0%)      +13 B  (+0.0%)
reader                                -222 B  (-0.0%)      +17 B  (+0.0%)
jetpack-connect                       +125 B  (+0.0%)      +47 B  (+0.0%)
stepper-user-step                      -54 B  (-0.0%)     -130 B  (-0.1%)
signup                                 -52 B  (-0.0%)      -20 B  (-0.0%)
async-step-unified-plans               -52 B  (-0.0%)      -17 B  (-0.0%)
async-step-unified-domains             -43 B  (-0.0%)      -14 B  (-0.0%)
domains                                +23 B  (+0.0%)      +10 B  (+0.0%)
plans                                  -13 B  (-0.0%)       +4 B  (+0.0%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Async-loaded Components (~844 bytes added 📈 [gzipped])

Details
name                                                      parsed_size           gzip_size
async-load-design-blocks                                      +1866 B  (+0.1%)     +803 B  (+0.1%)
async-load-design-playground                                  +1359 B  (+0.1%)     +527 B  (+0.2%)
async-load-design                                             +1359 B  (+0.1%)     +527 B  (+0.1%)
async-load-calypso-post-editor-media-modal                    +1359 B  (+0.1%)     +527 B  (+0.1%)
async-load-calypso-post-editor-editor-media-modal             +1359 B  (+0.1%)     +527 B  (+0.1%)
async-load-calypso-my-sites-stats-pages-subscribers            +388 B  (+0.2%)      +67 B  (+0.1%)
async-load-calypso-components-web-preview-component            +382 B  (+0.1%)     +229 B  (+0.2%)
async-load-calypso-my-sites-stats-summary                      +364 B  (+0.8%)     +143 B  (+1.1%)
async-load-context-links                                       +131 B  (+1.1%)      +17 B  (+0.6%)
async-load-calypso-my-sites-stats-jetpack-upsell-section        -59 B  (-0.5%)       -4 B  (-0.1%)
async-load-signup-steps-new-or-existing-site                    -13 B  (-0.0%)     -182 B  (-0.7%)

React components that are loaded lazily, when a certain part of UI is displayed for the first time.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@matticbot
Copy link
Contributor

matticbot commented Mar 25, 2025

@github-actions
Copy link

This PR has been marked as stale. This happened because:

  • It has been inactive for the past 3 months.
  • It hasn't been labeled `[Pri] BLOCKER`, `[Pri] High`, `[Status] Keep Open`, etc.

If this PR is still useful, please do a trunk merge or rebase and otherwise make sure it's up to date and has clear testing instructions. You may also want to ping possible reviewers in case they've forgotten about it. Please close this PR if you think it's not valid anymore — if you do, please add a brief explanation.

If the PR is not updated (or at least commented on) in another month, it will be automatically closed.

@github-actions
Copy link

This PR has been automatically closed as it has not been updated in some time. If you want to resume work on the PR, feel free to restore the branch and reopen the PR.

@github-actions github-actions bot closed this Sep 14, 2025
@github-actions github-actions bot deleted the add/business-card-badge-to-billing-history-receipt branch September 14, 2025 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Status] Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.