@cosmosapp/pay_sdkDefiniçõesServidor
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:Clientdata:ProductData
Properties
name
name: stringdescription
description: string | nullamount
amount: string | nullasset
Asset code, or native for XLM.
asset: stringkind
kind: ProductKindactive
active: booleanreference
reference: string | nullcreatedAt
createdAt: DateupdatedAt
updatedAt: Dateprotected
protected _patch(data: ProductData): thisget
Human-readable asset label (XLM for native).
get assetLabel(): stringdeleted
deleted: booleanmember
}>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: stringReturns Promise<{ id: string
toJSON()
toJSON(): ProductDataReturns ProductData