@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
1
|
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
3
2
|
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
3
|
+
const Paginator = require("../../common/Paginator");
|
|
4
4
|
const PaymentValidator = require("./PaymentPlatformApplicationValidator");
|
|
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, applicationId) {
|
|
@@ -13,13 +14,16 @@ class Payment {
|
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* @param {Object} arg - Arg object.
|
|
16
|
-
* @
|
|
17
|
-
* @
|
|
18
|
-
* @
|
|
17
|
+
* @param {AddBeneficiaryDetailsOTPRequest} arg.body
|
|
18
|
+
* @returns {Promise<RefundAccountResponse>} - Success response
|
|
19
|
+
* @summary: Save bank details for cancelled/returned order
|
|
20
|
+
* @description: Use this API to save bank details for returned/cancelled order to refund amount in his account.
|
|
19
21
|
*/
|
|
20
|
-
async
|
|
21
|
-
const { error } = PaymentValidator.
|
|
22
|
-
{
|
|
22
|
+
async addRefundBankAccountUsingOTP({ body } = {}) {
|
|
23
|
+
const { error } = PaymentValidator.addRefundBankAccountUsingOTP().validate(
|
|
24
|
+
{
|
|
25
|
+
body,
|
|
26
|
+
},
|
|
23
27
|
{ abortEarly: false, allowUnknown: true }
|
|
24
28
|
);
|
|
25
29
|
if (error) {
|
|
@@ -29,15 +33,17 @@ class Payment {
|
|
|
29
33
|
// Showing warrnings if extra unknown parameters are found
|
|
30
34
|
const {
|
|
31
35
|
error: warrning,
|
|
32
|
-
} = PaymentValidator.
|
|
33
|
-
{
|
|
36
|
+
} = PaymentValidator.addRefundBankAccountUsingOTP().validate(
|
|
37
|
+
{
|
|
38
|
+
body,
|
|
39
|
+
},
|
|
34
40
|
{ abortEarly: false, allowUnknown: false }
|
|
35
41
|
);
|
|
36
42
|
if (warrning) {
|
|
37
43
|
Logger({
|
|
38
44
|
level: "WARN",
|
|
39
45
|
message:
|
|
40
|
-
"Parameter Validation warrnings for
|
|
46
|
+
"Parameter Validation warrnings for addRefundBankAccountUsingOTP",
|
|
41
47
|
});
|
|
42
48
|
Logger({ level: "WARN", message: warrning });
|
|
43
49
|
}
|
|
@@ -46,15 +52,15 @@ class Payment {
|
|
|
46
52
|
|
|
47
53
|
const response = await PlatformAPIClient.execute(
|
|
48
54
|
this.config,
|
|
49
|
-
"
|
|
50
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
55
|
+
"post",
|
|
56
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/refund/account`,
|
|
51
57
|
query_params,
|
|
52
|
-
|
|
58
|
+
body
|
|
53
59
|
);
|
|
54
60
|
|
|
55
61
|
const {
|
|
56
62
|
error: res_error,
|
|
57
|
-
} = PaymentModel.
|
|
63
|
+
} = PaymentModel.RefundAccountResponse().validate(response, {
|
|
58
64
|
abortEarly: false,
|
|
59
65
|
allowUnknown: false,
|
|
60
66
|
});
|
|
@@ -63,7 +69,7 @@ class Payment {
|
|
|
63
69
|
Logger({
|
|
64
70
|
level: "WARN",
|
|
65
71
|
message:
|
|
66
|
-
"Response Validation Warnnings for
|
|
72
|
+
"Response Validation Warnnings for addRefundBankAccountUsingOTP",
|
|
67
73
|
});
|
|
68
74
|
Logger({ level: "WARN", message: res_error });
|
|
69
75
|
}
|
|
@@ -73,13 +79,13 @@ class Payment {
|
|
|
73
79
|
|
|
74
80
|
/**
|
|
75
81
|
* @param {Object} arg - Arg object.
|
|
76
|
-
* @param {
|
|
77
|
-
* @returns {Promise<
|
|
78
|
-
* @summary:
|
|
79
|
-
* @description:
|
|
82
|
+
* @param {PaymentConfirmationRequest} arg.body
|
|
83
|
+
* @returns {Promise<PaymentConfirmationResponse>} - Success response
|
|
84
|
+
* @summary: Confirm payment after successful payment from payment gateway
|
|
85
|
+
* @description: Use this API to confirm payment after payment gateway accepted payment.
|
|
80
86
|
*/
|
|
81
|
-
async
|
|
82
|
-
const { error } = PaymentValidator.
|
|
87
|
+
async confirmPayment({ body } = {}) {
|
|
88
|
+
const { error } = PaymentValidator.confirmPayment().validate(
|
|
83
89
|
{
|
|
84
90
|
body,
|
|
85
91
|
},
|
|
@@ -90,9 +96,7 @@ class Payment {
|
|
|
90
96
|
}
|
|
91
97
|
|
|
92
98
|
// Showing warrnings if extra unknown parameters are found
|
|
93
|
-
const {
|
|
94
|
-
error: warrning,
|
|
95
|
-
} = PaymentValidator.saveBrandPaymentGatewayConfig().validate(
|
|
99
|
+
const { error: warrning } = PaymentValidator.confirmPayment().validate(
|
|
96
100
|
{
|
|
97
101
|
body,
|
|
98
102
|
},
|
|
@@ -101,8 +105,7 @@ class Payment {
|
|
|
101
105
|
if (warrning) {
|
|
102
106
|
Logger({
|
|
103
107
|
level: "WARN",
|
|
104
|
-
message:
|
|
105
|
-
"Parameter Validation warrnings for saveBrandPaymentGatewayConfig",
|
|
108
|
+
message: "Parameter Validation warrnings for confirmPayment",
|
|
106
109
|
});
|
|
107
110
|
Logger({ level: "WARN", message: warrning });
|
|
108
111
|
}
|
|
@@ -112,14 +115,14 @@ class Payment {
|
|
|
112
115
|
const response = await PlatformAPIClient.execute(
|
|
113
116
|
this.config,
|
|
114
117
|
"post",
|
|
115
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
118
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/confirm`,
|
|
116
119
|
query_params,
|
|
117
120
|
body
|
|
118
121
|
);
|
|
119
122
|
|
|
120
123
|
const {
|
|
121
124
|
error: res_error,
|
|
122
|
-
} = PaymentModel.
|
|
125
|
+
} = PaymentModel.PaymentConfirmationResponse().validate(response, {
|
|
123
126
|
abortEarly: false,
|
|
124
127
|
allowUnknown: false,
|
|
125
128
|
});
|
|
@@ -127,8 +130,7 @@ class Payment {
|
|
|
127
130
|
if (res_error) {
|
|
128
131
|
Logger({
|
|
129
132
|
level: "WARN",
|
|
130
|
-
message:
|
|
131
|
-
"Response Validation Warnnings for saveBrandPaymentGatewayConfig",
|
|
133
|
+
message: "Response Validation Warnnings for confirmPayment",
|
|
132
134
|
});
|
|
133
135
|
Logger({ level: "WARN", message: res_error });
|
|
134
136
|
}
|
|
@@ -138,17 +140,22 @@ class Payment {
|
|
|
138
140
|
|
|
139
141
|
/**
|
|
140
142
|
* @param {Object} arg - Arg object.
|
|
141
|
-
* @param {
|
|
142
|
-
* @
|
|
143
|
-
* @
|
|
144
|
-
* @
|
|
143
|
+
* @param {string} arg.orderId -
|
|
144
|
+
* @param {string} [arg.requestHash] -
|
|
145
|
+
* @returns {Promise<RefundAccountResponse>} - Success response
|
|
146
|
+
* @summary: Get bank details
|
|
147
|
+
* @description: Use this API to get saved bank details for returned/cancelled order using order id.
|
|
145
148
|
*/
|
|
146
|
-
async
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
149
|
+
async getBankAccountDetailsOpenAPI({
|
|
150
|
+
orderId,
|
|
151
|
+
|
|
152
|
+
requestHash,
|
|
153
|
+
} = {}) {
|
|
154
|
+
const { error } = PaymentValidator.getBankAccountDetailsOpenAPI().validate(
|
|
150
155
|
{
|
|
151
|
-
|
|
156
|
+
orderId,
|
|
157
|
+
|
|
158
|
+
requestHash,
|
|
152
159
|
},
|
|
153
160
|
{ abortEarly: false, allowUnknown: true }
|
|
154
161
|
);
|
|
@@ -159,9 +166,11 @@ class Payment {
|
|
|
159
166
|
// Showing warrnings if extra unknown parameters are found
|
|
160
167
|
const {
|
|
161
168
|
error: warrning,
|
|
162
|
-
} = PaymentValidator.
|
|
169
|
+
} = PaymentValidator.getBankAccountDetailsOpenAPI().validate(
|
|
163
170
|
{
|
|
164
|
-
|
|
171
|
+
orderId,
|
|
172
|
+
|
|
173
|
+
requestHash,
|
|
165
174
|
},
|
|
166
175
|
{ abortEarly: false, allowUnknown: false }
|
|
167
176
|
);
|
|
@@ -169,24 +178,26 @@ class Payment {
|
|
|
169
178
|
Logger({
|
|
170
179
|
level: "WARN",
|
|
171
180
|
message:
|
|
172
|
-
"Parameter Validation warrnings for
|
|
181
|
+
"Parameter Validation warrnings for getBankAccountDetailsOpenAPI",
|
|
173
182
|
});
|
|
174
183
|
Logger({ level: "WARN", message: warrning });
|
|
175
184
|
}
|
|
176
185
|
|
|
177
186
|
const query_params = {};
|
|
187
|
+
query_params["order_id"] = orderId;
|
|
188
|
+
query_params["request_hash"] = requestHash;
|
|
178
189
|
|
|
179
190
|
const response = await PlatformAPIClient.execute(
|
|
180
191
|
this.config,
|
|
181
|
-
"
|
|
182
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
192
|
+
"get",
|
|
193
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/refund/account`,
|
|
183
194
|
query_params,
|
|
184
|
-
|
|
195
|
+
undefined
|
|
185
196
|
);
|
|
186
197
|
|
|
187
198
|
const {
|
|
188
199
|
error: res_error,
|
|
189
|
-
} = PaymentModel.
|
|
200
|
+
} = PaymentModel.RefundAccountResponse().validate(response, {
|
|
190
201
|
abortEarly: false,
|
|
191
202
|
allowUnknown: false,
|
|
192
203
|
});
|
|
@@ -195,7 +206,7 @@ class Payment {
|
|
|
195
206
|
Logger({
|
|
196
207
|
level: "WARN",
|
|
197
208
|
message:
|
|
198
|
-
"Response Validation Warnnings for
|
|
209
|
+
"Response Validation Warnnings for getBankAccountDetailsOpenAPI",
|
|
199
210
|
});
|
|
200
211
|
Logger({ level: "WARN", message: res_error });
|
|
201
212
|
}
|
|
@@ -205,18 +216,13 @@ class Payment {
|
|
|
205
216
|
|
|
206
217
|
/**
|
|
207
218
|
* @param {Object} arg - Arg object.
|
|
208
|
-
* @
|
|
209
|
-
* @
|
|
210
|
-
* @
|
|
211
|
-
* @summary: Get All Valid Payment Options
|
|
212
|
-
* @description: Use this API to get Get All Valid Payment Options for making payment
|
|
219
|
+
* @returns {Promise<PaymentGatewayConfigResponse>} - Success response
|
|
220
|
+
* @summary: Get All Brand Payment Gateway Config Secret
|
|
221
|
+
* @description: Get All Brand Payment Gateway Config Secret
|
|
213
222
|
*/
|
|
214
|
-
async
|
|
215
|
-
const { error } = PaymentValidator.
|
|
216
|
-
{
|
|
217
|
-
refresh,
|
|
218
|
-
requestType,
|
|
219
|
-
},
|
|
223
|
+
async getBrandPaymentGatewayConfig({} = {}) {
|
|
224
|
+
const { error } = PaymentValidator.getBrandPaymentGatewayConfig().validate(
|
|
225
|
+
{},
|
|
220
226
|
{ abortEarly: false, allowUnknown: true }
|
|
221
227
|
);
|
|
222
228
|
if (error) {
|
|
@@ -226,36 +232,32 @@ class Payment {
|
|
|
226
232
|
// Showing warrnings if extra unknown parameters are found
|
|
227
233
|
const {
|
|
228
234
|
error: warrning,
|
|
229
|
-
} = PaymentValidator.
|
|
230
|
-
{
|
|
231
|
-
refresh,
|
|
232
|
-
requestType,
|
|
233
|
-
},
|
|
235
|
+
} = PaymentValidator.getBrandPaymentGatewayConfig().validate(
|
|
236
|
+
{},
|
|
234
237
|
{ abortEarly: false, allowUnknown: false }
|
|
235
238
|
);
|
|
236
239
|
if (warrning) {
|
|
237
240
|
Logger({
|
|
238
241
|
level: "WARN",
|
|
239
|
-
message:
|
|
242
|
+
message:
|
|
243
|
+
"Parameter Validation warrnings for getBrandPaymentGatewayConfig",
|
|
240
244
|
});
|
|
241
245
|
Logger({ level: "WARN", message: warrning });
|
|
242
246
|
}
|
|
243
247
|
|
|
244
248
|
const query_params = {};
|
|
245
|
-
query_params["refresh"] = refresh;
|
|
246
|
-
query_params["request_type"] = requestType;
|
|
247
249
|
|
|
248
250
|
const response = await PlatformAPIClient.execute(
|
|
249
251
|
this.config,
|
|
250
252
|
"get",
|
|
251
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
253
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/aggregator/request`,
|
|
252
254
|
query_params,
|
|
253
255
|
undefined
|
|
254
256
|
);
|
|
255
257
|
|
|
256
258
|
const {
|
|
257
259
|
error: res_error,
|
|
258
|
-
} = PaymentModel.
|
|
260
|
+
} = PaymentModel.PaymentGatewayConfigResponse().validate(response, {
|
|
259
261
|
abortEarly: false,
|
|
260
262
|
allowUnknown: false,
|
|
261
263
|
});
|
|
@@ -263,7 +265,8 @@ class Payment {
|
|
|
263
265
|
if (res_error) {
|
|
264
266
|
Logger({
|
|
265
267
|
level: "WARN",
|
|
266
|
-
message:
|
|
268
|
+
message:
|
|
269
|
+
"Response Validation Warnnings for getBrandPaymentGatewayConfig",
|
|
267
270
|
});
|
|
268
271
|
Logger({ level: "WARN", message: res_error });
|
|
269
272
|
}
|
|
@@ -273,17 +276,17 @@ class Payment {
|
|
|
273
276
|
|
|
274
277
|
/**
|
|
275
278
|
* @param {Object} arg - Arg object.
|
|
276
|
-
* @param {
|
|
277
|
-
* @param {string}
|
|
278
|
-
* @returns {Promise<
|
|
279
|
-
* @summary: Get
|
|
280
|
-
* @description: Use this API to get
|
|
279
|
+
* @param {boolean} arg.refresh -
|
|
280
|
+
* @param {string} arg.requestType -
|
|
281
|
+
* @returns {Promise<PaymentOptionsResponse>} - Success response
|
|
282
|
+
* @summary: Get All Valid Payment Options
|
|
283
|
+
* @description: Use this API to get Get All Valid Payment Options for making payment
|
|
281
284
|
*/
|
|
282
|
-
async
|
|
283
|
-
const { error } = PaymentValidator.
|
|
285
|
+
async getPaymentModeRoutes({ refresh, requestType } = {}) {
|
|
286
|
+
const { error } = PaymentValidator.getPaymentModeRoutes().validate(
|
|
284
287
|
{
|
|
285
|
-
|
|
286
|
-
|
|
288
|
+
refresh,
|
|
289
|
+
requestType,
|
|
287
290
|
},
|
|
288
291
|
{ abortEarly: false, allowUnknown: true }
|
|
289
292
|
);
|
|
@@ -294,37 +297,36 @@ class Payment {
|
|
|
294
297
|
// Showing warrnings if extra unknown parameters are found
|
|
295
298
|
const {
|
|
296
299
|
error: warrning,
|
|
297
|
-
} = PaymentValidator.
|
|
300
|
+
} = PaymentValidator.getPaymentModeRoutes().validate(
|
|
298
301
|
{
|
|
299
|
-
|
|
300
|
-
|
|
302
|
+
refresh,
|
|
303
|
+
requestType,
|
|
301
304
|
},
|
|
302
305
|
{ abortEarly: false, allowUnknown: false }
|
|
303
306
|
);
|
|
304
307
|
if (warrning) {
|
|
305
308
|
Logger({
|
|
306
309
|
level: "WARN",
|
|
307
|
-
message:
|
|
308
|
-
"Parameter Validation warrnings for getBankAccountDetailsOpenAPI",
|
|
310
|
+
message: "Parameter Validation warrnings for getPaymentModeRoutes",
|
|
309
311
|
});
|
|
310
312
|
Logger({ level: "WARN", message: warrning });
|
|
311
313
|
}
|
|
312
314
|
|
|
313
315
|
const query_params = {};
|
|
314
|
-
query_params["
|
|
315
|
-
query_params["
|
|
316
|
+
query_params["refresh"] = refresh;
|
|
317
|
+
query_params["request_type"] = requestType;
|
|
316
318
|
|
|
317
319
|
const response = await PlatformAPIClient.execute(
|
|
318
320
|
this.config,
|
|
319
321
|
"get",
|
|
320
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
322
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/options`,
|
|
321
323
|
query_params,
|
|
322
324
|
undefined
|
|
323
325
|
);
|
|
324
326
|
|
|
325
327
|
const {
|
|
326
328
|
error: res_error,
|
|
327
|
-
} = PaymentModel.
|
|
329
|
+
} = PaymentModel.PaymentOptionsResponse().validate(response, {
|
|
328
330
|
abortEarly: false,
|
|
329
331
|
allowUnknown: false,
|
|
330
332
|
});
|
|
@@ -332,8 +334,7 @@ class Payment {
|
|
|
332
334
|
if (res_error) {
|
|
333
335
|
Logger({
|
|
334
336
|
level: "WARN",
|
|
335
|
-
message:
|
|
336
|
-
"Response Validation Warnnings for getBankAccountDetailsOpenAPI",
|
|
337
|
+
message: "Response Validation Warnnings for getPaymentModeRoutes",
|
|
337
338
|
});
|
|
338
339
|
Logger({ level: "WARN", message: res_error });
|
|
339
340
|
}
|
|
@@ -343,16 +344,14 @@ class Payment {
|
|
|
343
344
|
|
|
344
345
|
/**
|
|
345
346
|
* @param {Object} arg - Arg object.
|
|
346
|
-
* @param {
|
|
347
|
-
* @returns {Promise<
|
|
348
|
-
* @summary:
|
|
349
|
-
* @description:
|
|
347
|
+
* @param {string} arg.orderId -
|
|
348
|
+
* @returns {Promise<OrderBeneficiaryResponse>} - Success response
|
|
349
|
+
* @summary: List User Beneficiary
|
|
350
|
+
* @description: Get all active beneficiary details added by the user for refund
|
|
350
351
|
*/
|
|
351
|
-
async
|
|
352
|
-
const { error } = PaymentValidator.
|
|
353
|
-
{
|
|
354
|
-
body,
|
|
355
|
-
},
|
|
352
|
+
async getUserBeneficiaries({ orderId } = {}) {
|
|
353
|
+
const { error } = PaymentValidator.getUserBeneficiaries().validate(
|
|
354
|
+
{ orderId },
|
|
356
355
|
{ abortEarly: false, allowUnknown: true }
|
|
357
356
|
);
|
|
358
357
|
if (error) {
|
|
@@ -362,34 +361,32 @@ class Payment {
|
|
|
362
361
|
// Showing warrnings if extra unknown parameters are found
|
|
363
362
|
const {
|
|
364
363
|
error: warrning,
|
|
365
|
-
} = PaymentValidator.
|
|
366
|
-
{
|
|
367
|
-
body,
|
|
368
|
-
},
|
|
364
|
+
} = PaymentValidator.getUserBeneficiaries().validate(
|
|
365
|
+
{ orderId },
|
|
369
366
|
{ abortEarly: false, allowUnknown: false }
|
|
370
367
|
);
|
|
371
368
|
if (warrning) {
|
|
372
369
|
Logger({
|
|
373
370
|
level: "WARN",
|
|
374
|
-
message:
|
|
375
|
-
"Parameter Validation warrnings for addRefundBankAccountUsingOTP",
|
|
371
|
+
message: "Parameter Validation warrnings for getUserBeneficiaries",
|
|
376
372
|
});
|
|
377
373
|
Logger({ level: "WARN", message: warrning });
|
|
378
374
|
}
|
|
379
375
|
|
|
380
376
|
const query_params = {};
|
|
377
|
+
query_params["order_id"] = orderId;
|
|
381
378
|
|
|
382
379
|
const response = await PlatformAPIClient.execute(
|
|
383
380
|
this.config,
|
|
384
|
-
"
|
|
385
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/refund/
|
|
381
|
+
"get",
|
|
382
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/refund/accounts/user`,
|
|
386
383
|
query_params,
|
|
387
|
-
|
|
384
|
+
undefined
|
|
388
385
|
);
|
|
389
386
|
|
|
390
387
|
const {
|
|
391
388
|
error: res_error,
|
|
392
|
-
} = PaymentModel.
|
|
389
|
+
} = PaymentModel.OrderBeneficiaryResponse().validate(response, {
|
|
393
390
|
abortEarly: false,
|
|
394
391
|
allowUnknown: false,
|
|
395
392
|
});
|
|
@@ -397,8 +394,7 @@ class Payment {
|
|
|
397
394
|
if (res_error) {
|
|
398
395
|
Logger({
|
|
399
396
|
level: "WARN",
|
|
400
|
-
message:
|
|
401
|
-
"Response Validation Warnnings for addRefundBankAccountUsingOTP",
|
|
397
|
+
message: "Response Validation Warnnings for getUserBeneficiaries",
|
|
402
398
|
});
|
|
403
399
|
Logger({ level: "WARN", message: res_error });
|
|
404
400
|
}
|
|
@@ -408,15 +404,17 @@ class Payment {
|
|
|
408
404
|
|
|
409
405
|
/**
|
|
410
406
|
* @param {Object} arg - Arg object.
|
|
411
|
-
* @param {string} arg.
|
|
412
|
-
* @
|
|
413
|
-
* @
|
|
414
|
-
* @
|
|
407
|
+
* @param {string} arg.merchantUserId -
|
|
408
|
+
* @param {string} arg.mobileNo -
|
|
409
|
+
* @returns {Promise<GetUserCODLimitResponse>} - Success response
|
|
410
|
+
* @summary: Get COD limit for user
|
|
411
|
+
* @description: Use this API to get user cod limit and reamining limit for the payment
|
|
415
412
|
*/
|
|
416
|
-
async
|
|
417
|
-
const { error } = PaymentValidator.
|
|
413
|
+
async getUserCODlimitRoutes({ merchantUserId, mobileNo } = {}) {
|
|
414
|
+
const { error } = PaymentValidator.getUserCODlimitRoutes().validate(
|
|
418
415
|
{
|
|
419
|
-
|
|
416
|
+
merchantUserId,
|
|
417
|
+
mobileNo,
|
|
420
418
|
},
|
|
421
419
|
{ abortEarly: false, allowUnknown: true }
|
|
422
420
|
);
|
|
@@ -427,34 +425,36 @@ class Payment {
|
|
|
427
425
|
// Showing warrnings if extra unknown parameters are found
|
|
428
426
|
const {
|
|
429
427
|
error: warrning,
|
|
430
|
-
} = PaymentValidator.
|
|
428
|
+
} = PaymentValidator.getUserCODlimitRoutes().validate(
|
|
431
429
|
{
|
|
432
|
-
|
|
430
|
+
merchantUserId,
|
|
431
|
+
mobileNo,
|
|
433
432
|
},
|
|
434
433
|
{ abortEarly: false, allowUnknown: false }
|
|
435
434
|
);
|
|
436
435
|
if (warrning) {
|
|
437
436
|
Logger({
|
|
438
437
|
level: "WARN",
|
|
439
|
-
message: "Parameter Validation warrnings for
|
|
438
|
+
message: "Parameter Validation warrnings for getUserCODlimitRoutes",
|
|
440
439
|
});
|
|
441
440
|
Logger({ level: "WARN", message: warrning });
|
|
442
441
|
}
|
|
443
442
|
|
|
444
443
|
const query_params = {};
|
|
445
|
-
query_params["
|
|
444
|
+
query_params["merchant_user_id"] = merchantUserId;
|
|
445
|
+
query_params["mobile_no"] = mobileNo;
|
|
446
446
|
|
|
447
447
|
const response = await PlatformAPIClient.execute(
|
|
448
448
|
this.config,
|
|
449
449
|
"get",
|
|
450
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
450
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/user-cod`,
|
|
451
451
|
query_params,
|
|
452
452
|
undefined
|
|
453
453
|
);
|
|
454
454
|
|
|
455
455
|
const {
|
|
456
456
|
error: res_error,
|
|
457
|
-
} = PaymentModel.
|
|
457
|
+
} = PaymentModel.GetUserCODLimitResponse().validate(response, {
|
|
458
458
|
abortEarly: false,
|
|
459
459
|
allowUnknown: false,
|
|
460
460
|
});
|
|
@@ -462,7 +462,7 @@ class Payment {
|
|
|
462
462
|
if (res_error) {
|
|
463
463
|
Logger({
|
|
464
464
|
level: "WARN",
|
|
465
|
-
message: "Response Validation Warnnings for
|
|
465
|
+
message: "Response Validation Warnnings for getUserCODlimitRoutes",
|
|
466
466
|
});
|
|
467
467
|
Logger({ level: "WARN", message: res_error });
|
|
468
468
|
}
|
|
@@ -474,14 +474,12 @@ class Payment {
|
|
|
474
474
|
* @param {Object} arg - Arg object.
|
|
475
475
|
* @param {string} arg.orderId -
|
|
476
476
|
* @returns {Promise<OrderBeneficiaryResponse>} - Success response
|
|
477
|
-
* @summary: List
|
|
477
|
+
* @summary: List Order Beneficiary
|
|
478
478
|
* @description: Get all active beneficiary details added by the user for refund
|
|
479
479
|
*/
|
|
480
|
-
async
|
|
481
|
-
const { error } = PaymentValidator.
|
|
482
|
-
{
|
|
483
|
-
orderId,
|
|
484
|
-
},
|
|
480
|
+
async getUserOrderBeneficiaries({ orderId } = {}) {
|
|
481
|
+
const { error } = PaymentValidator.getUserOrderBeneficiaries().validate(
|
|
482
|
+
{ orderId },
|
|
485
483
|
{ abortEarly: false, allowUnknown: true }
|
|
486
484
|
);
|
|
487
485
|
if (error) {
|
|
@@ -491,16 +489,14 @@ class Payment {
|
|
|
491
489
|
// Showing warrnings if extra unknown parameters are found
|
|
492
490
|
const {
|
|
493
491
|
error: warrning,
|
|
494
|
-
} = PaymentValidator.
|
|
495
|
-
{
|
|
496
|
-
orderId,
|
|
497
|
-
},
|
|
492
|
+
} = PaymentValidator.getUserOrderBeneficiaries().validate(
|
|
493
|
+
{ orderId },
|
|
498
494
|
{ abortEarly: false, allowUnknown: false }
|
|
499
495
|
);
|
|
500
496
|
if (warrning) {
|
|
501
497
|
Logger({
|
|
502
498
|
level: "WARN",
|
|
503
|
-
message: "Parameter Validation warrnings for
|
|
499
|
+
message: "Parameter Validation warrnings for getUserOrderBeneficiaries",
|
|
504
500
|
});
|
|
505
501
|
Logger({ level: "WARN", message: warrning });
|
|
506
502
|
}
|
|
@@ -511,7 +507,7 @@ class Payment {
|
|
|
511
507
|
const response = await PlatformAPIClient.execute(
|
|
512
508
|
this.config,
|
|
513
509
|
"get",
|
|
514
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/refund/accounts/
|
|
510
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/refund/accounts/order`,
|
|
515
511
|
query_params,
|
|
516
512
|
undefined
|
|
517
513
|
);
|
|
@@ -526,7 +522,7 @@ class Payment {
|
|
|
526
522
|
if (res_error) {
|
|
527
523
|
Logger({
|
|
528
524
|
level: "WARN",
|
|
529
|
-
message: "Response Validation Warnnings for
|
|
525
|
+
message: "Response Validation Warnnings for getUserOrderBeneficiaries",
|
|
530
526
|
});
|
|
531
527
|
Logger({ level: "WARN", message: res_error });
|
|
532
528
|
}
|
|
@@ -536,13 +532,13 @@ class Payment {
|
|
|
536
532
|
|
|
537
533
|
/**
|
|
538
534
|
* @param {Object} arg - Arg object.
|
|
539
|
-
* @param {
|
|
540
|
-
* @returns {Promise<
|
|
541
|
-
* @summary:
|
|
542
|
-
* @description:
|
|
535
|
+
* @param {PaymentGatewayConfigRequest} arg.body
|
|
536
|
+
* @returns {Promise<PaymentGatewayToBeReviewed>} - Success response
|
|
537
|
+
* @summary: Save Config Secret For Brand Payment Gateway
|
|
538
|
+
* @description: Save Config Secret For Brand Payment Gateway
|
|
543
539
|
*/
|
|
544
|
-
async
|
|
545
|
-
const { error } = PaymentValidator.
|
|
540
|
+
async saveBrandPaymentGatewayConfig({ body } = {}) {
|
|
541
|
+
const { error } = PaymentValidator.saveBrandPaymentGatewayConfig().validate(
|
|
546
542
|
{
|
|
547
543
|
body,
|
|
548
544
|
},
|
|
@@ -553,7 +549,9 @@ class Payment {
|
|
|
553
549
|
}
|
|
554
550
|
|
|
555
551
|
// Showing warrnings if extra unknown parameters are found
|
|
556
|
-
const {
|
|
552
|
+
const {
|
|
553
|
+
error: warrning,
|
|
554
|
+
} = PaymentValidator.saveBrandPaymentGatewayConfig().validate(
|
|
557
555
|
{
|
|
558
556
|
body,
|
|
559
557
|
},
|
|
@@ -562,7 +560,8 @@ class Payment {
|
|
|
562
560
|
if (warrning) {
|
|
563
561
|
Logger({
|
|
564
562
|
level: "WARN",
|
|
565
|
-
message:
|
|
563
|
+
message:
|
|
564
|
+
"Parameter Validation warrnings for saveBrandPaymentGatewayConfig",
|
|
566
565
|
});
|
|
567
566
|
Logger({ level: "WARN", message: warrning });
|
|
568
567
|
}
|
|
@@ -572,14 +571,14 @@ class Payment {
|
|
|
572
571
|
const response = await PlatformAPIClient.execute(
|
|
573
572
|
this.config,
|
|
574
573
|
"post",
|
|
575
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
574
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/aggregator/request`,
|
|
576
575
|
query_params,
|
|
577
576
|
body
|
|
578
577
|
);
|
|
579
578
|
|
|
580
579
|
const {
|
|
581
580
|
error: res_error,
|
|
582
|
-
} = PaymentModel.
|
|
581
|
+
} = PaymentModel.PaymentGatewayToBeReviewed().validate(response, {
|
|
583
582
|
abortEarly: false,
|
|
584
583
|
allowUnknown: false,
|
|
585
584
|
});
|
|
@@ -587,7 +586,8 @@ class Payment {
|
|
|
587
586
|
if (res_error) {
|
|
588
587
|
Logger({
|
|
589
588
|
level: "WARN",
|
|
590
|
-
message:
|
|
589
|
+
message:
|
|
590
|
+
"Response Validation Warnnings for saveBrandPaymentGatewayConfig",
|
|
591
591
|
});
|
|
592
592
|
Logger({ level: "WARN", message: res_error });
|
|
593
593
|
}
|
|
@@ -597,17 +597,15 @@ class Payment {
|
|
|
597
597
|
|
|
598
598
|
/**
|
|
599
599
|
* @param {Object} arg - Arg object.
|
|
600
|
-
* @param {
|
|
601
|
-
* @
|
|
602
|
-
* @
|
|
603
|
-
* @
|
|
604
|
-
* @description: Use this API to get user cod limit and reamining limit for the payment
|
|
600
|
+
* @param {SetCODForUserRequest} arg.body
|
|
601
|
+
* @returns {Promise<SetCODOptionResponse>} - Success response
|
|
602
|
+
* @summary: Set COD option for user for payment
|
|
603
|
+
* @description: Use this API to set cod option as true or false for the payment
|
|
605
604
|
*/
|
|
606
|
-
async
|
|
607
|
-
const { error } = PaymentValidator.
|
|
605
|
+
async setUserCODlimitRoutes({ body } = {}) {
|
|
606
|
+
const { error } = PaymentValidator.setUserCODlimitRoutes().validate(
|
|
608
607
|
{
|
|
609
|
-
|
|
610
|
-
mobileNo,
|
|
608
|
+
body,
|
|
611
609
|
},
|
|
612
610
|
{ abortEarly: false, allowUnknown: true }
|
|
613
611
|
);
|
|
@@ -618,36 +616,33 @@ class Payment {
|
|
|
618
616
|
// Showing warrnings if extra unknown parameters are found
|
|
619
617
|
const {
|
|
620
618
|
error: warrning,
|
|
621
|
-
} = PaymentValidator.
|
|
619
|
+
} = PaymentValidator.setUserCODlimitRoutes().validate(
|
|
622
620
|
{
|
|
623
|
-
|
|
624
|
-
mobileNo,
|
|
621
|
+
body,
|
|
625
622
|
},
|
|
626
623
|
{ abortEarly: false, allowUnknown: false }
|
|
627
624
|
);
|
|
628
625
|
if (warrning) {
|
|
629
626
|
Logger({
|
|
630
627
|
level: "WARN",
|
|
631
|
-
message: "Parameter Validation warrnings for
|
|
628
|
+
message: "Parameter Validation warrnings for setUserCODlimitRoutes",
|
|
632
629
|
});
|
|
633
630
|
Logger({ level: "WARN", message: warrning });
|
|
634
631
|
}
|
|
635
632
|
|
|
636
633
|
const query_params = {};
|
|
637
|
-
query_params["merchant_user_id"] = merchantUserId;
|
|
638
|
-
query_params["mobile_no"] = mobileNo;
|
|
639
634
|
|
|
640
635
|
const response = await PlatformAPIClient.execute(
|
|
641
636
|
this.config,
|
|
642
|
-
"
|
|
637
|
+
"put",
|
|
643
638
|
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/user-cod`,
|
|
644
639
|
query_params,
|
|
645
|
-
|
|
640
|
+
body
|
|
646
641
|
);
|
|
647
642
|
|
|
648
643
|
const {
|
|
649
644
|
error: res_error,
|
|
650
|
-
} = PaymentModel.
|
|
645
|
+
} = PaymentModel.SetCODOptionResponse().validate(response, {
|
|
651
646
|
abortEarly: false,
|
|
652
647
|
allowUnknown: false,
|
|
653
648
|
});
|
|
@@ -655,7 +650,7 @@ class Payment {
|
|
|
655
650
|
if (res_error) {
|
|
656
651
|
Logger({
|
|
657
652
|
level: "WARN",
|
|
658
|
-
message: "Response Validation Warnnings for
|
|
653
|
+
message: "Response Validation Warnnings for setUserCODlimitRoutes",
|
|
659
654
|
});
|
|
660
655
|
Logger({ level: "WARN", message: res_error });
|
|
661
656
|
}
|
|
@@ -665,13 +660,15 @@ class Payment {
|
|
|
665
660
|
|
|
666
661
|
/**
|
|
667
662
|
* @param {Object} arg - Arg object.
|
|
668
|
-
* @param {
|
|
669
|
-
* @returns {Promise<
|
|
670
|
-
* @summary:
|
|
671
|
-
* @description:
|
|
663
|
+
* @param {PaymentGatewayConfigRequest} arg.body
|
|
664
|
+
* @returns {Promise<PaymentGatewayToBeReviewed>} - Success response
|
|
665
|
+
* @summary: Save Config Secret For Brand Payment Gateway
|
|
666
|
+
* @description: Save Config Secret For Brand Payment Gateway
|
|
672
667
|
*/
|
|
673
|
-
async
|
|
674
|
-
const {
|
|
668
|
+
async updateBrandPaymentGatewayConfig({ body } = {}) {
|
|
669
|
+
const {
|
|
670
|
+
error,
|
|
671
|
+
} = PaymentValidator.updateBrandPaymentGatewayConfig().validate(
|
|
675
672
|
{
|
|
676
673
|
body,
|
|
677
674
|
},
|
|
@@ -684,7 +681,7 @@ class Payment {
|
|
|
684
681
|
// Showing warrnings if extra unknown parameters are found
|
|
685
682
|
const {
|
|
686
683
|
error: warrning,
|
|
687
|
-
} = PaymentValidator.
|
|
684
|
+
} = PaymentValidator.updateBrandPaymentGatewayConfig().validate(
|
|
688
685
|
{
|
|
689
686
|
body,
|
|
690
687
|
},
|
|
@@ -693,7 +690,8 @@ class Payment {
|
|
|
693
690
|
if (warrning) {
|
|
694
691
|
Logger({
|
|
695
692
|
level: "WARN",
|
|
696
|
-
message:
|
|
693
|
+
message:
|
|
694
|
+
"Parameter Validation warrnings for updateBrandPaymentGatewayConfig",
|
|
697
695
|
});
|
|
698
696
|
Logger({ level: "WARN", message: warrning });
|
|
699
697
|
}
|
|
@@ -703,14 +701,14 @@ class Payment {
|
|
|
703
701
|
const response = await PlatformAPIClient.execute(
|
|
704
702
|
this.config,
|
|
705
703
|
"put",
|
|
706
|
-
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
704
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/aggregator/request`,
|
|
707
705
|
query_params,
|
|
708
706
|
body
|
|
709
707
|
);
|
|
710
708
|
|
|
711
709
|
const {
|
|
712
710
|
error: res_error,
|
|
713
|
-
} = PaymentModel.
|
|
711
|
+
} = PaymentModel.PaymentGatewayToBeReviewed().validate(response, {
|
|
714
712
|
abortEarly: false,
|
|
715
713
|
allowUnknown: false,
|
|
716
714
|
});
|
|
@@ -718,7 +716,8 @@ class Payment {
|
|
|
718
716
|
if (res_error) {
|
|
719
717
|
Logger({
|
|
720
718
|
level: "WARN",
|
|
721
|
-
message:
|
|
719
|
+
message:
|
|
720
|
+
"Response Validation Warnnings for updateBrandPaymentGatewayConfig",
|
|
722
721
|
});
|
|
723
722
|
Logger({ level: "WARN", message: res_error });
|
|
724
723
|
}
|
|
@@ -726,4 +725,5 @@ class Payment {
|
|
|
726
725
|
return response;
|
|
727
726
|
}
|
|
728
727
|
}
|
|
728
|
+
|
|
729
729
|
module.exports = Payment;
|