PrivatePayment
A private payment, from client.privatePayments: an amount in XLM whose value is hidden on-chain.
A private payment, from client.privatePayments: an amount in XLM whose value is hidden on-chain. The payer pays it with confidential transfers on Cosmos Pay's confidential token (net to {@link recipient}, the commission to {@link feeAccount}, and a third one when there is a {@link merchantFee}) and confirms them through the private checkout. Poll with await payment.fetch().
Constructor
PrivatePayment
constructor(client: Client, data: PrivatePaymentData)Parameters
client:Clientdata:PrivatePaymentData
Properties
status
As it reads now: a PENDING payment past {@link expiresAt} reads EXPIRED.
status: PrivatePaymentStatusnetwork
network: PrivatePaymentNetworktokenContract
The confidential token every transfer must be made on.
tokenContract: stringamount
What the payer pays in total, in XLM.
amount: stringnetAmount
What the merchant receives, in XLM.
netAmount: stringfeeAmount
The commission, in XLM.
feeAmount: stringfeeBps
The commission rate the payment was priced at, in basis points.
feeBps: numberrecipient
The merchant (G...).
recipient: stringfeeAccount
Cosmos Pay's account the commission is paid to.
feeAccount: stringpayer
The account the transfers came from, once settled.
payer: string | nullpaymentTxHash
paymentTxHash: string | nullfeeTxHash
feeTxHash: string | nullmerchantFee
merchantFee: MerchantFeeData | nullmerchantFeeTxHash
merchantFeeTxHash: string | nulldescription
description: string | nullidempotencyKey
idempotencyKey: stringexpiresAt
Every transfer must close before this.
expiresAt: DatesettledAt
settledAt: Date | nullcreatedAt
createdAt: DateupdatedAt
updatedAt: Dateprotected
protected _patch(data: PrivatePaymentData): thisget
Whether the payment is still waiting for its transfers.
get isPending(): booleanget
Whether every transfer has been confirmed.
get isSucceeded(): booleanget
Whether it passed {@link expiresAt} without settling (it can still settle with transfers that closed in time).
get isExpired(): booleanMethods
fetch()
Re-fetch from the API, updating this instance in place.
fetch(): Promise<this>Returns Promise<this>
toJSON()
toJSON(): PrivatePaymentDataReturns PrivatePaymentData