@tapsilat/tapsilat-js 2026.6.17 → 2026.7.7
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 +45 -0
- package/dist/TapsilatSDK.d.ts +139 -1
- package/dist/TapsilatSDK.d.ts.map +1 -1
- package/dist/http/HttpClient.d.ts +1 -0
- package/dist/http/HttpClient.d.ts.map +1 -1
- package/dist/index.cjs +304 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +201 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +304 -6
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +62 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -326,6 +326,51 @@ const terminatedOrder = await tapsilat.terminateOrder({
|
|
|
326
326
|
console.log('Order terminated at:', terminatedOrder.terminated_at);
|
|
327
327
|
```
|
|
328
328
|
|
|
329
|
+
### Submerchant Management
|
|
330
|
+
|
|
331
|
+
#### Create Submerchant
|
|
332
|
+
```typescript
|
|
333
|
+
const submerchant = await tapsilat.submerchant.create({
|
|
334
|
+
name: "Test Submerchant",
|
|
335
|
+
email: "submerchant@example.com",
|
|
336
|
+
address: "Istanbul, Turkey",
|
|
337
|
+
city: "Istanbul",
|
|
338
|
+
country: "Turkey",
|
|
339
|
+
gsm_number: "5555555555",
|
|
340
|
+
iban: "TR123456789012345678901234",
|
|
341
|
+
identity_number: "11111111111",
|
|
342
|
+
contact_name: "Test",
|
|
343
|
+
contact_surname: "Sub",
|
|
344
|
+
sub_merchant_type: "PERSONAL",
|
|
345
|
+
tax_office: "Test Office",
|
|
346
|
+
zip_code: "34000"
|
|
347
|
+
});
|
|
348
|
+
console.log('Submerchant created:', submerchant.id);
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
#### List Submerchants
|
|
352
|
+
```typescript
|
|
353
|
+
const submerchants = await tapsilat.submerchant.list(1, 10);
|
|
354
|
+
submerchants.data.forEach(sub => {
|
|
355
|
+
console.log(`Submerchant: ${sub.name}`);
|
|
356
|
+
});
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
### Document Downloads
|
|
360
|
+
|
|
361
|
+
#### Download Order PDF
|
|
362
|
+
```typescript
|
|
363
|
+
const pdfBlob = await tapsilat.orders.getPdf('order-reference-id');
|
|
364
|
+
// For browsers, you can create an object URL to download the Blob:
|
|
365
|
+
// const url = URL.createObjectURL(pdfBlob);
|
|
366
|
+
// window.open(url);
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
#### Download Order Excel
|
|
370
|
+
```typescript
|
|
371
|
+
const excelBlob = await tapsilat.orders.getExcel('order-reference-id');
|
|
372
|
+
```
|
|
373
|
+
|
|
329
374
|
### Subscription Management
|
|
330
375
|
|
|
331
376
|
#### Create Subscription
|
package/dist/TapsilatSDK.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConfigManager } from "./config/ConfigManager";
|
|
2
|
-
import { TapsilatConfig, GetOrderResponse, GetOrdersRequest, GetOrdersResponse, CancelOrderResponse, OrderRefundRequest, OrderRefundResponse, OrderStatusResponse, GetSystemOrderStatusesResponse, GetOrderPaymentDetailsResponse, OrderPaymentDetailDTO, OrderCreateRequest, OrderCreateResponse, OrderPaymentTermCreateDTO, OrderPaymentTermUpdateDTO, OrderTermRefundRequest, PaymentTermResponse, GetOrderTermResponse, PaymentTermDeleteRequest, PaymentTermRefundResponse, PaymentTermTerminateRequest, OrderTerminateRequest, OrderTerminateResponse, OrderPaymentTermActionResponse, SubscriptionGetRequest, SubscriptionCancelRequest, SubscriptionCreateRequest, SubscriptionRedirectRequest, ListSubscriptionsRequest, SubscriptionDetail, ListSubscriptionsResponse, SubscriptionCreateResponse, SubscriptionRedirectResponse, OrganizationSettings, GetOrderTransactionsResponse, GetOrderSubmerchantsRequest, GetOrderSubmerchantsResponse, OrderAccountingRequest, OrderAccountingResponse, OrderPostAuthRequest, OrderPostAuthResponse, AddBasketItemRequest, AddBasketItemResponse, RemoveBasketItemRequest, RemoveBasketItemResponse, UpdateBasketItemRequest, UpdateBasketItemResponse, OrderManualCallbackResponse, OrderRelatedUpdateResponse, CallbackURLDTO, OrgCreateBusinessRequest, OrgCreateBusinessResponse, OrganizationResponse, GetOrganizationCurrenciesResponse, GetUserLimitRequest, GetUserLimitResponse, SetLimitUserRequest, SetLimitUserResponse, GetOrganizationLimitsResponse, GetMetaResponse, GetOrganizationScopesResponse, GetSuborganizationsRequest, GetSubOrganizationListResponse, GetVposRequest, GetVposResponse, OrgCreateUserRequest, OrgCreateUserResponse, OrgUserVerifyRequest, OrgUserVerifyResponse, OrgUserMobileVerifyRequest, OrgUserMobileVerifyResponse, CancelSubscriptionResponse, OrderPaymentOptionsUpdateDTO, SplitOrderItemPaymentDTO, OrderCallbackResponse, OrderVposQueryResponse, GetOrganizationCurrencyPresetsResponse, GetSuborganizationDetailsResponse, GetSuborganizationSubmerchantsResponse, GetSystemBasketItemTypesResponse, GetSystemErrorCodesResponse, GetSystemPaymentTermStatusesResponse, GetSystemProductTypesResponse, GetSystemShortcutTypesResponse, GetSystemTransactionPaymentTypesResponse, GetSystemTransactionPurposesResponse, GetSystemTransactionStatusesResponse } from "./types/index";
|
|
2
|
+
import { TapsilatConfig, GetOrderResponse, GetOrdersRequest, GetOrdersResponse, CancelOrderResponse, OrderRefundRequest, OrderRefundResponse, OrderStatusResponse, GetSystemOrderStatusesResponse, GetOrderPaymentDetailsResponse, OrderPaymentDetailDTO, OrderCreateRequest, OrderCreateResponse, OrderPaymentTermCreateDTO, OrderPaymentTermUpdateDTO, OrderTermRefundRequest, PaymentTermResponse, GetOrderTermResponse, PaymentTermDeleteRequest, PaymentTermRefundResponse, PaymentTermTerminateRequest, OrderTerminateRequest, OrderTerminateResponse, OrderPaymentTermActionResponse, SubscriptionGetRequest, SubscriptionCancelRequest, SubscriptionCreateRequest, SubscriptionRedirectRequest, ListSubscriptionsRequest, SubscriptionDetail, ListSubscriptionsResponse, SubscriptionCreateResponse, SubscriptionRedirectResponse, OrganizationSettings, GetOrderTransactionsResponse, GetOrderSubmerchantsRequest, GetOrderSubmerchantsResponse, OrderAccountingRequest, OrderAccountingResponse, OrderPostAuthRequest, OrderPostAuthResponse, AddBasketItemRequest, AddBasketItemResponse, RemoveBasketItemRequest, RemoveBasketItemResponse, UpdateBasketItemRequest, UpdateBasketItemResponse, OrderManualCallbackResponse, OrderRelatedUpdateResponse, CallbackURLDTO, OrgCreateBusinessRequest, OrgCreateBusinessResponse, OrganizationResponse, GetOrganizationCurrenciesResponse, GetUserLimitRequest, GetUserLimitResponse, SetLimitUserRequest, SetLimitUserResponse, GetOrganizationLimitsResponse, GetMetaResponse, GetOrganizationScopesResponse, GetSuborganizationsRequest, GetSubOrganizationListResponse, GetVposRequest, GetVposResponse, OrgCreateUserRequest, OrgCreateUserResponse, OrgUserVerifyRequest, OrgUserVerifyResponse, OrgUserMobileVerifyRequest, OrgUserMobileVerifyResponse, CancelSubscriptionResponse, OrderPaymentOptionsUpdateDTO, SplitOrderItemPaymentDTO, OrderCallbackResponse, OrderVposQueryResponse, GetOrganizationCurrencyPresetsResponse, GetSuborganizationDetailsResponse, GetSuborganizationSubmerchantsResponse, GetOrderPaymentsRequest, GetOrderPaymentsResponse, OrderOIPDTO, OrderOIPResponse, SubmerchantCreateDTO, SubmerchantUpdateDTO, GetSubmerchantResponse, ListSubmerchantsResponse, OrgUserTokenCreateReq, OrgUserTokenCreateResponse, RefundOrderDTO, GetSystemBasketItemTypesResponse, GetSystemErrorCodesResponse, GetSystemPaymentTermStatusesResponse, GetSystemProductTypesResponse, GetSystemShortcutTypesResponse, GetSystemTransactionPaymentTypesResponse, GetSystemTransactionPurposesResponse, GetSystemTransactionStatusesResponse } from "./types/index";
|
|
3
3
|
/**
|
|
4
4
|
* Main SDK class for Tapsilat payment operations
|
|
5
5
|
*
|
|
@@ -57,6 +57,10 @@ export declare class TapsilatSDK {
|
|
|
57
57
|
* Access to organization operations
|
|
58
58
|
*/
|
|
59
59
|
get organization(): any;
|
|
60
|
+
/**
|
|
61
|
+
* Access to submerchant operations
|
|
62
|
+
*/
|
|
63
|
+
get submerchant(): any;
|
|
60
64
|
/**
|
|
61
65
|
* Access to system operations
|
|
62
66
|
*/
|
|
@@ -626,5 +630,139 @@ export declare class TapsilatSDK {
|
|
|
626
630
|
listSubscriptions(params?: ListSubscriptionsRequest): Promise<ListSubscriptionsResponse>;
|
|
627
631
|
cancelSubscription(request: SubscriptionCancelRequest): Promise<CancelSubscriptionResponse>;
|
|
628
632
|
redirectSubscription(request: SubscriptionRedirectRequest): Promise<SubscriptionRedirectResponse>;
|
|
633
|
+
/**
|
|
634
|
+
* Gets payments for an order.
|
|
635
|
+
* Based on `get_order_payments` from the Python SDK.
|
|
636
|
+
*
|
|
637
|
+
* @summary Get order payments
|
|
638
|
+
* @description Retrieve a list of payments made for a specific order.
|
|
639
|
+
*
|
|
640
|
+
* @param request - Order payments request containing order_id
|
|
641
|
+
* @returns Promise resolving to order payments
|
|
642
|
+
*/
|
|
643
|
+
getOrderPayments(request: GetOrderPaymentsRequest): Promise<GetOrderPaymentsResponse>;
|
|
644
|
+
/**
|
|
645
|
+
* Downloads order PDF.
|
|
646
|
+
* Based on `get_order_pdf` from the Python SDK.
|
|
647
|
+
*
|
|
648
|
+
* @summary Download order PDF
|
|
649
|
+
* @description Download order as a PDF file.
|
|
650
|
+
*
|
|
651
|
+
* @param id - Order reference ID
|
|
652
|
+
* @returns Promise resolving to a Blob representing the PDF
|
|
653
|
+
*/
|
|
654
|
+
getOrderPdf(id: string): Promise<Blob>;
|
|
655
|
+
/**
|
|
656
|
+
* Downloads order Excel.
|
|
657
|
+
* Based on `get_order_excel` from the Python SDK.
|
|
658
|
+
*
|
|
659
|
+
* @summary Download order Excel
|
|
660
|
+
* @description Download order as an Excel file.
|
|
661
|
+
*
|
|
662
|
+
* @param id - Order reference ID
|
|
663
|
+
* @returns Promise resolving to a Blob representing the Excel file
|
|
664
|
+
*/
|
|
665
|
+
getOrderExcel(id: string): Promise<Blob>;
|
|
666
|
+
/**
|
|
667
|
+
* Creates an order refund request.
|
|
668
|
+
* Based on `create_order_refund_request` from the Python SDK.
|
|
669
|
+
*
|
|
670
|
+
* @summary Create order refund request
|
|
671
|
+
* @description Request a refund for an order.
|
|
672
|
+
*
|
|
673
|
+
* @param request - Order refund request payload
|
|
674
|
+
* @returns Promise resolving to refund response
|
|
675
|
+
*/
|
|
676
|
+
createOrderRefundRequest(request: RefundOrderDTO): Promise<OrderRefundResponse>;
|
|
677
|
+
/**
|
|
678
|
+
* Adds an order item payment.
|
|
679
|
+
* Based on `add_order_oip` from the Python SDK.
|
|
680
|
+
*
|
|
681
|
+
* @summary Add Order OIP
|
|
682
|
+
* @description Adds an order item payment to a specific order.
|
|
683
|
+
*
|
|
684
|
+
* @param request - Order OIP request payload containing order_id and other details
|
|
685
|
+
* @returns Promise resolving to OIP response
|
|
686
|
+
*/
|
|
687
|
+
addOrderOip(request: OrderOIPDTO): Promise<OrderOIPResponse>;
|
|
688
|
+
/**
|
|
689
|
+
* Creates a submerchant.
|
|
690
|
+
* Based on `create_submerchant` from the Python SDK.
|
|
691
|
+
*
|
|
692
|
+
* @summary Create submerchant
|
|
693
|
+
* @description Creates a new submerchant.
|
|
694
|
+
*
|
|
695
|
+
* @param request - Submerchant creation payload
|
|
696
|
+
* @returns Promise resolving to the created submerchant details
|
|
697
|
+
*/
|
|
698
|
+
createSubmerchant(request: SubmerchantCreateDTO): Promise<GetSubmerchantResponse>;
|
|
699
|
+
/**
|
|
700
|
+
* Gets a submerchant.
|
|
701
|
+
* Based on `get_submerchant` from the Python SDK.
|
|
702
|
+
*
|
|
703
|
+
* @summary Get submerchant
|
|
704
|
+
* @description Retrieves submerchant details.
|
|
705
|
+
*
|
|
706
|
+
* @param id - Submerchant ID
|
|
707
|
+
* @returns Promise resolving to submerchant details
|
|
708
|
+
*/
|
|
709
|
+
getSubmerchant(id: string): Promise<GetSubmerchantResponse>;
|
|
710
|
+
/**
|
|
711
|
+
* Gets suborganization by submerchant.
|
|
712
|
+
* Based on `get_suborganization_by_submerchant` from the Python SDK.
|
|
713
|
+
*
|
|
714
|
+
* @summary Get suborganization by submerchant
|
|
715
|
+
* @description Retrieves the suborganization details associated with a submerchant.
|
|
716
|
+
*
|
|
717
|
+
* @param id - Submerchant ID
|
|
718
|
+
* @returns Promise resolving to suborganization details
|
|
719
|
+
*/
|
|
720
|
+
getSuborganizationBySubmerchant(id: string): Promise<unknown>;
|
|
721
|
+
/**
|
|
722
|
+
* Updates a submerchant.
|
|
723
|
+
* Based on `update_submerchant` from the Python SDK.
|
|
724
|
+
*
|
|
725
|
+
* @summary Update submerchant
|
|
726
|
+
* @description Updates submerchant details.
|
|
727
|
+
*
|
|
728
|
+
* @param id - Submerchant ID
|
|
729
|
+
* @param request - Update payload
|
|
730
|
+
* @returns Promise resolving to updated submerchant details
|
|
731
|
+
*/
|
|
732
|
+
updateSubmerchant(id: string, request: SubmerchantUpdateDTO): Promise<GetSubmerchantResponse>;
|
|
733
|
+
/**
|
|
734
|
+
* Deletes a submerchant.
|
|
735
|
+
* Based on `delete_submerchant` from the Python SDK.
|
|
736
|
+
*
|
|
737
|
+
* @summary Delete submerchant
|
|
738
|
+
* @description Deletes a submerchant.
|
|
739
|
+
*
|
|
740
|
+
* @param id - Submerchant ID
|
|
741
|
+
* @returns Promise resolving to deletion status
|
|
742
|
+
*/
|
|
743
|
+
deleteSubmerchant(id: string): Promise<unknown>;
|
|
744
|
+
/**
|
|
745
|
+
* Lists submerchants.
|
|
746
|
+
* Based on `list_submerchants` from the Python SDK.
|
|
747
|
+
*
|
|
748
|
+
* @summary List submerchants
|
|
749
|
+
* @description Retrieves a paginated list of submerchants.
|
|
750
|
+
*
|
|
751
|
+
* @param page - Page number
|
|
752
|
+
* @param perPage - Items per page
|
|
753
|
+
* @returns Promise resolving to list of submerchants
|
|
754
|
+
*/
|
|
755
|
+
listSubmerchants(page?: number, perPage?: number): Promise<ListSubmerchantsResponse>;
|
|
756
|
+
/**
|
|
757
|
+
* Creates an organization user token.
|
|
758
|
+
* Based on `create_organization_user_token` from the Python SDK.
|
|
759
|
+
*
|
|
760
|
+
* @summary Create organization user token
|
|
761
|
+
* @description Creates a token for an organization user.
|
|
762
|
+
*
|
|
763
|
+
* @param request - Token creation payload
|
|
764
|
+
* @returns Promise resolving to the created token details
|
|
765
|
+
*/
|
|
766
|
+
createOrganizationUserToken(request: OrgUserTokenCreateReq): Promise<OrgUserTokenCreateResponse>;
|
|
629
767
|
}
|
|
630
768
|
//# 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,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EAEjB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EAEnB,mBAAmB,EACnB,8BAA8B,EAC9B,8BAA8B,EAC9B,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EAEnB,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,wBAAwB,EACxB,yBAAyB,EACzB,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,8BAA8B,EAC9B,sBAAsB,EACtB,yBAAyB,EACzB,yBAAyB,EACzB,2BAA2B,EAC3B,wBAAwB,EACxB,kBAAkB,EAClB,yBAAyB,EACzB,0BAA0B,EAC1B,4BAA4B,EAC5B,oBAAoB,EACpB,4BAA4B,EAC5B,2BAA2B,EAC3B,4BAA4B,EAC5B,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,EACxB,u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H,OAAO,CAAC,oBAAoB;IAgB5B;;;;;;;;;OASG;IACH,OAAO,CAAC,QAAQ;IAoChB;;;;;;;;;OASG;YACW,mBAAmB;IAuCjC;;;;;;;OAOG;IACH,OAAO,CAAC,cAAc;IAStB;;;;;;;OAOG;IACH,OAAO,CAAC,mBAAmB;IAS3B;;;;;;;OAOG;IACH,OAAO,CAAC,KAAK;IAMb;;;;;;OAMG;IACH,eAAe,IAAI,kBAAkB;IAIrC;;;;;;;OAOG;IACH,qBAAqB,CACnB,WAAW,EAAE,UAAU,CAAC,kBAAkB,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC,GACtE,MAAM;IAIT;;;;;;;OAOG;IACH,sBAAsB,CACpB,WAAW,EAAE,UAAU,CAAC,kBAAkB,CAAC,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"}
|
package/dist/index.cjs
CHANGED
|
@@ -361,7 +361,7 @@ class HttpClient {
|
|
|
361
361
|
let lastError = null;
|
|
362
362
|
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
363
363
|
try {
|
|
364
|
-
const response = await this.makeRequest(interceptedUrl, interceptedOptions, config?.timeout);
|
|
364
|
+
const response = await this.makeRequest(interceptedUrl, interceptedOptions, config?.timeout, config?.responseType);
|
|
365
365
|
// Execute response interceptors
|
|
366
366
|
const interceptedResponse = await this.interceptors.executeResponseInterceptors(response, {
|
|
367
367
|
url: interceptedUrl,
|
|
@@ -399,7 +399,7 @@ class HttpClient {
|
|
|
399
399
|
* @param timeout - Optional timeout in milliseconds
|
|
400
400
|
* @returns Promise resolving to API response
|
|
401
401
|
*/
|
|
402
|
-
async makeRequest(url, options, timeout) {
|
|
402
|
+
async makeRequest(url, options, timeout, responseType) {
|
|
403
403
|
const controller = new AbortController();
|
|
404
404
|
const timeoutId = timeout
|
|
405
405
|
? setTimeout(() => controller.abort(), timeout)
|
|
@@ -413,7 +413,7 @@ class HttpClient {
|
|
|
413
413
|
if (timeoutId) {
|
|
414
414
|
clearTimeout(timeoutId);
|
|
415
415
|
}
|
|
416
|
-
return await this.processResponse(response);
|
|
416
|
+
return await this.processResponse(response, responseType);
|
|
417
417
|
}
|
|
418
418
|
catch (error) {
|
|
419
419
|
if (timeoutId) {
|
|
@@ -436,12 +436,21 @@ class HttpClient {
|
|
|
436
436
|
* @param response - The raw fetch Response object
|
|
437
437
|
* @returns Processed API response
|
|
438
438
|
*/
|
|
439
|
-
async processResponse(response) {
|
|
439
|
+
async processResponse(response, responseType) {
|
|
440
440
|
const contentType = response.headers.get("content-type");
|
|
441
441
|
const isJson = contentType?.includes("application/json");
|
|
442
442
|
let responseData;
|
|
443
443
|
try {
|
|
444
|
-
if (
|
|
444
|
+
if (responseType === "blob") {
|
|
445
|
+
responseData = await response.blob();
|
|
446
|
+
}
|
|
447
|
+
else if (responseType === "arraybuffer") {
|
|
448
|
+
responseData = await response.arrayBuffer();
|
|
449
|
+
}
|
|
450
|
+
else if (responseType === "text") {
|
|
451
|
+
responseData = await response.text();
|
|
452
|
+
}
|
|
453
|
+
else if (isJson || responseType === "json") {
|
|
445
454
|
responseData = await response.json();
|
|
446
455
|
}
|
|
447
456
|
else {
|
|
@@ -1460,6 +1469,11 @@ class TapsilatSDK {
|
|
|
1460
1469
|
getTerm: (termReferenceId) => this.getOrderTerm(termReferenceId),
|
|
1461
1470
|
terminateTerm: (request) => this.terminateOrderTerm(request),
|
|
1462
1471
|
terminate: (request) => this.terminateOrder(request),
|
|
1472
|
+
getPayments: (request) => this.getOrderPayments(request),
|
|
1473
|
+
getPdf: (id) => this.getOrderPdf(id),
|
|
1474
|
+
getExcel: (id) => this.getOrderExcel(id),
|
|
1475
|
+
createRefundRequest: (request) => this.createOrderRefundRequest(request),
|
|
1476
|
+
addOip: (request) => this.addOrderOip(request),
|
|
1463
1477
|
};
|
|
1464
1478
|
}
|
|
1465
1479
|
/**
|
|
@@ -1499,6 +1513,21 @@ class TapsilatSDK {
|
|
|
1499
1513
|
currencyPresets: () => this.getOrganizationCurrencyPresets(),
|
|
1500
1514
|
suborganizationDetails: (id) => this.getOrganizationSuborganizationDetails(id),
|
|
1501
1515
|
suborganizationSubmerchants: (id) => this.getOrganizationSuborganizationSubmerchants(id),
|
|
1516
|
+
createUserToken: (request) => this.createOrganizationUserToken(request),
|
|
1517
|
+
};
|
|
1518
|
+
}
|
|
1519
|
+
/**
|
|
1520
|
+
* Access to submerchant operations
|
|
1521
|
+
*/
|
|
1522
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1523
|
+
get submerchant() {
|
|
1524
|
+
return {
|
|
1525
|
+
create: (request) => this.createSubmerchant(request),
|
|
1526
|
+
get: (id) => this.getSubmerchant(id),
|
|
1527
|
+
getSuborganization: (id) => this.getSuborganizationBySubmerchant(id),
|
|
1528
|
+
update: (id, request) => this.updateSubmerchant(id, request),
|
|
1529
|
+
delete: (id) => this.deleteSubmerchant(id),
|
|
1530
|
+
list: (page, perPage) => this.listSubmerchants(page, perPage),
|
|
1502
1531
|
};
|
|
1503
1532
|
}
|
|
1504
1533
|
/**
|
|
@@ -2817,7 +2846,7 @@ class TapsilatSDK {
|
|
|
2817
2846
|
throw new TapsilatValidationError("Meta name is required and must be a non-empty string");
|
|
2818
2847
|
}
|
|
2819
2848
|
try {
|
|
2820
|
-
const organizationMetaResponse = await this.httpClient.get(`/organization/
|
|
2849
|
+
const organizationMetaResponse = await this.httpClient.get(`/organization/metas/${name}`);
|
|
2821
2850
|
return handleResponse(organizationMetaResponse, "Get organization meta");
|
|
2822
2851
|
}
|
|
2823
2852
|
catch (error) {
|
|
@@ -2972,6 +3001,275 @@ class TapsilatSDK {
|
|
|
2972
3001
|
return handleError(error, "redirect subscription");
|
|
2973
3002
|
}
|
|
2974
3003
|
}
|
|
3004
|
+
// ORDER PAYMENTS
|
|
3005
|
+
// Summary: Get payments for an order
|
|
3006
|
+
// Description: Retrieve a list of payments made for a specific order.
|
|
3007
|
+
/**
|
|
3008
|
+
* Gets payments for an order.
|
|
3009
|
+
* Based on `get_order_payments` from the Python SDK.
|
|
3010
|
+
*
|
|
3011
|
+
* @summary Get order payments
|
|
3012
|
+
* @description Retrieve a list of payments made for a specific order.
|
|
3013
|
+
*
|
|
3014
|
+
* @param request - Order payments request containing order_id
|
|
3015
|
+
* @returns Promise resolving to order payments
|
|
3016
|
+
*/
|
|
3017
|
+
async getOrderPayments(request) {
|
|
3018
|
+
try {
|
|
3019
|
+
const response = await this.httpClient.get(`/order/${request.order_id}/payment`);
|
|
3020
|
+
return handleResponse(response, "Get order payments");
|
|
3021
|
+
}
|
|
3022
|
+
catch (error) {
|
|
3023
|
+
return handleError(error, "get order payments");
|
|
3024
|
+
}
|
|
3025
|
+
}
|
|
3026
|
+
// ORDER PDF
|
|
3027
|
+
// Summary: Download order PDF
|
|
3028
|
+
// Description: Download order as a PDF file.
|
|
3029
|
+
/**
|
|
3030
|
+
* Downloads order PDF.
|
|
3031
|
+
* Based on `get_order_pdf` from the Python SDK.
|
|
3032
|
+
*
|
|
3033
|
+
* @summary Download order PDF
|
|
3034
|
+
* @description Download order as a PDF file.
|
|
3035
|
+
*
|
|
3036
|
+
* @param id - Order reference ID
|
|
3037
|
+
* @returns Promise resolving to a Blob representing the PDF
|
|
3038
|
+
*/
|
|
3039
|
+
async getOrderPdf(id) {
|
|
3040
|
+
const response = await this.httpClient.get(`/order/${id}/pdf`, { responseType: 'blob' });
|
|
3041
|
+
if (!response.success) {
|
|
3042
|
+
handleError(response.error, "get order pdf");
|
|
3043
|
+
}
|
|
3044
|
+
return response.data;
|
|
3045
|
+
}
|
|
3046
|
+
// ORDER EXCEL
|
|
3047
|
+
// Summary: Download order Excel
|
|
3048
|
+
// Description: Download order as an Excel file.
|
|
3049
|
+
/**
|
|
3050
|
+
* Downloads order Excel.
|
|
3051
|
+
* Based on `get_order_excel` from the Python SDK.
|
|
3052
|
+
*
|
|
3053
|
+
* @summary Download order Excel
|
|
3054
|
+
* @description Download order as an Excel file.
|
|
3055
|
+
*
|
|
3056
|
+
* @param id - Order reference ID
|
|
3057
|
+
* @returns Promise resolving to a Blob representing the Excel file
|
|
3058
|
+
*/
|
|
3059
|
+
async getOrderExcel(id) {
|
|
3060
|
+
const response = await this.httpClient.get(`/order/${id}/excel`, { responseType: 'blob' });
|
|
3061
|
+
if (!response.success) {
|
|
3062
|
+
handleError(response.error, "get order excel");
|
|
3063
|
+
}
|
|
3064
|
+
return response.data;
|
|
3065
|
+
}
|
|
3066
|
+
// ORDER REFUND REQUEST
|
|
3067
|
+
// Summary: Create order refund request
|
|
3068
|
+
// Description: Request a refund for an order.
|
|
3069
|
+
/**
|
|
3070
|
+
* Creates an order refund request.
|
|
3071
|
+
* Based on `create_order_refund_request` from the Python SDK.
|
|
3072
|
+
*
|
|
3073
|
+
* @summary Create order refund request
|
|
3074
|
+
* @description Request a refund for an order.
|
|
3075
|
+
*
|
|
3076
|
+
* @param request - Order refund request payload
|
|
3077
|
+
* @returns Promise resolving to refund response
|
|
3078
|
+
*/
|
|
3079
|
+
async createOrderRefundRequest(request) {
|
|
3080
|
+
try {
|
|
3081
|
+
const { reference_id, ...data } = request;
|
|
3082
|
+
const response = await this.httpClient.post(`/order/${reference_id}/refund/request`, data);
|
|
3083
|
+
return handleResponse(response, "Create order refund request");
|
|
3084
|
+
}
|
|
3085
|
+
catch (error) {
|
|
3086
|
+
return handleError(error, "create order refund request");
|
|
3087
|
+
}
|
|
3088
|
+
}
|
|
3089
|
+
// ADD ORDER OIP
|
|
3090
|
+
// Summary: Add Order Item Payment
|
|
3091
|
+
// Description: Adds an order item payment to a specific order.
|
|
3092
|
+
/**
|
|
3093
|
+
* Adds an order item payment.
|
|
3094
|
+
* Based on `add_order_oip` from the Python SDK.
|
|
3095
|
+
*
|
|
3096
|
+
* @summary Add Order OIP
|
|
3097
|
+
* @description Adds an order item payment to a specific order.
|
|
3098
|
+
*
|
|
3099
|
+
* @param request - Order OIP request payload containing order_id and other details
|
|
3100
|
+
* @returns Promise resolving to OIP response
|
|
3101
|
+
*/
|
|
3102
|
+
async addOrderOip(request) {
|
|
3103
|
+
try {
|
|
3104
|
+
const { order_id, ...data } = request;
|
|
3105
|
+
const response = await this.httpClient.post(`/order/${order_id}/oip`, data);
|
|
3106
|
+
return handleResponse(response, "Add order OIP");
|
|
3107
|
+
}
|
|
3108
|
+
catch (error) {
|
|
3109
|
+
return handleError(error, "add order oip");
|
|
3110
|
+
}
|
|
3111
|
+
}
|
|
3112
|
+
// CREATE SUBMERCHANT
|
|
3113
|
+
// Summary: Create a submerchant
|
|
3114
|
+
// Description: Creates a new submerchant in the system.
|
|
3115
|
+
/**
|
|
3116
|
+
* Creates a submerchant.
|
|
3117
|
+
* Based on `create_submerchant` from the Python SDK.
|
|
3118
|
+
*
|
|
3119
|
+
* @summary Create submerchant
|
|
3120
|
+
* @description Creates a new submerchant.
|
|
3121
|
+
*
|
|
3122
|
+
* @param request - Submerchant creation payload
|
|
3123
|
+
* @returns Promise resolving to the created submerchant details
|
|
3124
|
+
*/
|
|
3125
|
+
async createSubmerchant(request) {
|
|
3126
|
+
try {
|
|
3127
|
+
const response = await this.httpClient.post(`/submerchants`, request);
|
|
3128
|
+
return handleResponse(response, "Create submerchant");
|
|
3129
|
+
}
|
|
3130
|
+
catch (error) {
|
|
3131
|
+
return handleError(error, "create submerchant");
|
|
3132
|
+
}
|
|
3133
|
+
}
|
|
3134
|
+
// GET SUBMERCHANT
|
|
3135
|
+
// Summary: Get submerchant details
|
|
3136
|
+
// Description: Retrieves information about a specific submerchant by ID.
|
|
3137
|
+
/**
|
|
3138
|
+
* Gets a submerchant.
|
|
3139
|
+
* Based on `get_submerchant` from the Python SDK.
|
|
3140
|
+
*
|
|
3141
|
+
* @summary Get submerchant
|
|
3142
|
+
* @description Retrieves submerchant details.
|
|
3143
|
+
*
|
|
3144
|
+
* @param id - Submerchant ID
|
|
3145
|
+
* @returns Promise resolving to submerchant details
|
|
3146
|
+
*/
|
|
3147
|
+
async getSubmerchant(id) {
|
|
3148
|
+
try {
|
|
3149
|
+
const response = await this.httpClient.get(`/submerchants/${id}`);
|
|
3150
|
+
return handleResponse(response, "Get submerchant");
|
|
3151
|
+
}
|
|
3152
|
+
catch (error) {
|
|
3153
|
+
return handleError(error, "get submerchant");
|
|
3154
|
+
}
|
|
3155
|
+
}
|
|
3156
|
+
// GET SUBORGANIZATION BY SUBMERCHANT
|
|
3157
|
+
// Summary: Get suborganization by submerchant
|
|
3158
|
+
// Description: Retrieves the suborganization details associated with a submerchant.
|
|
3159
|
+
/**
|
|
3160
|
+
* Gets suborganization by submerchant.
|
|
3161
|
+
* Based on `get_suborganization_by_submerchant` from the Python SDK.
|
|
3162
|
+
*
|
|
3163
|
+
* @summary Get suborganization by submerchant
|
|
3164
|
+
* @description Retrieves the suborganization details associated with a submerchant.
|
|
3165
|
+
*
|
|
3166
|
+
* @param id - Submerchant ID
|
|
3167
|
+
* @returns Promise resolving to suborganization details
|
|
3168
|
+
*/
|
|
3169
|
+
async getSuborganizationBySubmerchant(id) {
|
|
3170
|
+
try {
|
|
3171
|
+
const response = await this.httpClient.get(`/submerchants/${id}/suborganization`);
|
|
3172
|
+
return handleResponse(response, "Get suborganization by submerchant");
|
|
3173
|
+
}
|
|
3174
|
+
catch (error) {
|
|
3175
|
+
return handleError(error, "get suborganization by submerchant");
|
|
3176
|
+
}
|
|
3177
|
+
}
|
|
3178
|
+
// UPDATE SUBMERCHANT
|
|
3179
|
+
// Summary: Update submerchant
|
|
3180
|
+
// Description: Updates an existing submerchant.
|
|
3181
|
+
/**
|
|
3182
|
+
* Updates a submerchant.
|
|
3183
|
+
* Based on `update_submerchant` from the Python SDK.
|
|
3184
|
+
*
|
|
3185
|
+
* @summary Update submerchant
|
|
3186
|
+
* @description Updates submerchant details.
|
|
3187
|
+
*
|
|
3188
|
+
* @param id - Submerchant ID
|
|
3189
|
+
* @param request - Update payload
|
|
3190
|
+
* @returns Promise resolving to updated submerchant details
|
|
3191
|
+
*/
|
|
3192
|
+
async updateSubmerchant(id, request) {
|
|
3193
|
+
try {
|
|
3194
|
+
const response = await this.httpClient.put(`/submerchants/${id}`, request);
|
|
3195
|
+
return handleResponse(response, "Update submerchant");
|
|
3196
|
+
}
|
|
3197
|
+
catch (error) {
|
|
3198
|
+
return handleError(error, "update submerchant");
|
|
3199
|
+
}
|
|
3200
|
+
}
|
|
3201
|
+
// DELETE SUBMERCHANT
|
|
3202
|
+
// Summary: Delete submerchant
|
|
3203
|
+
// Description: Deletes a submerchant from the system.
|
|
3204
|
+
/**
|
|
3205
|
+
* Deletes a submerchant.
|
|
3206
|
+
* Based on `delete_submerchant` from the Python SDK.
|
|
3207
|
+
*
|
|
3208
|
+
* @summary Delete submerchant
|
|
3209
|
+
* @description Deletes a submerchant.
|
|
3210
|
+
*
|
|
3211
|
+
* @param id - Submerchant ID
|
|
3212
|
+
* @returns Promise resolving to deletion status
|
|
3213
|
+
*/
|
|
3214
|
+
async deleteSubmerchant(id) {
|
|
3215
|
+
try {
|
|
3216
|
+
const response = await this.httpClient.delete(`/submerchants/${id}`);
|
|
3217
|
+
return handleResponse(response, "Delete submerchant");
|
|
3218
|
+
}
|
|
3219
|
+
catch (error) {
|
|
3220
|
+
return handleError(error, "delete submerchant");
|
|
3221
|
+
}
|
|
3222
|
+
}
|
|
3223
|
+
// LIST SUBMERCHANTS
|
|
3224
|
+
// Summary: List submerchants
|
|
3225
|
+
// Description: Retrieves a paginated list of submerchants.
|
|
3226
|
+
/**
|
|
3227
|
+
* Lists submerchants.
|
|
3228
|
+
* Based on `list_submerchants` from the Python SDK.
|
|
3229
|
+
*
|
|
3230
|
+
* @summary List submerchants
|
|
3231
|
+
* @description Retrieves a paginated list of submerchants.
|
|
3232
|
+
*
|
|
3233
|
+
* @param page - Page number
|
|
3234
|
+
* @param perPage - Items per page
|
|
3235
|
+
* @returns Promise resolving to list of submerchants
|
|
3236
|
+
*/
|
|
3237
|
+
async listSubmerchants(page, perPage) {
|
|
3238
|
+
try {
|
|
3239
|
+
const params = {};
|
|
3240
|
+
if (page)
|
|
3241
|
+
params.page = page;
|
|
3242
|
+
if (perPage)
|
|
3243
|
+
params.per_page = perPage;
|
|
3244
|
+
const response = await this.httpClient.get(`/submerchants`, { params });
|
|
3245
|
+
return handleResponse(response, "List submerchants");
|
|
3246
|
+
}
|
|
3247
|
+
catch (error) {
|
|
3248
|
+
return handleError(error, "list submerchants");
|
|
3249
|
+
}
|
|
3250
|
+
}
|
|
3251
|
+
// CREATE ORGANIZATION USER TOKEN
|
|
3252
|
+
// Summary: Create organization user token
|
|
3253
|
+
// Description: Creates a token for an organization user.
|
|
3254
|
+
/**
|
|
3255
|
+
* Creates an organization user token.
|
|
3256
|
+
* Based on `create_organization_user_token` from the Python SDK.
|
|
3257
|
+
*
|
|
3258
|
+
* @summary Create organization user token
|
|
3259
|
+
* @description Creates a token for an organization user.
|
|
3260
|
+
*
|
|
3261
|
+
* @param request - Token creation payload
|
|
3262
|
+
* @returns Promise resolving to the created token details
|
|
3263
|
+
*/
|
|
3264
|
+
async createOrganizationUserToken(request) {
|
|
3265
|
+
try {
|
|
3266
|
+
const response = await this.httpClient.post(`/organization/user/token`, request);
|
|
3267
|
+
return handleResponse(response, "Create organization user token");
|
|
3268
|
+
}
|
|
3269
|
+
catch (error) {
|
|
3270
|
+
return handleError(error, "create organization user token");
|
|
3271
|
+
}
|
|
3272
|
+
}
|
|
2975
3273
|
}
|
|
2976
3274
|
|
|
2977
3275
|
/**
|