@integraledger/lcp/card
The `card` entry point: the ATR hash on a card checkout, on five paths: Visa TAP, Mastercard Agent Pay, Visa Intelligent Commerce, Mastercard Verifiable Intent (Immediate and Autonomous) and the plain card checkout.
For AI agents: this page as Markdown, and llms.txt, the index of every page.
The card entry point: the ATR hash on a card checkout, on five paths: Visa TAP, Mastercard Agent Pay, Visa
Intelligent Commerce, Mastercard Verifiable Intent (Immediate and Autonomous) and the plain card checkout.
- Visa TAP and Mastercard Agent Pay: the hash rides in what the agent's message signature covers: its
nonce, the base64 of the hash followed by 32 random bytes, or the merchant's checkout path, whose last segment is the hash. - Visa Intelligent Commerce: the hash is the
transactionReferenceIdthe agent writes when it asks for the sale's credential, as unpadded base64url. - Mastercard Verifiable Intent: the hash rides in the
checkout_jwt, whose SHA-256 the user's L2 mandate (Immediate) or the agent's L3b mandate (Autonomous) signs ascheckout_hash. - The plain card checkout: nothing the buyer signs carries the hash. The seller shows it with the link before payment and places it in its processor reference.
Pure: no I/O, no state. WebCrypto supplies SHA-256 and ES256. No function throws.
Interfaces
CardOption
One card option offered at a checkout. checkout is the seller's own id: 1–128 visible ASCII characters.
Properties
| Property | Type |
|---|---|
checkout | string |
scheme | CardScheme |
CardPairing
Type Parameters
| Type Parameter |
|---|
PairingId extends CardPairingId |
U |
Properties
| Property | Type |
|---|---|
claims | boolean |
data | PairingData |
id | PairingId |
pattern | LcpPattern |
tie | (options) => ["card", { options: readonly CardOption[]; }] |
Methods
advertise()
advertise(
doc,h,link,offer,agreementUrl?):Refusal|CardValues
Parameters
| Parameter | Type |
|---|---|
doc | Record<string, never> |
h | `0x${string}` |
link | string |
offer | CardOption |
agreementUrl? | string |
Returns
bound()
bound(
presented):Promise<Refusal|`0x${string}`>
Parameters
| Parameter | Type |
|---|---|
presented | unknown |
Returns
Promise<Refusal | `0x${string}`>
broadcaster()
broadcaster(
presented):Promise<Refusal|Broadcaster>
Who broadcasts what the payer presents: the seller, which completes the payment ("payee").
Parameters
| Parameter | Type |
|---|---|
presented | unknown |
Returns
Promise<Refusal | Broadcaster>
build()
build(
doc,h):Promise<Refusal|U>
Parameters
| Parameter | Type |
|---|---|
doc | unknown |
h | `0x${string}` |
Returns
Promise<Refusal | U>
read()
read(
doc):Refusal| {agreement?:string;h:`0x${string}`;link:string; }
Parameters
| Parameter | Type |
|---|---|
doc | unknown |
Returns
Refusal | { agreement?: string; h: `0x${string}`; link: string; }
unplaced()
unplaced(
option):Refusal|CardOption
Parameters
| Parameter | Type |
|---|---|
option | CardOption |
Returns
CardValues
The values the seller's own stack places: the legal context shown before payment, with the agreement URL after the link when one is given, and the processor reference.
Properties
| Property | Type |
|---|---|
legalContext | object |
legalContext.legalContextAgreementUrl? | string |
legalContext.legalContextUrl | string |
legalContext.type | "sha256" |
legalContext.value | `0x${string}` |
reference | string |
TapPresented
A TAP or Agent Pay request as the merchant received it: its two signature fields and, where the merchant's checkout
path carries the hash, the request's absolute path without its query, as RFC 9421 §2.2.6 defines @path.
Properties
| Property | Type |
|---|---|
path? | string |
signature | string |
signatureInput | string |
TapUnsigned
What the agent's own RFC 9421 signer places in every message signature of its checkout request: the nonce, the
padded base64 of the hash's 32 bytes followed by 32 random bytes.
Properties
| Property | Type |
|---|---|
nonce | string |
ViAutonomous
The Autonomous chain. l2 is exactly the presentation that L3b's sd_hash covers.
Properties
| Property | Type |
|---|---|
l1 | string |
l2 | string |
l3b | string |
ViCheckoutChoice
Immediate mode with a checkout_jwt the agent creates: the checkout payload it will sign, and the JSON the seller
showed, whose legalContext member build writes into the payload.
Properties
| Property | Type |
|---|---|
checkout | object |
shown | unknown |
ViCheckoutUnsigned
The checkout payload with the seller's legalContext member, for the agent to sign as its checkout_jwt.
Properties
| Property | Type |
|---|---|
checkout | object |
VicPresented
A VIC transaction reference as the merchant reads it from the credential payload Visa signs for the sale.
Properties
| Property | Type |
|---|---|
transactionReferenceId | string |
VicUnsigned
The transaction reference the agent writes into its VIC credential request: the hash as unpadded base64url.
Properties
| Property | Type |
|---|---|
transactionReferenceId | string |
ViImmediate
L2 as presented: its JWS, then its disclosures, ~-separated, ending in ~.
Properties
| Property | Type |
|---|---|
l2 | string |
ViUnsigned
The checkout mandate for the wallet (L2) or the agent (L3b) to sign, and the payment mandate's transaction_id.
Properties
| Property | Type |
|---|---|
checkoutMandate | object |
checkoutMandate.checkout_hash | string |
checkoutMandate.checkout_jwt | string |
checkoutMandate.vct | "mandate.checkout.1" |
transactionId | string |
Type Aliases
CardPairingId
CardPairingId =
"card/visa-tap"|"card/mastercard-vi/immediate"|"card/mastercard-vi/autonomous"|"card/seller-reference"|"card/visa-vic"|"card/mastercard-agent-pay"
CardScheme
CardScheme =
"visa-tap"|"mastercard-vi"|"seller-reference"|"visa-vic"|"mastercard-agent-pay"
Variables
agentPay
constagentPay:CardPairing<"card/mastercard-agent-pay",TapUnsigned>
card/mastercard-agent-pay. TAP's carrier under Mastercard's two published tag spellings. The payee broadcasts
(broadcaster answers "payee"): the seller submits the card payment to its processor; nothing here reads it. A
value that is not an object gets card/tap-signature-input-malformed, as bound refuses it.
issuedDigest
constissuedDigest: typeofdigestJson=digestJson
The option digest the issuer keeps: SHA-256 over the RFC 8785 form.
MAX_CHARGE_REFERENCE
constMAX_CHARGE_REFERENCE:255=255
The longest charge reference lcp reads, in characters: a resource bound on what the seller presents, the bound lcp's
Stripe subscription key takes for a Stripe ID (mpp-card-stripe.ts), which an Adyen pspReference (16 characters)
is well within.
MAX_CHECKOUT_ID
constMAX_CHECKOUT_ID:128=128
The longest checkout id a card option names, in characters.
MAX_CHECKOUT_JWT
constMAX_CHECKOUT_JWT:16384=16_384
The longest checkout_jwt lcp reads, in characters.
MAX_TAP_COMPONENTS
constMAX_TAP_COMPONENTS:32=32
The most items lcp parses in one inner list of a TAP signature field: a signature's covered components.
MAX_TAP_FIELD
constMAX_TAP_FIELD:8192=8192
The longest TAP Signature-Input or Signature field lcp parses, in characters.
MAX_TAP_MEMBERS
constMAX_TAP_MEMBERS:16=16
The most members lcp parses in one TAP signature field, an RFC 9651 Dictionary.
MAX_TAP_PATH
constMAX_TAP_PATH:2048=2048
The longest request path lcp reads from a TAP or Agent Pay request, in characters.
MAX_VI_DISCLOSURES
constMAX_VI_DISCLOSURES:32=32
The most disclosures lcp reads in one Verifiable Intent layer.
MAX_VI_LAYER
constMAX_VI_LAYER:65536=65_536
The longest Verifiable Intent layer, an SD-JWT with its disclosures, lcp reads, in characters.
sellerReference
constsellerReference:CardPairing<"card/seller-reference",never> &object
card/seller-reference. The payee broadcasts (broadcaster answers "payee"): the seller submits the card payment
to its processor, with H in its processor reference; nothing here reads it. reference names the charge by the
seller's own reference for it.
Type Declaration
viAutonomous
constviAutonomous:CardPairing<"card/mastercard-vi/autonomous",ViUnsigned>
card/mastercard-vi/autonomous. The payee broadcasts (broadcaster answers "payee"): the seller submits the card
payment the mandates authorize to its processor; nothing here reads it. A value that is not an object gets
card/vi-malformed, as bound refuses it.
viImmediate
constviImmediate:CardPairing<"card/mastercard-vi/immediate",ViUnsigned|ViCheckoutUnsigned>
card/mastercard-vi/immediate. The payee broadcasts (broadcaster answers "payee"): the seller submits the card
payment the mandate authorizes to its processor; nothing here reads it. A value that is not an object gets
card/vi-malformed, as bound refuses it.
visaTap
constvisaTap:CardPairing<"card/visa-tap",TapUnsigned>
card/visa-tap. The payee broadcasts (broadcaster answers "payee"): the seller submits the card payment to its
processor; nothing here reads it. A value that is not an object gets card/tap-signature-input-malformed, as
bound refuses it.
visaVic
constvisaVic:CardPairing<"card/visa-vic",VicUnsigned>
card/visa-vic. The payee broadcasts (broadcaster answers "payee"): the seller submits the card payment with the
credential Visa issued for the sale to its processor; nothing here reads it. A value that is not an object gets
card/vic-reference-malformed, as bound refuses it.
Functions
disclosureDigest()
disclosureDigest(
s):Promise<string>
base64url, unpadded, of SHA-256 over the US-ASCII characters of s (RFC 9901 §4.2.3).
Parameters
| Parameter | Type |
|---|---|
s | string |
Returns
Promise<string>
tie()
tie(
options): ["card", {options: readonlyCardOption[]; }]
The binding slot: every card option offered at this checkout, exactly as issued.
Parameters
| Parameter | Type |
|---|---|
options | readonly CardOption[] |
Returns
["card", { options: readonly CardOption[]; }]
References
Broadcaster
Re-exports Broadcaster
ChargePresented
Re-exports ChargePresented
ChargeRef
Re-exports ChargeRef
Last updated on
@integraledger/lcp/avm
Algorand: the pairing `x402/exact/algorand`, in which the payer signs an asset transfer whose note is the ATR hash's LCP string, and the settlement read from an Indexer by the transaction id computed from the signed bytes.
@integraledger/lcp/cardano
Cardano, and its two pairings: `x402/exact/cardano`, x402's address-to-address method, and `x402/exact/cardano/lock`, its two lock methods (`masumi` and `script`). Each carries the ATR hash as a CIP-20 message that the payer's signed body commits to.