Skip to content

Add evidence matrix for Product Unacceptable + Booking/Reservation disputes#11304

Merged
mgascam merged 17 commits intodevelopfrom
woopmnt-5432-booking-reservation-product-unacceptable-purchase-info-pagelo
Feb 9, 2026
Merged

Add evidence matrix for Product Unacceptable + Booking/Reservation disputes#11304
mgascam merged 17 commits intodevelopfrom
woopmnt-5432-booking-reservation-product-unacceptable-purchase-info-pagelo

Conversation

@mgascam
Copy link
Contributor

@mgascam mgascam commented Jan 29, 2026

Fixes WOOPMNT-5432

Changes proposed in this Pull Request

Adds a product_unacceptable entry to the evidence matrix for the booking_reservation product type. When the _wcpay_feature_dispute_additional_evidence_types feature 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:

  1. Event or booking documentation — Screenshots or documents showing the event or reservation details and confirmation it occurred or remained valid as described.
  2. Order receipt — Standard receipt from transaction history.
  3. Customer communication — Auto-merged base field for all matrix entries.
  4. Refund policy — Screenshot of the store's refund policy.
  5. Other documents — Any other supporting documents.

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

  1. Enable the feature flag (i.e. wp option update _wcpay_feature_dispute_additional_evidence_types 1)
  2. Navigate to a dispute with reason product_unacceptable. Use the WCPay Dev Tools plugin to override the dispute reason.
  3. Click "Challenge dispute" to open the challenge form.
  4. In the "Product or service type" dropdown, select Booking/Reservation.
  5. Verify the "Recommended documents" section shows exactly:
    • Event or booking documentation
    • Order receipt
    • Customer communication
    • Refund policy
    • Other documents
  6. Change the product type to another option (e.g., Physical products) and verify the fallback fields appear instead (Order receipt, Customer communication, Customer's signature, Item condition, Store refund policy, Other documents).
  7. Cover letter check: Upload evidence files for a product_unacceptable + Booking/Reservation dispute and verify the cover letter lists "Event or booking documentation" (not "Item condition") in the attachments section.
Screenshot 2026-01-29 at 18 39 32 Screenshot 2026-01-30 at 16 36 07
  • Run npm run changelog to add a changelog file, choose patch to 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.
  • Covered with tests (or have a good reason not to test in description ☝️)
  • Tested on mobile (or does not apply)

Post merge

…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>
@github-actions
Copy link
Contributor

github-actions bot commented Jan 29, 2026

Test the build

Option 1. Jetpack Beta

  • Install and activate Jetpack Beta.
  • Use this build by searching for PR number 11304 or branch name woopmnt-5432-booking-reservation-product-unacceptable-purchase-info-pagelo in your-test.site/wp-admin/admin.php?page=jetpack-beta&plugin=woocommerce-payments

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:

  • Latest commit: 993c8da
  • Build time: 2026-02-06 09:54:37 UTC

Note: the build is updated when a new commit is pushed to this PR.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 29, 2026

Size Change: +367 B (0%)

Total Size: 950 kB

Filename Size Change
release/woocommerce-payments/dist/index.js 158 kB +367 B (0%)
ℹ️ View Unchanged
Filename Size
release/woocommerce-payments/assets/css/admin.css 1.46 kB
release/woocommerce-payments/assets/css/admin.rtl.css 1.46 kB
release/woocommerce-payments/assets/css/success.css 1.06 kB
release/woocommerce-payments/assets/css/success.rtl.css 1.06 kB
release/woocommerce-payments/dist/blocks-checkout-rtl.css 2.87 kB
release/woocommerce-payments/dist/blocks-checkout.css 2.87 kB
release/woocommerce-payments/dist/blocks-checkout.js 54.1 kB
release/woocommerce-payments/dist/cart-block-rtl.css 113 B
release/woocommerce-payments/dist/cart-block.css 112 B
release/woocommerce-payments/dist/cart-block.js 16.8 kB
release/woocommerce-payments/dist/cart.js 5.32 kB
release/woocommerce-payments/dist/checkout-rtl.css 1.01 kB
release/woocommerce-payments/dist/checkout.css 1.01 kB
release/woocommerce-payments/dist/checkout.js 34 kB
release/woocommerce-payments/dist/express-checkout-rtl.css 367 B
release/woocommerce-payments/dist/express-checkout.css 367 B
release/woocommerce-payments/dist/express-checkout.js 17.4 kB
release/woocommerce-payments/dist/frontend-tracks.js 883 B
release/woocommerce-payments/dist/index-rtl.css 21.7 kB
release/woocommerce-payments/dist/index.css 21.7 kB
release/woocommerce-payments/dist/multi-currency-analytics.js 1.09 kB
release/woocommerce-payments/dist/multi-currency-rtl.css 3.82 kB
release/woocommerce-payments/dist/multi-currency-switcher-block.js 19.2 kB
release/woocommerce-payments/dist/multi-currency.css 3.83 kB
release/woocommerce-payments/dist/multi-currency.js 25.5 kB
release/woocommerce-payments/dist/order-rtl.css 740 B
release/woocommerce-payments/dist/order.css 740 B
release/woocommerce-payments/dist/order.js 22.3 kB
release/woocommerce-payments/dist/plugins-page-rtl.css 484 B
release/woocommerce-payments/dist/plugins-page.css 484 B
release/woocommerce-payments/dist/plugins-page.js 2.65 kB
release/woocommerce-payments/dist/product-details-rtl.css 433 B
release/woocommerce-payments/dist/product-details.css 436 B
release/woocommerce-payments/dist/product-details.js 12.4 kB
release/woocommerce-payments/dist/settings-rtl.css 12.4 kB
release/woocommerce-payments/dist/settings.css 12.3 kB
release/woocommerce-payments/dist/settings.js 153 kB
release/woocommerce-payments/dist/subscription-edit-page.js 1.81 kB
release/woocommerce-payments/dist/subscription-product-onboarding-modal-rtl.css 527 B
release/woocommerce-payments/dist/subscription-product-onboarding-modal.css 527 B
release/woocommerce-payments/dist/subscription-product-onboarding-modal.js 1.98 kB
release/woocommerce-payments/dist/subscription-product-onboarding-toast.js 730 B
release/woocommerce-payments/dist/subscriptions-empty-state-rtl.css 120 B
release/woocommerce-payments/dist/subscriptions-empty-state.css 120 B
release/woocommerce-payments/dist/subscriptions-empty-state.js 1.9 kB
release/woocommerce-payments/dist/success.js 6.03 kB
release/woocommerce-payments/dist/tos-rtl.css 235 B
release/woocommerce-payments/dist/tos.css 235 B
release/woocommerce-payments/dist/tos.js 3 kB
release/woocommerce-payments/dist/wc-payments-review-prompt-rtl.css 1.66 kB
release/woocommerce-payments/dist/wc-payments-review-prompt.css 1.66 kB
release/woocommerce-payments/dist/wc-payments-review-prompt.js 14.9 kB
release/woocommerce-payments/dist/wc-payments-settings-spotlight-rtl.css 1.66 kB
release/woocommerce-payments/dist/wc-payments-settings-spotlight.css 1.66 kB
release/woocommerce-payments/dist/wc-payments-settings-spotlight.js 28.2 kB
release/woocommerce-payments/dist/woopay-direct-checkout.js 5.69 kB
release/woocommerce-payments/dist/woopay-express-button.js 22.9 kB
release/woocommerce-payments/dist/woopay-rtl.css 4.27 kB
release/woocommerce-payments/dist/woopay.css 4.25 kB
release/woocommerce-payments/dist/woopay.js 70.9 kB
release/woocommerce-payments/includes/subscriptions/assets/css/plugin-page.css 625 B
release/woocommerce-payments/includes/subscriptions/assets/js/plugin-page.js 814 B
release/woocommerce-payments/vendor/automattic/jetpack-assets/build/i18n-loader.js 2.46 kB
release/woocommerce-payments/vendor/automattic/jetpack-assets/build/jetpack-script-data.js 880 B
release/woocommerce-payments/vendor/automattic/jetpack-assets/src/js/i18n-loader.js 1.02 kB
release/woocommerce-payments/vendor/automattic/jetpack-assets/src/js/script-data.js 69 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/babel.config.js 163 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/identity-crisis.css 2.46 kB
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/identity-crisis.js 14.3 kB
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/identity-crisis.rtl.css 2.46 kB
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-connection.css 10.1 kB
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-connection.js 31.5 kB
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-connection.rtl.css 10.1 kB
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-sso-admin-create-user.css 198 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-sso-admin-create-user.js 280 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-sso-admin-create-user.rtl.css 198 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-sso-login.css 625 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-sso-login.js 331 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-sso-login.rtl.css 626 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-sso-users.js 415 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-users-connection.js 159 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/tracks-ajax.js 520 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/tracks-callables.js 585 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/src/sso/jetpack-sso-admin-create-user.css 218 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/src/sso/jetpack-sso-admin-create-user.js 521 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/src/sso/jetpack-sso-login.css 719 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/src/sso/jetpack-sso-login.js 412 B
release/woocommerce-payments/vendor/automattic/jetpack-connection/src/sso/jetpack-sso-users.js 625 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/about.css 1.04 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/admin-empty-state.css 294 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/admin-order-statuses.css 408 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/admin.css 3.59 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/checkout.css 301 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/modal.css 746 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/view-subscription.css 574 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/wcs-upgrade.css 414 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/admin-pointers.js 543 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/admin.js 9.4 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/jstz.js 6.78 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/jstz.min.js 3.84 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/meta-boxes-coupon.js 545 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/meta-boxes-subscription.js 2.52 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/moment.js 22.2 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/moment.min.js 11.7 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/payment-method-restrictions.js 1.29 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/wcs-meta-boxes-order.js 507 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/frontend/payment-methods.js 358 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/frontend/single-product.js 428 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/frontend/view-subscription.js 1.38 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/frontend/wcs-cart.js 782 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/modal.js 1.09 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/wcs-upgrade.js 1.26 kB
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/build/index.css 391 B
release/woocommerce-payments/vendor/woocommerce/subscriptions-core/build/index.js 3.04 kB

compressed-size-action

@mgascam mgascam marked this pull request as ready for review January 29, 2026 17:24
@mgascam mgascam requested review from a team, RadoslavGeorgiev and Copilot and removed request for a team January 29, 2026 17:25
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 evidenceMatrix export
  • 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.

mgascam and others added 5 commits January 30, 2026 12:34
…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>
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>
Copy link
Contributor

@RadoslavGeorgiev RadoslavGeorgiev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 😛

@mgascam
Copy link
Contributor Author

mgascam commented Feb 4, 2026

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.mov

Let me know if you see anything else

Copy link
Contributor

@RadoslavGeorgiev RadoslavGeorgiev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Image Image

mgascam and others added 7 commits February 5, 2026 11:20
…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>
@mgascam
Copy link
Contributor Author

mgascam commented Feb 5, 2026

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.

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!

Copy link
Contributor

@RadoslavGeorgiev RadoslavGeorgiev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for addressing my concerns!

The cover letter looks good for bookings/reservations, even after I had uploaded another set of evidence:

Image

@mgascam mgascam added this pull request to the merge queue Feb 9, 2026
Merged via the queue into develop with commit 736161e Feb 9, 2026
43 checks passed
@mgascam mgascam deleted the woopmnt-5432-booking-reservation-product-unacceptable-purchase-info-pagelo branch February 9, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants