Class: ClosedTransaction
Represents a closed transaction.
Constructors
constructor
• new ClosedTransaction(options
)
Creates an instance of ClosedTransaction.
Parameters
Name | Type | Description |
---|---|---|
options | TransactionOptions | The 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
Name | Type | Description |
---|---|---|
orderItem | IOrderItem | The order item to add. |
Returns
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
Name | Type | Description |
---|---|---|
orderItems | IOrderItem [] | The order items to add. |
Returns
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
Name | Type | Description |
---|---|---|
params | IClosedPaymentParams | The 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
Name | Type | Description |
---|---|---|
reference | string | The 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