-
Notifications
You must be signed in to change notification settings - Fork 440
split instrument availability into constraints and options axes
#626
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: proto/funding-source-and-credential-constraints
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,27 +2,28 @@ | |
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "$id": "https://ucp.dev/schemas/shopping/types/available_payment_instrument.json", | ||
| "title": "Available Payment Instrument", | ||
| "description": "An instrument type available from a payment handler with optional constraints.", | ||
| "description": "An instrument type a handler accepts, declared along two axes. `constraints` is an Object Constraint over the instrument's OWN fields (a JSON Schema overlay: presence + allowed values). `options` is the set of accepted values and typed families this instrument negotiates (resolved by lookup, not compiled into the overlay).", | ||
| "allOf": [ | ||
| { "$ref": "type_constraint.json" }, | ||
| { | ||
| "type": "object", | ||
| "properties": { | ||
| "constraints": { | ||
| "options": { | ||
| "type": "object", | ||
| "properties": { | ||
| "billing_address": { | ||
| "$ref": "object_constraint.json", | ||
| "description": "Local constraint on the instrument's `billing_address` field." | ||
| }, | ||
|
Comment on lines
-14
to
-17
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Without this, we'll fail to reject a constraint over field "billing_addr" when it should be "billing_address", right?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I follow correctly, I think this is safe to remove — the field-name check belongs against the target schema ( |
||
| "credentials": { | ||
| "type": "array", | ||
| "items": { "$ref": "type_constraint.json" }, | ||
| "uniqueItems": true, | ||
| "description": "Credential specific constraints accepted for the payment instrument branch selected by `type`. Concrete instrument schemas can narrow known credential entries while preserving handler-extended credential entries." | ||
| "description": "Accepted credential families — each a Typed Constraint keyed by `type` with per-branch `constraints`. Applied by data lookup on the submitted credential's `type`; unknown types are handler/extension branches." | ||
| } | ||
| }, | ||
| "description": "Constraints on this instrument type. Base payment instrument constraints can require and describe `billing_address` and `credentials`; concrete instrument schemas SHOULD add instrument-specific constraint keys while remaining open to extensions." | ||
| "additionalProperties": { | ||
| "type": "array", | ||
| "items": { "type": "string" }, | ||
| "uniqueItems": true | ||
|
Comment on lines
+22
to
+24
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems problematic to close the supported additional properties set, right?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1. The docs describe I'd suggest widening "additionalProperties": {
"anyOf": [
{ "type": "array", "items": { "type": "string" }, "uniqueItems": true },
{ "type": "array", "items": { "$ref": "type_constraint.json" }, "uniqueItems": true }
]
}With this, Otherwise, if |
||
| }, | ||
| "description": "Accepted options this instrument negotiates: `credentials` (a typed family) plus scalar value lists keyed by attribute (e.g. `brands`). A uniform map read to OFFER options; not part of the field-constraint overlay." | ||
| } | ||
| } | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.