Skip to content

Commit 3845cb4

Browse files
authored
Document AgentCard amount authority, charge fields, and checkout events (#759)
* Document AgentCard amount authority, charge fields, and checkout item events * Correct which AgentCard checkout events each processor records
1 parent 9fe5720 commit 3845cb4

1 file changed

Lines changed: 48 additions & 8 deletions

File tree

‎integrations/wallets/agentcard.mdx‎

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -788,13 +788,52 @@ continue observing an existing checkout; don't use it as evidence that a
788788
payment succeeded or failed. run `--open` only in a trusted, human-operated
789789
terminal and never pass its output to an agent.
790790

791-
| field | interpretation |
792-
| ---------------------------------- | ---------------------------------------------------------------------------------------------------- |
793-
| `amount_authority: 'display_only'` | the request does not prove a charge amount; tokenization requests can have this value |
794-
| `amount_verified` | whether the observed amount matched the approved amount when verification was available |
795-
| `charged_kind` | `captured`, `authorized`, or `none` as reported by the provider path |
796-
| `replay_attempted` | whether <span className="kernel-brand-name">KERNEL</span> attempted to replay the processor response |
797-
| `replay_delivered` | whether that response reached the browser; this does not confirm a merchant order |
791+
| field | interpretation |
792+
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
793+
| `amount_authority` | where the approved amount came from: `processor` (the processor request or payment), `agent` (the item's declared `amount`), `page` (the checkout page total), or `none`. `display_only` is a legacy provider value; <span className="kernel-brand-name">KERNEL</span> also sets it when recovering an authorization before the provider reports an authority |
794+
| `amount_verified` | whether the processor charged the approved amount. absent when there was no charge to compare |
795+
| `charged_amount_cents`, `charged_currency` | what the processor reported collecting. absent when agentcard didn't observe a charge |
796+
| `charged_kind` | `captured`, `authorized`, or `none` (the checkout returned a token the merchant charges later). absent when agentcard reported nothing |
797+
| `replay_attempted` | whether <span className="kernel-brand-name">KERNEL</span> attempted to replay the processor response |
798+
| `replay_delivered` | whether that response reached the browser; this does not confirm a merchant order |
799+
800+
`amount_authority: 'agent'` and `'display_only'` only restate the amount you
801+
declared on the item; they don't prove what the processor charged. when the
802+
held request is a tokenization request, such as a stripe card token or payment
803+
method, agentcard returns the token to the page and never sees the charge. these
804+
checkouts usually report `amount_authority: 'agent'` with no `amount_verified`
805+
or `charged_*` fields, even when the payment succeeds. the merchant page charges
806+
the token in a later request; use item events and the merchant's order record
807+
for that result.
808+
809+
### Checkout item events
810+
811+
the card's item events record the processor's response to the held request and,
812+
for stripe, the payment that follows it. this table lists only these processor
813+
events; the item also records `checkout_authorization_*` and
814+
`checkout_preparation_*` lifecycle events:
815+
816+
| event | meaning |
817+
| -------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
818+
| `checkout_response_replayed` | <span className="kernel-brand-name">KERNEL</span> replayed the approved processor response to the browser. `data.status` is its HTTP status |
819+
| `payment_succeeded` | the processor reported the follow-up payment succeeded |
820+
| `payment_requires_action`, `payment_processing` | the payment needs customer action, such as 3D Secure, or is still processing |
821+
| `payment_declined`, `payment_failed`, `credential_rejected` | the processor refused the payment or the card |
822+
| `credential_tokenized` | the processor accepted the card as a token; this isn't a charge |
823+
| `payment_unknown` | <span className="kernel-brand-name">KERNEL</span> couldn't classify the response. treat the attempt as indeterminate and don't retry |
824+
825+
every processor records an event for the held request's response, such as
826+
`credential_tokenized` or `payment_unknown`, alongside `checkout_response_replayed`.
827+
for stripe, payment events are also recorded when the checkout page confirms a
828+
payment intent, checkout session, or payment method that uses the replayed
829+
token. for other processors, events cover only the held request's response; the
830+
follow-up payment isn't observed. event `data` can include:
831+
832+
- `processor` and `request_kind`, such as `checkout_confirm` or `payment_intent_confirm`
833+
- `provider_status`, the stripe payment intent status, such as `succeeded`
834+
- `provider_payment_status`, the stripe checkout session payment status, such as `paid`
835+
- `provider_error_code` and `provider_decline_code` on refusals
836+
- `provider_http_status`, and stripe ids such as `payment_intent_id` and `checkout_session_id`
798837

799838
declines, expirations, and provider failures can return a processor-shaped
800839
failure response to the browser. the exact response depends on the native
@@ -804,7 +843,8 @@ doesn't prove that the purchase succeeded or failed.
804843
your reconciliation policy must return `succeeded` only when the merchant order
805844
record confirms a paid order whose merchant, items, amount, and currency match
806845
the frozen purchase object. treat `state.authorization`, `charged_kind`,
807-
`replay_delivered`, item events, and the checkout page as supporting evidence.
846+
`replay_delivered`, item events such as `payment_succeeded`, and the checkout
847+
page as supporting evidence.
808848
merchant success text is page-specific: **Thanks for your payment** can appear
809849
for one stripe checkout, but no generic success-text matcher proves that the
810850
merchant created the expected order. return `indeterminate` when the sources

0 commit comments

Comments
 (0)