@cosmosapp/pay_sdkDefinitionenServer

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: Client
  • data: CustomerData

Properties

name

name: string

alias

alias: string | null

note

note: string | null

email

email: string | null

wallets

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 | null

reference

reference: string | null

createdAt

createdAt: Date

updatedAt

updatedAt: Date

payments

Number of payment intents from this customer's wallets (list view only).

payments: number | null

succeeded

Number of succeeded payments (list view only).

succeeded: number | null

total

Total settled amount as a decimal string (list view only).

total: string | null

protected

protected _patch(data: CustomerData): this

deleted

deleted: boolean

member

}>

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: string

Returns 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(): CustomerData

Returns CustomerData

Auf dieser Seite