@gofynd/fdk-client-javascript 0.1.37 → 1.0.1
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 +24 -0
- package/application.d.ts +2 -1
- package/application.js +2 -1
- package/documentation/application/CART.md +315 -289
- package/documentation/application/CATALOG.md +438 -415
- package/documentation/application/FILESTORAGE.md +2 -0
- package/documentation/application/LEAD.md +18 -18
- package/documentation/application/LOGISTIC.md +45 -45
- package/documentation/application/ORDER.md +277 -277
- package/documentation/application/PAYMENT.md +251 -251
- package/documentation/application/POSCART.md +318 -292
- package/documentation/application/REWARDS.md +1 -0
- package/documentation/application/USER.md +19 -14
- package/documentation/platform/CART.md +465 -462
- package/documentation/platform/CATALOG.md +2792 -2711
- package/documentation/platform/COMPANYPROFILE.md +200 -362
- package/documentation/platform/DISCOUNT.md +86 -0
- package/documentation/platform/FILESTORAGE.md +2 -0
- package/documentation/platform/LEAD.md +60 -60
- package/documentation/platform/ORDER.md +1451 -1654
- package/documentation/platform/PAYMENT.md +94 -94
- package/documentation/platform/REWARDS.md +145 -0
- package/documentation/platform/USER.md +24 -14
- package/index.d.ts +4 -1
- package/index.js +13 -4
- package/package.json +9 -9
- package/platform.d.ts +2 -1
- package/platform.js +3 -2
- package/public.d.ts +1 -0
- package/public.js +3 -2
- package/sdk/application/ApplicationAPIClient.js +3 -1
- package/sdk/application/ApplicationClient.d.ts +16 -16
- package/sdk/application/ApplicationClient.js +32 -16
- package/sdk/application/ApplicationConfig.js +3 -2
- package/sdk/application/ApplicationModels.d.ts +0 -832
- package/sdk/application/ApplicationModels.js +3 -10574
- package/sdk/application/{client → Cart}/CartApplicationClient.d.ts +9 -3
- package/sdk/application/{client → Cart}/CartApplicationClient.js +316 -8
- package/sdk/application/Cart/CartApplicationModel.d.ts +81 -0
- package/sdk/application/Cart/CartApplicationModel.js +1136 -0
- package/sdk/application/{models/CartValidator.js → Cart/CartApplicationValidator.js} +17 -12
- package/sdk/application/{client → Catalog}/CatalogApplicationClient.d.ts +8 -5
- package/sdk/application/{client → Catalog}/CatalogApplicationClient.js +389 -8
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +117 -0
- package/sdk/application/Catalog/CatalogApplicationModel.js +1606 -0
- package/sdk/application/{models/CatalogValidator.js → Catalog/CatalogApplicationValidator.js} +4 -1
- package/sdk/application/{client → Common}/CommonApplicationClient.js +24 -2
- package/sdk/application/Common/CommonApplicationModel.d.ts +20 -0
- package/sdk/application/Common/CommonApplicationModel.js +228 -0
- package/sdk/{platform/models/CommonValidator.js → application/Common/CommonApplicationValidator.js} +3 -1
- package/sdk/application/{client → Communication}/CommunicationApplicationClient.js +43 -2
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +15 -0
- package/sdk/application/Communication/CommunicationApplicationModel.js +144 -0
- package/sdk/application/{models/CommunicationValidator.js → Communication/CommunicationApplicationValidator.js} +5 -3
- package/sdk/application/{client → Configuration}/ConfigurationApplicationClient.js +202 -2
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +111 -0
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +1182 -0
- package/sdk/application/{models/ConfigurationValidator.js → Configuration/ConfigurationApplicationValidator.js} +4 -2
- package/sdk/application/{client → Content}/ContentApplicationClient.js +217 -2
- package/sdk/application/Content/ContentApplicationModel.d.ts +105 -0
- package/sdk/application/Content/ContentApplicationModel.js +1349 -0
- package/sdk/application/{models/ContentValidator.js → Content/ContentApplicationValidator.js} +3 -1
- package/sdk/application/{client → FileStorage}/FileStorageApplicationClient.js +35 -2
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +21 -0
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +244 -0
- package/sdk/application/{models/FileStorageValidator.js → FileStorage/FileStorageApplicationValidator.js} +6 -4
- package/sdk/application/{client → Lead}/LeadApplicationClient.js +83 -2
- package/sdk/application/Lead/LeadApplicationModel.d.ts +55 -0
- package/sdk/application/Lead/LeadApplicationModel.js +690 -0
- package/sdk/application/{models/LeadValidator.js → Lead/LeadApplicationValidator.js} +6 -4
- package/sdk/application/{client → Logistic}/LogisticApplicationClient.js +46 -2
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +26 -0
- package/sdk/application/Logistic/LogisticApplicationModel.js +286 -0
- package/sdk/application/{models/LogisticValidator.js → Logistic/LogisticApplicationValidator.js} +5 -3
- package/sdk/application/{client → Order}/OrderApplicationClient.js +148 -2
- package/sdk/application/Order/OrderApplicationModel.d.ts +67 -0
- package/sdk/application/Order/OrderApplicationModel.js +872 -0
- package/sdk/application/{models/OrderValidator.js → Order/OrderApplicationValidator.js} +5 -3
- package/sdk/application/{client → Payment}/PaymentApplicationClient.js +530 -2
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +96 -0
- package/sdk/application/Payment/PaymentApplicationModel.js +1318 -0
- package/sdk/application/{models/PaymentValidator.js → Payment/PaymentApplicationValidator.js} +25 -23
- package/sdk/application/{client → PosCart}/PosCartApplicationClient.d.ts +9 -3
- package/sdk/application/{client → PosCart}/PosCartApplicationClient.js +343 -8
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +79 -0
- package/sdk/application/PosCart/PosCartApplicationModel.js +1132 -0
- package/sdk/application/{models/PosCartValidator.js → PosCart/PosCartApplicationValidator.js} +18 -13
- package/sdk/application/{client → Rewards}/RewardsApplicationClient.js +83 -2
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +23 -0
- package/sdk/application/Rewards/RewardsApplicationModel.js +276 -0
- package/sdk/application/{models/RewardsValidator.js → Rewards/RewardsApplicationValidator.js} +6 -4
- package/sdk/application/{client → Share}/ShareApplicationClient.js +89 -2
- package/sdk/application/Share/ShareApplicationModel.d.ts +16 -0
- package/sdk/application/Share/ShareApplicationModel.js +178 -0
- package/sdk/application/{models/ShareValidator.js → Share/ShareApplicationValidator.js} +4 -2
- package/sdk/application/{client → Theme}/ThemeApplicationClient.js +46 -2
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +49 -0
- package/sdk/application/Theme/ThemeApplicationModel.js +486 -0
- package/sdk/application/{models/ThemeValidator.js → Theme/ThemeApplicationValidator.js} +3 -1
- package/sdk/application/{client → User}/UserApplicationClient.js +407 -2
- package/sdk/application/User/UserApplicationModel.d.ts +95 -0
- package/sdk/application/User/UserApplicationModel.js +998 -0
- package/sdk/application/{models/UserValidator.js → User/UserApplicationValidator.js} +31 -29
- package/sdk/application/index.d.ts +18 -0
- package/sdk/application/index.js +33 -0
- package/sdk/common/AxiosHelper.js +23 -10
- package/sdk/common/Logger.d.ts +2 -0
- package/sdk/common/Logger.js +6 -0
- package/sdk/common/curlHelper.d.ts +2 -0
- package/sdk/common/curlHelper.js +95 -0
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +101 -0
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +399 -0
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +11 -0
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +56 -0
- package/sdk/platform/{client → Analytics}/AnalyticsPlatformClient.js +60 -2
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +23 -0
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +252 -0
- package/sdk/platform/{models/AnalyticsValidator.js → Analytics/AnalyticsPlatformValidator.js} +5 -4
- package/sdk/platform/{client → AuditTrail}/AuditTrailPlatformClient.js +48 -2
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +18 -0
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +144 -0
- package/sdk/platform/{models/AuditTrailValidator.js → AuditTrail/AuditTrailPlatformValidator.js} +3 -2
- package/sdk/platform/{client → Billing}/BillingPlatformClient.js +162 -2
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +65 -0
- package/sdk/platform/Billing/BillingPlatformModel.js +906 -0
- package/sdk/platform/{models/BillingValidator.js → Billing/BillingPlatformValidator.js} +6 -5
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +293 -0
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +1001 -0
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +20 -0
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +138 -0
- package/sdk/platform/Cart/CartPlatformModel.d.ts +104 -0
- package/sdk/platform/Cart/CartPlatformModel.js +1516 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +856 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +2927 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +56 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +389 -0
- package/sdk/platform/{client → Catalog}/CatalogPlatformClient.js +1402 -349
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +317 -0
- package/sdk/platform/Catalog/CatalogPlatformModel.js +4702 -0
- package/sdk/platform/{models/CatalogValidator.js → Catalog/CatalogPlatformValidator.js} +92 -91
- package/sdk/platform/{client → Common}/CommonPlatformClient.js +28 -2
- package/sdk/platform/Common/CommonPlatformModel.d.ts +20 -0
- package/sdk/platform/Common/CommonPlatformModel.js +228 -0
- package/sdk/{application/models/CommonValidator.js → platform/Common/CommonPlatformValidator.js} +2 -1
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +611 -0
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +2243 -0
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +43 -0
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +277 -0
- package/sdk/platform/{client → Communication}/CommunicationPlatformClient.js +17 -2
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +102 -0
- package/sdk/platform/Communication/CommunicationPlatformModel.js +1312 -0
- package/sdk/platform/{models/CommunicationValidator.js → Communication/CommunicationPlatformValidator.js} +2 -1
- package/sdk/platform/{client → CompanyProfile}/CompanyProfilePlatformClient.d.ts +0 -9
- package/sdk/platform/{client → CompanyProfile}/CompanyProfilePlatformClient.js +176 -28
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +44 -0
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +706 -0
- package/sdk/platform/{models/CompanyProfileValidator.d.ts → CompanyProfile/CompanyProfilePlatformValidator.d.ts} +0 -1
- package/sdk/platform/{models/CompanyProfileValidator.js → CompanyProfile/CompanyProfilePlatformValidator.js} +9 -14
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +309 -0
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +1322 -0
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +31 -0
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +164 -0
- package/sdk/platform/{client → Configuration}/ConfigurationPlatformClient.js +284 -2
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +185 -0
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +2072 -0
- package/sdk/platform/{models/ConfigurationValidator.js → Configuration/ConfigurationPlatformValidator.js} +9 -8
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +781 -0
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +3074 -0
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +71 -0
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +422 -0
- package/sdk/platform/Content/ContentPlatformModel.d.ts +105 -0
- package/sdk/platform/Content/ContentPlatformModel.js +1349 -0
- package/sdk/platform/{client → Discount}/DiscountPlatformClient.d.ts +11 -0
- package/sdk/platform/{client → Discount}/DiscountPlatformClient.js +187 -2
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +15 -0
- package/sdk/platform/Discount/DiscountPlatformModel.js +176 -0
- package/sdk/platform/{models/DiscountValidator.d.ts → Discount/DiscountPlatformValidator.d.ts} +1 -0
- package/sdk/platform/{models/DiscountValidator.js → Discount/DiscountPlatformValidator.js} +13 -5
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +114 -0
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +301 -0
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +7 -0
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +38 -0
- package/sdk/platform/{client → FileStorage}/FileStoragePlatformClient.js +78 -2
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +21 -0
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +244 -0
- package/sdk/platform/{models/FileStorageValidator.js → FileStorage/FileStoragePlatformValidator.js} +6 -5
- package/sdk/platform/{client → Inventory}/InventoryPlatformClient.js +163 -2
- package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +62 -0
- package/sdk/platform/Inventory/InventoryPlatformModel.js +1178 -0
- package/sdk/platform/{models/InventoryValidator.js → Inventory/InventoryPlatformValidator.js} +5 -4
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +138 -0
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +559 -0
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +16 -0
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +90 -0
- package/sdk/platform/{client → Lead}/LeadPlatformClient.js +142 -2
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +55 -0
- package/sdk/platform/Lead/LeadPlatformModel.js +690 -0
- package/sdk/platform/{models/LeadValidator.js → Lead/LeadPlatformValidator.js} +7 -6
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +59 -0
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +207 -0
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +6 -0
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +37 -0
- package/sdk/platform/{client → Order}/OrderPlatformClient.d.ts +24 -55
- package/sdk/platform/{client → Order}/OrderPlatformClient.js +693 -146
- package/sdk/platform/Order/OrderPlatformModel.d.ts +222 -0
- package/sdk/platform/Order/OrderPlatformModel.js +3466 -0
- package/sdk/platform/{models/OrderValidator.d.ts → Order/OrderPlatformValidator.d.ts} +2 -3
- package/sdk/platform/{models/OrderValidator.js → Order/OrderPlatformValidator.js} +32 -48
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +30 -0
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +100 -0
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +5 -0
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +20 -0
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +7 -0
- package/sdk/platform/Partner/PartnerPlatformModel.js +54 -0
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +108 -0
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +498 -0
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +14 -0
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +73 -0
- package/sdk/platform/{client → Payment}/PaymentPlatformClient.js +141 -2
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +44 -0
- package/sdk/platform/Payment/PaymentPlatformModel.js +552 -0
- package/sdk/platform/{models/PaymentValidator.js → Payment/PaymentPlatformValidator.js} +6 -5
- package/sdk/platform/PlatformAPIClient.js +2 -1
- package/sdk/platform/PlatformApplicationClient.d.ts +2824 -18486
- package/sdk/platform/PlatformApplicationClient.js +3772 -13928
- package/sdk/platform/PlatformClient.d.ts +2824 -2881
- package/sdk/platform/PlatformClient.js +3710 -3145
- package/sdk/platform/PlatformConfig.js +2 -1
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +150 -0
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +597 -0
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +16 -0
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +91 -0
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +24 -0
- package/sdk/platform/Rewards/RewardsPlatformModel.js +294 -0
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +72 -0
- package/sdk/platform/Share/SharePlatformApplicationClient.js +235 -0
- package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +7 -0
- package/sdk/platform/Share/SharePlatformApplicationValidator.js +35 -0
- package/sdk/platform/Share/SharePlatformModel.d.ts +15 -0
- package/sdk/platform/Share/SharePlatformModel.js +170 -0
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +238 -0
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +997 -0
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +27 -0
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +155 -0
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +49 -0
- package/sdk/platform/Theme/ThemePlatformModel.js +486 -0
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +121 -0
- package/sdk/platform/User/UserPlatformApplicationClient.js +506 -0
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +15 -0
- package/sdk/platform/User/UserPlatformApplicationValidator.js +79 -0
- package/sdk/platform/User/UserPlatformModel.d.ts +95 -0
- package/sdk/platform/User/UserPlatformModel.js +998 -0
- package/sdk/platform/{client → Webhook}/WebhookPlatformClient.js +92 -2
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +17 -0
- package/sdk/platform/Webhook/WebhookPlatformModel.js +208 -0
- package/sdk/platform/{models/WebhookValidator.js → Webhook/WebhookPlatformValidator.js} +4 -3
- package/sdk/platform/index.d.ts +24 -0
- package/sdk/platform/index.js +45 -0
- package/sdk/public/{client → Configuration}/ConfigurationPublicClient.js +26 -1
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +20 -0
- package/sdk/public/Configuration/ConfigurationPublicModel.js +230 -0
- package/sdk/public/{models/ConfigurationValidator.js → Configuration/ConfigurationPublicValidator.js} +3 -1
- package/sdk/public/{client → Inventory}/InventoryPublicClient.js +76 -1
- package/sdk/public/Inventory/InventoryPublicModel.d.ts +22 -0
- package/sdk/public/Inventory/InventoryPublicModel.js +334 -0
- package/sdk/public/{models/InventoryValidator.js → Inventory/InventoryPublicValidator.js} +4 -2
- package/sdk/public/PublicClient.d.ts +3 -3
- package/sdk/public/PublicClient.js +8 -3
- package/sdk/public/{client → Webhook}/WebhookPublicClient.js +30 -1
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +17 -0
- package/sdk/public/Webhook/WebhookPublicModel.js +208 -0
- package/sdk/public/{models/WebhookValidator.js → Webhook/WebhookPublicValidator.js} +4 -2
- package/sdk/public/index.d.ts +5 -0
- package/sdk/public/index.js +7 -0
- package/sdk/platform/PlatformApplicationModels.d.ts +0 -328
- package/sdk/platform/PlatformApplicationModels.js +0 -22658
- package/sdk/platform/PlatformModels.d.ts +0 -1477
- package/sdk/platform/PlatformModels.js +0 -20646
- package/sdk/platform/models/CartValidator.d.ts +0 -0
- package/sdk/platform/models/CartValidator.js +0 -0
- package/sdk/platform/models/ContentValidator.d.ts +0 -0
- package/sdk/platform/models/ContentValidator.js +0 -0
- package/sdk/platform/models/PartnerValidator.d.ts +0 -0
- package/sdk/platform/models/PartnerValidator.js +0 -0
- package/sdk/platform/models/RewardsValidator.d.ts +0 -0
- package/sdk/platform/models/RewardsValidator.js +0 -0
- package/sdk/platform/models/ShareValidator.d.ts +0 -0
- package/sdk/platform/models/ShareValidator.js +0 -0
- package/sdk/platform/models/ThemeValidator.d.ts +0 -0
- package/sdk/platform/models/ThemeValidator.js +0 -0
- package/sdk/platform/models/UserValidator.d.ts +0 -0
- package/sdk/platform/models/UserValidator.js +0 -0
- package/sdk/public/PublicModels.d.ts +0 -50
- package/sdk/public/PublicModels.js +0 -712
- package/sdk/application/{models/CartValidator.d.ts → Cart/CartApplicationValidator.d.ts} +0 -0
- package/sdk/application/{models/CatalogValidator.d.ts → Catalog/CatalogApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → Common}/CommonApplicationClient.d.ts +0 -0
- package/sdk/application/{models/CommonValidator.d.ts → Common/CommonApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → Communication}/CommunicationApplicationClient.d.ts +0 -0
- package/sdk/application/{models/CommunicationValidator.d.ts → Communication/CommunicationApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → Configuration}/ConfigurationApplicationClient.d.ts +0 -0
- package/sdk/application/{models/ConfigurationValidator.d.ts → Configuration/ConfigurationApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → Content}/ContentApplicationClient.d.ts +0 -0
- package/sdk/application/{models/ContentValidator.d.ts → Content/ContentApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → FileStorage}/FileStorageApplicationClient.d.ts +0 -0
- package/sdk/application/{models/FileStorageValidator.d.ts → FileStorage/FileStorageApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → Lead}/LeadApplicationClient.d.ts +0 -0
- package/sdk/application/{models/LeadValidator.d.ts → Lead/LeadApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → Logistic}/LogisticApplicationClient.d.ts +0 -0
- package/sdk/application/{models/LogisticValidator.d.ts → Logistic/LogisticApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → Order}/OrderApplicationClient.d.ts +0 -0
- package/sdk/application/{models/OrderValidator.d.ts → Order/OrderApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → Payment}/PaymentApplicationClient.d.ts +0 -0
- package/sdk/application/{models/PaymentValidator.d.ts → Payment/PaymentApplicationValidator.d.ts} +0 -0
- package/sdk/application/{models/PosCartValidator.d.ts → PosCart/PosCartApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → Rewards}/RewardsApplicationClient.d.ts +0 -0
- package/sdk/application/{models/RewardsValidator.d.ts → Rewards/RewardsApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → Share}/ShareApplicationClient.d.ts +0 -0
- package/sdk/application/{models/ShareValidator.d.ts → Share/ShareApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → Theme}/ThemeApplicationClient.d.ts +0 -0
- package/sdk/application/{models/ThemeValidator.d.ts → Theme/ThemeApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → User}/UserApplicationClient.d.ts +0 -0
- package/sdk/application/{models/UserValidator.d.ts → User/UserApplicationValidator.d.ts} +0 -0
- package/sdk/platform/{client → Analytics}/AnalyticsPlatformClient.d.ts +0 -0
- package/sdk/platform/{models/AnalyticsValidator.d.ts → Analytics/AnalyticsPlatformValidator.d.ts} +0 -0
- package/sdk/platform/{client → AuditTrail}/AuditTrailPlatformClient.d.ts +0 -0
- package/sdk/platform/{models/AuditTrailValidator.d.ts → AuditTrail/AuditTrailPlatformValidator.d.ts} +0 -0
- package/sdk/platform/{client → Billing}/BillingPlatformClient.d.ts +0 -0
- package/sdk/platform/{models/BillingValidator.d.ts → Billing/BillingPlatformValidator.d.ts} +0 -0
- package/sdk/platform/{client → Catalog}/CatalogPlatformClient.d.ts +149 -149
- package/sdk/platform/{models/CatalogValidator.d.ts → Catalog/CatalogPlatformValidator.d.ts} +21 -21
- /package/sdk/platform/{client → Common}/CommonPlatformClient.d.ts +0 -0
- /package/sdk/platform/{models/CommonValidator.d.ts → Common/CommonPlatformValidator.d.ts} +0 -0
- /package/sdk/platform/{client → Communication}/CommunicationPlatformClient.d.ts +0 -0
- /package/sdk/platform/{models/CommunicationValidator.d.ts → Communication/CommunicationPlatformValidator.d.ts} +0 -0
- /package/sdk/platform/{client → Configuration}/ConfigurationPlatformClient.d.ts +0 -0
- /package/sdk/platform/{models/ConfigurationValidator.d.ts → Configuration/ConfigurationPlatformValidator.d.ts} +0 -0
- /package/sdk/platform/{client → FileStorage}/FileStoragePlatformClient.d.ts +0 -0
- /package/sdk/platform/{models/FileStorageValidator.d.ts → FileStorage/FileStoragePlatformValidator.d.ts} +0 -0
- /package/sdk/platform/{client → Inventory}/InventoryPlatformClient.d.ts +0 -0
- /package/sdk/platform/{models/InventoryValidator.d.ts → Inventory/InventoryPlatformValidator.d.ts} +0 -0
- /package/sdk/platform/{client → Lead}/LeadPlatformClient.d.ts +0 -0
- /package/sdk/platform/{models/LeadValidator.d.ts → Lead/LeadPlatformValidator.d.ts} +0 -0
- /package/sdk/platform/{client → Payment}/PaymentPlatformClient.d.ts +0 -0
- /package/sdk/platform/{models/PaymentValidator.d.ts → Payment/PaymentPlatformValidator.d.ts} +0 -0
- /package/sdk/platform/{client → Webhook}/WebhookPlatformClient.d.ts +0 -0
- /package/sdk/platform/{models/WebhookValidator.d.ts → Webhook/WebhookPlatformValidator.d.ts} +0 -0
- /package/sdk/public/{client → Configuration}/ConfigurationPublicClient.d.ts +0 -0
- /package/sdk/public/{models/ConfigurationValidator.d.ts → Configuration/ConfigurationPublicValidator.d.ts} +0 -0
- /package/sdk/public/{client → Inventory}/InventoryPublicClient.d.ts +0 -0
- /package/sdk/public/{models/InventoryValidator.d.ts → Inventory/InventoryPublicValidator.d.ts} +0 -0
- /package/sdk/public/{client → Webhook}/WebhookPublicClient.d.ts +0 -0
- /package/sdk/public/{models/WebhookValidator.d.ts → Webhook/WebhookPublicValidator.d.ts} +0 -0
|
@@ -0,0 +1,498 @@
|
|
|
1
|
+
const Paginator = require("../../common/Paginator");
|
|
2
|
+
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
3
|
+
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
4
|
+
const PaymentValidator = require("./PaymentPlatformApplicationValidator");
|
|
5
|
+
|
|
6
|
+
class Payment {
|
|
7
|
+
constructor(config, applicationId) {
|
|
8
|
+
this.config = config;
|
|
9
|
+
this.applicationId = applicationId;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @param {Object} arg - Arg object.
|
|
14
|
+
* @summary: Get All Brand Payment Gateway Config Secret
|
|
15
|
+
* @description: Get All Brand Payment Gateway Config Secret
|
|
16
|
+
*/
|
|
17
|
+
getBrandPaymentGatewayConfig({} = {}) {
|
|
18
|
+
const { error } = PaymentValidator.getBrandPaymentGatewayConfig().validate(
|
|
19
|
+
{},
|
|
20
|
+
{ abortEarly: false, allowUnknown: true }
|
|
21
|
+
);
|
|
22
|
+
if (error) {
|
|
23
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Showing warrnings if extra unknown parameters are found
|
|
27
|
+
const {
|
|
28
|
+
error: warrning,
|
|
29
|
+
} = PaymentValidator.getBrandPaymentGatewayConfig().validate(
|
|
30
|
+
{},
|
|
31
|
+
{ abortEarly: false, allowUnknown: false }
|
|
32
|
+
);
|
|
33
|
+
if (warrning) {
|
|
34
|
+
console.log(
|
|
35
|
+
"Parameter Validation warrnings for getBrandPaymentGatewayConfig"
|
|
36
|
+
);
|
|
37
|
+
console.log(warrning);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const query_params = {};
|
|
41
|
+
|
|
42
|
+
return PlatformAPIClient.execute(
|
|
43
|
+
this.config,
|
|
44
|
+
"get",
|
|
45
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/aggregator/request`,
|
|
46
|
+
query_params,
|
|
47
|
+
undefined
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @param {Object} arg - Arg object.
|
|
53
|
+
* @param {PaymentGatewayConfigRequest} arg.body
|
|
54
|
+
* @summary: Save Config Secret For Brand Payment Gateway
|
|
55
|
+
* @description: Save Config Secret For Brand Payment Gateway
|
|
56
|
+
*/
|
|
57
|
+
saveBrandPaymentGatewayConfig({ body } = {}) {
|
|
58
|
+
const { error } = PaymentValidator.saveBrandPaymentGatewayConfig().validate(
|
|
59
|
+
{
|
|
60
|
+
body,
|
|
61
|
+
},
|
|
62
|
+
{ abortEarly: false, allowUnknown: true }
|
|
63
|
+
);
|
|
64
|
+
if (error) {
|
|
65
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Showing warrnings if extra unknown parameters are found
|
|
69
|
+
const {
|
|
70
|
+
error: warrning,
|
|
71
|
+
} = PaymentValidator.saveBrandPaymentGatewayConfig().validate(
|
|
72
|
+
{
|
|
73
|
+
body,
|
|
74
|
+
},
|
|
75
|
+
{ abortEarly: false, allowUnknown: false }
|
|
76
|
+
);
|
|
77
|
+
if (warrning) {
|
|
78
|
+
console.log(
|
|
79
|
+
"Parameter Validation warrnings for saveBrandPaymentGatewayConfig"
|
|
80
|
+
);
|
|
81
|
+
console.log(warrning);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const query_params = {};
|
|
85
|
+
|
|
86
|
+
return PlatformAPIClient.execute(
|
|
87
|
+
this.config,
|
|
88
|
+
"post",
|
|
89
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/aggregator/request`,
|
|
90
|
+
query_params,
|
|
91
|
+
body
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* @param {Object} arg - Arg object.
|
|
97
|
+
* @param {PaymentGatewayConfigRequest} arg.body
|
|
98
|
+
* @summary: Save Config Secret For Brand Payment Gateway
|
|
99
|
+
* @description: Save Config Secret For Brand Payment Gateway
|
|
100
|
+
*/
|
|
101
|
+
updateBrandPaymentGatewayConfig({ body } = {}) {
|
|
102
|
+
const {
|
|
103
|
+
error,
|
|
104
|
+
} = PaymentValidator.updateBrandPaymentGatewayConfig().validate(
|
|
105
|
+
{
|
|
106
|
+
body,
|
|
107
|
+
},
|
|
108
|
+
{ abortEarly: false, allowUnknown: true }
|
|
109
|
+
);
|
|
110
|
+
if (error) {
|
|
111
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// Showing warrnings if extra unknown parameters are found
|
|
115
|
+
const {
|
|
116
|
+
error: warrning,
|
|
117
|
+
} = PaymentValidator.updateBrandPaymentGatewayConfig().validate(
|
|
118
|
+
{
|
|
119
|
+
body,
|
|
120
|
+
},
|
|
121
|
+
{ abortEarly: false, allowUnknown: false }
|
|
122
|
+
);
|
|
123
|
+
if (warrning) {
|
|
124
|
+
console.log(
|
|
125
|
+
"Parameter Validation warrnings for updateBrandPaymentGatewayConfig"
|
|
126
|
+
);
|
|
127
|
+
console.log(warrning);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const query_params = {};
|
|
131
|
+
|
|
132
|
+
return PlatformAPIClient.execute(
|
|
133
|
+
this.config,
|
|
134
|
+
"put",
|
|
135
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/aggregator/request`,
|
|
136
|
+
query_params,
|
|
137
|
+
body
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* @param {Object} arg - Arg object.
|
|
143
|
+
* @param {boolean} arg.refresh -
|
|
144
|
+
* @param {string} arg.requestType -
|
|
145
|
+
* @summary: Get All Valid Payment Options
|
|
146
|
+
* @description: Use this API to get Get All Valid Payment Options for making payment
|
|
147
|
+
*/
|
|
148
|
+
getPaymentModeRoutes({ refresh, requestType } = {}) {
|
|
149
|
+
const { error } = PaymentValidator.getPaymentModeRoutes().validate(
|
|
150
|
+
{
|
|
151
|
+
refresh,
|
|
152
|
+
requestType,
|
|
153
|
+
},
|
|
154
|
+
{ abortEarly: false, allowUnknown: true }
|
|
155
|
+
);
|
|
156
|
+
if (error) {
|
|
157
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// Showing warrnings if extra unknown parameters are found
|
|
161
|
+
const {
|
|
162
|
+
error: warrning,
|
|
163
|
+
} = PaymentValidator.getPaymentModeRoutes().validate(
|
|
164
|
+
{
|
|
165
|
+
refresh,
|
|
166
|
+
requestType,
|
|
167
|
+
},
|
|
168
|
+
{ abortEarly: false, allowUnknown: false }
|
|
169
|
+
);
|
|
170
|
+
if (warrning) {
|
|
171
|
+
console.log("Parameter Validation warrnings for getPaymentModeRoutes");
|
|
172
|
+
console.log(warrning);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const query_params = {};
|
|
176
|
+
query_params["refresh"] = refresh;
|
|
177
|
+
query_params["request_type"] = requestType;
|
|
178
|
+
|
|
179
|
+
return PlatformAPIClient.execute(
|
|
180
|
+
this.config,
|
|
181
|
+
"get",
|
|
182
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/options`,
|
|
183
|
+
query_params,
|
|
184
|
+
undefined
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* @param {Object} arg - Arg object.
|
|
190
|
+
* @param {string} arg.orderId -
|
|
191
|
+
* @param {string} [arg.requestHash] -
|
|
192
|
+
* @summary: Get bank details
|
|
193
|
+
* @description: Use this API to get saved bank details for returned/cancelled order using order id.
|
|
194
|
+
*/
|
|
195
|
+
getBankAccountDetailsOpenAPI({ orderId, requestHash } = {}) {
|
|
196
|
+
const { error } = PaymentValidator.getBankAccountDetailsOpenAPI().validate(
|
|
197
|
+
{
|
|
198
|
+
orderId,
|
|
199
|
+
requestHash,
|
|
200
|
+
},
|
|
201
|
+
{ abortEarly: false, allowUnknown: true }
|
|
202
|
+
);
|
|
203
|
+
if (error) {
|
|
204
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// Showing warrnings if extra unknown parameters are found
|
|
208
|
+
const {
|
|
209
|
+
error: warrning,
|
|
210
|
+
} = PaymentValidator.getBankAccountDetailsOpenAPI().validate(
|
|
211
|
+
{
|
|
212
|
+
orderId,
|
|
213
|
+
requestHash,
|
|
214
|
+
},
|
|
215
|
+
{ abortEarly: false, allowUnknown: false }
|
|
216
|
+
);
|
|
217
|
+
if (warrning) {
|
|
218
|
+
console.log(
|
|
219
|
+
"Parameter Validation warrnings for getBankAccountDetailsOpenAPI"
|
|
220
|
+
);
|
|
221
|
+
console.log(warrning);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
const query_params = {};
|
|
225
|
+
query_params["order_id"] = orderId;
|
|
226
|
+
query_params["request_hash"] = requestHash;
|
|
227
|
+
|
|
228
|
+
return PlatformAPIClient.execute(
|
|
229
|
+
this.config,
|
|
230
|
+
"get",
|
|
231
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/refund/account`,
|
|
232
|
+
query_params,
|
|
233
|
+
undefined
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* @param {Object} arg - Arg object.
|
|
239
|
+
* @param {AddBeneficiaryDetailsOTPRequest} arg.body
|
|
240
|
+
* @summary: Save bank details for cancelled/returned order
|
|
241
|
+
* @description: Use this API to save bank details for returned/cancelled order to refund amount in his account.
|
|
242
|
+
*/
|
|
243
|
+
addRefundBankAccountUsingOTP({ body } = {}) {
|
|
244
|
+
const { error } = PaymentValidator.addRefundBankAccountUsingOTP().validate(
|
|
245
|
+
{
|
|
246
|
+
body,
|
|
247
|
+
},
|
|
248
|
+
{ abortEarly: false, allowUnknown: true }
|
|
249
|
+
);
|
|
250
|
+
if (error) {
|
|
251
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// Showing warrnings if extra unknown parameters are found
|
|
255
|
+
const {
|
|
256
|
+
error: warrning,
|
|
257
|
+
} = PaymentValidator.addRefundBankAccountUsingOTP().validate(
|
|
258
|
+
{
|
|
259
|
+
body,
|
|
260
|
+
},
|
|
261
|
+
{ abortEarly: false, allowUnknown: false }
|
|
262
|
+
);
|
|
263
|
+
if (warrning) {
|
|
264
|
+
console.log(
|
|
265
|
+
"Parameter Validation warrnings for addRefundBankAccountUsingOTP"
|
|
266
|
+
);
|
|
267
|
+
console.log(warrning);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
const query_params = {};
|
|
271
|
+
|
|
272
|
+
return PlatformAPIClient.execute(
|
|
273
|
+
this.config,
|
|
274
|
+
"post",
|
|
275
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/refund/account`,
|
|
276
|
+
query_params,
|
|
277
|
+
body
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* @param {Object} arg - Arg object.
|
|
283
|
+
* @param {string} arg.orderId -
|
|
284
|
+
* @summary: List Order Beneficiary
|
|
285
|
+
* @description: Get all active beneficiary details added by the user for refund
|
|
286
|
+
*/
|
|
287
|
+
getUserOrderBeneficiaries({ orderId } = {}) {
|
|
288
|
+
const { error } = PaymentValidator.getUserOrderBeneficiaries().validate(
|
|
289
|
+
{
|
|
290
|
+
orderId,
|
|
291
|
+
},
|
|
292
|
+
{ abortEarly: false, allowUnknown: true }
|
|
293
|
+
);
|
|
294
|
+
if (error) {
|
|
295
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// Showing warrnings if extra unknown parameters are found
|
|
299
|
+
const {
|
|
300
|
+
error: warrning,
|
|
301
|
+
} = PaymentValidator.getUserOrderBeneficiaries().validate(
|
|
302
|
+
{
|
|
303
|
+
orderId,
|
|
304
|
+
},
|
|
305
|
+
{ abortEarly: false, allowUnknown: false }
|
|
306
|
+
);
|
|
307
|
+
if (warrning) {
|
|
308
|
+
console.log(
|
|
309
|
+
"Parameter Validation warrnings for getUserOrderBeneficiaries"
|
|
310
|
+
);
|
|
311
|
+
console.log(warrning);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
const query_params = {};
|
|
315
|
+
query_params["order_id"] = orderId;
|
|
316
|
+
|
|
317
|
+
return PlatformAPIClient.execute(
|
|
318
|
+
this.config,
|
|
319
|
+
"get",
|
|
320
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/refund/accounts/order`,
|
|
321
|
+
query_params,
|
|
322
|
+
undefined
|
|
323
|
+
);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* @param {Object} arg - Arg object.
|
|
328
|
+
* @param {string} arg.orderId -
|
|
329
|
+
* @summary: List User Beneficiary
|
|
330
|
+
* @description: Get all active beneficiary details added by the user for refund
|
|
331
|
+
*/
|
|
332
|
+
getUserBeneficiaries({ orderId } = {}) {
|
|
333
|
+
const { error } = PaymentValidator.getUserBeneficiaries().validate(
|
|
334
|
+
{
|
|
335
|
+
orderId,
|
|
336
|
+
},
|
|
337
|
+
{ abortEarly: false, allowUnknown: true }
|
|
338
|
+
);
|
|
339
|
+
if (error) {
|
|
340
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// Showing warrnings if extra unknown parameters are found
|
|
344
|
+
const {
|
|
345
|
+
error: warrning,
|
|
346
|
+
} = PaymentValidator.getUserBeneficiaries().validate(
|
|
347
|
+
{
|
|
348
|
+
orderId,
|
|
349
|
+
},
|
|
350
|
+
{ abortEarly: false, allowUnknown: false }
|
|
351
|
+
);
|
|
352
|
+
if (warrning) {
|
|
353
|
+
console.log("Parameter Validation warrnings for getUserBeneficiaries");
|
|
354
|
+
console.log(warrning);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
const query_params = {};
|
|
358
|
+
query_params["order_id"] = orderId;
|
|
359
|
+
|
|
360
|
+
return PlatformAPIClient.execute(
|
|
361
|
+
this.config,
|
|
362
|
+
"get",
|
|
363
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/refund/accounts/user`,
|
|
364
|
+
query_params,
|
|
365
|
+
undefined
|
|
366
|
+
);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* @param {Object} arg - Arg object.
|
|
371
|
+
* @param {PaymentConfirmationRequest} arg.body
|
|
372
|
+
* @summary: Confirm payment after successful payment from payment gateway
|
|
373
|
+
* @description: Use this API to confirm payment after payment gateway accepted payment.
|
|
374
|
+
*/
|
|
375
|
+
confirmPayment({ body } = {}) {
|
|
376
|
+
const { error } = PaymentValidator.confirmPayment().validate(
|
|
377
|
+
{
|
|
378
|
+
body,
|
|
379
|
+
},
|
|
380
|
+
{ abortEarly: false, allowUnknown: true }
|
|
381
|
+
);
|
|
382
|
+
if (error) {
|
|
383
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
// Showing warrnings if extra unknown parameters are found
|
|
387
|
+
const { error: warrning } = PaymentValidator.confirmPayment().validate(
|
|
388
|
+
{
|
|
389
|
+
body,
|
|
390
|
+
},
|
|
391
|
+
{ abortEarly: false, allowUnknown: false }
|
|
392
|
+
);
|
|
393
|
+
if (warrning) {
|
|
394
|
+
console.log("Parameter Validation warrnings for confirmPayment");
|
|
395
|
+
console.log(warrning);
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
const query_params = {};
|
|
399
|
+
|
|
400
|
+
return PlatformAPIClient.execute(
|
|
401
|
+
this.config,
|
|
402
|
+
"post",
|
|
403
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/confirm`,
|
|
404
|
+
query_params,
|
|
405
|
+
body
|
|
406
|
+
);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* @param {Object} arg - Arg object.
|
|
411
|
+
* @param {string} arg.merchantUserId -
|
|
412
|
+
* @param {string} arg.mobileNo -
|
|
413
|
+
* @summary: Get COD limit for user
|
|
414
|
+
* @description: Use this API to get user cod limit and reamining limit for the payment
|
|
415
|
+
*/
|
|
416
|
+
getUserCODlimitRoutes({ merchantUserId, mobileNo } = {}) {
|
|
417
|
+
const { error } = PaymentValidator.getUserCODlimitRoutes().validate(
|
|
418
|
+
{
|
|
419
|
+
merchantUserId,
|
|
420
|
+
mobileNo,
|
|
421
|
+
},
|
|
422
|
+
{ abortEarly: false, allowUnknown: true }
|
|
423
|
+
);
|
|
424
|
+
if (error) {
|
|
425
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
// Showing warrnings if extra unknown parameters are found
|
|
429
|
+
const {
|
|
430
|
+
error: warrning,
|
|
431
|
+
} = PaymentValidator.getUserCODlimitRoutes().validate(
|
|
432
|
+
{
|
|
433
|
+
merchantUserId,
|
|
434
|
+
mobileNo,
|
|
435
|
+
},
|
|
436
|
+
{ abortEarly: false, allowUnknown: false }
|
|
437
|
+
);
|
|
438
|
+
if (warrning) {
|
|
439
|
+
console.log("Parameter Validation warrnings for getUserCODlimitRoutes");
|
|
440
|
+
console.log(warrning);
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
const query_params = {};
|
|
444
|
+
query_params["merchant_user_id"] = merchantUserId;
|
|
445
|
+
query_params["mobile_no"] = mobileNo;
|
|
446
|
+
|
|
447
|
+
return PlatformAPIClient.execute(
|
|
448
|
+
this.config,
|
|
449
|
+
"get",
|
|
450
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/user-cod`,
|
|
451
|
+
query_params,
|
|
452
|
+
undefined
|
|
453
|
+
);
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
/**
|
|
457
|
+
* @param {Object} arg - Arg object.
|
|
458
|
+
* @param {SetCODForUserRequest} arg.body
|
|
459
|
+
* @summary: Set COD option for user for payment
|
|
460
|
+
* @description: Use this API to set cod option as true or false for the payment
|
|
461
|
+
*/
|
|
462
|
+
setUserCODlimitRoutes({ body } = {}) {
|
|
463
|
+
const { error } = PaymentValidator.setUserCODlimitRoutes().validate(
|
|
464
|
+
{
|
|
465
|
+
body,
|
|
466
|
+
},
|
|
467
|
+
{ abortEarly: false, allowUnknown: true }
|
|
468
|
+
);
|
|
469
|
+
if (error) {
|
|
470
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
// Showing warrnings if extra unknown parameters are found
|
|
474
|
+
const {
|
|
475
|
+
error: warrning,
|
|
476
|
+
} = PaymentValidator.setUserCODlimitRoutes().validate(
|
|
477
|
+
{
|
|
478
|
+
body,
|
|
479
|
+
},
|
|
480
|
+
{ abortEarly: false, allowUnknown: false }
|
|
481
|
+
);
|
|
482
|
+
if (warrning) {
|
|
483
|
+
console.log("Parameter Validation warrnings for setUserCODlimitRoutes");
|
|
484
|
+
console.log(warrning);
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
const query_params = {};
|
|
488
|
+
|
|
489
|
+
return PlatformAPIClient.execute(
|
|
490
|
+
this.config,
|
|
491
|
+
"put",
|
|
492
|
+
`/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/user-cod`,
|
|
493
|
+
query_params,
|
|
494
|
+
body
|
|
495
|
+
);
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
module.exports = Payment;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export = PaymentValidator;
|
|
2
|
+
declare class PaymentValidator {
|
|
3
|
+
static getBrandPaymentGatewayConfig(): any;
|
|
4
|
+
static saveBrandPaymentGatewayConfig(): any;
|
|
5
|
+
static updateBrandPaymentGatewayConfig(): any;
|
|
6
|
+
static getPaymentModeRoutes(): any;
|
|
7
|
+
static getBankAccountDetailsOpenAPI(): any;
|
|
8
|
+
static addRefundBankAccountUsingOTP(): any;
|
|
9
|
+
static getUserOrderBeneficiaries(): any;
|
|
10
|
+
static getUserBeneficiaries(): any;
|
|
11
|
+
static confirmPayment(): any;
|
|
12
|
+
static getUserCODlimitRoutes(): any;
|
|
13
|
+
static setUserCODlimitRoutes(): any;
|
|
14
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
const Joi = require("joi");
|
|
2
|
+
const PaymentModel = require("./PaymentPlatformModel");
|
|
3
|
+
|
|
4
|
+
class PaymentValidator {
|
|
5
|
+
static getBrandPaymentGatewayConfig() {
|
|
6
|
+
return Joi.object({}).required();
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
static saveBrandPaymentGatewayConfig() {
|
|
10
|
+
return Joi.object({
|
|
11
|
+
body: PaymentModel.PaymentGatewayConfigRequest().required(),
|
|
12
|
+
}).required();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
static updateBrandPaymentGatewayConfig() {
|
|
16
|
+
return Joi.object({
|
|
17
|
+
body: PaymentModel.PaymentGatewayConfigRequest().required(),
|
|
18
|
+
}).required();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
static getPaymentModeRoutes() {
|
|
22
|
+
return Joi.object({
|
|
23
|
+
refresh: Joi.boolean().required(),
|
|
24
|
+
requestType: Joi.string().allow("").required(),
|
|
25
|
+
}).required();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
static getBankAccountDetailsOpenAPI() {
|
|
29
|
+
return Joi.object({
|
|
30
|
+
orderId: Joi.string().allow("").required(),
|
|
31
|
+
requestHash: Joi.string().allow(""),
|
|
32
|
+
}).required();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
static addRefundBankAccountUsingOTP() {
|
|
36
|
+
return Joi.object({
|
|
37
|
+
body: PaymentModel.AddBeneficiaryDetailsOTPRequest().required(),
|
|
38
|
+
}).required();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
static getUserOrderBeneficiaries() {
|
|
42
|
+
return Joi.object({
|
|
43
|
+
orderId: Joi.string().allow("").required(),
|
|
44
|
+
}).required();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
static getUserBeneficiaries() {
|
|
48
|
+
return Joi.object({
|
|
49
|
+
orderId: Joi.string().allow("").required(),
|
|
50
|
+
}).required();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
static confirmPayment() {
|
|
54
|
+
return Joi.object({
|
|
55
|
+
body: PaymentModel.PaymentConfirmationRequest().required(),
|
|
56
|
+
}).required();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
static getUserCODlimitRoutes() {
|
|
60
|
+
return Joi.object({
|
|
61
|
+
merchantUserId: Joi.string().allow("").required(),
|
|
62
|
+
mobileNo: Joi.string().allow("").required(),
|
|
63
|
+
}).required();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
static setUserCODlimitRoutes() {
|
|
67
|
+
return Joi.object({
|
|
68
|
+
body: PaymentModel.SetCODForUserRequest().required(),
|
|
69
|
+
}).required();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
module.exports = PaymentValidator;
|