-
Notifications
You must be signed in to change notification settings - Fork 72
Render tax details in the transaction timeline #10707
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
base: develop
Are you sure you want to change the base?
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: +581 B (0%) Total Size: 1.26 MB
ℹ️ View Unchanged
|
…nested and update tests for tax scenarios
…formatting for tax rows
…d TaxFeeRow component
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 havent' been able to see the tax breakdown in any of my transactions, yet. Do you have some suggestions for me? 😬
client/payment-details/transaction-breakdown/fees-breakdown/index.tsx
Outdated
Show resolved
Hide resolved
* - "AU GST" for Australian Goods and Services Tax | ||
*/ | ||
type TaxDescriptionKey = | ||
| 'AT VAT' // Austria VAT |
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.
(minor) do we get any advantage by specifically typing each one of these? I wonder if we can just declare TaxDescriptionKey
as a string
, and taxDescriptions
as Record< string, 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.
+1 here. We should probably avoid hardcoding things in this way and over-relying on types to enforce values too. Especiallly that we also have a handling for the default
(i.e. not found) case.
@frosso My bad, you need to set a metadata flag in the server: |
Thank you @mgascam ! diff --git a/client/payment-details/transaction-breakdown/index.tsx b/client/payment-details/transaction-breakdown/index.tsx
index 00aa2eff2..0ce362ffb 100644
--- a/client/payment-details/transaction-breakdown/index.tsx
+++ b/client/payment-details/transaction-breakdown/index.tsx
@@ -35,7 +35,7 @@ interface PaymentTransactionBreakdownProps {
*
* Switch to `false` while testing.
*/
-const disableTransactionBreakdown = true;
+const disableTransactionBreakdown = false;
const PaymentTransactionBreakdown: React.FC< PaymentTransactionBreakdownProps > = ( {
paymentIntentId,
But I still can't see the tax on the transaction breakdown. ![]() Do I need anything else to see the tax in the transaction details page? |
…iptions to be in English language by default.
Apologies again, @frosso — I forgot to mention that tax calculation is limited to merchants based in certain countries. This means the merchant account linked to your WooPayments store must be located in a supported country, and the appropriate metadata flag must be set on that account. |
Fixes WOOPMNT-4878
Changes proposed in this Pull Request
This PR adds support for displaying tax information in the transaction timeline where available. The changes include:
TimelineFeeTax
interface to support tax details including amount, currency, description, and percentage rateTimelineFeeRates
interface to include tax and before_tax informationcomposeTaxString
function to format tax information for displayThe tax information will be displayed in the transaction timeline with the following format:
This change helps merchants better understand the tax components of their transaction fees.
Screenshots
1. Tax information in the timeline
2. Tax information in the Transaction breakdown
Testing instructions
Note: The transaction breakdown is temporarily disabled. Please edit the
disableTransactionBreakdown
const to enable it.The tax on fee feature is under development, you need to set a metadata flag in the server to use it:
npm run cli wp wcpay set_account_meta <YOUR_ACCOUNT_ID> --key=tax_on_fee_enabled --value=1
.Please note the tax calculation feature is limited to accounts not in US, CA, HK, AE so you might need to re-onboard with an account in a supported country from this list.