Customer
A customer record, optionally enriched with on-chain payment stats. Reference for the Customer class of @cosmosapp/pay_sdk: its members and their signatures.
A customer record, optionally enriched with on-chain payment stats.
Constructor
Customer
constructor(client: Client, data: CustomerData)Parameters
client:Clientdata:CustomerData
Properties
name
name: stringalias
alias: string | nullnote
note: string | nullemail: string | nullwallets
The customer's wallets, oldest first, on Stellar, Solana or Monad. Payments paid from any of them count toward the customer.
wallets: CustomerWalletData[]account
account: string | nullreference
reference: string | nullcreatedAt
createdAt: DateupdatedAt
updatedAt: Datepayments
Number of payment intents from this customer's wallets (list view only).
payments: number | nullsucceeded
Number of succeeded payments (list view only).
succeeded: number | nulltotal
Total settled amount as a decimal string (list view only).
total: string | nullprotected
protected _patch(data: CustomerData): thisdeleted
deleted: booleanmember
}>Methods
fetch()
Re-fetch this customer.
fetch(): Promise<Customer>Returns Promise<Customer>
edit()
Update this customer. Mutates and returns this.
edit(options: UpdateCustomerOptions): Promise<this>Parameters
options:UpdateCustomerOptions
Returns Promise<this>
delete()
Delete this customer.
delete(): Promise<{ id: stringReturns Promise<{ id: string
addWallet()
Add a wallet to this customer and to {@link Customer.wallets}. A wallet the customer already holds answers as it is.
addWallet(options: AddCustomerWalletOptions): Promise<CustomerWalletData>Parameters
options:AddCustomerWalletOptions
Returns Promise<CustomerWalletData>
removeWallet()
Remove one of this customer's wallets, by id or as read from {@link Customer.wallets}.
removeWallet(wallet: string | CustomerWalletData): Promise<CustomerWalletDeletedData>Parameters
wallet:string | CustomerWalletData
Returns Promise<CustomerWalletDeletedData>
toJSON()
toJSON(): CustomerDataReturns CustomerData