Skip to content
Integra Protocol
API

@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.

For AI agents: this page as Markdown, and llms.txt, the index of every page.

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.

ACK defines no payer signature, so build and bound always refuse. The token is read under the name ACK's SDKs write from 0.10.0, paymentRequestToken, and under paymentToken, the name they wrote before it, in the 402 body and in a receipt's credential subject alike. Pure; no I/O. No token or receipt signature is verified here.

Interfaces

AckBody

The 402 body. The seller-signed token is paymentRequestToken, as ACK's SDKs write it from 0.10.0, or paymentToken, as they wrote it before; a body that carries both carries one token under both names.

Properties

PropertyType
legalContextJson
paymentRequest?Json
paymentRequestToken?string
paymentToken?string

AckPaymentOption

An ACK payment option as the seller wrote it.

Indexable

[k: string]: Json

Properties

PropertyType
idstring

AckValues

What the seller's stack places: the Payment Request's id, and the legal context beside the request, with the agreement URL after the link when one is given.

Properties

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

Variables

issuedDigest

const issuedDigest: typeof digestJson = digestJson

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


paymentRequest

const paymentRequest: Readonly<{ advertise: (_doc, h, link, offer, agreementUrl?) => Refusal | AckValues; bound: (_presented) => Promise<Refusal>; broadcaster: (presented) => Promise<Broadcaster>; build: (_doc, _h) => Promise<Refusal>; claims: boolean; data: PairingData; id: "ack/payment-request"; pattern: LcpPattern; read: (doc) => Refusal | { agreement?: string; h: `0x${string}`; link: string; offer: { options: readonly Json[]; }; }; tie: (options) => ["ack", { paymentOptions: readonly AckPaymentOption[]; }]; unplaced: (option) => Refusal | AckPaymentOption; }>

ack/payment-request. The payer broadcasts (broadcaster answers "payer"): it pays the Payment Request through its payment service before presenting the receipt. Settlement is the seller's report: the seller verifies the receipt, and fromReceipt reads the hash from it; no fetchPresented, status or recover reads it.

Functions

fromReceipt()

fromReceipt(credentialSubject): Refusal | `0x${string}`

The hash in a receipt: the id of the Payment Request token embedded in its credentialSubject, under either of the token's two names. Verifies nothing; a party calls it on a receipt it has verified.

Parameters

ParameterType
credentialSubjectunknown

Returns

Refusal | `0x${string}`


tie()

tie(options): ["ack", { paymentOptions: readonly AckPaymentOption[]; }]

The binding slot: the Payment Request's options exactly as issued.

Parameters

ParameterType
optionsreadonly AckPaymentOption[]

Returns

["ack", { paymentOptions: readonly AckPaymentOption[]; }]

References

Broadcaster

Re-exports Broadcaster

Last updated on

On this page