Skip to main content

Class: OpenTransaction

Represents an open transaction.

Constructors​

constructor​

• new OpenTransaction(options)

Constructs a new OpenTransaction instance.

Parameters​

NameTypeDescription
optionsTransactionOptionsThe transaction options.

Defined in​

src/transaction/open-transaction/open-transaction.ts:38

Properties​

merchantCode​

• Private merchantCode: string

The merchant code for identification.

Defined in​

src/transaction/open-transaction/open-transaction.ts:31


privateKey​

• Private privateKey: string

The private key for authentication.

Defined in​

src/transaction/open-transaction/open-transaction.ts:26


request​

• Private request: HTTPRequest

HTTP Request

Defined in​

src/transaction/open-transaction/open-transaction.ts:21

Methods​

create​

▸ create(params): Promise<IOpenTransaction>

Creating a new transaction or generating a payment code for Open Payment type.

Throws

Throws an error if failed to create the transaction.

See

Create Open Payment - Tripay

Parameters​

NameTypeDescription
paramsIOpenPaymentParamsThe payment parameters.

Returns​

Promise<IOpenTransaction>

A promise that resolves to the created transaction.

Defined in​

src/transaction/open-transaction/open-transaction.ts:55


detail​

▸ detail(uuid): Promise<IOpenTransaction>

Fetching the details of the previously made open payment transaction.

Throws

Throws an error if failed to retrieve the transaction.

See

Detail Open Payment - Tripay

Parameters​

NameTypeDescription
uuidstringThe UUID of the transaction.

Returns​

Promise<IOpenTransaction>

A promise that resolves to the transaction details.

Defined in​

src/transaction/open-transaction/open-transaction.ts:85


formatDateTime​

▸ Private formatDateTime(date): string

Formats a date and time to a string in the format "YYYY-MM-DD HH:mm:ss".

Parameters​

NameTypeDescription
dateDateThe date to format.

Returns​

string

The formatted date and time string.

Defined in​

src/transaction/open-transaction/open-transaction.ts:136


list​

▸ list(uuid, params?): Promise<IOpenTransactionLists>

Retrieving a list of incoming payments for open payment.

Throws

Throws an error if failed to list the transactions.

See

Open Transactions List - Tripay

Parameters​

NameTypeDescription
uuidstringThe UUID of the payment.
params?IOpenPaymentListParamsThe list parameters.

Returns​

Promise<IOpenTransactionLists>

A promise that resolves to the list of transactions.

Defined in​

src/transaction/open-transaction/open-transaction.ts:100