@30nama/sdk 2.0.0-rc.18 → 2.0.0-rc.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.
|
@@ -6,7 +6,7 @@ import { BaseService } from '../../core/base-service';
|
|
|
6
6
|
import { ConfigManager } from '../../core/config';
|
|
7
7
|
import { AuthManager } from '../../core/auth';
|
|
8
8
|
import type { CodeResponse, ListCryptoCurrencyResponse, ListShowPricingResponse, ListUserGatewayTypeResponse, ListUserPaymentsReportResponse, PaymentInput, ShowTransactionReportsPaymentReportsGetParams, SubmitCodePaymentCodePostParams, UpgradeResponse, UpgradeSubscriptionPaymentUpgradeSubscriptionPlanTypePostParams } from '../../generated/financial/models';
|
|
9
|
-
import { APIResponse } from '
|
|
9
|
+
import { APIResponse } from '../../core/types';
|
|
10
10
|
/**
|
|
11
11
|
* Financial Service class
|
|
12
12
|
* Provides methods for financial management (public endpoints only)
|
|
@@ -18,33 +18,33 @@ export declare class FinancialService extends BaseService {
|
|
|
18
18
|
* Requires authentication using an API key
|
|
19
19
|
* @returns Promise with plans payment pricing
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
getPlans(): Promise<APIResponse<ListShowPricingResponse>>;
|
|
22
22
|
/**
|
|
23
23
|
* Get gateway types
|
|
24
24
|
* Requires authentication using an API key
|
|
25
25
|
* @returns Promise with gateway types
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
getPaymentGatewayTypes(): Promise<APIResponse<ListUserGatewayTypeResponse>>;
|
|
28
28
|
/**
|
|
29
29
|
* Get crypto currency types
|
|
30
30
|
* Requires authentication using an API key
|
|
31
31
|
* @returns Promise with crypto currency types
|
|
32
32
|
*/
|
|
33
|
-
|
|
33
|
+
getCryptoCurrencyTypes(): Promise<APIResponse<ListCryptoCurrencyResponse>>;
|
|
34
34
|
/**
|
|
35
35
|
* Submit code payment
|
|
36
36
|
* Requires authentication using an API key
|
|
37
37
|
* @param params Parameters including code
|
|
38
38
|
* @returns Promise with code payment
|
|
39
39
|
*/
|
|
40
|
-
|
|
40
|
+
submitCode(params: SubmitCodePaymentCodePostParams): Promise<APIResponse<CodeResponse>>;
|
|
41
41
|
/**
|
|
42
42
|
* Request pay payment
|
|
43
43
|
* Requires authentication using an API key
|
|
44
44
|
* @param params Parameters including payment input
|
|
45
45
|
* @returns Promise with payment response
|
|
46
46
|
*/
|
|
47
|
-
|
|
47
|
+
reqeustPay(params: PaymentInput): Promise<APIResponse<PaymentResponse>>;
|
|
48
48
|
/**
|
|
49
49
|
* Upgrade subscription
|
|
50
50
|
* Requires authentication using an API key
|
|
@@ -52,11 +52,11 @@ export declare class FinancialService extends BaseService {
|
|
|
52
52
|
* @param params Parameters including upgrade subscription
|
|
53
53
|
* @returns Promise with upgrade subscription response
|
|
54
54
|
*/
|
|
55
|
-
|
|
55
|
+
upgradeSubscription(planType: string, params: UpgradeSubscriptionPaymentUpgradeSubscriptionPlanTypePostParams): Promise<APIResponse<UpgradeResponse>>;
|
|
56
56
|
/**
|
|
57
57
|
* Show transaction reports
|
|
58
58
|
* Requires authentication using an API key
|
|
59
59
|
* @returns Promise with transaction reports
|
|
60
60
|
*/
|
|
61
|
-
|
|
61
|
+
showTransactionReports(params?: ShowTransactionReportsPaymentReportsGetParams): Promise<APIResponse<ListUserPaymentsReportResponse>>;
|
|
62
62
|
}
|
|
@@ -22,7 +22,7 @@ class FinancialService extends base_service_1.BaseService {
|
|
|
22
22
|
* Requires authentication using an API key
|
|
23
23
|
* @returns Promise with plans payment pricing
|
|
24
24
|
*/
|
|
25
|
-
async
|
|
25
|
+
async getPlans() {
|
|
26
26
|
return this.get('/payment/pricing');
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
@@ -30,7 +30,7 @@ class FinancialService extends base_service_1.BaseService {
|
|
|
30
30
|
* Requires authentication using an API key
|
|
31
31
|
* @returns Promise with gateway types
|
|
32
32
|
*/
|
|
33
|
-
async
|
|
33
|
+
async getPaymentGatewayTypes() {
|
|
34
34
|
return this.get('/payment/gateway_types');
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
@@ -38,7 +38,7 @@ class FinancialService extends base_service_1.BaseService {
|
|
|
38
38
|
* Requires authentication using an API key
|
|
39
39
|
* @returns Promise with crypto currency types
|
|
40
40
|
*/
|
|
41
|
-
async
|
|
41
|
+
async getCryptoCurrencyTypes() {
|
|
42
42
|
return this.get('/payment/crypto_currency_types');
|
|
43
43
|
}
|
|
44
44
|
// =============================================
|
|
@@ -50,7 +50,7 @@ class FinancialService extends base_service_1.BaseService {
|
|
|
50
50
|
* @param params Parameters including code
|
|
51
51
|
* @returns Promise with code payment
|
|
52
52
|
*/
|
|
53
|
-
async
|
|
53
|
+
async submitCode(params) {
|
|
54
54
|
return this.post('/payment/code', params);
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
@@ -59,7 +59,7 @@ class FinancialService extends base_service_1.BaseService {
|
|
|
59
59
|
* @param params Parameters including payment input
|
|
60
60
|
* @returns Promise with payment response
|
|
61
61
|
*/
|
|
62
|
-
async
|
|
62
|
+
async reqeustPay(params) {
|
|
63
63
|
return this.post('/payment/request_pay', params);
|
|
64
64
|
}
|
|
65
65
|
/**
|
|
@@ -69,7 +69,7 @@ class FinancialService extends base_service_1.BaseService {
|
|
|
69
69
|
* @param params Parameters including upgrade subscription
|
|
70
70
|
* @returns Promise with upgrade subscription response
|
|
71
71
|
*/
|
|
72
|
-
async
|
|
72
|
+
async upgradeSubscription(planType, params) {
|
|
73
73
|
return this.post(`/payment/upgrade_subscription/${planType}`, params);
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
@@ -77,7 +77,7 @@ class FinancialService extends base_service_1.BaseService {
|
|
|
77
77
|
* Requires authentication using an API key
|
|
78
78
|
* @returns Promise with transaction reports
|
|
79
79
|
*/
|
|
80
|
-
async
|
|
80
|
+
async showTransactionReports(params) {
|
|
81
81
|
const queryString = params ? this.buildQueryString(params) : '';
|
|
82
82
|
return this.get(`/payment/reports${queryString ? `?${queryString}` : ''}`);
|
|
83
83
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/financial/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,0DAAqD;AAiBrD;;;GAGG;AACH,MAAa,gBAAiB,SAAQ,0BAAW;IAC/C,YAAY,aAA4B,EAAE,WAAwB;QAChE,KAAK,CAAC,WAAW,EAAE,aAAa,EAAE,WAAW,CAAC,CAAA;IAChD,CAAC;IAED,gDAAgD;IAChD,uCAAuC;IACvC,gDAAgD;IAEhD;;;;OAIG;IACH,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/financial/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,0DAAqD;AAiBrD;;;GAGG;AACH,MAAa,gBAAiB,SAAQ,0BAAW;IAC/C,YAAY,aAA4B,EAAE,WAAwB;QAChE,KAAK,CAAC,WAAW,EAAE,aAAa,EAAE,WAAW,CAAC,CAAA;IAChD,CAAC;IAED,gDAAgD;IAChD,uCAAuC;IACvC,gDAAgD;IAEhD;;;;OAIG;IACH,KAAK,CAAC,QAAQ;QACZ,OAAO,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAA;IACrC,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,sBAAsB;QAC1B,OAAO,IAAI,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAA;IAC3C,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,sBAAsB;QAC1B,OAAO,IAAI,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAA;IACnD,CAAC;IAED,gDAAgD;IAChD,6CAA6C;IAC7C,gDAAgD;IAEhD;;;;;OAKG;IACH,KAAK,CAAC,UAAU,CAAC,MAAuC;QACtD,OAAO,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,MAAM,CAAC,CAAA;IAC3C,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,U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