Skip to main content

Class: ClosedTransaction

Represents a closed transaction.

Constructors

constructor

new ClosedTransaction(options)

Creates an instance of ClosedTransaction.

Parameters

NameTypeDescription
optionsTransactionOptionsThe transaction options.

Defined in

src/transaction/closed-transaction/closed-transaction.ts:42

Properties

merchantCode

Private merchantCode: string

The merchant code for identification.

Defined in

src/transaction/closed-transaction/closed-transaction.ts:30


orderItems

Private orderItems: IOrderItem[] = []

Order items

Defined in

src/transaction/closed-transaction/closed-transaction.ts:35


privateKey

Private privateKey: string

The private key for authentication.

Defined in

src/transaction/closed-transaction/closed-transaction.ts:25


request

Private request: HTTPRequest

HTTP Request

Defined in

src/transaction/closed-transaction/closed-transaction.ts:20

Methods

addOrderItem

addOrderItem(orderItem): ClosedTransaction

Adds an order item to the transaction.

Parameters

NameTypeDescription
orderItemIOrderItemThe order item to add.

Returns

ClosedTransaction

The updated ClosedTransaction instance.

Defined in

src/transaction/closed-transaction/closed-transaction.ts:57


addOrderItems

addOrderItems(orderItems): ClosedTransaction

Adds multiple order items to the transaction.

Parameters

NameTypeDescription
orderItemsIOrderItem[]The order items to add.

Returns

ClosedTransaction

The updated ClosedTransaction instance.

Defined in

src/transaction/closed-transaction/closed-transaction.ts:68


create

create(params): Promise<IClosedTransaction>

Creating a new transaction or generating a payment code.

Throws

Throws an error if failed to create the transaction.

See

Create Closed Payment - Tripay

Parameters

NameTypeDescription
paramsIClosedPaymentParamsThe payment parameters.

Returns

Promise<IClosedTransaction>

A promise that resolves to the created closed transaction.

Defined in

src/transaction/closed-transaction/closed-transaction.ts:81


detail

detail(reference): Promise<IClosedTransactionDetail>

Fetching the details of a previously made transaction. It can also be used to check the payment status.

Throws

Throws an error if failed to retrieve the transaction.

See

Detail Closed Transaction - Tripay

Parameters

NameTypeDescription
referencestringThe reference of the transaction.

Returns

Promise<IClosedTransactionDetail>

A promise that resolves to the details of the closed transaction.

Defined in

src/transaction/closed-transaction/closed-transaction.ts:143