@gofynd/fdk-client-javascript 1.0.2 → 1.0.4
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 +31 -2
- package/index.d.ts +4 -4
- package/index.js +9 -10
- package/package.json +14 -14
- package/sdk/APIClient.d.ts +11 -0
- package/sdk/APIClient.js +35 -0
- package/sdk/Client.d.ts +6 -0
- package/sdk/Client.js +17 -0
- package/sdk/Config.d.ts +9 -0
- package/sdk/Config.js +17 -0
- package/sdk/application/Cart/CartApplicationClient.d.ts +243 -243
- package/sdk/application/Cart/CartApplicationClient.js +595 -594
- package/sdk/application/Cart/CartApplicationModel.d.ts +64 -63
- package/sdk/application/Cart/CartApplicationModel.js +490 -885
- 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 +1079 -1078
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +90 -90
- package/sdk/application/Catalog/CatalogApplicationModel.js +683 -1249
- 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 +43 -42
- 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 +32 -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 +350 -349
- 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 +216 -215
- package/sdk/application/Content/ContentApplicationModel.d.ts +76 -76
- package/sdk/application/Content/ContentApplicationModel.js +468 -884
- 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 +65 -64
- 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 +109 -108
- 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 +31 -22
- package/sdk/application/Logistic/LogisticApplicationClient.js +115 -49
- 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 -9
- package/sdk/application/Order/OrderApplicationClient.d.ts +85 -85
- package/sdk/application/Order/OrderApplicationClient.js +247 -246
- package/sdk/application/Order/OrderApplicationModel.d.ts +50 -50
- package/sdk/application/Order/OrderApplicationModel.js +361 -656
- 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 +781 -780
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +72 -72
- package/sdk/application/Payment/PaymentApplicationModel.js +570 -1038
- 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 +646 -645
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +64 -63
- package/sdk/application/PosCart/PosCartApplicationModel.js +476 -870
- 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 +122 -121
- 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 +94 -93
- 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 +38 -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 +619 -618
- 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 +18 -7
- package/sdk/constructUrl.d.ts +5 -0
- package/sdk/constructUrl.js +13 -0
- package/sdk/index.d.ts +3 -0
- package/sdk/index.js +5 -0
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +51 -51
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +182 -180
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +6 -6
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +21 -21
- package/sdk/platform/Analytics/AnalyticsPlatformClient.js +5 -4
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +11 -11
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +95 -178
- package/sdk/platform/Analytics/AnalyticsPlatformValidator.js +1 -0
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +10 -10
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +44 -43
- 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 +7 -6
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +60 -60
- package/sdk/platform/Billing/BillingPlatformClient.js +184 -183
- 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 +26 -25
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +192 -165
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +686 -510
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +14 -11
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +77 -61
- package/sdk/platform/Cart/CartPlatformModel.d.ts +84 -83
- package/sdk/platform/Cart/CartPlatformModel.js +676 -1206
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +632 -632
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1558 -1556
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +40 -40
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +175 -175
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +688 -688
- package/sdk/platform/Catalog/CatalogPlatformClient.js +1556 -1559
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +291 -291
- package/sdk/platform/Catalog/CatalogPlatformModel.js +2133 -3910
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +66 -66
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +229 -228
- package/sdk/platform/Common/CommonPlatformClient.d.ts +12 -12
- package/sdk/platform/Common/CommonPlatformClient.js +40 -51
- 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 +7 -6
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +326 -326
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +945 -943
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +30 -30
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +88 -88
- package/sdk/platform/Communication/CommunicationPlatformClient.js +4 -3
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +67 -67
- package/sdk/platform/Communication/CommunicationPlatformModel.js +522 -974
- package/sdk/platform/Communication/CommunicationPlatformValidator.js +1 -0
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +55 -55
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +217 -216
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +27 -27
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +279 -542
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +7 -7
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +25 -24
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +163 -153
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +617 -552
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +22 -21
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +70 -64
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +125 -125
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +348 -347
- 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 +39 -38
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +524 -534
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +1287 -1346
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +49 -50
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +153 -159
- package/sdk/platform/Content/ContentPlatformModel.d.ts +78 -78
- package/sdk/platform/Content/ContentPlatformModel.js +485 -907
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +65 -65
- package/sdk/platform/Discount/DiscountPlatformClient.js +219 -218
- 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 +30 -29
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +25 -25
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +83 -61
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +9 -9
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +53 -53
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +147 -125
- 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 +12 -11
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +63 -63
- package/sdk/platform/Inventory/InventoryPlatformClient.js +231 -230
- 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 +29 -28
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +73 -73
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +203 -201
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +7 -7
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +29 -29
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +80 -80
- package/sdk/platform/Lead/LeadPlatformClient.js +215 -214
- 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 +25 -24
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +10 -10
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +68 -66
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +7 -7
- package/sdk/platform/Order/OrderPlatformClient.d.ts +357 -357
- package/sdk/platform/Order/OrderPlatformClient.js +1046 -1033
- package/sdk/platform/Order/OrderPlatformModel.d.ts +198 -196
- package/sdk/platform/Order/OrderPlatformModel.js +1575 -2861
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +32 -32
- package/sdk/platform/Order/OrderPlatformValidator.js +161 -160
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +3 -1
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +1 -1
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -1
- package/sdk/platform/Partner/PartnerPlatformModel.js +10 -26
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +58 -58
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +178 -178
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +6 -6
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +24 -24
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +42 -42
- package/sdk/platform/Payment/PaymentPlatformClient.js +156 -155
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +27 -27
- package/sdk/platform/Payment/PaymentPlatformModel.js +222 -410
- package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +4 -4
- package/sdk/platform/Payment/PaymentPlatformValidator.js +22 -21
- package/sdk/platform/PlatformApplicationClient.d.ts +1496 -10325
- package/sdk/platform/PlatformApplicationClient.js +1584 -13899
- package/sdk/platform/PlatformClient.d.ts +7972 -7888
- package/sdk/platform/PlatformClient.js +8678 -10107
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +85 -85
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +299 -280
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +8 -8
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +35 -35
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +15 -15
- package/sdk/platform/Rewards/RewardsPlatformModel.js +92 -194
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +10 -10
- package/sdk/platform/Share/SharePlatformApplicationClient.js +62 -60
- package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/Share/SharePlatformApplicationValidator.js +7 -7
- package/sdk/platform/Share/SharePlatformModel.d.ts +8 -8
- package/sdk/platform/Share/SharePlatformModel.js +60 -118
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +132 -132
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +314 -312
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +15 -15
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +45 -45
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +34 -34
- package/sdk/platform/Theme/ThemePlatformModel.js +190 -336
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +136 -69
- package/sdk/platform/User/UserPlatformApplicationClient.js +507 -166
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +12 -7
- package/sdk/platform/User/UserPlatformApplicationValidator.js +62 -24
- package/sdk/platform/User/UserPlatformModel.d.ts +79 -72
- package/sdk/platform/User/UserPlatformModel.js +440 -689
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +31 -31
- package/sdk/platform/Webhook/WebhookPlatformClient.js +91 -90
- 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 +15 -14
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +13 -13
- package/sdk/public/Configuration/ConfigurationPublicClient.js +40 -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 +115 -113
- 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 +2 -0
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +7 -7
- package/sdk/public/Webhook/WebhookPublicModel.js +68 -136
- package/.github/workflows/on_create_release.yml +0 -23
- package/.github/workflows/on_merge_main.yml +0 -38
- package/.github/workflows/on_pull_request.yml +0 -35
- package/.prettierrc +0 -5
- package/documentation/application/CART.md +0 -7339
- package/documentation/application/CATALOG.md +0 -9597
- package/documentation/application/COMMON.md +0 -452
- package/documentation/application/COMMUNICATION.md +0 -467
- package/documentation/application/CONFIGURATION.md +0 -2906
- package/documentation/application/CONTENT.md +0 -3351
- package/documentation/application/FILESTORAGE.md +0 -578
- package/documentation/application/LEAD.md +0 -1895
- package/documentation/application/LOGISTIC.md +0 -765
- package/documentation/application/ORDER.md +0 -3432
- package/documentation/application/PAYMENT.md +0 -5221
- package/documentation/application/POSCART.md +0 -7938
- package/documentation/application/README.md +0 -21
- package/documentation/application/REWARDS.md +0 -708
- package/documentation/application/SHARE.md +0 -733
- package/documentation/application/THEME.md +0 -5800
- package/documentation/application/USER.md +0 -4335
- package/documentation/platform/ANALYTICS.md +0 -1154
- package/documentation/platform/AUDITTRAIL.md +0 -576
- package/documentation/platform/BILLING.md +0 -2400
- package/documentation/platform/CART.md +0 -5559
- package/documentation/platform/CATALOG.md +0 -23261
- package/documentation/platform/COMMON.md +0 -452
- package/documentation/platform/COMMUNICATION.md +0 -5718
- package/documentation/platform/COMPANYPROFILE.md +0 -2031
- package/documentation/platform/CONFIGURATION.md +0 -7339
- package/documentation/platform/CONTENT.md +0 -9098
- package/documentation/platform/DISCOUNT.md +0 -863
- package/documentation/platform/FILESTORAGE.md +0 -1081
- package/documentation/platform/INVENTORY.md +0 -1779
- package/documentation/platform/LEAD.md +0 -4740
- package/documentation/platform/ORDER.md +0 -8486
- package/documentation/platform/PARTNER.md +0 -220
- package/documentation/platform/PAYMENT.md +0 -3448
- package/documentation/platform/README.md +0 -27
- package/documentation/platform/REWARDS.md +0 -1083
- package/documentation/platform/SHARE.md +0 -606
- package/documentation/platform/THEME.md +0 -35729
- package/documentation/platform/USER.md +0 -2319
- package/documentation/platform/WEBHOOK.md +0 -591
- package/documentation/public/CONFIGURATION.md +0 -452
- package/documentation/public/INVENTORY.md +0 -690
- package/documentation/public/WEBHOOK.md +0 -352
- package/jest.config.d.ts +0 -4
- package/jest.config.js +0 -6
- package/tests/application/catalog.spec.js +0 -47
- package/tests/common/action-url.spec.js +0 -35
- package/tests/common/schema/action-url.json +0 -178
- package/tests/common/schema/url-action.json +0 -683
- package/tests/common/url-action.spec.js +0 -48
- package/tests/helpers/cookie.helper.js +0 -31
- package/tests/helpers/oauth.helper.js +0 -43
- package/tests/platform/catalog.spec.js +0 -49
- package/tests/public/location.spec.js +0 -39
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
const Paginator = require("../../common/Paginator");
|
|
2
|
-
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
3
1
|
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
2
|
+
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
3
|
+
const Paginator = require("../../common/Paginator");
|
|
4
4
|
const PaymentValidator = require("./PaymentPlatformValidator");
|
|
5
5
|
const PaymentModel = require("./PaymentPlatformModel");
|
|
6
6
|
const { Logger } = require("./../../common/Logger");
|
|
7
|
+
const Joi = require("joi");
|
|
7
8
|
|
|
8
9
|
class Payment {
|
|
9
10
|
constructor(config) {
|
|
@@ -12,15 +13,17 @@ class Payment {
|
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* @param {Object} arg - Arg object.
|
|
15
|
-
* @param {string}
|
|
16
|
-
* @
|
|
17
|
-
* @
|
|
18
|
-
* @
|
|
16
|
+
* @param {string} arg.uniqueTransferNo - Unique transfer id
|
|
17
|
+
* @param {UpdatePayoutRequest} arg.body
|
|
18
|
+
* @returns {Promise<UpdatePayoutResponse>} - Success response
|
|
19
|
+
* @summary: Partial Update Payout
|
|
20
|
+
* @description: Partial Update Payout
|
|
19
21
|
*/
|
|
20
|
-
async
|
|
21
|
-
const { error } = PaymentValidator.
|
|
22
|
+
async activateAndDectivatePayout({ uniqueTransferNo, body } = {}) {
|
|
23
|
+
const { error } = PaymentValidator.activateAndDectivatePayout().validate(
|
|
22
24
|
{
|
|
23
|
-
|
|
25
|
+
uniqueTransferNo,
|
|
26
|
+
body,
|
|
24
27
|
},
|
|
25
28
|
{ abortEarly: false, allowUnknown: true }
|
|
26
29
|
);
|
|
@@ -29,37 +32,40 @@ class Payment {
|
|
|
29
32
|
}
|
|
30
33
|
|
|
31
34
|
// Showing warrnings if extra unknown parameters are found
|
|
32
|
-
const {
|
|
35
|
+
const {
|
|
36
|
+
error: warrning,
|
|
37
|
+
} = PaymentValidator.activateAndDectivatePayout().validate(
|
|
33
38
|
{
|
|
34
|
-
|
|
39
|
+
uniqueTransferNo,
|
|
40
|
+
body,
|
|
35
41
|
},
|
|
36
42
|
{ abortEarly: false, allowUnknown: false }
|
|
37
43
|
);
|
|
38
44
|
if (warrning) {
|
|
39
45
|
Logger({
|
|
40
46
|
level: "WARN",
|
|
41
|
-
message:
|
|
47
|
+
message:
|
|
48
|
+
"Parameter Validation warrnings for activateAndDectivatePayout",
|
|
42
49
|
});
|
|
43
50
|
Logger({ level: "WARN", message: warrning });
|
|
44
51
|
}
|
|
45
52
|
|
|
46
53
|
const query_params = {};
|
|
47
|
-
query_params["unique_external_id"] = uniqueExternalId;
|
|
48
54
|
|
|
49
55
|
const xHeaders = {};
|
|
50
56
|
|
|
51
57
|
const response = await PlatformAPIClient.execute(
|
|
52
58
|
this.config,
|
|
53
|
-
"
|
|
54
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/payouts`,
|
|
59
|
+
"patch",
|
|
60
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/payouts/${uniqueTransferNo}`,
|
|
55
61
|
query_params,
|
|
56
|
-
|
|
62
|
+
body,
|
|
57
63
|
xHeaders
|
|
58
64
|
);
|
|
59
65
|
|
|
60
66
|
const {
|
|
61
67
|
error: res_error,
|
|
62
|
-
} = PaymentModel.
|
|
68
|
+
} = PaymentModel.UpdatePayoutResponse().validate(response, {
|
|
63
69
|
abortEarly: false,
|
|
64
70
|
allowUnknown: false,
|
|
65
71
|
});
|
|
@@ -67,7 +73,7 @@ class Payment {
|
|
|
67
73
|
if (res_error) {
|
|
68
74
|
Logger({
|
|
69
75
|
level: "WARN",
|
|
70
|
-
message: "Response Validation Warnnings for
|
|
76
|
+
message: "Response Validation Warnnings for activateAndDectivatePayout",
|
|
71
77
|
});
|
|
72
78
|
Logger({ level: "WARN", message: res_error });
|
|
73
79
|
}
|
|
@@ -77,15 +83,15 @@ class Payment {
|
|
|
77
83
|
|
|
78
84
|
/**
|
|
79
85
|
* @param {Object} arg - Arg object.
|
|
80
|
-
* @param {
|
|
81
|
-
* @returns {Promise<
|
|
82
|
-
* @summary:
|
|
83
|
-
* @description:
|
|
86
|
+
* @param {string} arg.uniqueTransferNo - Unique transfer id
|
|
87
|
+
* @returns {Promise<DeletePayoutResponse>} - Success response
|
|
88
|
+
* @summary: Delete Payout
|
|
89
|
+
* @description: Delete Payout
|
|
84
90
|
*/
|
|
85
|
-
async
|
|
86
|
-
const { error } = PaymentValidator.
|
|
91
|
+
async deletePayout({ uniqueTransferNo } = {}) {
|
|
92
|
+
const { error } = PaymentValidator.deletePayout().validate(
|
|
87
93
|
{
|
|
88
|
-
|
|
94
|
+
uniqueTransferNo,
|
|
89
95
|
},
|
|
90
96
|
{ abortEarly: false, allowUnknown: true }
|
|
91
97
|
);
|
|
@@ -94,16 +100,16 @@ class Payment {
|
|
|
94
100
|
}
|
|
95
101
|
|
|
96
102
|
// Showing warrnings if extra unknown parameters are found
|
|
97
|
-
const { error: warrning } = PaymentValidator.
|
|
103
|
+
const { error: warrning } = PaymentValidator.deletePayout().validate(
|
|
98
104
|
{
|
|
99
|
-
|
|
105
|
+
uniqueTransferNo,
|
|
100
106
|
},
|
|
101
107
|
{ abortEarly: false, allowUnknown: false }
|
|
102
108
|
);
|
|
103
109
|
if (warrning) {
|
|
104
110
|
Logger({
|
|
105
111
|
level: "WARN",
|
|
106
|
-
message: "Parameter Validation warrnings for
|
|
112
|
+
message: "Parameter Validation warrnings for deletePayout",
|
|
107
113
|
});
|
|
108
114
|
Logger({ level: "WARN", message: warrning });
|
|
109
115
|
}
|
|
@@ -114,16 +120,16 @@ class Payment {
|
|
|
114
120
|
|
|
115
121
|
const response = await PlatformAPIClient.execute(
|
|
116
122
|
this.config,
|
|
117
|
-
"
|
|
118
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/payouts`,
|
|
123
|
+
"delete",
|
|
124
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/payouts/${uniqueTransferNo}`,
|
|
119
125
|
query_params,
|
|
120
|
-
|
|
126
|
+
undefined,
|
|
121
127
|
xHeaders
|
|
122
128
|
);
|
|
123
129
|
|
|
124
130
|
const {
|
|
125
131
|
error: res_error,
|
|
126
|
-
} = PaymentModel.
|
|
132
|
+
} = PaymentModel.DeletePayoutResponse().validate(response, {
|
|
127
133
|
abortEarly: false,
|
|
128
134
|
allowUnknown: false,
|
|
129
135
|
});
|
|
@@ -131,7 +137,7 @@ class Payment {
|
|
|
131
137
|
if (res_error) {
|
|
132
138
|
Logger({
|
|
133
139
|
level: "WARN",
|
|
134
|
-
message: "Response Validation Warnnings for
|
|
140
|
+
message: "Response Validation Warnnings for deletePayout",
|
|
135
141
|
});
|
|
136
142
|
Logger({ level: "WARN", message: res_error });
|
|
137
143
|
}
|
|
@@ -141,17 +147,22 @@ class Payment {
|
|
|
141
147
|
|
|
142
148
|
/**
|
|
143
149
|
* @param {Object} arg - Arg object.
|
|
144
|
-
* @param {string} arg.
|
|
145
|
-
* @param {
|
|
146
|
-
* @returns {Promise<
|
|
147
|
-
* @summary:
|
|
148
|
-
* @description:
|
|
150
|
+
* @param {string} arg.uniqueExternalId -
|
|
151
|
+
* @param {string} arg.paymentMethodId -
|
|
152
|
+
* @returns {Promise<DeleteSubscriptionPaymentMethodResponse>} - Success response
|
|
153
|
+
* @summary: Delete Subscription Payment Method
|
|
154
|
+
* @description: Uses this api to Delete Subscription Payment Method
|
|
149
155
|
*/
|
|
150
|
-
async
|
|
151
|
-
|
|
156
|
+
async deleteSubscriptionPaymentMethod({
|
|
157
|
+
uniqueExternalId,
|
|
158
|
+
paymentMethodId,
|
|
159
|
+
} = {}) {
|
|
160
|
+
const {
|
|
161
|
+
error,
|
|
162
|
+
} = PaymentValidator.deleteSubscriptionPaymentMethod().validate(
|
|
152
163
|
{
|
|
153
|
-
|
|
154
|
-
|
|
164
|
+
uniqueExternalId,
|
|
165
|
+
paymentMethodId,
|
|
155
166
|
},
|
|
156
167
|
{ abortEarly: false, allowUnknown: true }
|
|
157
168
|
);
|
|
@@ -160,45 +171,51 @@ class Payment {
|
|
|
160
171
|
}
|
|
161
172
|
|
|
162
173
|
// Showing warrnings if extra unknown parameters are found
|
|
163
|
-
const {
|
|
174
|
+
const {
|
|
175
|
+
error: warrning,
|
|
176
|
+
} = PaymentValidator.deleteSubscriptionPaymentMethod().validate(
|
|
164
177
|
{
|
|
165
|
-
|
|
166
|
-
|
|
178
|
+
uniqueExternalId,
|
|
179
|
+
paymentMethodId,
|
|
167
180
|
},
|
|
168
181
|
{ abortEarly: false, allowUnknown: false }
|
|
169
182
|
);
|
|
170
183
|
if (warrning) {
|
|
171
184
|
Logger({
|
|
172
185
|
level: "WARN",
|
|
173
|
-
message:
|
|
186
|
+
message:
|
|
187
|
+
"Parameter Validation warrnings for deleteSubscriptionPaymentMethod",
|
|
174
188
|
});
|
|
175
189
|
Logger({ level: "WARN", message: warrning });
|
|
176
190
|
}
|
|
177
191
|
|
|
178
192
|
const query_params = {};
|
|
193
|
+
query_params["unique_external_id"] = uniqueExternalId;
|
|
194
|
+
query_params["payment_method_id"] = paymentMethodId;
|
|
179
195
|
|
|
180
196
|
const xHeaders = {};
|
|
181
197
|
|
|
182
198
|
const response = await PlatformAPIClient.execute(
|
|
183
199
|
this.config,
|
|
184
|
-
"
|
|
185
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/
|
|
200
|
+
"delete",
|
|
201
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/subscription/methods`,
|
|
186
202
|
query_params,
|
|
187
|
-
|
|
203
|
+
undefined,
|
|
188
204
|
xHeaders
|
|
189
205
|
);
|
|
190
206
|
|
|
191
207
|
const {
|
|
192
208
|
error: res_error,
|
|
193
|
-
} = PaymentModel.
|
|
194
|
-
|
|
195
|
-
allowUnknown: false
|
|
196
|
-
|
|
209
|
+
} = PaymentModel.DeleteSubscriptionPaymentMethodResponse().validate(
|
|
210
|
+
response,
|
|
211
|
+
{ abortEarly: false, allowUnknown: false }
|
|
212
|
+
);
|
|
197
213
|
|
|
198
214
|
if (res_error) {
|
|
199
215
|
Logger({
|
|
200
216
|
level: "WARN",
|
|
201
|
-
message:
|
|
217
|
+
message:
|
|
218
|
+
"Response Validation Warnnings for deleteSubscriptionPaymentMethod",
|
|
202
219
|
});
|
|
203
220
|
Logger({ level: "WARN", message: res_error });
|
|
204
221
|
}
|
|
@@ -208,17 +225,15 @@ class Payment {
|
|
|
208
225
|
|
|
209
226
|
/**
|
|
210
227
|
* @param {Object} arg - Arg object.
|
|
211
|
-
* @param {string} arg.
|
|
212
|
-
* @
|
|
213
|
-
* @
|
|
214
|
-
* @
|
|
215
|
-
* @description: Partial Update Payout
|
|
228
|
+
* @param {string} [arg.uniqueExternalId] - Fetch payouts using unique external id
|
|
229
|
+
* @returns {Promise<PayoutsResponse>} - Success response
|
|
230
|
+
* @summary: Get All Payouts
|
|
231
|
+
* @description: Get All Payouts
|
|
216
232
|
*/
|
|
217
|
-
async
|
|
218
|
-
const { error } = PaymentValidator.
|
|
233
|
+
async getAllPayouts({ uniqueExternalId } = {}) {
|
|
234
|
+
const { error } = PaymentValidator.getAllPayouts().validate(
|
|
219
235
|
{
|
|
220
|
-
|
|
221
|
-
body,
|
|
236
|
+
uniqueExternalId,
|
|
222
237
|
},
|
|
223
238
|
{ abortEarly: false, allowUnknown: true }
|
|
224
239
|
);
|
|
@@ -227,40 +242,37 @@ class Payment {
|
|
|
227
242
|
}
|
|
228
243
|
|
|
229
244
|
// Showing warrnings if extra unknown parameters are found
|
|
230
|
-
const {
|
|
231
|
-
error: warrning,
|
|
232
|
-
} = PaymentValidator.activateAndDectivatePayout().validate(
|
|
245
|
+
const { error: warrning } = PaymentValidator.getAllPayouts().validate(
|
|
233
246
|
{
|
|
234
|
-
|
|
235
|
-
body,
|
|
247
|
+
uniqueExternalId,
|
|
236
248
|
},
|
|
237
249
|
{ abortEarly: false, allowUnknown: false }
|
|
238
250
|
);
|
|
239
251
|
if (warrning) {
|
|
240
252
|
Logger({
|
|
241
253
|
level: "WARN",
|
|
242
|
-
message:
|
|
243
|
-
"Parameter Validation warrnings for activateAndDectivatePayout",
|
|
254
|
+
message: "Parameter Validation warrnings for getAllPayouts",
|
|
244
255
|
});
|
|
245
256
|
Logger({ level: "WARN", message: warrning });
|
|
246
257
|
}
|
|
247
258
|
|
|
248
259
|
const query_params = {};
|
|
260
|
+
query_params["unique_external_id"] = uniqueExternalId;
|
|
249
261
|
|
|
250
262
|
const xHeaders = {};
|
|
251
263
|
|
|
252
264
|
const response = await PlatformAPIClient.execute(
|
|
253
265
|
this.config,
|
|
254
|
-
"
|
|
255
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/payouts
|
|
266
|
+
"get",
|
|
267
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/payouts`,
|
|
256
268
|
query_params,
|
|
257
|
-
|
|
269
|
+
undefined,
|
|
258
270
|
xHeaders
|
|
259
271
|
);
|
|
260
272
|
|
|
261
273
|
const {
|
|
262
274
|
error: res_error,
|
|
263
|
-
} = PaymentModel.
|
|
275
|
+
} = PaymentModel.PayoutsResponse().validate(response, {
|
|
264
276
|
abortEarly: false,
|
|
265
277
|
allowUnknown: false,
|
|
266
278
|
});
|
|
@@ -268,7 +280,7 @@ class Payment {
|
|
|
268
280
|
if (res_error) {
|
|
269
281
|
Logger({
|
|
270
282
|
level: "WARN",
|
|
271
|
-
message: "Response Validation Warnnings for
|
|
283
|
+
message: "Response Validation Warnnings for getAllPayouts",
|
|
272
284
|
});
|
|
273
285
|
Logger({ level: "WARN", message: res_error });
|
|
274
286
|
}
|
|
@@ -278,16 +290,13 @@ class Payment {
|
|
|
278
290
|
|
|
279
291
|
/**
|
|
280
292
|
* @param {Object} arg - Arg object.
|
|
281
|
-
* @
|
|
282
|
-
* @
|
|
283
|
-
* @
|
|
284
|
-
* @description: Delete Payout
|
|
293
|
+
* @returns {Promise<SubscriptionConfigResponse>} - Success response
|
|
294
|
+
* @summary: List Subscription Config
|
|
295
|
+
* @description: Get all Subscription Config details
|
|
285
296
|
*/
|
|
286
|
-
async
|
|
287
|
-
const { error } = PaymentValidator.
|
|
288
|
-
{
|
|
289
|
-
uniqueTransferNo,
|
|
290
|
-
},
|
|
297
|
+
async getSubscriptionConfig({} = {}) {
|
|
298
|
+
const { error } = PaymentValidator.getSubscriptionConfig().validate(
|
|
299
|
+
{},
|
|
291
300
|
{ abortEarly: false, allowUnknown: true }
|
|
292
301
|
);
|
|
293
302
|
if (error) {
|
|
@@ -295,16 +304,16 @@ class Payment {
|
|
|
295
304
|
}
|
|
296
305
|
|
|
297
306
|
// Showing warrnings if extra unknown parameters are found
|
|
298
|
-
const {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
},
|
|
307
|
+
const {
|
|
308
|
+
error: warrning,
|
|
309
|
+
} = PaymentValidator.getSubscriptionConfig().validate(
|
|
310
|
+
{},
|
|
302
311
|
{ abortEarly: false, allowUnknown: false }
|
|
303
312
|
);
|
|
304
313
|
if (warrning) {
|
|
305
314
|
Logger({
|
|
306
315
|
level: "WARN",
|
|
307
|
-
message: "Parameter Validation warrnings for
|
|
316
|
+
message: "Parameter Validation warrnings for getSubscriptionConfig",
|
|
308
317
|
});
|
|
309
318
|
Logger({ level: "WARN", message: warrning });
|
|
310
319
|
}
|
|
@@ -315,8 +324,8 @@ class Payment {
|
|
|
315
324
|
|
|
316
325
|
const response = await PlatformAPIClient.execute(
|
|
317
326
|
this.config,
|
|
318
|
-
"
|
|
319
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/
|
|
327
|
+
"get",
|
|
328
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/subscription/configs`,
|
|
320
329
|
query_params,
|
|
321
330
|
undefined,
|
|
322
331
|
xHeaders
|
|
@@ -324,7 +333,7 @@ class Payment {
|
|
|
324
333
|
|
|
325
334
|
const {
|
|
326
335
|
error: res_error,
|
|
327
|
-
} = PaymentModel.
|
|
336
|
+
} = PaymentModel.SubscriptionConfigResponse().validate(response, {
|
|
328
337
|
abortEarly: false,
|
|
329
338
|
allowUnknown: false,
|
|
330
339
|
});
|
|
@@ -332,7 +341,7 @@ class Payment {
|
|
|
332
341
|
if (res_error) {
|
|
333
342
|
Logger({
|
|
334
343
|
level: "WARN",
|
|
335
|
-
message: "Response Validation Warnnings for
|
|
344
|
+
message: "Response Validation Warnnings for getSubscriptionConfig",
|
|
336
345
|
});
|
|
337
346
|
Logger({ level: "WARN", message: res_error });
|
|
338
347
|
}
|
|
@@ -411,22 +420,15 @@ class Payment {
|
|
|
411
420
|
|
|
412
421
|
/**
|
|
413
422
|
* @param {Object} arg - Arg object.
|
|
414
|
-
* @param {
|
|
415
|
-
* @
|
|
416
|
-
* @
|
|
417
|
-
* @
|
|
418
|
-
* @description: Uses this api to Delete Subscription Payment Method
|
|
423
|
+
* @param {PayoutRequest} arg.body
|
|
424
|
+
* @returns {Promise<PayoutResponse>} - Success response
|
|
425
|
+
* @summary: Save Payout
|
|
426
|
+
* @description: Save Payout
|
|
419
427
|
*/
|
|
420
|
-
async
|
|
421
|
-
|
|
422
|
-
paymentMethodId,
|
|
423
|
-
} = {}) {
|
|
424
|
-
const {
|
|
425
|
-
error,
|
|
426
|
-
} = PaymentValidator.deleteSubscriptionPaymentMethod().validate(
|
|
428
|
+
async savePayout({ body } = {}) {
|
|
429
|
+
const { error } = PaymentValidator.savePayout().validate(
|
|
427
430
|
{
|
|
428
|
-
|
|
429
|
-
paymentMethodId,
|
|
431
|
+
body,
|
|
430
432
|
},
|
|
431
433
|
{ abortEarly: false, allowUnknown: true }
|
|
432
434
|
);
|
|
@@ -435,51 +437,44 @@ class Payment {
|
|
|
435
437
|
}
|
|
436
438
|
|
|
437
439
|
// Showing warrnings if extra unknown parameters are found
|
|
438
|
-
const {
|
|
439
|
-
error: warrning,
|
|
440
|
-
} = PaymentValidator.deleteSubscriptionPaymentMethod().validate(
|
|
440
|
+
const { error: warrning } = PaymentValidator.savePayout().validate(
|
|
441
441
|
{
|
|
442
|
-
|
|
443
|
-
paymentMethodId,
|
|
442
|
+
body,
|
|
444
443
|
},
|
|
445
444
|
{ abortEarly: false, allowUnknown: false }
|
|
446
445
|
);
|
|
447
446
|
if (warrning) {
|
|
448
447
|
Logger({
|
|
449
448
|
level: "WARN",
|
|
450
|
-
message:
|
|
451
|
-
"Parameter Validation warrnings for deleteSubscriptionPaymentMethod",
|
|
449
|
+
message: "Parameter Validation warrnings for savePayout",
|
|
452
450
|
});
|
|
453
451
|
Logger({ level: "WARN", message: warrning });
|
|
454
452
|
}
|
|
455
453
|
|
|
456
454
|
const query_params = {};
|
|
457
|
-
query_params["unique_external_id"] = uniqueExternalId;
|
|
458
|
-
query_params["payment_method_id"] = paymentMethodId;
|
|
459
455
|
|
|
460
456
|
const xHeaders = {};
|
|
461
457
|
|
|
462
458
|
const response = await PlatformAPIClient.execute(
|
|
463
459
|
this.config,
|
|
464
|
-
"
|
|
465
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/
|
|
460
|
+
"post",
|
|
461
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/payouts`,
|
|
466
462
|
query_params,
|
|
467
|
-
|
|
463
|
+
body,
|
|
468
464
|
xHeaders
|
|
469
465
|
);
|
|
470
466
|
|
|
471
467
|
const {
|
|
472
468
|
error: res_error,
|
|
473
|
-
} = PaymentModel.
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
);
|
|
469
|
+
} = PaymentModel.PayoutResponse().validate(response, {
|
|
470
|
+
abortEarly: false,
|
|
471
|
+
allowUnknown: false,
|
|
472
|
+
});
|
|
477
473
|
|
|
478
474
|
if (res_error) {
|
|
479
475
|
Logger({
|
|
480
476
|
level: "WARN",
|
|
481
|
-
message:
|
|
482
|
-
"Response Validation Warnnings for deleteSubscriptionPaymentMethod",
|
|
477
|
+
message: "Response Validation Warnnings for savePayout",
|
|
483
478
|
});
|
|
484
479
|
Logger({ level: "WARN", message: res_error });
|
|
485
480
|
}
|
|
@@ -489,13 +484,16 @@ class Payment {
|
|
|
489
484
|
|
|
490
485
|
/**
|
|
491
486
|
* @param {Object} arg - Arg object.
|
|
492
|
-
* @
|
|
493
|
-
* @
|
|
494
|
-
* @
|
|
487
|
+
* @param {SaveSubscriptionSetupIntentRequest} arg.body
|
|
488
|
+
* @returns {Promise<SaveSubscriptionSetupIntentResponse>} - Success response
|
|
489
|
+
* @summary: Save Subscription Setup Intent
|
|
490
|
+
* @description: Uses this api to Save Subscription Setup Intent
|
|
495
491
|
*/
|
|
496
|
-
async
|
|
497
|
-
const { error } = PaymentValidator.
|
|
498
|
-
{
|
|
492
|
+
async saveSubscriptionSetupIntent({ body } = {}) {
|
|
493
|
+
const { error } = PaymentValidator.saveSubscriptionSetupIntent().validate(
|
|
494
|
+
{
|
|
495
|
+
body,
|
|
496
|
+
},
|
|
499
497
|
{ abortEarly: false, allowUnknown: true }
|
|
500
498
|
);
|
|
501
499
|
if (error) {
|
|
@@ -505,14 +503,17 @@ class Payment {
|
|
|
505
503
|
// Showing warrnings if extra unknown parameters are found
|
|
506
504
|
const {
|
|
507
505
|
error: warrning,
|
|
508
|
-
} = PaymentValidator.
|
|
509
|
-
{
|
|
506
|
+
} = PaymentValidator.saveSubscriptionSetupIntent().validate(
|
|
507
|
+
{
|
|
508
|
+
body,
|
|
509
|
+
},
|
|
510
510
|
{ abortEarly: false, allowUnknown: false }
|
|
511
511
|
);
|
|
512
512
|
if (warrning) {
|
|
513
513
|
Logger({
|
|
514
514
|
level: "WARN",
|
|
515
|
-
message:
|
|
515
|
+
message:
|
|
516
|
+
"Parameter Validation warrnings for saveSubscriptionSetupIntent",
|
|
516
517
|
});
|
|
517
518
|
Logger({ level: "WARN", message: warrning });
|
|
518
519
|
}
|
|
@@ -523,16 +524,16 @@ class Payment {
|
|
|
523
524
|
|
|
524
525
|
const response = await PlatformAPIClient.execute(
|
|
525
526
|
this.config,
|
|
526
|
-
"
|
|
527
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/subscription/
|
|
527
|
+
"post",
|
|
528
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/subscription/setup/intent`,
|
|
528
529
|
query_params,
|
|
529
|
-
|
|
530
|
+
body,
|
|
530
531
|
xHeaders
|
|
531
532
|
);
|
|
532
533
|
|
|
533
534
|
const {
|
|
534
535
|
error: res_error,
|
|
535
|
-
} = PaymentModel.
|
|
536
|
+
} = PaymentModel.SaveSubscriptionSetupIntentResponse().validate(response, {
|
|
536
537
|
abortEarly: false,
|
|
537
538
|
allowUnknown: false,
|
|
538
539
|
});
|
|
@@ -540,7 +541,8 @@ class Payment {
|
|
|
540
541
|
if (res_error) {
|
|
541
542
|
Logger({
|
|
542
543
|
level: "WARN",
|
|
543
|
-
message:
|
|
544
|
+
message:
|
|
545
|
+
"Response Validation Warnnings for saveSubscriptionSetupIntent",
|
|
544
546
|
});
|
|
545
547
|
Logger({ level: "WARN", message: res_error });
|
|
546
548
|
}
|
|
@@ -550,14 +552,16 @@ class Payment {
|
|
|
550
552
|
|
|
551
553
|
/**
|
|
552
554
|
* @param {Object} arg - Arg object.
|
|
553
|
-
* @param {
|
|
554
|
-
* @
|
|
555
|
-
* @
|
|
556
|
-
* @
|
|
555
|
+
* @param {string} arg.uniqueTransferNo - Unique transfer id
|
|
556
|
+
* @param {PayoutRequest} arg.body
|
|
557
|
+
* @returns {Promise<UpdatePayoutResponse>} - Success response
|
|
558
|
+
* @summary: Update Payout
|
|
559
|
+
* @description: Update Payout
|
|
557
560
|
*/
|
|
558
|
-
async
|
|
559
|
-
const { error } = PaymentValidator.
|
|
561
|
+
async updatePayout({ uniqueTransferNo, body } = {}) {
|
|
562
|
+
const { error } = PaymentValidator.updatePayout().validate(
|
|
560
563
|
{
|
|
564
|
+
uniqueTransferNo,
|
|
561
565
|
body,
|
|
562
566
|
},
|
|
563
567
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -567,10 +571,9 @@ class Payment {
|
|
|
567
571
|
}
|
|
568
572
|
|
|
569
573
|
// Showing warrnings if extra unknown parameters are found
|
|
570
|
-
const {
|
|
571
|
-
error: warrning,
|
|
572
|
-
} = PaymentValidator.saveSubscriptionSetupIntent().validate(
|
|
574
|
+
const { error: warrning } = PaymentValidator.updatePayout().validate(
|
|
573
575
|
{
|
|
576
|
+
uniqueTransferNo,
|
|
574
577
|
body,
|
|
575
578
|
},
|
|
576
579
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -578,8 +581,7 @@ class Payment {
|
|
|
578
581
|
if (warrning) {
|
|
579
582
|
Logger({
|
|
580
583
|
level: "WARN",
|
|
581
|
-
message:
|
|
582
|
-
"Parameter Validation warrnings for saveSubscriptionSetupIntent",
|
|
584
|
+
message: "Parameter Validation warrnings for updatePayout",
|
|
583
585
|
});
|
|
584
586
|
Logger({ level: "WARN", message: warrning });
|
|
585
587
|
}
|
|
@@ -590,8 +592,8 @@ class Payment {
|
|
|
590
592
|
|
|
591
593
|
const response = await PlatformAPIClient.execute(
|
|
592
594
|
this.config,
|
|
593
|
-
"
|
|
594
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/
|
|
595
|
+
"put",
|
|
596
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/payouts/${uniqueTransferNo}`,
|
|
595
597
|
query_params,
|
|
596
598
|
body,
|
|
597
599
|
xHeaders
|
|
@@ -599,7 +601,7 @@ class Payment {
|
|
|
599
601
|
|
|
600
602
|
const {
|
|
601
603
|
error: res_error,
|
|
602
|
-
} = PaymentModel.
|
|
604
|
+
} = PaymentModel.UpdatePayoutResponse().validate(response, {
|
|
603
605
|
abortEarly: false,
|
|
604
606
|
allowUnknown: false,
|
|
605
607
|
});
|
|
@@ -607,8 +609,7 @@ class Payment {
|
|
|
607
609
|
if (res_error) {
|
|
608
610
|
Logger({
|
|
609
611
|
level: "WARN",
|
|
610
|
-
message:
|
|
611
|
-
"Response Validation Warnnings for saveSubscriptionSetupIntent",
|
|
612
|
+
message: "Response Validation Warnnings for updatePayout",
|
|
612
613
|
});
|
|
613
614
|
Logger({ level: "WARN", message: res_error });
|
|
614
615
|
}
|