PaymentIntent
A Stellar SEP-7 payment intent. Wraps the raw API payload with typed accessors and atomic action methods so you can operate on it directly…
A Stellar SEP-7 payment intent. Wraps the raw API payload with typed accessors and atomic action methods so you can operate on it directly: await intent.validate(txHash), await intent.cancel(), await intent.delete().
Constructor
PaymentIntent
constructor(client: Client, data: PaymentIntentData)Parameters
client:Clientdata:PaymentIntentData
Properties
kind
kind: PaymentIntentKindstatus
status: PaymentIntentStatuschain
Chain the payment settles on.
chain: PaymentChainnetwork
network: stringsource
Payer account (null for PAY intents).
source: string | nulldestination
destination: stringamount
amount: string | nullasset
Asset code, or native for the chain's coin (XLM, SOL or MON).
asset: stringassetIssuer
assetIssuer: string | nullmemo
Mandatory MEMO_ID.
memo: stringmsg
msg: string | nullcallback
callback: string | nullxdr
Unsigned transaction envelope (base64 XDR); null for PAY intents.
xdr: string | nulluri
SEP-7 deep link (tx or pay).
uri: stringqr
QR code of the SEP-7 URI (PNG data URL).
qr: stringtxHash
txHash: string | nullreference
reference: string | nullcreatedAt
createdAt: DateupdatedAt
updatedAt: Dateprotected
protected _patch(data: PaymentIntentData): thisget
Whether this is a SEP-7 tx intent (known source, has XDR).
get isTx(): booleanget
Whether this is a SEP-7 pay intent (no source).
get isPay(): booleanget
Whether the payment has settled on-chain.
get isSucceeded(): booleanget
Whether the intent is still awaiting payment.
get isPending(): booleanget
Human-readable asset label (the chain's coin for native: XLM, SOL or MON).
get assetLabel(): stringMethods
fetch()
Re-fetch this intent from the API, returning a fresh instance.
fetch(): Promise<PaymentIntent>Returns Promise<PaymentIntent>
edit()
Update this intent (status / txHash / reference). Mutates and returns it.
edit(options: UpdatePaymentIntentOptions): Promise<this>Parameters
options:UpdatePaymentIntentOptions
Returns Promise<this>
validate()
Validate a submitted transaction against this intent. On a match the status is finalized server-side and the webhook fires.
validate(txHash: string): Promise<ValidationOutcome>Parameters
txHash:string
Returns Promise<ValidationOutcome>
cancel()
Mark this intent as cancelled.
cancel(): Promise<this>Returns Promise<this>
delete()
Delete this intent.
delete(): Promise<DeletedData>Returns Promise<DeletedData>
toJSON()
toJSON(): PaymentIntentDataReturns PaymentIntentData
Related
PublicKeyManager
The shared public API key — client.publicKey. It is what an open-source wallet embeds to reach the few routes anonymous callers may use; the route that serves…
PaymentIntentManager
Manages Stellar payment intents — client.paymentIntents. Reference for the PaymentIntentManager class of @cosmosapp/pay_sdk: its members and their signatures.