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