feat: add payment instruments to the order capability - #584
Conversation
|
cc @jingyli @amithanda Now that we will land split payments (https://ucp.dev/draft/specification/split-payments/#gift-card-credit-card) in 08 this follow up allows order confirmation screens to properly display the split. This came up during implementations as there is no clear way to show the buyer what portion of the payment is captured on each method. LGTM. |
There was a problem hiding this comment.
Hey @richmolj! Thanks for identifying and filling this gap. I agree with the core problem: Order needs a durable, buyer-facing record of how the order was paid, especially so split payments can show each instrument’s contribution.
I forked the PR to explore a different schema boundary rather than editing your branch directly: #638
The goal is to preserve your end-to-end behaviour while avoiding a second payment-instrument hierarchy that the current handler prose does not extend, which we should treat as a blocking issue with this proposal. LMK what you think!
There was a problem hiding this comment.
Most of these fields would be reused any time we need to display a payment instrument summary. Instead of a having a detailed object for just this use case, it would be ideal to create something like payment_instrument_display.json and have order_payment_instrument.json inherit from that. Billing address might be overly specific for the former but could be included in the order_payment_instrument.json object.
Description
Order confirmation pages typically want to show how the buyer paid — card vs gift card, last four, billing address — but the Order capability has no payment field today. This adds
order.payment, mirroring the checkoutpaymentobject but reduced to the subset of fields relevant at order time (dropping collection-time details like handler reference, credential, and selection state).order_payment_instrumentfollows the existing order-subset pattern (order_line_item,order_confirmation): a standalone read-only sibling of the checkout type carrying onlyid,type,amount,billing_address, and an opendisplayblock.typeis an open string anddisplayis left open so businesses snapshot whatever they present to the buyer.Category (Required)
Related Issues
Checklist
!for breaking changes).Screenshots / Logs (if applicable)
Rendered
Order Payment Instrumentschema table: