@cosmosapp/pay_sdkDéfinitionsServeur

Product

A product / price the consumer can charge for. Reference for the Product class of @cosmosapp/pay_sdk: its members and their signatures.

A product / price the consumer can charge for.

Constructor

Product

constructor(client: Client, data: ProductData)

Parameters

  • client: Client
  • data: ProductData

Properties

name

name: string

description

description: string | null

amount

amount: string | null

asset

Asset code, or native for XLM.

asset: string

kind

kind: ProductKind

active

active: boolean

reference

reference: string | null

createdAt

createdAt: Date

updatedAt

updatedAt: Date

protected

protected _patch(data: ProductData): this

get

Human-readable asset label (XLM for native).

get assetLabel(): string

deleted

deleted: boolean

member

}>

Methods

fetch()

Re-fetch this product.

fetch(): Promise<Product>

Returns Promise<Product>

edit()

Update this product. Mutates and returns this.

edit(options: UpdateProductOptions): Promise<this>

Parameters

  • options: UpdateProductOptions

Returns Promise<this>

activate()

Mark the product active.

activate(): Promise<this>

Returns Promise<this>

deactivate()

Mark the product inactive.

deactivate(): Promise<this>

Returns Promise<this>

delete()

Delete this product.

delete(): Promise<{ id: string

Returns Promise<{ id: string

toJSON()

toJSON(): ProductData

Returns ProductData

Sur cette page