@tapsilat/tapsilat-js 2025.12.5 → 2025.12.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -2
- package/dist/TapsilatSDK.d.ts +42 -8
- package/dist/TapsilatSDK.d.ts.map +1 -1
- package/dist/errors/TapsilatError.d.ts +5 -5
- package/dist/errors/TapsilatError.d.ts.map +1 -1
- package/dist/http/HttpClient.d.ts +2 -2
- package/dist/http/HttpClient.d.ts.map +1 -1
- package/dist/http/interceptors.d.ts +4 -4
- package/dist/http/interceptors.d.ts.map +1 -1
- package/dist/index.d.ts +82 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +91 -11
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +91 -11
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +36 -4
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
-
## [2025.12.
|
|
10
|
+
## [2025.12.5] - 2025-12-05
|
|
11
11
|
|
|
12
12
|
### Added
|
|
13
13
|
- **New Features**:
|
|
@@ -21,7 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
21
21
|
- **Subscription Management**: Full suite of subscription methods (`createSubscription`, `getSubscription`, `listSubscriptions`, `cancelSubscription`, `redirectSubscription`).
|
|
22
22
|
|
|
23
23
|
### Changed
|
|
24
|
-
- Updated `package.json` version to `2025.12.
|
|
24
|
+
- Updated `package.json` version to `2025.12.5`.
|
|
25
25
|
- Refactored tests to align with project structure.
|
|
26
26
|
|
|
27
27
|
## [1.0.4] - 2025-06-16
|
package/dist/TapsilatSDK.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConfigManager } from "./config/ConfigManager";
|
|
2
|
-
import { TapsilatConfig, PaginatedResponse, Order, OrderRefundRequest, OrderRefundResponse, OrderStatusResponse, OrderPaymentDetail, OrderCreateRequest, OrderCreateResponse, OrderPaymentTermCreateDTO, OrderPaymentTermUpdateDTO, OrderTermRefundRequest, PaymentTermResponse, PaymentTermDeleteRequest, PaymentTermRefundResponse, PaymentTermTerminateRequest, OrderTerminateRequest, OrderTerminateResponse, SubscriptionGetRequest, SubscriptionCancelRequest, SubscriptionCreateRequest, SubscriptionRedirectRequest, SubscriptionDetail, SubscriptionCreateResponse, SubscriptionRedirectResponse, OrganizationSettings } from "./types/index";
|
|
2
|
+
import { TapsilatConfig, PaginatedResponse, Order, OrderRefundRequest, OrderRefundResponse, OrderStatusResponse, OrderPaymentDetail, OrderCreateRequest, OrderCreateResponse, OrderPaymentTermCreateDTO, OrderPaymentTermUpdateDTO, OrderTermRefundRequest, PaymentTermResponse, PaymentTermDeleteRequest, PaymentTermRefundResponse, PaymentTermTerminateRequest, OrderTerminateRequest, OrderTerminateResponse, SubscriptionGetRequest, SubscriptionCancelRequest, SubscriptionCreateRequest, SubscriptionRedirectRequest, SubscriptionDetail, SubscriptionCreateResponse, SubscriptionRedirectResponse, OrganizationSettings, OrderTransaction, OrderSubmerchant, APIResponse, OrderAccountingRequest, OrderPostAuthRequest } from "./types/index";
|
|
3
3
|
/**
|
|
4
4
|
* Main SDK class for Tapsilat payment operations
|
|
5
5
|
*
|
|
@@ -97,6 +97,40 @@ export declare class TapsilatSDK {
|
|
|
97
97
|
* @throws {TapsilatError} When API returns business logic errors
|
|
98
98
|
*/
|
|
99
99
|
createOrder(orderRequest: OrderCreateRequest): Promise<OrderCreateResponse>;
|
|
100
|
+
/**
|
|
101
|
+
* Process accounting for an order
|
|
102
|
+
*
|
|
103
|
+
* @summary Process accounting for an order
|
|
104
|
+
* @description Handles accounting operations for a specific order using its reference ID.
|
|
105
|
+
*
|
|
106
|
+
* @param {OrderAccountingRequest} request - Accounting request details
|
|
107
|
+
* @returns {Promise<APIResponse<unknown>>} Promise resolving to the accounting response
|
|
108
|
+
* @throws {TapsilatValidationError} When input validation fails
|
|
109
|
+
* @throws {TapsilatError} When API returns an error response
|
|
110
|
+
*/
|
|
111
|
+
orderAccounting(request: OrderAccountingRequest): Promise<APIResponse<unknown>>;
|
|
112
|
+
/**
|
|
113
|
+
* Process post-authorization for an order
|
|
114
|
+
*
|
|
115
|
+
* @summary Process post-authorization for an order
|
|
116
|
+
* @description Handles post-authorization operations for a specific order.
|
|
117
|
+
*
|
|
118
|
+
* @param {OrderPostAuthRequest} request - Post-authorization request details
|
|
119
|
+
* @returns {Promise<APIResponse<unknown>>} Promise resolving to the post-auth response
|
|
120
|
+
* @throws {TapsilatValidationError} When input validation fails
|
|
121
|
+
* @throws {TapsilatError} When API returns an error response
|
|
122
|
+
*/
|
|
123
|
+
orderPostAuth(request: OrderPostAuthRequest): Promise<APIResponse<unknown>>;
|
|
124
|
+
/**
|
|
125
|
+
* Retrieve system order statuses
|
|
126
|
+
*
|
|
127
|
+
* @summary Retrieve system order statuses
|
|
128
|
+
* @description Gets a list of all possible order statuses in the system.
|
|
129
|
+
*
|
|
130
|
+
* @returns {Promise<APIResponse<unknown>>} Promise resolving to system order statuses
|
|
131
|
+
* @throws {TapsilatError} When API returns an error response
|
|
132
|
+
*/
|
|
133
|
+
getSystemOrderStatuses(): Promise<APIResponse<unknown>>;
|
|
100
134
|
/**
|
|
101
135
|
* Gets an order by reference ID.
|
|
102
136
|
*
|
|
@@ -237,7 +271,7 @@ export declare class TapsilatSDK {
|
|
|
237
271
|
* @throws {TapsilatValidationError} When referenceId is invalid
|
|
238
272
|
* @throws {TapsilatError} When API returns an error response
|
|
239
273
|
*/
|
|
240
|
-
getOrderTransactions(referenceId: string): Promise<
|
|
274
|
+
getOrderTransactions(referenceId: string): Promise<OrderTransaction[]>;
|
|
241
275
|
/**
|
|
242
276
|
* Gets order submerchants with pagination.
|
|
243
277
|
* Based on `get_order_submerchants` from the Python SDK.
|
|
@@ -252,7 +286,7 @@ export declare class TapsilatSDK {
|
|
|
252
286
|
getOrderSubmerchants(params?: {
|
|
253
287
|
page?: number;
|
|
254
288
|
per_page?: number;
|
|
255
|
-
}): Promise<
|
|
289
|
+
}): Promise<PaginatedResponse<OrderSubmerchant>>;
|
|
256
290
|
/**
|
|
257
291
|
* Gets checkout URL for an order.
|
|
258
292
|
* Based on `get_checkout_url` from the Python SDK.
|
|
@@ -432,17 +466,17 @@ export declare class TapsilatSDK {
|
|
|
432
466
|
* @throws {TapsilatError} When API returns an error response
|
|
433
467
|
*/
|
|
434
468
|
terminateOrder(terminateData: OrderTerminateRequest): Promise<OrderTerminateResponse>;
|
|
435
|
-
orderManualCallback(referenceId: string, conversationId?: string): Promise<
|
|
436
|
-
orderRelatedUpdate(referenceId: string, relatedReferenceId: string): Promise<
|
|
469
|
+
orderManualCallback(referenceId: string, conversationId?: string): Promise<APIResponse<unknown>>;
|
|
470
|
+
orderRelatedUpdate(referenceId: string, relatedReferenceId: string): Promise<APIResponse<unknown>>;
|
|
437
471
|
getOrganizationSettings(): Promise<OrganizationSettings>;
|
|
438
|
-
getOrderTerm(termReferenceId: string): Promise<
|
|
472
|
+
getOrderTerm(termReferenceId: string): Promise<PaymentTermResponse>;
|
|
439
473
|
createSubscription(request: SubscriptionCreateRequest): Promise<SubscriptionCreateResponse>;
|
|
440
474
|
getSubscription(request: SubscriptionGetRequest): Promise<SubscriptionDetail>;
|
|
441
475
|
listSubscriptions(params?: {
|
|
442
476
|
page?: number;
|
|
443
477
|
per_page?: number;
|
|
444
|
-
}): Promise<PaginatedResponse<
|
|
445
|
-
cancelSubscription(request: SubscriptionCancelRequest): Promise<
|
|
478
|
+
}): Promise<PaginatedResponse<SubscriptionDetail>>;
|
|
479
|
+
cancelSubscription(request: SubscriptionCancelRequest): Promise<APIResponse<unknown>>;
|
|
446
480
|
redirectSubscription(request: SubscriptionRedirectRequest): Promise<SubscriptionRedirectResponse>;
|
|
447
481
|
}
|
|
448
482
|
//# sourceMappingURL=TapsilatSDK.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TapsilatSDK.d.ts","sourceRoot":"","sources":["../src/TapsilatSDK.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AASvD,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,KAAK,EACL,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,yBAAyB,EACzB,yBAAyB,EACzB,2BAA2B,EAC3B,kBAAkB,EAClB,0BAA0B,EAC1B,4BAA4B,EAC5B,oBAAoB,EACrB,MAAM,eAAe,CAAC;AAKvB;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgB;IAK9C;;;;;;;;;;;;;;;;;;;;;;;OAuBG;gBACS,MAAM,EAAE,cAAc;IASlC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkDG;IACG,WAAW,CACf,YAAY,EAAE,kBAAkB,GAC/B,OAAO,CAAC,mBAAmB,CAAC;IA4G/B;;;;;;;;;;;OAWG;IACG,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;IA0BnD;;;;;;;;;;OAUG;IACG,SAAS,CACb,MAAM,GAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAO,GAChD,OAAO,CAAC,iBAAiB,CAAC,KA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,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAY1B,oBAAoB,CACxB,OAAO,EAAE,2BAA2B,GACnC,OAAO,CAAC,4BAA4B,CAAC;CAWzC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @category Errors
|
|
3
3
|
* @module TapsilatError
|
|
4
4
|
*/
|
|
5
|
-
import { APIError } from
|
|
5
|
+
import { APIError } from "../types/index";
|
|
6
6
|
/**
|
|
7
7
|
* @category Errors
|
|
8
8
|
* @summary Base error class for Tapsilat SDK
|
|
@@ -12,7 +12,7 @@ import { APIError } from '../types/index';
|
|
|
12
12
|
*/
|
|
13
13
|
export declare class TapsilatError extends Error {
|
|
14
14
|
readonly code: string;
|
|
15
|
-
readonly details?:
|
|
15
|
+
readonly details?: unknown;
|
|
16
16
|
/**
|
|
17
17
|
* @summary Creates a new TapsilatError instance
|
|
18
18
|
* @description Initializes base error with message, code and optional details
|
|
@@ -21,7 +21,7 @@ export declare class TapsilatError extends Error {
|
|
|
21
21
|
* @param code - Error code for programmatic identification
|
|
22
22
|
* @param details - Optional additional error context
|
|
23
23
|
*/
|
|
24
|
-
constructor(message: string, code: string, details?:
|
|
24
|
+
constructor(message: string, code: string, details?: unknown);
|
|
25
25
|
/**
|
|
26
26
|
* @summary Creates a TapsilatError from an API error response
|
|
27
27
|
* @description Factory method to convert API error format to a TapsilatError instance
|
|
@@ -49,7 +49,7 @@ export declare class TapsilatNetworkError extends TapsilatError {
|
|
|
49
49
|
* @param statusCode - HTTP status code if applicable
|
|
50
50
|
* @param details - Optional additional error context
|
|
51
51
|
*/
|
|
52
|
-
constructor(message: string, code: string, statusCode?: number, details?:
|
|
52
|
+
constructor(message: string, code: string, statusCode?: number, details?: unknown);
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
55
|
* @category Errors
|
|
@@ -66,7 +66,7 @@ export declare class TapsilatValidationError extends TapsilatError {
|
|
|
66
66
|
* @param message - Human-readable error message
|
|
67
67
|
* @param details - Optional field-specific validation errors
|
|
68
68
|
*/
|
|
69
|
-
constructor(message: string, details?:
|
|
69
|
+
constructor(message: string, details?: unknown);
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
72
|
* @category Errors
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TapsilatError.d.ts","sourceRoot":"","sources":["../../src/errors/TapsilatError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C;;;;;;GAMG;AACH,qBAAa,aAAc,SAAQ,KAAK;IACtC,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,SAAgB,OAAO,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"TapsilatError.d.ts","sourceRoot":"","sources":["../../src/errors/TapsilatError.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C;;;;;;GAMG;AACH,qBAAa,aAAc,SAAQ,KAAK;IACtC,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,SAAgB,OAAO,CAAC,EAAE,OAAO,CAAC;IAElC;;;;;;;OAOG;gBACS,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO;IAc5D;;;;;;OAMG;IACH,MAAM,CAAC,YAAY,CAAC,QAAQ,EAAE,QAAQ,GAAG,aAAa;CAGvD;AAED;;;;;;GAMG;AACH,qBAAa,oBAAqB,SAAQ,aAAa;IACrD,SAAgB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpC;;;;;;;;OAQG;gBAED,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,OAAO;CAMpB;AAED;;;;;;GAMG;AACH,qBAAa,uBAAwB,SAAQ,aAAa;IACxD;;;;;;OAMG;gBACS,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO;CAI/C;AAED;;;;;;GAMG;AACH,qBAAa,2BAA4B,SAAQ,aAAa;IAC5D;;;;;OAKG;gBACS,OAAO,GAAE,MAAgC;CAItD;AAED;;;;;;GAMG;AACH,qBAAa,sBAAuB,SAAQ,aAAa;IACvD,SAAgB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpC;;;;;;OAMG;gBACS,OAAO,GAAE,MAA8B,EAAE,UAAU,CAAC,EAAE,MAAM;CAKzE"}
|
|
@@ -15,7 +15,7 @@ export interface RequestConfig extends Omit<RequestInit, "method" | "body"> {
|
|
|
15
15
|
retries?: number;
|
|
16
16
|
baseURL?: string;
|
|
17
17
|
maxRetries?: number;
|
|
18
|
-
params?: Record<string,
|
|
18
|
+
params?: Record<string, unknown>;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* @category HTTP
|
|
@@ -30,7 +30,7 @@ export type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
|
30
30
|
* @description Types that can be sent as HTTP request bodies
|
|
31
31
|
* @typedef {object|array|string|FormData} RequestBody
|
|
32
32
|
*/
|
|
33
|
-
export type RequestBody = Record<string, unknown> | Record<string,
|
|
33
|
+
export type RequestBody = Record<string, unknown> | Record<string, unknown> | object | unknown[] | string | FormData;
|
|
34
34
|
/**
|
|
35
35
|
* @category HTTP
|
|
36
36
|
* @summary HTTP Client for making API requests to Tapsilat services
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpClient.d.ts","sourceRoot":"","sources":["../../src/http/HttpClient.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAQ7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,WAAW,EAAE,QAAQ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AC,wBAAwB,CAAC,CAAC,CAAC,CAAC,CAAC,GACvE,MAAM;IAIT;;;;;;;OAOG;IACH,mBAAmB,CACjB,WAAW,EAAE,UAAU,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC,GACpE,MAAM;CAGV"}
|
|
@@ -22,10 +22,10 @@ export type RequestInterceptor = (url: string, options: RequestInit) => Promise<
|
|
|
22
22
|
* @description Allows transformation and analysis of API responses after receiving them but before they reach the calling code
|
|
23
23
|
* @typedef {Function} ResponseInterceptor
|
|
24
24
|
*/
|
|
25
|
-
export type ResponseInterceptor = (response: APIResponse<
|
|
25
|
+
export type ResponseInterceptor = (response: APIResponse<unknown>, request: {
|
|
26
26
|
url: string;
|
|
27
27
|
options: RequestInit;
|
|
28
|
-
}) => Promise<APIResponse<
|
|
28
|
+
}) => Promise<APIResponse<unknown>> | APIResponse<unknown>;
|
|
29
29
|
/**
|
|
30
30
|
* @category Interceptors
|
|
31
31
|
* @summary Function type for handling errors that occur during HTTP requests
|
|
@@ -35,7 +35,7 @@ export type ResponseInterceptor = (response: APIResponse<any>, request: {
|
|
|
35
35
|
export type ErrorInterceptor = (error: Error, request: {
|
|
36
36
|
url: string;
|
|
37
37
|
options: RequestInit;
|
|
38
|
-
}) => Promise<never | APIResponse<
|
|
38
|
+
}) => Promise<never | APIResponse<unknown>> | never | APIResponse<unknown>;
|
|
39
39
|
/**
|
|
40
40
|
* @category HTTP
|
|
41
41
|
* @summary Central registry and execution engine for all HTTP interceptors
|
|
@@ -132,7 +132,7 @@ export declare class InterceptorManager {
|
|
|
132
132
|
executeErrorInterceptors(error: Error, request: {
|
|
133
133
|
url: string;
|
|
134
134
|
options: RequestInit;
|
|
135
|
-
}): Promise<never | APIResponse<
|
|
135
|
+
}): Promise<never | APIResponse<unknown>>;
|
|
136
136
|
/**
|
|
137
137
|
* @summary Remove all registered interceptors
|
|
138
138
|
* @description Clears all request, response, and error interceptors at once
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interceptors.d.ts","sourceRoot":"","sources":["../../src/http/interceptors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAC/B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,WAAW,KAElB,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,WAAW,CAAA;CAAE,CAAC,GAC9C;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,WAAW,CAAA;CAAE,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAChC,QAAQ,EAAE,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"interceptors.d.ts","sourceRoot":"","sources":["../../src/http/interceptors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,CAC/B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,WAAW,KAElB,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,WAAW,CAAA;CAAE,CAAC,GAC9C;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,WAAW,CAAA;CAAE,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAChC,QAAQ,EAAE,WAAW,CAAC,OAAO,CAAC,EAC9B,OAAO,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,WAAW,CAAA;CAAE,KAC3C,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAC7B,KAA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O,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,WAAW,CAAA;KAAE,GAC7C,OAAO,CAAC,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;IAgBxC;;;OAGG;IACH,KAAK,IAAI,IAAI;CAKd;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,GACnC,QAAO,OAAe,KACrB;IACD,OAAO,EAAE,kBAAkB,CAAC;IAC5B,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,KAAK,EAAE,gBAAgB,CAAC;CA+BxB,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,QAAO;IACzC,OAAO,EAAE,kBAAkB,CAAC;IAC5B,QAAQ,EAAE,mBAAmB,CAAC;CAmC/B,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ interface PaymentRequest {
|
|
|
49
49
|
currency: Currency;
|
|
50
50
|
paymentMethod: PaymentMethod;
|
|
51
51
|
description?: string;
|
|
52
|
-
metadata?: Record<string,
|
|
52
|
+
metadata?: Record<string, unknown>;
|
|
53
53
|
returnUrl?: string;
|
|
54
54
|
webhookUrl?: string;
|
|
55
55
|
customerId?: string;
|
|
@@ -67,7 +67,7 @@ interface PaymentResponse {
|
|
|
67
67
|
currency: Currency;
|
|
68
68
|
paymentMethod: PaymentMethod;
|
|
69
69
|
description?: string;
|
|
70
|
-
metadata?: Record<string,
|
|
70
|
+
metadata?: Record<string, unknown>;
|
|
71
71
|
createdAt: string;
|
|
72
72
|
updatedAt: string;
|
|
73
73
|
paymentUrl?: string;
|
|
@@ -185,7 +185,7 @@ interface WebhookEvent {
|
|
|
185
185
|
interface APIError {
|
|
186
186
|
code: string;
|
|
187
187
|
message: string;
|
|
188
|
-
details?:
|
|
188
|
+
details?: unknown;
|
|
189
189
|
}
|
|
190
190
|
/**
|
|
191
191
|
* @category HTTP
|
|
@@ -199,7 +199,7 @@ interface APIResponse<T> {
|
|
|
199
199
|
error?: {
|
|
200
200
|
message: string;
|
|
201
201
|
code: string;
|
|
202
|
-
details?:
|
|
202
|
+
details?: unknown;
|
|
203
203
|
};
|
|
204
204
|
status?: number;
|
|
205
205
|
headers?: Record<string, string>;
|
|
@@ -862,6 +862,38 @@ interface OrganizationSettings {
|
|
|
862
862
|
checkout_domain?: string;
|
|
863
863
|
subscription_domain?: string;
|
|
864
864
|
}
|
|
865
|
+
interface OrderTransaction {
|
|
866
|
+
id: string;
|
|
867
|
+
date: string;
|
|
868
|
+
amount: number;
|
|
869
|
+
type: string;
|
|
870
|
+
status: string;
|
|
871
|
+
[key: string]: unknown;
|
|
872
|
+
}
|
|
873
|
+
interface OrderSubmerchant {
|
|
874
|
+
id: string;
|
|
875
|
+
name: string;
|
|
876
|
+
[key: string]: unknown;
|
|
877
|
+
}
|
|
878
|
+
/**
|
|
879
|
+
* @category Order Management
|
|
880
|
+
* @summary Request for order accounting
|
|
881
|
+
* @description Data required to process accounting for an order
|
|
882
|
+
* @interface OrderAccountingRequest
|
|
883
|
+
*/
|
|
884
|
+
interface OrderAccountingRequest {
|
|
885
|
+
order_reference_id: string;
|
|
886
|
+
}
|
|
887
|
+
/**
|
|
888
|
+
* @category Order Management
|
|
889
|
+
* @summary Request for order post-authorization
|
|
890
|
+
* @description Data required to process post-authorization for an order
|
|
891
|
+
* @interface OrderPostAuthRequest
|
|
892
|
+
*/
|
|
893
|
+
interface OrderPostAuthRequest {
|
|
894
|
+
amount: number;
|
|
895
|
+
reference_id: string;
|
|
896
|
+
}
|
|
865
897
|
|
|
866
898
|
/**
|
|
867
899
|
* @category Configuration
|
|
@@ -1037,6 +1069,40 @@ declare class TapsilatSDK {
|
|
|
1037
1069
|
* @throws {TapsilatError} When API returns business logic errors
|
|
1038
1070
|
*/
|
|
1039
1071
|
createOrder(orderRequest: OrderCreateRequest): Promise<OrderCreateResponse>;
|
|
1072
|
+
/**
|
|
1073
|
+
* Process accounting for an order
|
|
1074
|
+
*
|
|
1075
|
+
* @summary Process accounting for an order
|
|
1076
|
+
* @description Handles accounting operations for a specific order using its reference ID.
|
|
1077
|
+
*
|
|
1078
|
+
* @param {OrderAccountingRequest} request - Accounting request details
|
|
1079
|
+
* @returns {Promise<APIResponse<unknown>>} Promise resolving to the accounting response
|
|
1080
|
+
* @throws {TapsilatValidationError} When input validation fails
|
|
1081
|
+
* @throws {TapsilatError} When API returns an error response
|
|
1082
|
+
*/
|
|
1083
|
+
orderAccounting(request: OrderAccountingRequest): Promise<APIResponse<unknown>>;
|
|
1084
|
+
/**
|
|
1085
|
+
* Process post-authorization for an order
|
|
1086
|
+
*
|
|
1087
|
+
* @summary Process post-authorization for an order
|
|
1088
|
+
* @description Handles post-authorization operations for a specific order.
|
|
1089
|
+
*
|
|
1090
|
+
* @param {OrderPostAuthRequest} request - Post-authorization request details
|
|
1091
|
+
* @returns {Promise<APIResponse<unknown>>} Promise resolving to the post-auth response
|
|
1092
|
+
* @throws {TapsilatValidationError} When input validation fails
|
|
1093
|
+
* @throws {TapsilatError} When API returns an error response
|
|
1094
|
+
*/
|
|
1095
|
+
orderPostAuth(request: OrderPostAuthRequest): Promise<APIResponse<unknown>>;
|
|
1096
|
+
/**
|
|
1097
|
+
* Retrieve system order statuses
|
|
1098
|
+
*
|
|
1099
|
+
* @summary Retrieve system order statuses
|
|
1100
|
+
* @description Gets a list of all possible order statuses in the system.
|
|
1101
|
+
*
|
|
1102
|
+
* @returns {Promise<APIResponse<unknown>>} Promise resolving to system order statuses
|
|
1103
|
+
* @throws {TapsilatError} When API returns an error response
|
|
1104
|
+
*/
|
|
1105
|
+
getSystemOrderStatuses(): Promise<APIResponse<unknown>>;
|
|
1040
1106
|
/**
|
|
1041
1107
|
* Gets an order by reference ID.
|
|
1042
1108
|
*
|
|
@@ -1177,7 +1243,7 @@ declare class TapsilatSDK {
|
|
|
1177
1243
|
* @throws {TapsilatValidationError} When referenceId is invalid
|
|
1178
1244
|
* @throws {TapsilatError} When API returns an error response
|
|
1179
1245
|
*/
|
|
1180
|
-
getOrderTransactions(referenceId: string): Promise<
|
|
1246
|
+
getOrderTransactions(referenceId: string): Promise<OrderTransaction[]>;
|
|
1181
1247
|
/**
|
|
1182
1248
|
* Gets order submerchants with pagination.
|
|
1183
1249
|
* Based on `get_order_submerchants` from the Python SDK.
|
|
@@ -1192,7 +1258,7 @@ declare class TapsilatSDK {
|
|
|
1192
1258
|
getOrderSubmerchants(params?: {
|
|
1193
1259
|
page?: number;
|
|
1194
1260
|
per_page?: number;
|
|
1195
|
-
}): Promise<
|
|
1261
|
+
}): Promise<PaginatedResponse<OrderSubmerchant>>;
|
|
1196
1262
|
/**
|
|
1197
1263
|
* Gets checkout URL for an order.
|
|
1198
1264
|
* Based on `get_checkout_url` from the Python SDK.
|
|
@@ -1372,17 +1438,17 @@ declare class TapsilatSDK {
|
|
|
1372
1438
|
* @throws {TapsilatError} When API returns an error response
|
|
1373
1439
|
*/
|
|
1374
1440
|
terminateOrder(terminateData: OrderTerminateRequest): Promise<OrderTerminateResponse>;
|
|
1375
|
-
orderManualCallback(referenceId: string, conversationId?: string): Promise<
|
|
1376
|
-
orderRelatedUpdate(referenceId: string, relatedReferenceId: string): Promise<
|
|
1441
|
+
orderManualCallback(referenceId: string, conversationId?: string): Promise<APIResponse<unknown>>;
|
|
1442
|
+
orderRelatedUpdate(referenceId: string, relatedReferenceId: string): Promise<APIResponse<unknown>>;
|
|
1377
1443
|
getOrganizationSettings(): Promise<OrganizationSettings>;
|
|
1378
|
-
getOrderTerm(termReferenceId: string): Promise<
|
|
1444
|
+
getOrderTerm(termReferenceId: string): Promise<PaymentTermResponse>;
|
|
1379
1445
|
createSubscription(request: SubscriptionCreateRequest): Promise<SubscriptionCreateResponse>;
|
|
1380
1446
|
getSubscription(request: SubscriptionGetRequest): Promise<SubscriptionDetail>;
|
|
1381
1447
|
listSubscriptions(params?: {
|
|
1382
1448
|
page?: number;
|
|
1383
1449
|
per_page?: number;
|
|
1384
|
-
}): Promise<PaginatedResponse<
|
|
1385
|
-
cancelSubscription(request: SubscriptionCancelRequest): Promise<
|
|
1450
|
+
}): Promise<PaginatedResponse<SubscriptionDetail>>;
|
|
1451
|
+
cancelSubscription(request: SubscriptionCancelRequest): Promise<APIResponse<unknown>>;
|
|
1386
1452
|
redirectSubscription(request: SubscriptionRedirectRequest): Promise<SubscriptionRedirectResponse>;
|
|
1387
1453
|
}
|
|
1388
1454
|
|
|
@@ -1400,7 +1466,7 @@ declare class TapsilatSDK {
|
|
|
1400
1466
|
*/
|
|
1401
1467
|
declare class TapsilatError extends Error {
|
|
1402
1468
|
readonly code: string;
|
|
1403
|
-
readonly details?:
|
|
1469
|
+
readonly details?: unknown;
|
|
1404
1470
|
/**
|
|
1405
1471
|
* @summary Creates a new TapsilatError instance
|
|
1406
1472
|
* @description Initializes base error with message, code and optional details
|
|
@@ -1409,7 +1475,7 @@ declare class TapsilatError extends Error {
|
|
|
1409
1475
|
* @param code - Error code for programmatic identification
|
|
1410
1476
|
* @param details - Optional additional error context
|
|
1411
1477
|
*/
|
|
1412
|
-
constructor(message: string, code: string, details?:
|
|
1478
|
+
constructor(message: string, code: string, details?: unknown);
|
|
1413
1479
|
/**
|
|
1414
1480
|
* @summary Creates a TapsilatError from an API error response
|
|
1415
1481
|
* @description Factory method to convert API error format to a TapsilatError instance
|
|
@@ -1437,7 +1503,7 @@ declare class TapsilatNetworkError extends TapsilatError {
|
|
|
1437
1503
|
* @param statusCode - HTTP status code if applicable
|
|
1438
1504
|
* @param details - Optional additional error context
|
|
1439
1505
|
*/
|
|
1440
|
-
constructor(message: string, code: string, statusCode?: number, details?:
|
|
1506
|
+
constructor(message: string, code: string, statusCode?: number, details?: unknown);
|
|
1441
1507
|
}
|
|
1442
1508
|
/**
|
|
1443
1509
|
* @category Errors
|
|
@@ -1454,7 +1520,7 @@ declare class TapsilatValidationError extends TapsilatError {
|
|
|
1454
1520
|
* @param message - Human-readable error message
|
|
1455
1521
|
* @param details - Optional field-specific validation errors
|
|
1456
1522
|
*/
|
|
1457
|
-
constructor(message: string, details?:
|
|
1523
|
+
constructor(message: string, details?: unknown);
|
|
1458
1524
|
}
|
|
1459
1525
|
/**
|
|
1460
1526
|
* @category Errors
|
|
@@ -1591,4 +1657,4 @@ declare function validateGsmNumber(gsmNumber: string | number): GsmValidationRes
|
|
|
1591
1657
|
declare function validateInstallments(installments: string | number | number[]): InstallmentsValidationResult;
|
|
1592
1658
|
|
|
1593
1659
|
export { ConfigManager, TapsilatAuthenticationError, TapsilatError, TapsilatNetworkError, TapsilatRateLimitError, TapsilatSDK, TapsilatValidationError, isValidCurrency, isValidPaymentMethod, isValidUrl, sanitizeMetadata, validateEmail, validateGsmNumber, validateInstallments, validatePaymentRequest };
|
|
1594
|
-
export type { APIError, APIResponse, Address, BasketItem, BasketItemDTO, BasketItemPayerDTO, BillingAddress, BillingAddressDTO, Buyer, BuyerDTO, CheckoutDesignDTO, Currency, Customer, GsmValidationResult, InstallmentsValidationResult, Locale, MetadataDTO, Order, OrderCardDTO, OrderCreateDTO, OrderCreateRequest, OrderCreateResponse, OrderPFSubMerchantDTO, OrderPaymentDetail, OrderPaymentTermCreateDTO, OrderPaymentTermUpdateDTO, OrderRefundRequest, OrderRefundResponse, OrderResponse, OrderStatusResponse, OrderTermRefundRequest, OrderTerminateRequest, OrderTerminateResponse, PaginatedResponse, PaginationParams, PaymentMethod, PaymentOption, PaymentRequest, PaymentResponse, PaymentStatus, PaymentTermDTO, PaymentTermDeleteRequest, PaymentTermRefundResponse, PaymentTermResponse, PaymentTermTerminateRequest, RefundOrderDTO, RefundRequest, RefundResponse, ShippingAddressDTO, SubOrganizationDTO, SubmerchantDTO, TapsilatConfig, WebhookEvent };
|
|
1660
|
+
export type { APIError, APIResponse, Address, BasketItem, BasketItemDTO, BasketItemPayerDTO, BillingAddress, BillingAddressDTO, Buyer, BuyerDTO, CheckoutDesignDTO, Currency, Customer, GsmValidationResult, InstallmentsValidationResult, Locale, MetadataDTO, Order, OrderCardDTO, OrderCreateDTO, OrderCreateRequest, OrderCreateResponse, OrderPFSubMerchantDTO, OrderPaymentDetail, OrderPaymentTermCreateDTO, OrderPaymentTermUpdateDTO, OrderRefundRequest, OrderRefundResponse, OrderResponse, OrderStatusResponse, OrderSubmerchant, OrderTermRefundRequest, OrderTerminateRequest, OrderTerminateResponse, OrderTransaction, OrganizationSettings, PaginatedResponse, PaginationParams, PaymentMethod, PaymentOption, PaymentRequest, PaymentResponse, PaymentStatus, PaymentTermDTO, PaymentTermDeleteRequest, PaymentTermRefundResponse, PaymentTermResponse, PaymentTermTerminateRequest, RefundOrderDTO, RefundRequest, RefundResponse, ShippingAddressDTO, SubOrganizationDTO, SubmerchantDTO, SubscriptionBilling, SubscriptionCancelRequest, SubscriptionCreateRequest, SubscriptionCreateResponse, SubscriptionDetail, SubscriptionGetRequest, SubscriptionOrder, SubscriptionRedirectRequest, SubscriptionRedirectResponse, SubscriptionUser, TapsilatConfig, WebhookEvent };
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD,YAAY,EACV,cAAc,EACd,aAAa,EACb,aAAa,EACb,QAAQ,EACR,cAAc,EACd,eAAe,EACf,QAAQ,EACR,OAAO,EACP,cAAc,EACd,UAAU,EACV,aAAa,EACb,aAAa,EACb,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,MAAM,EACN,KAAK,EACL,kBAAkB,EAClB,mBAAmB,EACnB,KAAK,EACL,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,QAAQ,EACR,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,cAAc,EACd,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,aAAa,EACb,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,4BAA4B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAGvD,YAAY,EACV,cAAc,EACd,aAAa,EACb,aAAa,EACb,QAAQ,EACR,cAAc,EACd,eAAe,EACf,QAAQ,EACR,OAAO,EACP,cAAc,EACd,UAAU,EACV,aAAa,EACb,aAAa,EACb,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,MAAM,EACN,KAAK,EACL,kBAAkB,EAClB,mBAAmB,EACnB,KAAK,EACL,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,QAAQ,EACR,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,cAAc,EACd,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,cAAc,EACd,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,aAAa,EACb,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,4BAA4B,EAC5B,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,EACtB,yBAAyB,EACzB,mBAAmB,EACnB,gBAAgB,EAChB,yBAAyB,EACzB,2BAA2B,EAC3B,iBAAiB,EACjB,kBAAkB,EAClB,0BAA0B,EAC1B,4BAA4B,EAC5B,oBAAoB,GACrB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,uBAAuB,EACvB,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,sBAAsB,EACtB,aAAa,EACb,eAAe,EACf,oBAAoB,EACpB,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,oBAAoB,CAAC"}
|
package/dist/index.esm.js
CHANGED
|
@@ -20,11 +20,13 @@ class TapsilatError extends Error {
|
|
|
20
20
|
*/
|
|
21
21
|
constructor(message, code, details) {
|
|
22
22
|
super(message);
|
|
23
|
-
this.name =
|
|
23
|
+
this.name = "TapsilatError";
|
|
24
24
|
this.code = code;
|
|
25
25
|
this.details = details;
|
|
26
26
|
// Maintain proper stack trace for where our error was thrown
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
28
|
if (Error.captureStackTrace) {
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
30
|
Error.captureStackTrace(this, TapsilatError);
|
|
29
31
|
}
|
|
30
32
|
}
|
|
@@ -59,7 +61,7 @@ class TapsilatNetworkError extends TapsilatError {
|
|
|
59
61
|
*/
|
|
60
62
|
constructor(message, code, statusCode, details) {
|
|
61
63
|
super(message, code, details);
|
|
62
|
-
this.name =
|
|
64
|
+
this.name = "TapsilatNetworkError";
|
|
63
65
|
this.statusCode = statusCode;
|
|
64
66
|
}
|
|
65
67
|
}
|
|
@@ -79,8 +81,8 @@ class TapsilatValidationError extends TapsilatError {
|
|
|
79
81
|
* @param details - Optional field-specific validation errors
|
|
80
82
|
*/
|
|
81
83
|
constructor(message, details) {
|
|
82
|
-
super(message,
|
|
83
|
-
this.name =
|
|
84
|
+
super(message, "VALIDATION_ERROR", details);
|
|
85
|
+
this.name = "TapsilatValidationError";
|
|
84
86
|
}
|
|
85
87
|
}
|
|
86
88
|
/**
|
|
@@ -97,9 +99,9 @@ class TapsilatAuthenticationError extends TapsilatError {
|
|
|
97
99
|
*
|
|
98
100
|
* @param message - Human-readable error message (defaults to 'Authentication failed')
|
|
99
101
|
*/
|
|
100
|
-
constructor(message =
|
|
101
|
-
super(message,
|
|
102
|
-
this.name =
|
|
102
|
+
constructor(message = "Authentication failed") {
|
|
103
|
+
super(message, "AUTHENTICATION_ERROR");
|
|
104
|
+
this.name = "TapsilatAuthenticationError";
|
|
103
105
|
}
|
|
104
106
|
}
|
|
105
107
|
/**
|
|
@@ -118,9 +120,9 @@ class TapsilatRateLimitError extends TapsilatError {
|
|
|
118
120
|
* @param message - Human-readable error message (defaults to 'Rate limit exceeded')
|
|
119
121
|
* @param retryAfter - Optional seconds to wait before retrying
|
|
120
122
|
*/
|
|
121
|
-
constructor(message =
|
|
122
|
-
super(message,
|
|
123
|
-
this.name =
|
|
123
|
+
constructor(message = "Rate limit exceeded", retryAfter) {
|
|
124
|
+
super(message, "RATE_LIMIT_ERROR");
|
|
125
|
+
this.name = "TapsilatRateLimitError";
|
|
124
126
|
this.retryAfter = retryAfter;
|
|
125
127
|
}
|
|
126
128
|
}
|
|
@@ -217,7 +219,7 @@ class InterceptorManager {
|
|
|
217
219
|
let currentResponse = response;
|
|
218
220
|
for (const interceptor of this.responseInterceptors) {
|
|
219
221
|
if (interceptor) {
|
|
220
|
-
currentResponse = await interceptor(currentResponse, request);
|
|
222
|
+
currentResponse = (await interceptor(currentResponse, request));
|
|
221
223
|
}
|
|
222
224
|
}
|
|
223
225
|
return currentResponse;
|
|
@@ -1518,6 +1520,84 @@ class TapsilatSDK {
|
|
|
1518
1520
|
return handleError(error, "order creation");
|
|
1519
1521
|
}
|
|
1520
1522
|
}
|
|
1523
|
+
// ORDER ACCOUNTING
|
|
1524
|
+
// Summary: Process accounting for an order
|
|
1525
|
+
// Description: Handles accounting operations for a specific order using its reference ID
|
|
1526
|
+
/**
|
|
1527
|
+
* Process accounting for an order
|
|
1528
|
+
*
|
|
1529
|
+
* @summary Process accounting for an order
|
|
1530
|
+
* @description Handles accounting operations for a specific order using its reference ID.
|
|
1531
|
+
*
|
|
1532
|
+
* @param {OrderAccountingRequest} request - Accounting request details
|
|
1533
|
+
* @returns {Promise<APIResponse<unknown>>} Promise resolving to the accounting response
|
|
1534
|
+
* @throws {TapsilatValidationError} When input validation fails
|
|
1535
|
+
* @throws {TapsilatError} When API returns an error response
|
|
1536
|
+
*/
|
|
1537
|
+
async orderAccounting(request) {
|
|
1538
|
+
if (!isNonEmptyString(request.order_reference_id)) {
|
|
1539
|
+
throw new TapsilatValidationError("Order reference ID is required and must be a non-empty string", { provided: request.order_reference_id });
|
|
1540
|
+
}
|
|
1541
|
+
try {
|
|
1542
|
+
const response = await this.httpClient.post("/order/accounting", request);
|
|
1543
|
+
return handleResponse(response, "Order accounting");
|
|
1544
|
+
}
|
|
1545
|
+
catch (error) {
|
|
1546
|
+
return handleError(error, "order accounting");
|
|
1547
|
+
}
|
|
1548
|
+
}
|
|
1549
|
+
// ORDER POST-AUTHORIZATION
|
|
1550
|
+
// Summary: Process post-authorization for an order
|
|
1551
|
+
// Description: Handles post-authorization operations for a specific order
|
|
1552
|
+
/**
|
|
1553
|
+
* Process post-authorization for an order
|
|
1554
|
+
*
|
|
1555
|
+
* @summary Process post-authorization for an order
|
|
1556
|
+
* @description Handles post-authorization operations for a specific order.
|
|
1557
|
+
*
|
|
1558
|
+
* @param {OrderPostAuthRequest} request - Post-authorization request details
|
|
1559
|
+
* @returns {Promise<APIResponse<unknown>>} Promise resolving to the post-auth response
|
|
1560
|
+
* @throws {TapsilatValidationError} When input validation fails
|
|
1561
|
+
* @throws {TapsilatError} When API returns an error response
|
|
1562
|
+
*/
|
|
1563
|
+
async orderPostAuth(request) {
|
|
1564
|
+
if (!isNonEmptyString(request.reference_id)) {
|
|
1565
|
+
throw new TapsilatValidationError("Reference ID is required and must be a non-empty string", { provided: request.reference_id });
|
|
1566
|
+
}
|
|
1567
|
+
if (!isPositiveNumber(request.amount)) {
|
|
1568
|
+
throw new TapsilatValidationError("Amount must be a positive number", {
|
|
1569
|
+
provided: request.amount,
|
|
1570
|
+
});
|
|
1571
|
+
}
|
|
1572
|
+
try {
|
|
1573
|
+
const response = await this.httpClient.post("/order/postauth", request);
|
|
1574
|
+
return handleResponse(response, "Order post-auth");
|
|
1575
|
+
}
|
|
1576
|
+
catch (error) {
|
|
1577
|
+
return handleError(error, "order post-auth");
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
// SYSTEM ORDER STATUSES
|
|
1581
|
+
// Summary: Retrieve system order statuses
|
|
1582
|
+
// Description: Gets a list of all possible order statuses in the system
|
|
1583
|
+
/**
|
|
1584
|
+
* Retrieve system order statuses
|
|
1585
|
+
*
|
|
1586
|
+
* @summary Retrieve system order statuses
|
|
1587
|
+
* @description Gets a list of all possible order statuses in the system.
|
|
1588
|
+
*
|
|
1589
|
+
* @returns {Promise<APIResponse<unknown>>} Promise resolving to system order statuses
|
|
1590
|
+
* @throws {TapsilatError} When API returns an error response
|
|
1591
|
+
*/
|
|
1592
|
+
async getSystemOrderStatuses() {
|
|
1593
|
+
try {
|
|
1594
|
+
const response = await this.httpClient.get("/system/order-statuses");
|
|
1595
|
+
return handleResponse(response, "Get system order statuses");
|
|
1596
|
+
}
|
|
1597
|
+
catch (error) {
|
|
1598
|
+
return handleError(error, "get system order statuses");
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1521
1601
|
// ORDER RETRIEVAL BY REFERENCE ID
|
|
1522
1602
|
// Summary: Get complete order details and information
|
|
1523
1603
|
// Description: Retrieves full order data including buyer info, amounts, and current status
|