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: +94 B (0%) Total Size: 963 kB
ℹ️ View Unchanged
|
| fee_exchange_rate?: TimelineFeeExchangeRate; | ||
| tax?: TimelineFeeTax; | ||
| before_tax?: TimelineFeeTax; | ||
| fee_refunded?: boolean; |
There was a problem hiding this comment.
Server sets fee_rates.fee_refunded: true on refunded captured events.
| if ( event.fee_rates.fee_refunded ) { | ||
| return null; | ||
| } |
| // Only set transaction fee if the charge was actually captured. | ||
| // Canceled authorizations should not have fees since no payment was processed. | ||
| if ( $charge && null !== $charge->get_application_fee_amount() && $charge->is_captured() ) { | ||
| // Non-card Amazon Pay transactions have the application fee refunded |
| } | ||
|
|
||
| $lines[] = $this->compose_fee_string(); | ||
| $fee_rates = $this->captured_event['fee_rates'] ?? []; |
There was a problem hiding this comment.
Pull request overview
This PR adjusts how WooPayments records and displays fees for Amazon Pay transactions, particularly when the application fee is later refunded server-side (non-card funding), so merchants don’t see misleading fee/net values.
Changes:
- Record
_wcpay_transaction_feeas0upfront for Amazon Pay non-card funding, and backfill it later from the timeline’sstore_feeonce settled. - Ensure webhook processing persists fee/net meta even when the fee amount is
0(avoid falsy checks skipping updates). - Update admin timeline/UI rendering to suppress standard fee breakdown for refunded-fee events and optionally show “Stripe processing fee” once available.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/test-class-wc-payments-order-service.php | Adds unit tests for Amazon Pay fee behavior and backfilling logic. |
| includes/class-wc-payments-webhook-processing-service.php | Fixes fee/net meta updates when application fee amount is zero. |
| includes/class-wc-payments-order-service.php | Implements Amazon Pay upfront fee=0 behavior, backfill from timeline, and delays fee breakdown note job. |
| includes/class-wc-payments-captured-event-note.php | Adjusts captured-event note rendering for refunded-fee events (Stripe processing fee + net). |
| client/payment-details/transaction-breakdown/fees-breakdown/index.tsx | Hides fee breakdown UI when fee is refunded. |
| client/payment-details/timeline/map-events.js | Updates timeline mapping to handle refunded-fee events and display Stripe processing fee when available. |
| client/data/timeline/types.d.ts | Adds fee_refunded to timeline fee rate typings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.



Fixes WOOPMNT-6097
Changes proposed in this Pull Request
For non-card Amazon Pay transactions (SEPA, BNPL, etc.), the fee shown across the order and transaction surfaces didn't match the amount actually deducted from the merchant's payout. This PR updates the merchant-facing displays to show the correct fee.
fee_refunded: true.$0fee/net meta values when the payload carries them (previously skipped by a truthy check, leaving stale values in place).$0up front for non-card Amazon Pay so the order page doesn't briefly display a stale value.Regular card payments and card-funded Amazon Pay should remain unaffected.
Testing instructions
Use in combination with the server-side PR (#211501 - or get it from the Linear issue)
npm run changelogto add a changelog file, choosepatchto 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