@tapsilat/tapsilat-js 1.0.7 → 2025.11.19
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/README.md +153 -0
- package/dist/TapsilatSDK.d.ts +148 -34
- package/dist/TapsilatSDK.d.ts.map +1 -1
- package/dist/__mocks__/HttpClient.d.ts +9 -0
- package/dist/__mocks__/HttpClient.d.ts.map +1 -0
- package/dist/http/HttpClient.d.ts.map +1 -1
- package/dist/index.d.ts +356 -51
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +486 -52
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +487 -51
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +169 -16
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/validators.d.ts +39 -1
- package/dist/utils/validators.d.ts.map +1 -1
- package/package.json +16 -17
package/README.md
CHANGED
|
@@ -68,6 +68,53 @@ console.log("Order status:", status.status);
|
|
|
68
68
|
|
|
69
69
|
---
|
|
70
70
|
|
|
71
|
+
## Features
|
|
72
|
+
|
|
73
|
+
### Core Payment Operations
|
|
74
|
+
- Secure authentication with bearer tokens
|
|
75
|
+
- Complete payment lifecycle management
|
|
76
|
+
- Multi-currency support (TRY, USD, EUR, GBP)
|
|
77
|
+
- Advanced filtering and pagination
|
|
78
|
+
|
|
79
|
+
### Payment Term Management
|
|
80
|
+
- Create and manage installment plans
|
|
81
|
+
- Update payment terms (amount, dates, status)
|
|
82
|
+
- Delete payment terms
|
|
83
|
+
- Term-specific refunds and termination
|
|
84
|
+
- Complete order termination
|
|
85
|
+
|
|
86
|
+
### Validation & Utilities
|
|
87
|
+
- Turkish GSM number validation and formatting
|
|
88
|
+
- Installment validation with flexible input formats
|
|
89
|
+
- Input validation for all request parameters
|
|
90
|
+
- Webhook signature verification
|
|
91
|
+
|
|
92
|
+
### Technical Features
|
|
93
|
+
- Full TypeScript support
|
|
94
|
+
- Modern ES6+ architecture
|
|
95
|
+
- Automatic retry logic
|
|
96
|
+
- Configuration management
|
|
97
|
+
- Health monitoring
|
|
98
|
+
- Request/response interceptors
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## SDK Compatibility
|
|
103
|
+
|
|
104
|
+
This JavaScript SDK provides full feature parity with Tapsilat's Python and .NET SDKs:
|
|
105
|
+
|
|
106
|
+
| Feature Category | JavaScript | Python | .NET |
|
|
107
|
+
|-----------------|------------|--------|------|
|
|
108
|
+
| Order Management | Yes | Yes | Yes |
|
|
109
|
+
| Payment Terms | Yes | Yes | Yes |
|
|
110
|
+
| GSM Validation | Yes | Yes | Yes |
|
|
111
|
+
| Installment Validation | Yes | Yes | Yes |
|
|
112
|
+
| Webhook Verification | Yes | No | No |
|
|
113
|
+
| TypeScript Support | Yes | No | Yes |
|
|
114
|
+
| Health Monitoring | Yes | No | No |
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
71
118
|
## API Methods & Examples
|
|
72
119
|
|
|
73
120
|
### Order Management
|
|
@@ -213,6 +260,112 @@ app.post('/webhooks/tapsilat', async (req, res) => {
|
|
|
213
260
|
});
|
|
214
261
|
```
|
|
215
262
|
|
|
263
|
+
### Payment Term Management
|
|
264
|
+
|
|
265
|
+
#### Create Payment Term
|
|
266
|
+
```typescript
|
|
267
|
+
const paymentTerm = await tapsilat.createOrderTerm({
|
|
268
|
+
order_id: 'order-reference-id',
|
|
269
|
+
term_reference_id: 'term-001',
|
|
270
|
+
amount: 250.00,
|
|
271
|
+
due_date: '2024-12-31',
|
|
272
|
+
term_sequence: 1,
|
|
273
|
+
required: true,
|
|
274
|
+
status: 'pending',
|
|
275
|
+
data: 'First installment'
|
|
276
|
+
});
|
|
277
|
+
console.log('Payment term created:', paymentTerm.term_reference_id);
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
#### Update Payment Term
|
|
281
|
+
```typescript
|
|
282
|
+
const updatedTerm = await tapsilat.updateOrderTerm({
|
|
283
|
+
term_reference_id: 'term-001',
|
|
284
|
+
amount: 275.00,
|
|
285
|
+
due_date: '2025-01-15',
|
|
286
|
+
status: 'updated'
|
|
287
|
+
});
|
|
288
|
+
console.log('Payment term updated:', updatedTerm.status);
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
#### Delete Payment Term
|
|
292
|
+
```typescript
|
|
293
|
+
const deletedTerm = await tapsilat.deleteOrderTerm({
|
|
294
|
+
term_reference_id: 'term-001'
|
|
295
|
+
});
|
|
296
|
+
console.log('Payment term deleted:', deletedTerm.term_reference_id);
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
#### Refund Payment Term
|
|
300
|
+
```typescript
|
|
301
|
+
const termRefund = await tapsilat.refundOrderTerm({
|
|
302
|
+
term_id: 'term-001',
|
|
303
|
+
amount: 100.00,
|
|
304
|
+
reference_id: 'refund-ref-123'
|
|
305
|
+
});
|
|
306
|
+
console.log('Term refund processed:', termRefund.refund_id);
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
#### Terminate Payment Term
|
|
310
|
+
```typescript
|
|
311
|
+
const terminatedTerm = await tapsilat.terminateOrderTerm({
|
|
312
|
+
term_reference_id: 'term-001',
|
|
313
|
+
reason: 'Customer request'
|
|
314
|
+
});
|
|
315
|
+
console.log('Payment term terminated:', terminatedTerm.status);
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
#### Terminate Order
|
|
319
|
+
```typescript
|
|
320
|
+
const terminatedOrder = await tapsilat.terminateOrder({
|
|
321
|
+
reference_id: 'order-reference-id',
|
|
322
|
+
reason: 'Business decision'
|
|
323
|
+
});
|
|
324
|
+
console.log('Order terminated at:', terminatedOrder.terminated_at);
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
### Validation Utilities
|
|
328
|
+
|
|
329
|
+
#### GSM Number Validation
|
|
330
|
+
```typescript
|
|
331
|
+
import { validateGsmNumber } from "@tapsilat/tapsilat-js";
|
|
332
|
+
|
|
333
|
+
const gsmResult = validateGsmNumber('+90 555 123 45 67');
|
|
334
|
+
if (gsmResult.isValid) {
|
|
335
|
+
console.log('Cleaned number:', gsmResult.cleanedNumber); // +90000000000
|
|
336
|
+
} else {
|
|
337
|
+
console.error('Invalid GSM:', gsmResult.error);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
// Supports multiple formats
|
|
341
|
+
validateGsmNumber('0999 123 45 67'); // National format
|
|
342
|
+
validateGsmNumber('999 123 45 67'); // Local format
|
|
343
|
+
validateGsmNumber('9991234567'); // No formatting
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
#### Installments Validation
|
|
347
|
+
```typescript
|
|
348
|
+
import { validateInstallments } from "@tapsilat/tapsilat-js";
|
|
349
|
+
|
|
350
|
+
// Single installment
|
|
351
|
+
const single = validateInstallments(3);
|
|
352
|
+
console.log(single.validatedInstallments); // [3]
|
|
353
|
+
|
|
354
|
+
// Multiple installments
|
|
355
|
+
const multiple = validateInstallments('1,3,6,12');
|
|
356
|
+
console.log(multiple.validatedInstallments); // [1, 3, 6, 12]
|
|
357
|
+
|
|
358
|
+
// Array format
|
|
359
|
+
const array = validateInstallments([6, 3, 12, 1]);
|
|
360
|
+
console.log(array.validatedInstallments); // [1, 3, 6, 12] (sorted, unique)
|
|
361
|
+
|
|
362
|
+
// Error handling
|
|
363
|
+
const invalid = validateInstallments('abc');
|
|
364
|
+
if (!invalid.isValid) {
|
|
365
|
+
console.error('Validation error:', invalid.error);
|
|
366
|
+
}
|
|
367
|
+
```
|
|
368
|
+
|
|
216
369
|
### Health Monitoring
|
|
217
370
|
|
|
218
371
|
#### API Health Check
|
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 } from "./types/index";
|
|
2
|
+
import { TapsilatConfig, PaginatedResponse, Order, OrderRefundRequest, OrderRefundResponse, OrderStatusResponse, OrderPaymentDetail, OrderCreateRequest, OrderCreateResponse, OrderPaymentTermCreateDTO, OrderPaymentTermUpdateDTO, OrderTermRefundRequest, PaymentTermResponse, PaymentTermDeleteRequest, PaymentTermRefundResponse, PaymentTermTerminateRequest, OrderTerminateRequest, OrderTerminateResponse } from "./types/index";
|
|
3
3
|
/**
|
|
4
4
|
* Main SDK class for Tapsilat payment operations
|
|
5
5
|
*
|
|
@@ -34,7 +34,7 @@ export declare class TapsilatSDK {
|
|
|
34
34
|
*
|
|
35
35
|
* @param {TapsilatConfig} config - SDK configuration options
|
|
36
36
|
* @param {string} config.bearerToken - API authentication token (required)
|
|
37
|
-
* @param {string} [config.baseURL='https://
|
|
37
|
+
* @param {string} [config.baseURL='https://panel.tapsilat.dev/v1'] - API base URL
|
|
38
38
|
* @param {number} [config.timeout=30000] - Request timeout in milliseconds
|
|
39
39
|
* @param {number} [config.maxRetries=3] - Maximum number of retry attempts
|
|
40
40
|
* @param {number} [config.retryDelay=1000] - Delay between retries in milliseconds
|
|
@@ -48,57 +48,53 @@ export declare class TapsilatSDK {
|
|
|
48
48
|
/**
|
|
49
49
|
* Creates a new order and returns a checkout URL
|
|
50
50
|
*
|
|
51
|
-
* @summary Initiates a new payment order with
|
|
51
|
+
* @summary Initiates a new payment order with comprehensive order details
|
|
52
52
|
* @description
|
|
53
53
|
* Creates a new payment order in the Tapsilat system with the provided order details.
|
|
54
54
|
* This method performs comprehensive validation of all input parameters, creates the order
|
|
55
|
-
* on the payment platform, and returns
|
|
56
|
-
*
|
|
57
|
-
* buyer information for compliance and fraud prevention.
|
|
55
|
+
* on the payment platform, and returns order identifiers including reference_id and order_id.
|
|
56
|
+
* The method supports multiple currencies, locales, payment options, basket items,
|
|
57
|
+
* and comprehensive buyer information for compliance and fraud prevention.
|
|
58
58
|
*
|
|
59
|
-
* The returned
|
|
60
|
-
*
|
|
61
|
-
* returned reference ID through the getOrderStatus method.
|
|
59
|
+
* The returned order_id and reference_id can be used to track order status through
|
|
60
|
+
* the getOrderStatus method.
|
|
62
61
|
*
|
|
63
62
|
* @param {OrderCreateRequest} orderRequest - Complete order information
|
|
64
63
|
* @param {number} orderRequest.amount - Payment amount (must be positive, max 2 decimal places)
|
|
64
|
+
* @param {number} [orderRequest.tax_amount] - Tax amount included in total
|
|
65
65
|
* @param {Currency} orderRequest.currency - Payment currency ('TRY', 'USD', 'EUR', 'GBP')
|
|
66
66
|
* @param {Locale} orderRequest.locale - Display language ('tr' for Turkish, 'en' for English)
|
|
67
|
+
* @param {boolean} [orderRequest.three_d_force] - Force 3D Secure authentication
|
|
68
|
+
* @param {Address} [orderRequest.shipping_address] - Shipping address for delivery
|
|
69
|
+
* @param {BasketItem[]} orderRequest.basket_items - Array of items in the order
|
|
70
|
+
* @param {BillingAddress} orderRequest.billing_address - Billing address with tax information
|
|
67
71
|
* @param {Buyer} orderRequest.buyer - Customer information for payment processing
|
|
68
|
-
* @param {string} orderRequest.
|
|
69
|
-
* @param {
|
|
70
|
-
* @param {
|
|
71
|
-
* @param {
|
|
72
|
-
* @param {string} [orderRequest.
|
|
73
|
-
* @param {
|
|
74
|
-
* @param {
|
|
75
|
-
* @param {string} [orderRequest.description] - Order description for customer reference
|
|
76
|
-
* @param {string} [orderRequest.callbackUrl] - URL to redirect after payment completion
|
|
77
|
-
* @param {string} [orderRequest.conversationId] - Custom tracking ID for your system
|
|
72
|
+
* @param {string} [orderRequest.conversation_id] - Custom tracking ID for your system
|
|
73
|
+
* @param {boolean} [orderRequest.partial_payment] - Enable partial payment
|
|
74
|
+
* @param {boolean} [orderRequest.payment_methods] - Enable payment method selection
|
|
75
|
+
* @param {PaymentOption[]} [orderRequest.payment_options] - Available payment options
|
|
76
|
+
* @param {string} [orderRequest.payment_success_url] - URL to redirect after successful payment
|
|
77
|
+
* @param {string} [orderRequest.payment_failure_url] - URL to redirect after failed payment
|
|
78
|
+
* @param {number[]} [orderRequest.enabled_installments] - Allowed installment counts
|
|
78
79
|
* @param {Record<string, unknown>} [orderRequest.metadata] - Additional custom data
|
|
79
80
|
*
|
|
80
81
|
* @returns {Promise<OrderCreateResponse>} Promise resolving to order creation response
|
|
81
|
-
* @returns {string} OrderCreateResponse.
|
|
82
|
-
* @returns {string} OrderCreateResponse.
|
|
83
|
-
* @returns {string} OrderCreateResponse.
|
|
84
|
-
* @returns {string} OrderCreateResponse.
|
|
85
|
-
* @returns {string} [OrderCreateResponse.
|
|
82
|
+
* @returns {string} OrderCreateResponse.order_id - Internal order identifier
|
|
83
|
+
* @returns {string} OrderCreateResponse.reference_id - Unique order reference for tracking
|
|
84
|
+
* @returns {string} [OrderCreateResponse.checkout_url] - Payment page URL for customer
|
|
85
|
+
* @returns {string} [OrderCreateResponse.conversation_id] - Echo of provided conversation ID
|
|
86
|
+
* @returns {string} [OrderCreateResponse.status] - Initial order status
|
|
87
|
+
* @returns {string} [OrderCreateResponse.qr_code_url] - QR code URL for mobile payments
|
|
86
88
|
*
|
|
87
89
|
* @throws {TapsilatValidationError} When input validation fails:
|
|
88
90
|
* - Amount is not positive or has more than 2 decimal places
|
|
89
91
|
* - Currency is not supported
|
|
90
92
|
* - Buyer information is incomplete or invalid
|
|
91
|
-
* -
|
|
93
|
+
* - Basket items are missing or invalid
|
|
94
|
+
* - Billing address is missing
|
|
92
95
|
* - Required fields are missing
|
|
93
|
-
* @throws {TapsilatNetworkError} When network request fails
|
|
94
|
-
*
|
|
95
|
-
* - DNS resolution failure
|
|
96
|
-
* - Network connectivity issues
|
|
97
|
-
* @throws {TapsilatError} When API returns business logic errors:
|
|
98
|
-
* - Insufficient merchant balance
|
|
99
|
-
* - Currency not enabled for merchant
|
|
100
|
-
* - Buyer blocked due to fraud detection
|
|
101
|
-
* - Rate limiting exceeded
|
|
96
|
+
* @throws {TapsilatNetworkError} When network request fails
|
|
97
|
+
* @throws {TapsilatError} When API returns business logic errors
|
|
102
98
|
*/
|
|
103
99
|
createOrder(orderRequest: OrderCreateRequest): Promise<OrderCreateResponse>;
|
|
104
100
|
/**
|
|
@@ -318,5 +314,123 @@ export declare class TapsilatSDK {
|
|
|
318
314
|
* @returns ConfigManager instance for configuration operations
|
|
319
315
|
*/
|
|
320
316
|
getConfigManager(): ConfigManager;
|
|
317
|
+
/**
|
|
318
|
+
* Creates a new payment term for an existing order
|
|
319
|
+
*
|
|
320
|
+
* @summary Create payment term for installment or partial payment
|
|
321
|
+
* @description
|
|
322
|
+
* Creates a new payment term for an existing order, enabling installment payments
|
|
323
|
+
* or partial payment collection. Payment terms allow splitting order amounts
|
|
324
|
+
* across multiple payments with specific due dates and requirements.
|
|
325
|
+
*
|
|
326
|
+
* @param {OrderPaymentTermCreateDTO} termData - Payment term creation data
|
|
327
|
+
* @param {string} termData.order_id - Reference ID of the existing order
|
|
328
|
+
* @param {string} termData.term_reference_id - Unique identifier for this payment term
|
|
329
|
+
* @param {number} termData.amount - Amount for this payment term
|
|
330
|
+
* @param {string} termData.due_date - Due date for this payment (ISO 8601 format)
|
|
331
|
+
* @param {number} termData.term_sequence - Sequence number for this term
|
|
332
|
+
* @param {boolean} termData.required - Whether this payment term is required
|
|
333
|
+
* @param {string} termData.status - Initial status of the payment term
|
|
334
|
+
* @param {string} [termData.data] - Additional metadata for the term
|
|
335
|
+
* @param {string} [termData.paid_date] - Date when payment was completed
|
|
336
|
+
*
|
|
337
|
+
* @returns {Promise<PaymentTermResponse>} Promise resolving to created payment term details
|
|
338
|
+
* @throws {TapsilatValidationError} When input validation fails
|
|
339
|
+
* @throws {TapsilatError} When API returns an error response
|
|
340
|
+
*/
|
|
341
|
+
createOrderTerm(termData: OrderPaymentTermCreateDTO): Promise<PaymentTermResponse>;
|
|
342
|
+
/**
|
|
343
|
+
* Updates an existing payment term
|
|
344
|
+
*
|
|
345
|
+
* @summary Update payment term details
|
|
346
|
+
* @description
|
|
347
|
+
* Updates an existing payment term with new information such as amount,
|
|
348
|
+
* due date, status, or other metadata. This allows for flexible management
|
|
349
|
+
* of installment payments and payment schedules.
|
|
350
|
+
*
|
|
351
|
+
* @param {OrderPaymentTermUpdateDTO} updateData - Payment term update data
|
|
352
|
+
* @param {string} updateData.term_reference_id - Reference ID of the term to update
|
|
353
|
+
* @param {number} [updateData.amount] - New amount for the payment term
|
|
354
|
+
* @param {string} [updateData.due_date] - New due date (ISO 8601 format)
|
|
355
|
+
* @param {string} [updateData.paid_date] - Date when payment was completed
|
|
356
|
+
* @param {boolean} [updateData.required] - Whether this payment term is required
|
|
357
|
+
* @param {string} [updateData.status] - New status of the payment term
|
|
358
|
+
* @param {number} [updateData.term_sequence] - New sequence number
|
|
359
|
+
*
|
|
360
|
+
* @returns {Promise<PaymentTermResponse>} Promise resolving to updated payment term details
|
|
361
|
+
* @throws {TapsilatValidationError} When input validation fails
|
|
362
|
+
* @throws {TapsilatError} When API returns an error response
|
|
363
|
+
*/
|
|
364
|
+
updateOrderTerm(updateData: OrderPaymentTermUpdateDTO): Promise<PaymentTermResponse>;
|
|
365
|
+
/**
|
|
366
|
+
* Deletes a payment term
|
|
367
|
+
*
|
|
368
|
+
* @summary Delete payment term
|
|
369
|
+
* @description
|
|
370
|
+
* Permanently deletes a payment term from an order. This action cannot be undone.
|
|
371
|
+
* Only unpaid payment terms can be deleted.
|
|
372
|
+
*
|
|
373
|
+
* @param {PaymentTermDeleteRequest} deleteData - Payment term deletion data
|
|
374
|
+
* @param {string} deleteData.term_reference_id - Reference ID of the term to delete
|
|
375
|
+
*
|
|
376
|
+
* @returns {Promise<PaymentTermResponse>} Promise resolving to deleted payment term details
|
|
377
|
+
* @throws {TapsilatValidationError} When input validation fails
|
|
378
|
+
* @throws {TapsilatError} When API returns an error response
|
|
379
|
+
*/
|
|
380
|
+
deleteOrderTerm(deleteData: PaymentTermDeleteRequest): Promise<PaymentTermResponse>;
|
|
381
|
+
/**
|
|
382
|
+
* Refunds a specific payment term
|
|
383
|
+
*
|
|
384
|
+
* @summary Refund payment term
|
|
385
|
+
* @description
|
|
386
|
+
* Processes a refund for a specific payment term. This allows partial refunds
|
|
387
|
+
* at the payment term level rather than the entire order level.
|
|
388
|
+
*
|
|
389
|
+
* @param {OrderTermRefundRequest} refundData - Payment term refund data
|
|
390
|
+
* @param {string} refundData.term_id - ID of the term to refund
|
|
391
|
+
* @param {number} refundData.amount - Amount to refund
|
|
392
|
+
* @param {string} [refundData.reference_id] - Optional reference ID
|
|
393
|
+
* @param {string} [refundData.term_payment_id] - Optional term payment ID
|
|
394
|
+
*
|
|
395
|
+
* @returns {Promise<PaymentTermRefundResponse>} Promise resolving to refund details
|
|
396
|
+
* @throws {TapsilatValidationError} When input validation fails
|
|
397
|
+
* @throws {TapsilatError} When API returns an error response
|
|
398
|
+
*/
|
|
399
|
+
refundOrderTerm(refundData: OrderTermRefundRequest): Promise<PaymentTermRefundResponse>;
|
|
400
|
+
/**
|
|
401
|
+
* Terminates a payment term
|
|
402
|
+
*
|
|
403
|
+
* @summary Terminate payment term
|
|
404
|
+
* @description
|
|
405
|
+
* Terminates an active payment term, preventing further payments.
|
|
406
|
+
* This is useful for canceling installment plans or payment schedules.
|
|
407
|
+
*
|
|
408
|
+
* @param {PaymentTermTerminateRequest} terminateData - Payment term termination data
|
|
409
|
+
* @param {string} terminateData.term_reference_id - Reference ID of the term to terminate
|
|
410
|
+
* @param {string} [terminateData.reason] - Optional reason for termination
|
|
411
|
+
*
|
|
412
|
+
* @returns {Promise<PaymentTermResponse>} Promise resolving to terminated term details
|
|
413
|
+
* @throws {TapsilatValidationError} When input validation fails
|
|
414
|
+
* @throws {TapsilatError} When API returns an error response
|
|
415
|
+
*/
|
|
416
|
+
terminateOrderTerm(terminateData: PaymentTermTerminateRequest): Promise<PaymentTermResponse>;
|
|
417
|
+
/**
|
|
418
|
+
* Terminates an entire order
|
|
419
|
+
*
|
|
420
|
+
* @summary Terminate order
|
|
421
|
+
* @description
|
|
422
|
+
* Terminates an entire order, canceling all associated payment terms and
|
|
423
|
+
* preventing any further payment processing. This is a more comprehensive
|
|
424
|
+
* action than canceling individual payment terms.
|
|
425
|
+
*
|
|
426
|
+
* @param {OrderTerminateRequest} terminateData - Order termination data
|
|
427
|
+
* @param {string} terminateData.reference_id - Reference ID of the order to terminate
|
|
428
|
+
* @param {string} [terminateData.reason] - Optional reason for termination
|
|
429
|
+
*
|
|
430
|
+
* @returns {Promise<OrderTerminateResponse>} Promise resolving to terminated order details
|
|
431
|
+
* @throws {TapsilatValidationError} When input validation fails
|
|
432
|
+
* @throws {TapsilatError} When API returns an error response
|
|
433
|
+
*/
|
|
434
|
+
terminateOrder(terminateData: OrderTerminateRequest): Promise<OrderTerminateResponse>;
|
|
321
435
|
}
|
|
322
436
|
//# 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,
|
|
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,EACvB,MAAM,eAAe,CAAC;AAKvB;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAA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CAAC,sBAAsB,CAAC;CAqBnC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare class HttpClient {
|
|
2
|
+
post: jest.Mock<any, any, any>;
|
|
3
|
+
get: jest.Mock<any, any, any>;
|
|
4
|
+
put: jest.Mock<any, any, any>;
|
|
5
|
+
delete: jest.Mock<any, any, any>;
|
|
6
|
+
patch: jest.Mock<any, any, any>;
|
|
7
|
+
constructor();
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=HttpClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HttpClient.d.ts","sourceRoot":"","sources":["../../src/__mocks__/HttpClient.ts"],"names":[],"mappings":"AAAA,qBAAa,UAAU;IACd,IAAI,2BAAa;IACjB,GAAG,2BAAa;IAChB,GAAG,2BAAa;IAChB,MAAM,2BAAa;IACnB,KAAK,2BAAa;;CAS1B"}
|
|
@@ -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,GAAG,MAAM,CAAC;IACzE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC9B;AAED;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;AAErE;;;;;G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