Skip to content
Integra Protocol
API

@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 transactionReferenceId the 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 as checkout_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

PropertyType
checkoutstring
schemeCardScheme

CardPairing

Type Parameters

Type Parameter
PairingId extends CardPairingId
U

Properties

PropertyType
claimsboolean
dataPairingData
idPairingId
patternLcpPattern
tie(options) => ["card", { options: readonly CardOption[]; }]

Methods

advertise(doc, h, link, offer, agreementUrl?): Refusal | CardValues

Parameters
ParameterType
docRecord<string, never>
h`0x${string}`
linkstring
offerCardOption
agreementUrl?string
Returns

Refusal | CardValues

bound()

bound(presented): Promise<Refusal | `0x${string}`>

Parameters
ParameterType
presentedunknown
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
ParameterType
presentedunknown
Returns

Promise<Refusal | Broadcaster>

build()

build(doc, h): Promise<Refusal | U>

Parameters
ParameterType
docunknown
h`0x${string}`
Returns

Promise<Refusal | U>

read()

read(doc): Refusal | { agreement?: string; h: `0x${string}`; link: string; }

Parameters
ParameterType
docunknown
Returns

Refusal | { agreement?: string; h: `0x${string}`; link: string; }

unplaced()

unplaced(option): Refusal | CardOption

Parameters
ParameterType
optionCardOption
Returns

Refusal | CardOption


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

PropertyType
legalContextobject
legalContext.legalContextAgreementUrl?string
legalContext.legalContextUrlstring
legalContext.type"sha256"
legalContext.value`0x${string}`
referencestring

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

PropertyType
path?string
signaturestring
signatureInputstring

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

PropertyType
noncestring

ViAutonomous

The Autonomous chain. l2 is exactly the presentation that L3b's sd_hash covers.

Properties

PropertyType
l1string
l2string
l3bstring

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

PropertyType
checkoutobject
shownunknown

ViCheckoutUnsigned

The checkout payload with the seller's legalContext member, for the agent to sign as its checkout_jwt.

Properties

PropertyType
checkoutobject

VicPresented

A VIC transaction reference as the merchant reads it from the credential payload Visa signs for the sale.

Properties

PropertyType
transactionReferenceIdstring

VicUnsigned

The transaction reference the agent writes into its VIC credential request: the hash as unpadded base64url.

Properties

PropertyType
transactionReferenceIdstring

ViImmediate

L2 as presented: its JWS, then its disclosures, ~-separated, ending in ~.

Properties

PropertyType
l2string

ViUnsigned

The checkout mandate for the wallet (L2) or the agent (L3b) to sign, and the payment mandate's transaction_id.

Properties

PropertyType
checkoutMandateobject
checkoutMandate.checkout_hashstring
checkoutMandate.checkout_jwtstring
checkoutMandate.vct"mandate.checkout.1"
transactionIdstring

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

const agentPay: 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

const issuedDigest: typeof digestJson = digestJson

The option digest the issuer keeps: SHA-256 over the RFC 8785 form.


MAX_CHARGE_REFERENCE

const MAX_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

const MAX_CHECKOUT_ID: 128 = 128

The longest checkout id a card option names, in characters.


MAX_CHECKOUT_JWT

const MAX_CHECKOUT_JWT: 16384 = 16_384

The longest checkout_jwt lcp reads, in characters.


MAX_TAP_COMPONENTS

const MAX_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

const MAX_TAP_FIELD: 8192 = 8192

The longest TAP Signature-Input or Signature field lcp parses, in characters.


MAX_TAP_MEMBERS

const MAX_TAP_MEMBERS: 16 = 16

The most members lcp parses in one TAP signature field, an RFC 9651 Dictionary.


MAX_TAP_PATH

const MAX_TAP_PATH: 2048 = 2048

The longest request path lcp reads from a TAP or Agent Pay request, in characters.


MAX_VI_DISCLOSURES

const MAX_VI_DISCLOSURES: 32 = 32

The most disclosures lcp reads in one Verifiable Intent layer.


MAX_VI_LAYER

const MAX_VI_LAYER: 65536 = 65_536

The longest Verifiable Intent layer, an SD-JWT with its disclosures, lcp reads, in characters.


sellerReference

const sellerReference: 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

NameType
reference()(presented, option) => Promise<Refusal | ChargeRef>

viAutonomous

const viAutonomous: 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

const viImmediate: 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

const visaTap: 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

const visaVic: 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

ParameterType
sstring

Returns

Promise<string>


tie()

tie(options): ["card", { options: readonly CardOption[]; }]

The binding slot: every card option offered at this checkout, exactly as issued.

Parameters

ParameterType
optionsreadonly CardOption[]

Returns

["card", { options: readonly CardOption[]; }]

References

Broadcaster

Re-exports Broadcaster


ChargePresented

Re-exports ChargePresented


ChargeRef

Re-exports ChargeRef

Last updated on

On this page