@gofynd/fdk-client-javascript 1.0.1 → 1.0.3
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/documentation/application/CART.md +5934 -4502
- package/documentation/application/CATALOG.md +6338 -7245
- package/documentation/application/COMMON.md +95 -222
- package/documentation/application/COMMUNICATION.md +106 -186
- package/documentation/application/CONFIGURATION.md +903 -1597
- package/documentation/application/CONTENT.md +562 -1270
- package/documentation/application/FILESTORAGE.md +84 -220
- package/documentation/application/LEAD.md +314 -660
- package/documentation/application/LOGISTIC.md +229 -305
- package/documentation/application/ORDER.md +642 -1137
- package/documentation/application/PAYMENT.md +2285 -3031
- package/documentation/application/POSCART.md +6079 -4642
- package/documentation/application/REWARDS.md +94 -248
- package/documentation/application/SHARE.md +152 -250
- package/documentation/application/THEME.md +952 -1235
- package/documentation/application/USER.md +1228 -1765
- package/documentation/platform/ANALYTICS.md +207 -349
- package/documentation/platform/AUDITTRAIL.md +121 -204
- package/documentation/platform/BILLING.md +865 -1376
- package/documentation/platform/CART.md +2814 -3662
- package/documentation/platform/CATALOG.md +15266 -17619
- package/documentation/platform/COMMON.md +95 -222
- package/documentation/platform/COMMUNICATION.md +1632 -2380
- package/documentation/platform/COMPANYPROFILE.md +572 -957
- package/documentation/platform/CONFIGURATION.md +3050 -4073
- package/documentation/platform/CONTENT.md +3509 -4121
- package/documentation/platform/DISCOUNT.md +140 -236
- package/documentation/platform/FILESTORAGE.md +187 -323
- package/documentation/platform/INVENTORY.md +268 -911
- package/documentation/platform/LEAD.md +2195 -2541
- package/documentation/platform/ORDER.md +3750 -5636
- package/documentation/platform/PARTNER.md +9 -36
- package/documentation/platform/PAYMENT.md +903 -1213
- package/documentation/platform/REWARDS.md +183 -347
- package/documentation/platform/SHARE.md +120 -213
- package/documentation/platform/THEME.md +12956 -13239
- package/documentation/platform/USER.md +975 -1120
- package/documentation/platform/WEBHOOK.md +78 -184
- package/documentation/public/CONFIGURATION.md +95 -222
- package/documentation/public/INVENTORY.md +100 -282
- package/documentation/public/WEBHOOK.md +27 -133
- package/package.json +1 -1
- package/sdk/application/ApplicationConfig.js +1 -1
- package/sdk/application/Cart/CartApplicationClient.d.ts +243 -243
- package/sdk/application/Cart/CartApplicationClient.js +1058 -547
- package/sdk/application/Cart/CartApplicationModel.d.ts +64 -63
- package/sdk/application/Cart/CartApplicationModel.js +489 -886
- package/sdk/application/Cart/CartApplicationValidator.d.ts +17 -17
- package/sdk/application/Cart/CartApplicationValidator.js +98 -98
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +358 -358
- package/sdk/application/Catalog/CatalogApplicationClient.js +1545 -949
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +90 -90
- package/sdk/application/Catalog/CatalogApplicationModel.js +692 -1258
- package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +19 -19
- package/sdk/application/Catalog/CatalogApplicationValidator.js +110 -110
- package/sdk/application/Common/CommonApplicationClient.d.ts +13 -13
- package/sdk/application/Common/CommonApplicationClient.js +76 -36
- package/sdk/application/Common/CommonApplicationModel.d.ts +12 -12
- package/sdk/application/Common/CommonApplicationModel.js +83 -160
- package/sdk/application/Common/CommonApplicationValidator.d.ts +1 -1
- package/sdk/application/Common/CommonApplicationValidator.js +6 -6
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +11 -11
- package/sdk/application/Communication/CommunicationApplicationClient.js +92 -31
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +6 -6
- package/sdk/application/Communication/CommunicationApplicationModel.js +38 -83
- package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +1 -1
- package/sdk/application/Communication/CommunicationApplicationValidator.js +4 -4
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +116 -116
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +638 -312
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +85 -85
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +480 -851
- package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +8 -8
- package/sdk/application/Configuration/ConfigurationApplicationValidator.js +33 -33
- package/sdk/application/Content/ContentApplicationClient.d.ts +67 -67
- package/sdk/application/Content/ContentApplicationClient.js +581 -213
- package/sdk/application/Content/ContentApplicationModel.d.ts +76 -75
- package/sdk/application/Content/ContentApplicationModel.js +468 -875
- package/sdk/application/Content/ContentApplicationValidator.d.ts +5 -5
- package/sdk/application/Content/ContentApplicationValidator.js +24 -24
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +25 -25
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +121 -59
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +13 -13
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +86 -169
- package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +1 -1
- package/sdk/application/FileStorage/FileStorageApplicationValidator.js +7 -7
- package/sdk/application/Lead/LeadApplicationClient.d.ts +24 -24
- package/sdk/application/Lead/LeadApplicationClient.js +230 -96
- package/sdk/application/Lead/LeadApplicationModel.d.ts +35 -35
- package/sdk/application/Lead/LeadApplicationModel.js +267 -474
- package/sdk/application/Lead/LeadApplicationValidator.d.ts +2 -2
- package/sdk/application/Lead/LeadApplicationValidator.js +11 -11
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +30 -19
- package/sdk/application/Logistic/LogisticApplicationClient.js +196 -47
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +17 -14
- package/sdk/application/Logistic/LogisticApplicationModel.js +133 -201
- package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +3 -2
- package/sdk/application/Logistic/LogisticApplicationValidator.js +14 -8
- package/sdk/application/Order/OrderApplicationClient.d.ts +86 -86
- package/sdk/application/Order/OrderApplicationClient.js +448 -215
- package/sdk/application/Order/OrderApplicationModel.d.ts +50 -50
- package/sdk/application/Order/OrderApplicationModel.js +357 -661
- package/sdk/application/Order/OrderApplicationValidator.d.ts +7 -7
- package/sdk/application/Order/OrderApplicationValidator.js +28 -28
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +318 -318
- package/sdk/application/Payment/PaymentApplicationClient.js +1525 -750
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +72 -72
- package/sdk/application/Payment/PaymentApplicationModel.js +565 -1033
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +28 -28
- package/sdk/application/Payment/PaymentApplicationValidator.js +107 -107
- package/sdk/application/PosCart/PosCartApplicationClient.d.ts +254 -254
- package/sdk/application/PosCart/PosCartApplicationClient.js +1137 -606
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +61 -60
- package/sdk/application/PosCart/PosCartApplicationModel.js +477 -873
- package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +18 -18
- package/sdk/application/PosCart/PosCartApplicationValidator.js +103 -103
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +27 -27
- package/sdk/application/Rewards/RewardsApplicationClient.js +253 -113
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +14 -14
- package/sdk/application/Rewards/RewardsApplicationModel.js +96 -191
- package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +3 -3
- package/sdk/application/Rewards/RewardsApplicationValidator.js +12 -12
- package/sdk/application/Share/ShareApplicationClient.d.ts +37 -37
- package/sdk/application/Share/ShareApplicationClient.js +221 -96
- package/sdk/application/Share/ShareApplicationModel.d.ts +8 -8
- package/sdk/application/Share/ShareApplicationModel.js +63 -123
- package/sdk/application/Share/ShareApplicationValidator.d.ts +4 -4
- package/sdk/application/Share/ShareApplicationValidator.js +12 -12
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -8
- package/sdk/application/Theme/ThemeApplicationClient.js +115 -37
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +34 -34
- package/sdk/application/Theme/ThemeApplicationModel.js +190 -336
- package/sdk/application/Theme/ThemeApplicationValidator.d.ts +1 -1
- package/sdk/application/Theme/ThemeApplicationValidator.js +4 -4
- package/sdk/application/User/UserApplicationClient.d.ts +280 -280
- package/sdk/application/User/UserApplicationClient.js +1201 -543
- package/sdk/application/User/UserApplicationModel.d.ts +79 -72
- package/sdk/application/User/UserApplicationModel.js +440 -689
- package/sdk/application/User/UserApplicationValidator.d.ts +24 -24
- package/sdk/application/User/UserApplicationValidator.js +89 -89
- package/sdk/common/AxiosHelper.js +1 -1
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +55 -47
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +308 -151
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +6 -6
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +20 -20
- package/sdk/platform/Analytics/AnalyticsPlatformClient.d.ts +8 -4
- package/sdk/platform/Analytics/AnalyticsPlatformClient.js +103 -16
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +11 -11
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +95 -178
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +16 -12
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +131 -44
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +10 -10
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +50 -89
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +1 -1
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +6 -6
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +68 -56
- package/sdk/platform/Billing/BillingPlatformClient.js +416 -171
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +40 -40
- package/sdk/platform/Billing/BillingPlatformModel.js +342 -668
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +8 -8
- package/sdk/platform/Billing/BillingPlatformValidator.js +25 -25
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +176 -159
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +837 -500
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +11 -11
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +63 -63
- package/sdk/platform/Cart/CartPlatformModel.d.ts +86 -85
- package/sdk/platform/Cart/CartPlatformModel.js +677 -1211
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +582 -529
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +2642 -1533
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +40 -40
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +175 -175
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +708 -590
- package/sdk/platform/Catalog/CatalogPlatformClient.js +3103 -1362
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +293 -284
- package/sdk/platform/Catalog/CatalogPlatformModel.js +2149 -3660
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +66 -64
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +235 -216
- package/sdk/platform/Common/CommonPlatformClient.d.ts +14 -12
- package/sdk/platform/Common/CommonPlatformClient.js +80 -37
- package/sdk/platform/Common/CommonPlatformModel.d.ts +12 -12
- package/sdk/platform/Common/CommonPlatformModel.js +83 -160
- package/sdk/platform/Common/CommonPlatformValidator.d.ts +1 -1
- package/sdk/platform/Common/CommonPlatformValidator.js +6 -6
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +333 -293
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +1687 -855
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +30 -30
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +87 -87
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +2 -1
- package/sdk/platform/Communication/CommunicationPlatformClient.js +28 -4
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +67 -67
- package/sdk/platform/Communication/CommunicationPlatformModel.js +522 -974
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +70 -57
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +463 -182
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +28 -28
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +294 -557
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +7 -7
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +24 -24
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +175 -137
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +1168 -521
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +22 -21
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +69 -63
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +137 -119
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +691 -316
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +148 -146
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +854 -1508
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +9 -9
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +38 -38
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +542 -461
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +2600 -1160
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +50 -49
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +159 -152
- package/sdk/platform/Content/ContentPlatformModel.d.ts +79 -75
- package/sdk/platform/Content/ContentPlatformModel.js +486 -867
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +72 -61
- package/sdk/platform/Discount/DiscountPlatformClient.js +424 -198
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +7 -7
- package/sdk/platform/Discount/DiscountPlatformModel.js +60 -121
- package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +6 -6
- package/sdk/platform/Discount/DiscountPlatformValidator.js +29 -29
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +26 -22
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +145 -59
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +8 -8
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +58 -52
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +240 -114
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +13 -13
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +86 -169
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +3 -3
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +11 -11
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +76 -63
- package/sdk/platform/Inventory/InventoryPlatformClient.js +461 -197
- package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +30 -30
- package/sdk/platform/Inventory/InventoryPlatformModel.js +497 -964
- package/sdk/platform/Inventory/InventoryPlatformValidator.d.ts +7 -7
- package/sdk/platform/Inventory/InventoryPlatformValidator.js +28 -28
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +84 -71
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +441 -182
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +7 -7
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +28 -28
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +86 -75
- package/sdk/platform/Lead/LeadPlatformClient.js +434 -212
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +35 -35
- package/sdk/platform/Lead/LeadPlatformModel.js +267 -474
- package/sdk/platform/Lead/LeadPlatformValidator.d.ts +6 -6
- package/sdk/platform/Lead/LeadPlatformValidator.js +24 -24
- package/sdk/platform/OAuthClient.js +8 -8
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +14 -11
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +113 -49
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +6 -6
- package/sdk/platform/Order/OrderPlatformClient.d.ts +367 -315
- package/sdk/platform/Order/OrderPlatformClient.js +1775 -893
- package/sdk/platform/Order/OrderPlatformModel.d.ts +198 -192
- package/sdk/platform/Order/OrderPlatformModel.js +1591 -2822
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +32 -32
- package/sdk/platform/Order/OrderPlatformValidator.js +160 -155
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -2
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +52 -8
- package/sdk/platform/Partner/PartnerPlatformModel.js +6 -22
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +65 -54
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +395 -164
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +6 -6
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +23 -23
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +55 -45
- package/sdk/platform/Payment/PaymentPlatformClient.js +362 -147
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +27 -27
- package/sdk/platform/Payment/PaymentPlatformModel.js +220 -408
- package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +4 -4
- package/sdk/platform/Payment/PaymentPlatformValidator.js +21 -21
- package/sdk/platform/PlatformApplicationClient.d.ts +1496 -10153
- package/sdk/platform/PlatformApplicationClient.js +1584 -13691
- package/sdk/platform/PlatformClient.d.ts +7918 -7666
- package/sdk/platform/PlatformClient.js +8701 -9926
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +91 -78
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +507 -253
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +8 -8
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +34 -34
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +15 -15
- package/sdk/platform/Rewards/RewardsPlatformModel.js +92 -194
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +16 -12
- package/sdk/platform/Share/SharePlatformApplicationClient.js +130 -52
- package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/Share/SharePlatformApplicationValidator.js +6 -6
- package/sdk/platform/Share/SharePlatformModel.d.ts +8 -8
- package/sdk/platform/Share/SharePlatformModel.js +60 -118
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +148 -124
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +770 -295
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +15 -15
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +44 -44
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +34 -34
- package/sdk/platform/Theme/ThemePlatformModel.js +190 -336
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +146 -67
- package/sdk/platform/User/UserPlatformApplicationClient.js +742 -155
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +12 -7
- package/sdk/platform/User/UserPlatformApplicationValidator.js +61 -23
- package/sdk/platform/User/UserPlatformModel.d.ts +79 -72
- package/sdk/platform/User/UserPlatformModel.js +440 -689
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +35 -29
- package/sdk/platform/Webhook/WebhookPlatformClient.js +218 -91
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +7 -7
- package/sdk/platform/Webhook/WebhookPlatformModel.js +68 -136
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +3 -3
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +14 -14
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +13 -13
- package/sdk/public/Configuration/ConfigurationPublicClient.js +81 -38
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +12 -12
- package/sdk/public/Configuration/ConfigurationPublicModel.js +85 -162
- package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +1 -1
- package/sdk/public/Configuration/ConfigurationPublicValidator.js +6 -6
- package/sdk/public/Inventory/InventoryPublicClient.d.ts +34 -34
- package/sdk/public/Inventory/InventoryPublicClient.js +228 -105
- package/sdk/public/Inventory/InventoryPublicModel.d.ts +10 -10
- package/sdk/public/Inventory/InventoryPublicModel.js +119 -245
- package/sdk/public/Inventory/InventoryPublicValidator.d.ts +3 -3
- package/sdk/public/Inventory/InventoryPublicValidator.js +15 -15
- package/sdk/public/Webhook/WebhookPublicClient.js +51 -10
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +7 -7
- package/sdk/public/Webhook/WebhookPublicModel.js +68 -136
- package/tests/application/catalog.spec.js +7 -0
|
@@ -2,6 +2,9 @@ const Paginator = require("../../common/Paginator");
|
|
|
2
2
|
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
3
3
|
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
4
4
|
const PaymentValidator = require("./PaymentPlatformValidator");
|
|
5
|
+
const PaymentModel = require("./PaymentPlatformModel");
|
|
6
|
+
const { Logger } = require("./../../common/Logger");
|
|
7
|
+
|
|
5
8
|
class Payment {
|
|
6
9
|
constructor(config) {
|
|
7
10
|
this.config = config;
|
|
@@ -9,14 +12,17 @@ class Payment {
|
|
|
9
12
|
|
|
10
13
|
/**
|
|
11
14
|
* @param {Object} arg - Arg object.
|
|
12
|
-
* @param {string}
|
|
13
|
-
* @
|
|
14
|
-
* @
|
|
15
|
+
* @param {string} arg.uniqueTransferNo - Unique transfer id
|
|
16
|
+
* @param {UpdatePayoutRequest} arg.body
|
|
17
|
+
* @returns {Promise<UpdatePayoutResponse>} - Success response
|
|
18
|
+
* @summary: Partial Update Payout
|
|
19
|
+
* @description: Partial Update Payout
|
|
15
20
|
*/
|
|
16
|
-
|
|
17
|
-
const { error } = PaymentValidator.
|
|
21
|
+
async activateAndDectivatePayout({ uniqueTransferNo, body } = {}) {
|
|
22
|
+
const { error } = PaymentValidator.activateAndDectivatePayout().validate(
|
|
18
23
|
{
|
|
19
|
-
|
|
24
|
+
uniqueTransferNo,
|
|
25
|
+
body,
|
|
20
26
|
},
|
|
21
27
|
{ abortEarly: false, allowUnknown: true }
|
|
22
28
|
);
|
|
@@ -25,42 +31,66 @@ class Payment {
|
|
|
25
31
|
}
|
|
26
32
|
|
|
27
33
|
// Showing warrnings if extra unknown parameters are found
|
|
28
|
-
const {
|
|
34
|
+
const {
|
|
35
|
+
error: warrning,
|
|
36
|
+
} = PaymentValidator.activateAndDectivatePayout().validate(
|
|
29
37
|
{
|
|
30
|
-
|
|
38
|
+
uniqueTransferNo,
|
|
39
|
+
body,
|
|
31
40
|
},
|
|
32
41
|
{ abortEarly: false, allowUnknown: false }
|
|
33
42
|
);
|
|
34
43
|
if (warrning) {
|
|
35
|
-
|
|
36
|
-
|
|
44
|
+
Logger({
|
|
45
|
+
level: "WARN",
|
|
46
|
+
message:
|
|
47
|
+
"Parameter Validation warrnings for activateAndDectivatePayout",
|
|
48
|
+
});
|
|
49
|
+
Logger({ level: "WARN", message: warrning });
|
|
37
50
|
}
|
|
38
51
|
|
|
39
52
|
const query_params = {};
|
|
40
|
-
query_params["unique_external_id"] = uniqueExternalId;
|
|
41
53
|
|
|
42
54
|
const xHeaders = {};
|
|
43
55
|
|
|
44
|
-
|
|
56
|
+
const response = await PlatformAPIClient.execute(
|
|
45
57
|
this.config,
|
|
46
|
-
"
|
|
47
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/payouts`,
|
|
58
|
+
"patch",
|
|
59
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/payouts/${uniqueTransferNo}`,
|
|
48
60
|
query_params,
|
|
49
|
-
|
|
61
|
+
body,
|
|
50
62
|
xHeaders
|
|
51
63
|
);
|
|
64
|
+
|
|
65
|
+
const {
|
|
66
|
+
error: res_error,
|
|
67
|
+
} = PaymentModel.UpdatePayoutResponse().validate(response, {
|
|
68
|
+
abortEarly: false,
|
|
69
|
+
allowUnknown: false,
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
if (res_error) {
|
|
73
|
+
Logger({
|
|
74
|
+
level: "WARN",
|
|
75
|
+
message: "Response Validation Warnnings for activateAndDectivatePayout",
|
|
76
|
+
});
|
|
77
|
+
Logger({ level: "WARN", message: res_error });
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return response;
|
|
52
81
|
}
|
|
53
82
|
|
|
54
83
|
/**
|
|
55
84
|
* @param {Object} arg - Arg object.
|
|
56
|
-
* @param {
|
|
57
|
-
* @
|
|
58
|
-
* @
|
|
85
|
+
* @param {string} arg.uniqueTransferNo - Unique transfer id
|
|
86
|
+
* @returns {Promise<DeletePayoutResponse>} - Success response
|
|
87
|
+
* @summary: Delete Payout
|
|
88
|
+
* @description: Delete Payout
|
|
59
89
|
*/
|
|
60
|
-
|
|
61
|
-
const { error } = PaymentValidator.
|
|
90
|
+
async deletePayout({ uniqueTransferNo } = {}) {
|
|
91
|
+
const { error } = PaymentValidator.deletePayout().validate(
|
|
62
92
|
{
|
|
63
|
-
|
|
93
|
+
uniqueTransferNo,
|
|
64
94
|
},
|
|
65
95
|
{ abortEarly: false, allowUnknown: true }
|
|
66
96
|
);
|
|
@@ -69,43 +99,69 @@ class Payment {
|
|
|
69
99
|
}
|
|
70
100
|
|
|
71
101
|
// Showing warrnings if extra unknown parameters are found
|
|
72
|
-
const { error: warrning } = PaymentValidator.
|
|
102
|
+
const { error: warrning } = PaymentValidator.deletePayout().validate(
|
|
73
103
|
{
|
|
74
|
-
|
|
104
|
+
uniqueTransferNo,
|
|
75
105
|
},
|
|
76
106
|
{ abortEarly: false, allowUnknown: false }
|
|
77
107
|
);
|
|
78
108
|
if (warrning) {
|
|
79
|
-
|
|
80
|
-
|
|
109
|
+
Logger({
|
|
110
|
+
level: "WARN",
|
|
111
|
+
message: "Parameter Validation warrnings for deletePayout",
|
|
112
|
+
});
|
|
113
|
+
Logger({ level: "WARN", message: warrning });
|
|
81
114
|
}
|
|
82
115
|
|
|
83
116
|
const query_params = {};
|
|
84
117
|
|
|
85
118
|
const xHeaders = {};
|
|
86
119
|
|
|
87
|
-
|
|
120
|
+
const response = await PlatformAPIClient.execute(
|
|
88
121
|
this.config,
|
|
89
|
-
"
|
|
90
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/payouts`,
|
|
122
|
+
"delete",
|
|
123
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/payouts/${uniqueTransferNo}`,
|
|
91
124
|
query_params,
|
|
92
|
-
|
|
125
|
+
undefined,
|
|
93
126
|
xHeaders
|
|
94
127
|
);
|
|
128
|
+
|
|
129
|
+
const {
|
|
130
|
+
error: res_error,
|
|
131
|
+
} = PaymentModel.DeletePayoutResponse().validate(response, {
|
|
132
|
+
abortEarly: false,
|
|
133
|
+
allowUnknown: false,
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
if (res_error) {
|
|
137
|
+
Logger({
|
|
138
|
+
level: "WARN",
|
|
139
|
+
message: "Response Validation Warnnings for deletePayout",
|
|
140
|
+
});
|
|
141
|
+
Logger({ level: "WARN", message: res_error });
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return response;
|
|
95
145
|
}
|
|
96
146
|
|
|
97
147
|
/**
|
|
98
148
|
* @param {Object} arg - Arg object.
|
|
99
|
-
* @param {string} arg.
|
|
100
|
-
* @param {
|
|
101
|
-
* @
|
|
102
|
-
* @
|
|
149
|
+
* @param {string} arg.uniqueExternalId -
|
|
150
|
+
* @param {string} arg.paymentMethodId -
|
|
151
|
+
* @returns {Promise<DeleteSubscriptionPaymentMethodResponse>} - Success response
|
|
152
|
+
* @summary: Delete Subscription Payment Method
|
|
153
|
+
* @description: Uses this api to Delete Subscription Payment Method
|
|
103
154
|
*/
|
|
104
|
-
|
|
105
|
-
|
|
155
|
+
async deleteSubscriptionPaymentMethod({
|
|
156
|
+
uniqueExternalId,
|
|
157
|
+
paymentMethodId,
|
|
158
|
+
} = {}) {
|
|
159
|
+
const {
|
|
160
|
+
error,
|
|
161
|
+
} = PaymentValidator.deleteSubscriptionPaymentMethod().validate(
|
|
106
162
|
{
|
|
107
|
-
|
|
108
|
-
|
|
163
|
+
uniqueExternalId,
|
|
164
|
+
paymentMethodId,
|
|
109
165
|
},
|
|
110
166
|
{ abortEarly: false, allowUnknown: true }
|
|
111
167
|
);
|
|
@@ -114,44 +170,69 @@ class Payment {
|
|
|
114
170
|
}
|
|
115
171
|
|
|
116
172
|
// Showing warrnings if extra unknown parameters are found
|
|
117
|
-
const {
|
|
173
|
+
const {
|
|
174
|
+
error: warrning,
|
|
175
|
+
} = PaymentValidator.deleteSubscriptionPaymentMethod().validate(
|
|
118
176
|
{
|
|
119
|
-
|
|
120
|
-
|
|
177
|
+
uniqueExternalId,
|
|
178
|
+
paymentMethodId,
|
|
121
179
|
},
|
|
122
180
|
{ abortEarly: false, allowUnknown: false }
|
|
123
181
|
);
|
|
124
182
|
if (warrning) {
|
|
125
|
-
|
|
126
|
-
|
|
183
|
+
Logger({
|
|
184
|
+
level: "WARN",
|
|
185
|
+
message:
|
|
186
|
+
"Parameter Validation warrnings for deleteSubscriptionPaymentMethod",
|
|
187
|
+
});
|
|
188
|
+
Logger({ level: "WARN", message: warrning });
|
|
127
189
|
}
|
|
128
190
|
|
|
129
191
|
const query_params = {};
|
|
192
|
+
query_params["unique_external_id"] = uniqueExternalId;
|
|
193
|
+
query_params["payment_method_id"] = paymentMethodId;
|
|
130
194
|
|
|
131
195
|
const xHeaders = {};
|
|
132
196
|
|
|
133
|
-
|
|
197
|
+
const response = await PlatformAPIClient.execute(
|
|
134
198
|
this.config,
|
|
135
|
-
"
|
|
136
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/
|
|
199
|
+
"delete",
|
|
200
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/subscription/methods`,
|
|
137
201
|
query_params,
|
|
138
|
-
|
|
202
|
+
undefined,
|
|
139
203
|
xHeaders
|
|
140
204
|
);
|
|
205
|
+
|
|
206
|
+
const {
|
|
207
|
+
error: res_error,
|
|
208
|
+
} = PaymentModel.DeleteSubscriptionPaymentMethodResponse().validate(
|
|
209
|
+
response,
|
|
210
|
+
{ abortEarly: false, allowUnknown: false }
|
|
211
|
+
);
|
|
212
|
+
|
|
213
|
+
if (res_error) {
|
|
214
|
+
Logger({
|
|
215
|
+
level: "WARN",
|
|
216
|
+
message:
|
|
217
|
+
"Response Validation Warnnings for deleteSubscriptionPaymentMethod",
|
|
218
|
+
});
|
|
219
|
+
Logger({ level: "WARN", message: res_error });
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
return response;
|
|
141
223
|
}
|
|
142
224
|
|
|
143
225
|
/**
|
|
144
226
|
* @param {Object} arg - Arg object.
|
|
145
|
-
* @param {string} arg.
|
|
146
|
-
* @
|
|
147
|
-
* @summary:
|
|
148
|
-
* @description:
|
|
227
|
+
* @param {string} [arg.uniqueExternalId] - Fetch payouts using unique external id
|
|
228
|
+
* @returns {Promise<PayoutsResponse>} - Success response
|
|
229
|
+
* @summary: Get All Payouts
|
|
230
|
+
* @description: Get All Payouts
|
|
149
231
|
*/
|
|
150
|
-
|
|
151
|
-
const { error } = PaymentValidator.
|
|
232
|
+
async getAllPayouts({ uniqueExternalId } = {}) {
|
|
233
|
+
const { error } = PaymentValidator.getAllPayouts().validate(
|
|
152
234
|
{
|
|
153
|
-
|
|
154
|
-
body,
|
|
235
|
+
uniqueExternalId,
|
|
155
236
|
},
|
|
156
237
|
{ abortEarly: false, allowUnknown: true }
|
|
157
238
|
);
|
|
@@ -160,47 +241,61 @@ class Payment {
|
|
|
160
241
|
}
|
|
161
242
|
|
|
162
243
|
// Showing warrnings if extra unknown parameters are found
|
|
163
|
-
const {
|
|
164
|
-
error: warrning,
|
|
165
|
-
} = PaymentValidator.activateAndDectivatePayout().validate(
|
|
244
|
+
const { error: warrning } = PaymentValidator.getAllPayouts().validate(
|
|
166
245
|
{
|
|
167
|
-
|
|
168
|
-
body,
|
|
246
|
+
uniqueExternalId,
|
|
169
247
|
},
|
|
170
248
|
{ abortEarly: false, allowUnknown: false }
|
|
171
249
|
);
|
|
172
250
|
if (warrning) {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
251
|
+
Logger({
|
|
252
|
+
level: "WARN",
|
|
253
|
+
message: "Parameter Validation warrnings for getAllPayouts",
|
|
254
|
+
});
|
|
255
|
+
Logger({ level: "WARN", message: warrning });
|
|
177
256
|
}
|
|
178
257
|
|
|
179
258
|
const query_params = {};
|
|
259
|
+
query_params["unique_external_id"] = uniqueExternalId;
|
|
180
260
|
|
|
181
261
|
const xHeaders = {};
|
|
182
262
|
|
|
183
|
-
|
|
263
|
+
const response = await PlatformAPIClient.execute(
|
|
184
264
|
this.config,
|
|
185
|
-
"
|
|
186
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/payouts
|
|
265
|
+
"get",
|
|
266
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/payouts`,
|
|
187
267
|
query_params,
|
|
188
|
-
|
|
268
|
+
undefined,
|
|
189
269
|
xHeaders
|
|
190
270
|
);
|
|
271
|
+
|
|
272
|
+
const {
|
|
273
|
+
error: res_error,
|
|
274
|
+
} = PaymentModel.PayoutsResponse().validate(response, {
|
|
275
|
+
abortEarly: false,
|
|
276
|
+
allowUnknown: false,
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
if (res_error) {
|
|
280
|
+
Logger({
|
|
281
|
+
level: "WARN",
|
|
282
|
+
message: "Response Validation Warnnings for getAllPayouts",
|
|
283
|
+
});
|
|
284
|
+
Logger({ level: "WARN", message: res_error });
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
return response;
|
|
191
288
|
}
|
|
192
289
|
|
|
193
290
|
/**
|
|
194
291
|
* @param {Object} arg - Arg object.
|
|
195
|
-
* @
|
|
196
|
-
* @summary:
|
|
197
|
-
* @description:
|
|
292
|
+
* @returns {Promise<SubscriptionConfigResponse>} - Success response
|
|
293
|
+
* @summary: List Subscription Config
|
|
294
|
+
* @description: Get all Subscription Config details
|
|
198
295
|
*/
|
|
199
|
-
|
|
200
|
-
const { error } = PaymentValidator.
|
|
201
|
-
{
|
|
202
|
-
uniqueTransferNo,
|
|
203
|
-
},
|
|
296
|
+
async getSubscriptionConfig({} = {}) {
|
|
297
|
+
const { error } = PaymentValidator.getSubscriptionConfig().validate(
|
|
298
|
+
{},
|
|
204
299
|
{ abortEarly: false, allowUnknown: true }
|
|
205
300
|
);
|
|
206
301
|
if (error) {
|
|
@@ -208,38 +303,59 @@ class Payment {
|
|
|
208
303
|
}
|
|
209
304
|
|
|
210
305
|
// Showing warrnings if extra unknown parameters are found
|
|
211
|
-
const {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
},
|
|
306
|
+
const {
|
|
307
|
+
error: warrning,
|
|
308
|
+
} = PaymentValidator.getSubscriptionConfig().validate(
|
|
309
|
+
{},
|
|
215
310
|
{ abortEarly: false, allowUnknown: false }
|
|
216
311
|
);
|
|
217
312
|
if (warrning) {
|
|
218
|
-
|
|
219
|
-
|
|
313
|
+
Logger({
|
|
314
|
+
level: "WARN",
|
|
315
|
+
message: "Parameter Validation warrnings for getSubscriptionConfig",
|
|
316
|
+
});
|
|
317
|
+
Logger({ level: "WARN", message: warrning });
|
|
220
318
|
}
|
|
221
319
|
|
|
222
320
|
const query_params = {};
|
|
223
321
|
|
|
224
322
|
const xHeaders = {};
|
|
225
323
|
|
|
226
|
-
|
|
324
|
+
const response = await PlatformAPIClient.execute(
|
|
227
325
|
this.config,
|
|
228
|
-
"
|
|
229
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/
|
|
326
|
+
"get",
|
|
327
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/subscription/configs`,
|
|
230
328
|
query_params,
|
|
231
329
|
undefined,
|
|
232
330
|
xHeaders
|
|
233
331
|
);
|
|
332
|
+
|
|
333
|
+
const {
|
|
334
|
+
error: res_error,
|
|
335
|
+
} = PaymentModel.SubscriptionConfigResponse().validate(response, {
|
|
336
|
+
abortEarly: false,
|
|
337
|
+
allowUnknown: false,
|
|
338
|
+
});
|
|
339
|
+
|
|
340
|
+
if (res_error) {
|
|
341
|
+
Logger({
|
|
342
|
+
level: "WARN",
|
|
343
|
+
message: "Response Validation Warnnings for getSubscriptionConfig",
|
|
344
|
+
});
|
|
345
|
+
Logger({ level: "WARN", message: res_error });
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
return response;
|
|
234
349
|
}
|
|
235
350
|
|
|
236
351
|
/**
|
|
237
352
|
* @param {Object} arg - Arg object.
|
|
238
353
|
* @param {string} [arg.uniqueExternalId] - Unique external id
|
|
354
|
+
* @returns {Promise<SubscriptionPaymentMethodResponse>} - Success response
|
|
239
355
|
* @summary: List Subscription Payment Method
|
|
240
356
|
* @description: Get all Subscription Payment Method
|
|
241
357
|
*/
|
|
242
|
-
getSubscriptionPaymentMethod({ uniqueExternalId } = {}) {
|
|
358
|
+
async getSubscriptionPaymentMethod({ uniqueExternalId } = {}) {
|
|
243
359
|
const { error } = PaymentValidator.getSubscriptionPaymentMethod().validate(
|
|
244
360
|
{
|
|
245
361
|
uniqueExternalId,
|
|
@@ -260,10 +376,12 @@ class Payment {
|
|
|
260
376
|
{ abortEarly: false, allowUnknown: false }
|
|
261
377
|
);
|
|
262
378
|
if (warrning) {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
379
|
+
Logger({
|
|
380
|
+
level: "WARN",
|
|
381
|
+
message:
|
|
382
|
+
"Parameter Validation warrnings for getSubscriptionPaymentMethod",
|
|
383
|
+
});
|
|
384
|
+
Logger({ level: "WARN", message: warrning });
|
|
267
385
|
}
|
|
268
386
|
|
|
269
387
|
const query_params = {};
|
|
@@ -271,7 +389,7 @@ class Payment {
|
|
|
271
389
|
|
|
272
390
|
const xHeaders = {};
|
|
273
391
|
|
|
274
|
-
|
|
392
|
+
const response = await PlatformAPIClient.execute(
|
|
275
393
|
this.config,
|
|
276
394
|
"get",
|
|
277
395
|
`/service/platform/payment/v1.0/company/${this.config.companyId}/subscription/methods`,
|
|
@@ -279,22 +397,37 @@ class Payment {
|
|
|
279
397
|
undefined,
|
|
280
398
|
xHeaders
|
|
281
399
|
);
|
|
400
|
+
|
|
401
|
+
const {
|
|
402
|
+
error: res_error,
|
|
403
|
+
} = PaymentModel.SubscriptionPaymentMethodResponse().validate(response, {
|
|
404
|
+
abortEarly: false,
|
|
405
|
+
allowUnknown: false,
|
|
406
|
+
});
|
|
407
|
+
|
|
408
|
+
if (res_error) {
|
|
409
|
+
Logger({
|
|
410
|
+
level: "WARN",
|
|
411
|
+
message:
|
|
412
|
+
"Response Validation Warnnings for getSubscriptionPaymentMethod",
|
|
413
|
+
});
|
|
414
|
+
Logger({ level: "WARN", message: res_error });
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
return response;
|
|
282
418
|
}
|
|
283
419
|
|
|
284
420
|
/**
|
|
285
421
|
* @param {Object} arg - Arg object.
|
|
286
|
-
* @param {
|
|
287
|
-
* @
|
|
288
|
-
* @summary:
|
|
289
|
-
* @description:
|
|
422
|
+
* @param {PayoutRequest} arg.body
|
|
423
|
+
* @returns {Promise<PayoutResponse>} - Success response
|
|
424
|
+
* @summary: Save Payout
|
|
425
|
+
* @description: Save Payout
|
|
290
426
|
*/
|
|
291
|
-
|
|
292
|
-
const {
|
|
293
|
-
error,
|
|
294
|
-
} = PaymentValidator.deleteSubscriptionPaymentMethod().validate(
|
|
427
|
+
async savePayout({ body } = {}) {
|
|
428
|
+
const { error } = PaymentValidator.savePayout().validate(
|
|
295
429
|
{
|
|
296
|
-
|
|
297
|
-
paymentMethodId,
|
|
430
|
+
body,
|
|
298
431
|
},
|
|
299
432
|
{ abortEarly: false, allowUnknown: true }
|
|
300
433
|
);
|
|
@@ -303,46 +436,63 @@ class Payment {
|
|
|
303
436
|
}
|
|
304
437
|
|
|
305
438
|
// Showing warrnings if extra unknown parameters are found
|
|
306
|
-
const {
|
|
307
|
-
error: warrning,
|
|
308
|
-
} = PaymentValidator.deleteSubscriptionPaymentMethod().validate(
|
|
439
|
+
const { error: warrning } = PaymentValidator.savePayout().validate(
|
|
309
440
|
{
|
|
310
|
-
|
|
311
|
-
paymentMethodId,
|
|
441
|
+
body,
|
|
312
442
|
},
|
|
313
443
|
{ abortEarly: false, allowUnknown: false }
|
|
314
444
|
);
|
|
315
445
|
if (warrning) {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
446
|
+
Logger({
|
|
447
|
+
level: "WARN",
|
|
448
|
+
message: "Parameter Validation warrnings for savePayout",
|
|
449
|
+
});
|
|
450
|
+
Logger({ level: "WARN", message: warrning });
|
|
320
451
|
}
|
|
321
452
|
|
|
322
453
|
const query_params = {};
|
|
323
|
-
query_params["unique_external_id"] = uniqueExternalId;
|
|
324
|
-
query_params["payment_method_id"] = paymentMethodId;
|
|
325
454
|
|
|
326
455
|
const xHeaders = {};
|
|
327
456
|
|
|
328
|
-
|
|
457
|
+
const response = await PlatformAPIClient.execute(
|
|
329
458
|
this.config,
|
|
330
|
-
"
|
|
331
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/
|
|
459
|
+
"post",
|
|
460
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/payouts`,
|
|
332
461
|
query_params,
|
|
333
|
-
|
|
462
|
+
body,
|
|
334
463
|
xHeaders
|
|
335
464
|
);
|
|
465
|
+
|
|
466
|
+
const {
|
|
467
|
+
error: res_error,
|
|
468
|
+
} = PaymentModel.PayoutResponse().validate(response, {
|
|
469
|
+
abortEarly: false,
|
|
470
|
+
allowUnknown: false,
|
|
471
|
+
});
|
|
472
|
+
|
|
473
|
+
if (res_error) {
|
|
474
|
+
Logger({
|
|
475
|
+
level: "WARN",
|
|
476
|
+
message: "Response Validation Warnnings for savePayout",
|
|
477
|
+
});
|
|
478
|
+
Logger({ level: "WARN", message: res_error });
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
return response;
|
|
336
482
|
}
|
|
337
483
|
|
|
338
484
|
/**
|
|
339
485
|
* @param {Object} arg - Arg object.
|
|
340
|
-
* @
|
|
341
|
-
* @
|
|
486
|
+
* @param {SaveSubscriptionSetupIntentRequest} arg.body
|
|
487
|
+
* @returns {Promise<SaveSubscriptionSetupIntentResponse>} - Success response
|
|
488
|
+
* @summary: Save Subscription Setup Intent
|
|
489
|
+
* @description: Uses this api to Save Subscription Setup Intent
|
|
342
490
|
*/
|
|
343
|
-
|
|
344
|
-
const { error } = PaymentValidator.
|
|
345
|
-
{
|
|
491
|
+
async saveSubscriptionSetupIntent({ body } = {}) {
|
|
492
|
+
const { error } = PaymentValidator.saveSubscriptionSetupIntent().validate(
|
|
493
|
+
{
|
|
494
|
+
body,
|
|
495
|
+
},
|
|
346
496
|
{ abortEarly: false, allowUnknown: true }
|
|
347
497
|
);
|
|
348
498
|
if (error) {
|
|
@@ -352,38 +502,65 @@ class Payment {
|
|
|
352
502
|
// Showing warrnings if extra unknown parameters are found
|
|
353
503
|
const {
|
|
354
504
|
error: warrning,
|
|
355
|
-
} = PaymentValidator.
|
|
356
|
-
{
|
|
505
|
+
} = PaymentValidator.saveSubscriptionSetupIntent().validate(
|
|
506
|
+
{
|
|
507
|
+
body,
|
|
508
|
+
},
|
|
357
509
|
{ abortEarly: false, allowUnknown: false }
|
|
358
510
|
);
|
|
359
511
|
if (warrning) {
|
|
360
|
-
|
|
361
|
-
|
|
512
|
+
Logger({
|
|
513
|
+
level: "WARN",
|
|
514
|
+
message:
|
|
515
|
+
"Parameter Validation warrnings for saveSubscriptionSetupIntent",
|
|
516
|
+
});
|
|
517
|
+
Logger({ level: "WARN", message: warrning });
|
|
362
518
|
}
|
|
363
519
|
|
|
364
520
|
const query_params = {};
|
|
365
521
|
|
|
366
522
|
const xHeaders = {};
|
|
367
523
|
|
|
368
|
-
|
|
524
|
+
const response = await PlatformAPIClient.execute(
|
|
369
525
|
this.config,
|
|
370
|
-
"
|
|
371
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/subscription/
|
|
526
|
+
"post",
|
|
527
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/subscription/setup/intent`,
|
|
372
528
|
query_params,
|
|
373
|
-
|
|
529
|
+
body,
|
|
374
530
|
xHeaders
|
|
375
531
|
);
|
|
532
|
+
|
|
533
|
+
const {
|
|
534
|
+
error: res_error,
|
|
535
|
+
} = PaymentModel.SaveSubscriptionSetupIntentResponse().validate(response, {
|
|
536
|
+
abortEarly: false,
|
|
537
|
+
allowUnknown: false,
|
|
538
|
+
});
|
|
539
|
+
|
|
540
|
+
if (res_error) {
|
|
541
|
+
Logger({
|
|
542
|
+
level: "WARN",
|
|
543
|
+
message:
|
|
544
|
+
"Response Validation Warnnings for saveSubscriptionSetupIntent",
|
|
545
|
+
});
|
|
546
|
+
Logger({ level: "WARN", message: res_error });
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
return response;
|
|
376
550
|
}
|
|
377
551
|
|
|
378
552
|
/**
|
|
379
553
|
* @param {Object} arg - Arg object.
|
|
380
|
-
* @param {
|
|
381
|
-
* @
|
|
382
|
-
* @
|
|
554
|
+
* @param {string} arg.uniqueTransferNo - Unique transfer id
|
|
555
|
+
* @param {PayoutRequest} arg.body
|
|
556
|
+
* @returns {Promise<UpdatePayoutResponse>} - Success response
|
|
557
|
+
* @summary: Update Payout
|
|
558
|
+
* @description: Update Payout
|
|
383
559
|
*/
|
|
384
|
-
|
|
385
|
-
const { error } = PaymentValidator.
|
|
560
|
+
async updatePayout({ uniqueTransferNo, body } = {}) {
|
|
561
|
+
const { error } = PaymentValidator.updatePayout().validate(
|
|
386
562
|
{
|
|
563
|
+
uniqueTransferNo,
|
|
387
564
|
body,
|
|
388
565
|
},
|
|
389
566
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -393,42 +570,60 @@ class Payment {
|
|
|
393
570
|
}
|
|
394
571
|
|
|
395
572
|
// Showing warrnings if extra unknown parameters are found
|
|
396
|
-
const {
|
|
397
|
-
error: warrning,
|
|
398
|
-
} = PaymentValidator.saveSubscriptionSetupIntent().validate(
|
|
573
|
+
const { error: warrning } = PaymentValidator.updatePayout().validate(
|
|
399
574
|
{
|
|
575
|
+
uniqueTransferNo,
|
|
400
576
|
body,
|
|
401
577
|
},
|
|
402
578
|
{ abortEarly: false, allowUnknown: false }
|
|
403
579
|
);
|
|
404
580
|
if (warrning) {
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
581
|
+
Logger({
|
|
582
|
+
level: "WARN",
|
|
583
|
+
message: "Parameter Validation warrnings for updatePayout",
|
|
584
|
+
});
|
|
585
|
+
Logger({ level: "WARN", message: warrning });
|
|
409
586
|
}
|
|
410
587
|
|
|
411
588
|
const query_params = {};
|
|
412
589
|
|
|
413
590
|
const xHeaders = {};
|
|
414
591
|
|
|
415
|
-
|
|
592
|
+
const response = await PlatformAPIClient.execute(
|
|
416
593
|
this.config,
|
|
417
|
-
"
|
|
418
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/
|
|
594
|
+
"put",
|
|
595
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/payouts/${uniqueTransferNo}`,
|
|
419
596
|
query_params,
|
|
420
597
|
body,
|
|
421
598
|
xHeaders
|
|
422
599
|
);
|
|
600
|
+
|
|
601
|
+
const {
|
|
602
|
+
error: res_error,
|
|
603
|
+
} = PaymentModel.UpdatePayoutResponse().validate(response, {
|
|
604
|
+
abortEarly: false,
|
|
605
|
+
allowUnknown: false,
|
|
606
|
+
});
|
|
607
|
+
|
|
608
|
+
if (res_error) {
|
|
609
|
+
Logger({
|
|
610
|
+
level: "WARN",
|
|
611
|
+
message: "Response Validation Warnnings for updatePayout",
|
|
612
|
+
});
|
|
613
|
+
Logger({ level: "WARN", message: res_error });
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
return response;
|
|
423
617
|
}
|
|
424
618
|
|
|
425
619
|
/**
|
|
426
620
|
* @param {Object} arg - Arg object.
|
|
427
621
|
* @param {string} [arg.ifscCode] -
|
|
622
|
+
* @returns {Promise<IfscCodeResponse>} - Success response
|
|
428
623
|
* @summary: Ifsc Code Verification
|
|
429
624
|
* @description: Get True/False for correct IFSC Code for adding bank details for refund
|
|
430
625
|
*/
|
|
431
|
-
verifyIfscCode({ ifscCode } = {}) {
|
|
626
|
+
async verifyIfscCode({ ifscCode } = {}) {
|
|
432
627
|
const { error } = PaymentValidator.verifyIfscCode().validate(
|
|
433
628
|
{
|
|
434
629
|
ifscCode,
|
|
@@ -447,8 +642,11 @@ class Payment {
|
|
|
447
642
|
{ abortEarly: false, allowUnknown: false }
|
|
448
643
|
);
|
|
449
644
|
if (warrning) {
|
|
450
|
-
|
|
451
|
-
|
|
645
|
+
Logger({
|
|
646
|
+
level: "WARN",
|
|
647
|
+
message: "Parameter Validation warrnings for verifyIfscCode",
|
|
648
|
+
});
|
|
649
|
+
Logger({ level: "WARN", message: warrning });
|
|
452
650
|
}
|
|
453
651
|
|
|
454
652
|
const query_params = {};
|
|
@@ -456,7 +654,7 @@ class Payment {
|
|
|
456
654
|
|
|
457
655
|
const xHeaders = {};
|
|
458
656
|
|
|
459
|
-
|
|
657
|
+
const response = await PlatformAPIClient.execute(
|
|
460
658
|
this.config,
|
|
461
659
|
"get",
|
|
462
660
|
`/service/platform/payment/v1.0/company/${this.config.companyId}/ifsc-code/verify`,
|
|
@@ -464,6 +662,23 @@ class Payment {
|
|
|
464
662
|
undefined,
|
|
465
663
|
xHeaders
|
|
466
664
|
);
|
|
665
|
+
|
|
666
|
+
const {
|
|
667
|
+
error: res_error,
|
|
668
|
+
} = PaymentModel.IfscCodeResponse().validate(response, {
|
|
669
|
+
abortEarly: false,
|
|
670
|
+
allowUnknown: false,
|
|
671
|
+
});
|
|
672
|
+
|
|
673
|
+
if (res_error) {
|
|
674
|
+
Logger({
|
|
675
|
+
level: "WARN",
|
|
676
|
+
message: "Response Validation Warnnings for verifyIfscCode",
|
|
677
|
+
});
|
|
678
|
+
Logger({ level: "WARN", message: res_error });
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
return response;
|
|
467
682
|
}
|
|
468
683
|
}
|
|
469
684
|
|