@integraledger/lcp/acp
ACP checkout sessions and delegate-payment allowances, and the pairings `acp/checkout/delegated` and `acp/checkout/undelegated`: the ATR hash as the checkout session's `id`.
For AI agents: this page as Markdown, and llms.txt, the index of every page.
ACP checkout sessions and delegate-payment allowances, and the pairings acp/checkout/delegated and
acp/checkout/undelegated: the ATR hash as the checkout session's id.
The link rides beside it in the session's metadata.legal_context, and, where the handler requires
delegate_payment, the hash is also the allowance's checkout_session_id. Pure; no I/O. Nothing here signs or
verifies a signature.
Interfaces
AcpBinding
The shape of an ACP pairing: its id, data, binding record and codec.
Type Parameters
| Type Parameter |
|---|
Id extends string |
Properties
| Property | Type |
|---|---|
claims | boolean |
data | PairingData |
id | Id |
pattern | LcpPattern |
tie | (options) => ["acp", { options: readonly HandlerOption[]; }] |
Methods
advertise()
advertise(
doc,h,link,offer,agreementUrl?):Refusal|Session
Parameters
| Parameter | Type |
|---|---|
doc | Session |
h | `0x${string}` |
link | string |
offer | HandlerOption |
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()
Parameters
| Parameter | Type |
|---|---|
choice | AcpChoice |
h | `0x${string}` |
Returns
read()
read(
doc):Refusal| {agreement?:string;h:`0x${string}`;link:string;offer: {session:Session; }; }
Parameters
| Parameter | Type |
|---|---|
doc | Session |
Returns
Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { session: Session; }; }
unplaced()
unplaced(
option):Refusal|HandlerOption
Parameters
| Parameter | Type |
|---|---|
option | HandlerOption |
Returns
AcpChoice
The buyer's own values for the allowance, and the session it pays.
Properties
| Property | Type |
|---|---|
currency | string |
expires_at | string |
max_amount | number |
merchant_id | string |
session | Session |
ChargePresented
What the seller presents of a charge: its own reference for it, the processor's identifier of the payment.
Properties
| Property | Type | Description |
|---|---|---|
charge | string | 1 to 255 visible ASCII characters: a Stripe PaymentIntent's id, an Adyen pspReference. |
ChargeRef
The reference of a charge: the checkout of the option it answers, where the option names one, and the charge.
Properties
| Property | Type |
|---|---|
charge | string |
checkout? | string |
Unsigned
Properties
| Property | Type |
|---|---|
allowance | Allowance |
Methods
complete()
Parameters
| Parameter | Type |
|---|---|
request | Presented |
Returns
Type Aliases
Allowance
Allowance =
object
ACP's Allowance: six members, closed.
Properties
| Property | Type |
|---|---|
checkout_session_id | string |
currency | string |
expires_at | string |
max_amount | number |
merchant_id | string |
reason | "one_time" |
HandlerOption
HandlerOption =
object
The kind of payment handler a session offers: ACP's own requires_delegate_payment flag.
Properties
| Property | Type |
|---|---|
requires_delegate_payment | boolean |
Presented
Presented =
object&object
The delegate_payment request as the agent signs it.
Type Declaration
| Name | Type |
|---|---|
allowance | Allowance |
Session
Session =
object&object
A CheckoutSession. Every member other than id and metadata.legal_context is carried untouched.
Type Declaration
| Name | Type |
|---|---|
id? | string |
metadata? | object |
Variables
delegated
constdelegated:AcpBinding<"acp/checkout/delegated">
acp/checkout/delegated. The payee broadcasts (broadcaster answers "payee" for a payment within bound's shape
gate, allowanceShape): the seller's PSP charges the vault token the buyer's agent obtained; nothing here reads it.
Any other value gets acp/allowance-malformed, as bound refuses it.
issuedDigest
constissuedDigest: typeofdigestJson=digestJson
SHA-256 over the RFC 8785 form of an issued handler option.
METADATA_KEY
constMETADATA_KEY:"legal_context"="legal_context"
The member of a CheckoutSession's metadata that carries the ATR hash and link.
undelegated
constundelegated:AcpBinding<"acp/checkout/undelegated"> &object
acp/checkout/undelegated. The payee broadcasts (broadcaster answers "payee"): the seller's payment handler
charges the payment the checkout completed; nothing here reads it. reference names the charge by the seller's own
reference for it.
Type Declaration
Functions
tie()
tie(
options): ["acp", {options: readonlyHandlerOption[]; }]
The binding slot: one option per kind of payment handler the session offers, and nothing from the checkout.
Parameters
| Parameter | Type |
|---|---|
options | readonly HandlerOption[] |
Returns
["acp", { options: readonly HandlerOption[]; }]
References
Broadcaster
Re-exports Broadcaster
Last updated on
@integraledger/lcp/ack
ACK Payment Requests and receipts, and the pairing `ack/payment-request`: the ATR hash as the `id` of the seller-signed Payment Request, in LCP's string form, with the link beside the request in the 402 body.
@integraledger/lcp/ap2
AP2 v0.2 checkouts and closed Checkout Mandates, and the `ap2/checkout-mandate` pairing: the ATR hash as the `legalContext` member of the merchant-signed `checkout_jwt` payload, which the buyer's closed Checkout Mandate commits to through `checkout_hash`.