@mytiki/tiki-sdk-js
Version:
JS SDK for client-side integration with TIKI
45 lines (44 loc) • 1.99 kB
TypeScript
import { PayableRecord } from "./payable-record";
export { PayableRecord } from "./payable-record";
/**
* Creates a new {@link PayableRecord} object.
*
* Note: This method requires an existing {@link License.LicenseRecord}. Use {@link License.create} first.
*
* The expiry parameter sets the expiration date of the {@link PayableRecord}. If the payable never expires,
* leave this parameter as `undefined`.
*
* @param licenseId - The identifier for the corresponding license record
*
* @param amount - The total amount. Can be a simple numeric value, or an atypical value such as downloadable content.
*
* @param type - Describes the type of payment (e.g. loyalty-point, cash, coupon, etc.)
*
* @param description - A short, human-readable description of the {@link Title.TitleRecord} as a future reminder.
* This parameter is used only if a {@link Title.TitleRecord} does not already exist for the provided ptr.
*
* @param expiry - The expiration date of the {@link License.LicenseRecord}. If the license never expires, leave this parameter
* as `undefined`.
*
* @param reference - A customer-specific reference identifier
*/
export declare function create(licenseId: string, amount: string, type: string, description?: string, expiry?: Date, reference?: string): Promise<PayableRecord>;
/**
* Returns all {@link PayableRecord}s associated with a given {@link License.LicenseRecord}.
*
* @param licenseId - The id of the LicenseRecord
*/
export declare function getByLicense(licenseId: string): Array<PayableRecord>;
/**
* Retrieves the {@link PayableRecord} with the specified ID, or `undefined` if the record is not found.
*
* @param id - The ID of the PayableRecord to retrieve.
*/
export declare function getById(id: string): PayableRecord | undefined;
/**
* @hidden
* Marshall the {@link RspPayable} object to {@link PayableRecord}
*
* @param rsp - The response object to marshall
*/
export declare function _toPayable(rsp: RspPayable): PayableRecord;