Conversation
…sputes Add product_unacceptable reason to the evidence matrix with a booking_reservation entry. When the feature flag is enabled and a merchant selects Booking/Reservation product type for a Product Unacceptable dispute, the recommended documents now show: - Event or booking documentation - Order receipt - Customer communication (auto-merged base field) - Refund policy - Other documents Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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: +367 B (0%) Total Size: 950 kB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Pull request overview
This PR adds support for Product Unacceptable disputes with Booking/Reservation product types by extending the evidence matrix system. When the feature flag _wcpay_feature_dispute_additional_evidence_types is enabled, merchants challenging Product Unacceptable disputes for bookings/reservations will see a tailored set of recommended evidence fields instead of generic fallback fields.
Changes:
- Added
getProductUnacceptableMatrix()function defining evidence fields for booking/reservation product type - Integrated the new matrix into the main
evidenceMatrixexport - Added comprehensive tests verifying the new matrix entry and fallback behavior
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
client/disputes/new-evidence/evidence-matrix.ts |
Adds getProductUnacceptableMatrix() function with booking_reservation entry containing 4 specific evidence fields, integrated into the main evidence matrix |
client/disputes/new-evidence/__tests__/recommended-document-fields.test.ts |
Adds two test cases: one verifying the new matrix fields are returned for booking_reservation, another ensuring fallback to trunk fields for physical_product |
changelog/woopmnt-5432-booking-reservation-product-unacceptable-purchase-info-pagelo |
Documents the change as a patch-level addition |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…unacceptable-purchase-info-pagelo
…ct_unacceptable disputes The cover letter was displaying "Item condition" instead of "Event or booking documentation" for the SERVICE_DOCUMENTATION field in product_unacceptable disputes. Changed labelForReasons from a single object to an array to support multiple reason-specific label overrides. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…unacceptable-purchase-info-pagelo
For product_unacceptable + booking_reservation, "Event or booking documentation" should appear as Attachment A (first), matching the evidence matrix order. Added orderForReasons support to allow reason-specific sorting of attachments. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Verifies that with all evidence fields present, the cover letter lists attachments in the correct order: Event or booking documentation (A), Order receipt (B), Customer communication (C), Store refund policy (D), Other documents (E). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…unacceptable-purchase-info-pagelo
RadoslavGeorgiev
left a comment
There was a problem hiding this comment.
The changes look pretty good. I just noticed a small bug: if I select a physical product after adding attachments for a Booking/Reservation, the cover letter gets some unwanted additions:
Our records indicate that the customer, John Doe, ordered Online Payment for Order #2461 for localhost:8082 blog_id 194586300 on February 3, 2026, 10:08 pm. The product matched the description provided at the time of sale, and we did not receive any indication from the customer that it was defective or not as described.
To support our case, we are providing the following documentation:
• Event or booking documentation (Attachment A)
• Order receipt (Attachment B)
• Customer communication (Attachment C)
• Customer's signature (Attachment D)
• Store refund policy (Attachment E)
• Other documents (Attachment F)
Let's fix this, and you'll get my stamp of approval 😛
…unacceptable-purchase-info-pagelo
|
Thanks for catching that, @RadoslavGeorgiev! Great spot. I've pushed a fix for this in 5d686ab. You were right, the evidence state from the "Booking/Reservation" product type wasn't being cleared when switching to another product type. Screen.Recording.2026-02-04.at.17.29.20.movLet me know if you see anything else |
RadoslavGeorgiev
left a comment
There was a problem hiding this comment.
Almost there :)
I made a screen recording but realized that it's visible in yours as well. If you add evidence for a physical product first and then switch to a Booking/Reservation, the Customer Signature file seems to remain and is visible in the cover letter.
I started a new dispute, and if I go straight to Booking/Reservation with all files, I don't see it.
| Straight to booking/reservation | Physical product first |
|---|---|
![]() |
![]() |
…unacceptable-purchase-info-pagelo
…products When switching from Physical Product to another product type (e.g., Booking/Reservation), the Customer's signature field was still appearing in the generated cover letter even though the UI correctly hid the field. This fix adds `onlyForProductTypes` filtering to the cover letter generator's attachment logic, similar to the existing `onlyForReasons` filter. The Customer's signature attachment is now filtered to only appear for physical_product type. Changes: - Add `onlyForProductTypes` property to standardAttachments type definition - Add filtering logic in generateAttachments() to check product type - Apply `onlyForProductTypes: ['physical_product']` to CUSTOMER_SIGNATURE - Add comprehensive test covering multiple product types Note: There is a separate issue where the cover letter doesn't regenerate when product type changes if it was previously manually edited. This fix ensures correct behavior when the cover letter IS regenerated. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This test file validates the implementation against the specification document "Reason Code x Product Type Logic". It ensures correctness across all implemented Reason × Product Type combinations by testing: 1. UI Document Fields (getRecommendedDocumentFields) - Required fields are included - Non-applicable fields are excluded - Labels match specification 2. Evidence Matrix (getMatrixFields) - Implemented combinations return correct fields - Non-implemented combinations return undefined 3. Cover Letter Attachments (generateAttachments) - Correct attachments for each combination - Product type filtering works correctly 4. Customer's Signature filtering (regression test) - Only appears for physical_product - Correctly excluded for booking_reservation and other types Implemented combinations tested: - fraudulent × booking_reservation - product_not_received × booking_reservation - product_unacceptable × booking_reservation - subscription_canceled × booking_reservation, other, multiple - duplicate × booking_reservation (both scenarios) The file also documents all not-yet-implemented combinations for tracking as new product types are added. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…hange When users removed documents from dispute evidence, the empty values were filtered out before being sent to the server. This caused the server to retain the old document references, which then reappeared when the dispute data was re-fetched. The fix ensures that document field keys (receipt, customer_communication, customer_signature, etc.) are always included in the API request, even when empty, allowing the server to properly clear removed documents. This follows the same pattern already used for shipping fields. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When users changed the product type in the dispute challenge form, the cover letter wasn't regenerating to update the attachment labels. This happened because the `isCoverLetterManuallyEdited` flag remained true after document uploads, blocking the automatic regeneration. The fix resets the manual edit flag when the product type changes, allowing the cover letter to regenerate with the correct attachment labels for the new product type (e.g., showing "Customer's signature" only for physical products). This completes the fix for the cover letter attachment label bug: - Commit 1c469ae: Filter attachments by product type during generation - Commit 652e4ab: Send empty document fields to clear server data - This commit: Reset manual edit flag to trigger regeneration Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When generating the cover letter, we now filter evidence to only include document fields that are applicable to the current dispute reason and product type combination. This uses the same getRecommendedDocumentFields() function that determines which fields appear in the UI. Previously, if a user uploaded documents while on "Physical products" and then switched to "Booking/Reservation", the cover letter would still show attachments for the physical product documents (like Order receipt, Store refund policy) even though those fields weren't visible in the UI for booking/reservation. Now the cover letter correctly shows only attachments for fields that are applicable to the current product type selection. Note: Shipping documentation is handled separately and is cleared from state when the product type doesn't require shipping (existing behavior). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…unacceptable-purchase-info-pagelo
Thanks for catching this, @RadoslavGeorgiev! 🙏 The bug has been fixed (cannot point to a single commit, it took several attempts 😄 ). The cover letter now correctly filters out documents that aren't applicable to the current product type when you switch between types. Ready for another look when you have a chance! |
…unacceptable-purchase-info-pagelo



Fixes WOOPMNT-5432
Changes proposed in this Pull Request
Adds a
product_unacceptableentry to the evidence matrix for thebooking_reservationproduct type. When the_wcpay_feature_dispute_additional_evidence_typesfeature flag is enabled and a merchant selects "Booking/Reservation" as the product type for a Product Unacceptable dispute, the Purchase Info page now shows the correct recommended evidence fields:This follows the same pattern used for other reason + product type combinations already in the evidence matrix (fraudulent, product_not_received, subscription_canceled, duplicate).
Testing instructions
wp option update _wcpay_feature_dispute_additional_evidence_types 1)product_unacceptable. Use the WCPay Dev Tools plugin to override the dispute reason.product_unacceptable+ Booking/Reservation dispute and verify the cover letter lists "Event or booking documentation" (not "Item condition") in the attachments section.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