@gofynd/fdk-client-javascript 1.0.2 → 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 +557 -1279
- 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 +14453 -17192
- 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 +3438 -4172
- 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 +3400 -5361
- 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/Cart/CartApplicationClient.d.ts +243 -243
- package/sdk/application/Cart/CartApplicationClient.js +567 -567
- 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 +1036 -1036
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +90 -90
- package/sdk/application/Catalog/CatalogApplicationModel.js +677 -1243
- 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 +38 -38
- 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 +26 -26
- 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 +330 -330
- 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 +191 -191
- package/sdk/application/Content/ContentApplicationModel.d.ts +76 -76
- package/sdk/application/Content/ContentApplicationModel.js +467 -884
- package/sdk/application/Content/ContentApplicationValidator.d.ts +5 -5
- package/sdk/application/Content/ContentApplicationValidator.js +24 -24
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +25 -25
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +59 -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 +100 -100
- 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 +110 -43
- 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 +85 -85
- package/sdk/application/Order/OrderApplicationClient.js +232 -232
- package/sdk/application/Order/OrderApplicationModel.d.ts +50 -50
- package/sdk/application/Order/OrderApplicationModel.js +352 -656
- package/sdk/application/Order/OrderApplicationValidator.d.ts +7 -7
- package/sdk/application/Order/OrderApplicationValidator.js +28 -28
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +318 -318
- package/sdk/application/Payment/PaymentApplicationClient.js +739 -739
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +72 -72
- package/sdk/application/Payment/PaymentApplicationModel.js +570 -1038
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +28 -28
- package/sdk/application/Payment/PaymentApplicationValidator.js +107 -107
- package/sdk/application/PosCart/PosCartApplicationClient.d.ts +254 -254
- package/sdk/application/PosCart/PosCartApplicationClient.js +617 -617
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +64 -63
- package/sdk/application/PosCart/PosCartApplicationModel.js +475 -871
- 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 +112 -112
- 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 +84 -84
- 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 +31 -31
- 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 +581 -581
- 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 +51 -51
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +179 -179
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +6 -6
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +20 -20
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +11 -11
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +95 -178
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +10 -10
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +41 -41
- 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 +60 -60
- package/sdk/platform/Billing/BillingPlatformClient.js +181 -181
- 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 +168 -168
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +553 -553
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +11 -11
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +63 -63
- package/sdk/platform/Cart/CartPlatformModel.d.ts +84 -83
- package/sdk/platform/Cart/CartPlatformModel.js +671 -1205
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +632 -632
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1525 -1525
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +40 -40
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +174 -174
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +682 -682
- package/sdk/platform/Catalog/CatalogPlatformClient.js +1557 -1557
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +291 -291
- package/sdk/platform/Catalog/CatalogPlatformModel.js +2127 -3904
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +66 -66
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +229 -229
- package/sdk/platform/Common/CommonPlatformClient.d.ts +12 -12
- package/sdk/platform/Common/CommonPlatformClient.js +41 -41
- 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 +326 -326
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +943 -943
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +30 -30
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +87 -87
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +67 -67
- package/sdk/platform/Communication/CommunicationPlatformModel.js +522 -974
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +55 -55
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +212 -212
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +27 -27
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +279 -542
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +7 -7
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +24 -24
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +163 -153
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +615 -552
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +22 -21
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +69 -63
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +125 -125
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +342 -342
- 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 +534 -534
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +1324 -1324
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +50 -50
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +156 -156
- package/sdk/platform/Content/ContentPlatformModel.d.ts +78 -78
- package/sdk/platform/Content/ContentPlatformModel.js +484 -907
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +65 -65
- package/sdk/platform/Discount/DiscountPlatformClient.js +216 -216
- 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 +24 -24
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +58 -58
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +8 -8
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +52 -52
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +123 -123
- 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 +63 -63
- package/sdk/platform/Inventory/InventoryPlatformClient.js +228 -228
- 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 +73 -73
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +200 -200
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +7 -7
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +28 -28
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +80 -80
- package/sdk/platform/Lead/LeadPlatformClient.js +212 -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/Order/OrderPlatformApplicationClient.d.ts +10 -10
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +65 -65
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +6 -6
- package/sdk/platform/Order/OrderPlatformClient.d.ts +357 -357
- package/sdk/platform/Order/OrderPlatformClient.js +1035 -1035
- package/sdk/platform/Order/OrderPlatformModel.d.ts +198 -196
- package/sdk/platform/Order/OrderPlatformModel.js +1574 -2861
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +32 -32
- package/sdk/platform/Order/OrderPlatformValidator.js +160 -160
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -1
- package/sdk/platform/Partner/PartnerPlatformModel.js +10 -26
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +57 -57
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +167 -167
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +6 -6
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +23 -23
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +42 -42
- package/sdk/platform/Payment/PaymentPlatformClient.js +153 -153
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +27 -27
- package/sdk/platform/Payment/PaymentPlatformModel.js +222 -410
- package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +4 -4
- package/sdk/platform/Payment/PaymentPlatformValidator.js +21 -21
- package/sdk/platform/PlatformApplicationClient.d.ts +1496 -10325
- package/sdk/platform/PlatformApplicationClient.js +1584 -13899
- package/sdk/platform/PlatformClient.d.ts +7965 -7885
- package/sdk/platform/PlatformClient.js +8672 -10105
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +83 -83
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +275 -275
- 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 +10 -10
- package/sdk/platform/Share/SharePlatformApplicationClient.js +59 -59
- 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 +132 -132
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +310 -310
- 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 +136 -69
- package/sdk/platform/User/UserPlatformApplicationClient.js +505 -166
- 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 +31 -31
- package/sdk/platform/Webhook/WebhookPlatformClient.js +88 -88
- 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 +38 -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 +113 -113
- package/sdk/public/Inventory/InventoryPublicModel.d.ts +10 -10
- package/sdk/public/Inventory/InventoryPublicModel.js +119 -245
- package/sdk/public/Inventory/InventoryPublicValidator.d.ts +3 -3
- package/sdk/public/Inventory/InventoryPublicValidator.js +15 -15
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +7 -7
- package/sdk/public/Webhook/WebhookPublicModel.js +68 -136
- package/tests/application/catalog.spec.js +7 -0
|
@@ -10,71 +10,71 @@ class Payment {
|
|
|
10
10
|
constructor(_conf) {
|
|
11
11
|
this._conf = _conf;
|
|
12
12
|
this._relativeUrls = {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
addBeneficiaryDetails: "/service/application/payment/v1.0/refund/account",
|
|
14
|
+
addRefundBankAccountUsingOTP:
|
|
15
|
+
"/service/application/payment/v1.0/refund/account/otp",
|
|
15
16
|
attachCardToCustomer: "/service/application/payment/v1.0/card/attach",
|
|
17
|
+
cancelPaymentLink:
|
|
18
|
+
"/service/application/payment/v1.0/cancel-payment-link/",
|
|
19
|
+
checkAndUpdatePaymentStatus:
|
|
20
|
+
"/service/application/payment/v1.0/payment/confirm/polling",
|
|
21
|
+
checkAndUpdatePaymentStatusPaymentLink:
|
|
22
|
+
"/service/application/payment/v1.0/payment/confirm/polling/link/",
|
|
23
|
+
checkCredit: "/service/application/payment/v1.0/check-credits/",
|
|
24
|
+
createOrderHandlerPaymentLink:
|
|
25
|
+
"/service/application/payment/v1.0/create-order/link/",
|
|
26
|
+
createPaymentLink:
|
|
27
|
+
"/service/application/payment/v1.0/create-payment-link/",
|
|
28
|
+
customerCreditSummary:
|
|
29
|
+
"/service/application/payment/v1.0/payment/credit-summary/",
|
|
30
|
+
customerOnboard: "/service/application/payment/v1.0/credit-onboard/",
|
|
31
|
+
deleteUserCard: "/service/application/payment/v1.0/card/remove",
|
|
32
|
+
enableOrDisableRefundTransferMode:
|
|
33
|
+
"/service/application/payment/v1.0/refund/transfer-mode",
|
|
16
34
|
getActiveCardAggregator:
|
|
17
35
|
"/service/application/payment/v1.0/card/aggregator",
|
|
36
|
+
getActiveRefundTransferModes:
|
|
37
|
+
"/service/application/payment/v1.0/refund/transfer-mode",
|
|
18
38
|
getActiveUserCards: "/service/application/payment/v1.0/cards",
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"/service/application/payment/v1.0/payment/confirm/polling",
|
|
39
|
+
getAggregatorsConfig:
|
|
40
|
+
"/service/application/payment/v1.0/config/aggregators/key",
|
|
41
|
+
getEpaylaterBannerDetails:
|
|
42
|
+
"/service/application/payment/v1.0/epaylater/banner",
|
|
43
|
+
getOrderBeneficiariesDetail:
|
|
44
|
+
"/service/application/payment/v1.0/refund/order/beneficiaries",
|
|
45
|
+
getPaymentLink: "/service/application/payment/v1.0/create-payment-link/",
|
|
27
46
|
getPaymentModeRoutes: "/service/application/payment/v1.0/payment/options",
|
|
47
|
+
getPaymentModeRoutesPaymentLink:
|
|
48
|
+
"/service/application/payment/v1.0/payment/options/link/",
|
|
28
49
|
getPosPaymentModeRoutes:
|
|
29
50
|
"/service/application/payment/v1.0/payment/options/pos",
|
|
30
51
|
getRupifiBannerDetails: "/service/application/payment/v1.0/rupifi/banner",
|
|
31
|
-
|
|
32
|
-
"/service/application/payment/v1.0/
|
|
52
|
+
getUserBeneficiariesDetail:
|
|
53
|
+
"/service/application/payment/v1.0/refund/user/beneficiary",
|
|
54
|
+
initialisePayment: "/service/application/payment/v1.0/payment/request",
|
|
55
|
+
initialisePaymentPaymentLink:
|
|
56
|
+
"/service/application/payment/v1.0/payment/request/link/",
|
|
57
|
+
pollingPaymentLink:
|
|
58
|
+
"/service/application/payment/v1.0/polling-payment-link/",
|
|
59
|
+
redirectToAggregator:
|
|
60
|
+
"/service/application/payment/v1.0/payment/redirect-to-aggregator/",
|
|
61
|
+
renderHTML: "/service/application/payment/v1.0/payment/html/render/",
|
|
33
62
|
resendOrCancelPayment:
|
|
34
63
|
"/service/application/payment/v1.0/payment/resend_or_cancel",
|
|
35
|
-
|
|
64
|
+
resendPaymentLink:
|
|
65
|
+
"/service/application/payment/v1.0/resend-payment-link/",
|
|
66
|
+
updateDefaultBeneficiary:
|
|
67
|
+
"/service/application/payment/v1.0/refund/beneficiary/default",
|
|
36
68
|
validateVPA: "/service/application/payment/v1.0/validate-vpa",
|
|
37
|
-
|
|
38
|
-
"/service/application/payment/v1.0/
|
|
39
|
-
|
|
40
|
-
"/service/application/payment/v1.0/
|
|
41
|
-
getUserBeneficiariesDetail:
|
|
42
|
-
"/service/application/payment/v1.0/refund/user/beneficiary",
|
|
69
|
+
verifyAndChargePayment:
|
|
70
|
+
"/service/application/payment/v1.0/payment/confirm/charge",
|
|
71
|
+
verifyCustomerForPayment:
|
|
72
|
+
"/service/application/payment/v1.0/payment/customer/validation",
|
|
43
73
|
verifyIfscCode: "/service/application/payment/v1.0/ifsc-code/verify",
|
|
44
|
-
getOrderBeneficiariesDetail:
|
|
45
|
-
"/service/application/payment/v1.0/refund/order/beneficiaries",
|
|
46
74
|
verifyOtpAndAddBeneficiaryForBank:
|
|
47
75
|
"/service/application/payment/v1.0/refund/verification/bank",
|
|
48
|
-
addBeneficiaryDetails: "/service/application/payment/v1.0/refund/account",
|
|
49
|
-
addRefundBankAccountUsingOTP:
|
|
50
|
-
"/service/application/payment/v1.0/refund/account/otp",
|
|
51
76
|
verifyOtpAndAddBeneficiaryForWallet:
|
|
52
77
|
"/service/application/payment/v1.0/refund/verification/wallet",
|
|
53
|
-
updateDefaultBeneficiary:
|
|
54
|
-
"/service/application/payment/v1.0/refund/beneficiary/default",
|
|
55
|
-
getPaymentLink: "/service/application/payment/v1.0/create-payment-link/",
|
|
56
|
-
createPaymentLink:
|
|
57
|
-
"/service/application/payment/v1.0/create-payment-link/",
|
|
58
|
-
resendPaymentLink:
|
|
59
|
-
"/service/application/payment/v1.0/resend-payment-link/",
|
|
60
|
-
cancelPaymentLink:
|
|
61
|
-
"/service/application/payment/v1.0/cancel-payment-link/",
|
|
62
|
-
getPaymentModeRoutesPaymentLink:
|
|
63
|
-
"/service/application/payment/v1.0/payment/options/link/",
|
|
64
|
-
pollingPaymentLink:
|
|
65
|
-
"/service/application/payment/v1.0/polling-payment-link/",
|
|
66
|
-
createOrderHandlerPaymentLink:
|
|
67
|
-
"/service/application/payment/v1.0/create-order/link/",
|
|
68
|
-
initialisePaymentPaymentLink:
|
|
69
|
-
"/service/application/payment/v1.0/payment/request/link/",
|
|
70
|
-
checkAndUpdatePaymentStatusPaymentLink:
|
|
71
|
-
"/service/application/payment/v1.0/payment/confirm/polling/link/",
|
|
72
|
-
customerCreditSummary:
|
|
73
|
-
"/service/application/payment/v1.0/payment/credit-summary/",
|
|
74
|
-
redirectToAggregator:
|
|
75
|
-
"/service/application/payment/v1.0/payment/redirect-to-aggregator/",
|
|
76
|
-
checkCredit: "/service/application/payment/v1.0/check-credits/",
|
|
77
|
-
customerOnboard: "/service/application/payment/v1.0/credit-onboard/",
|
|
78
78
|
};
|
|
79
79
|
this._urls = Object.entries(this._relativeUrls).reduce(
|
|
80
80
|
(urls, [method, relativeUrl]) => {
|
|
@@ -94,17 +94,14 @@ class Payment {
|
|
|
94
94
|
|
|
95
95
|
/**
|
|
96
96
|
* @param {Object} arg - Arg object.
|
|
97
|
-
* @param {
|
|
98
|
-
* @
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
* @returns {Promise<AggregatorsConfigDetailResponse>} - Success response
|
|
102
|
-
* @summary: Get payment gateway keys
|
|
103
|
-
* @description: Use this API to retrieve the payment gateway key, secrets, merchant, SDK/API details to complete a payment at front-end.
|
|
97
|
+
* @param {AddBeneficiaryDetailsRequest} arg.body
|
|
98
|
+
* @returns {Promise<RefundAccountResponse>} - Success response
|
|
99
|
+
* @summary: Save bank details for cancelled/returned order
|
|
100
|
+
* @description: Use this API to save the bank details for a returned or cancelled order to refund the amount.
|
|
104
101
|
*/
|
|
105
|
-
async
|
|
106
|
-
const { error } = PaymentValidator.
|
|
107
|
-
{
|
|
102
|
+
async addBeneficiaryDetails({ body } = {}) {
|
|
103
|
+
const { error } = PaymentValidator.addBeneficiaryDetails().validate(
|
|
104
|
+
{ body },
|
|
108
105
|
{ abortEarly: false, allowUnknown: true }
|
|
109
106
|
);
|
|
110
107
|
if (error) {
|
|
@@ -114,39 +111,37 @@ class Payment {
|
|
|
114
111
|
// Showing warrnings if extra unknown parameters are found
|
|
115
112
|
const {
|
|
116
113
|
error: warrning,
|
|
117
|
-
} = PaymentValidator.
|
|
118
|
-
{
|
|
114
|
+
} = PaymentValidator.addBeneficiaryDetails().validate(
|
|
115
|
+
{ body },
|
|
119
116
|
{ abortEarly: false, allowUnknown: false }
|
|
120
117
|
);
|
|
121
118
|
if (warrning) {
|
|
122
119
|
Logger({
|
|
123
120
|
level: "WARN",
|
|
124
|
-
message: "Parameter Validation warrnings for
|
|
121
|
+
message: "Parameter Validation warrnings for addBeneficiaryDetails",
|
|
125
122
|
});
|
|
126
123
|
Logger({ level: "WARN", message: warrning });
|
|
127
124
|
}
|
|
128
125
|
|
|
129
126
|
const query_params = {};
|
|
130
|
-
query_params["refresh"] = refresh;
|
|
131
127
|
|
|
132
128
|
const xHeaders = {};
|
|
133
|
-
xHeaders["x-api-token"] = xApiToken;
|
|
134
129
|
|
|
135
130
|
const response = await APIClient.execute(
|
|
136
131
|
this._conf,
|
|
137
|
-
"
|
|
132
|
+
"post",
|
|
138
133
|
constructUrl({
|
|
139
|
-
url: this._urls["
|
|
134
|
+
url: this._urls["addBeneficiaryDetails"],
|
|
140
135
|
params: {},
|
|
141
136
|
}),
|
|
142
137
|
query_params,
|
|
143
|
-
|
|
138
|
+
body,
|
|
144
139
|
xHeaders
|
|
145
140
|
);
|
|
146
141
|
|
|
147
142
|
const {
|
|
148
143
|
error: res_error,
|
|
149
|
-
} = PaymentModel.
|
|
144
|
+
} = PaymentModel.RefundAccountResponse().validate(response, {
|
|
150
145
|
abortEarly: false,
|
|
151
146
|
allowUnknown: false,
|
|
152
147
|
});
|
|
@@ -154,7 +149,7 @@ class Payment {
|
|
|
154
149
|
if (res_error) {
|
|
155
150
|
Logger({
|
|
156
151
|
level: "WARN",
|
|
157
|
-
message: "Response Validation Warnnings for
|
|
152
|
+
message: "Response Validation Warnnings for addBeneficiaryDetails",
|
|
158
153
|
});
|
|
159
154
|
Logger({ level: "WARN", message: res_error });
|
|
160
155
|
}
|
|
@@ -164,13 +159,13 @@ class Payment {
|
|
|
164
159
|
|
|
165
160
|
/**
|
|
166
161
|
* @param {Object} arg - Arg object.
|
|
167
|
-
* @param {
|
|
168
|
-
* @returns {Promise<
|
|
169
|
-
* @summary:
|
|
170
|
-
* @description: Use this API to
|
|
162
|
+
* @param {AddBeneficiaryDetailsOTPRequest} arg.body
|
|
163
|
+
* @returns {Promise<RefundAccountResponse>} - Success response
|
|
164
|
+
* @summary: Save bank details for cancelled/returned order
|
|
165
|
+
* @description: Use this API to save bank details for returned/cancelled order to refund amount in his account.
|
|
171
166
|
*/
|
|
172
|
-
async
|
|
173
|
-
const { error } = PaymentValidator.
|
|
167
|
+
async addRefundBankAccountUsingOTP({ body } = {}) {
|
|
168
|
+
const { error } = PaymentValidator.addRefundBankAccountUsingOTP().validate(
|
|
174
169
|
{ body },
|
|
175
170
|
{ abortEarly: false, allowUnknown: true }
|
|
176
171
|
);
|
|
@@ -181,14 +176,15 @@ class Payment {
|
|
|
181
176
|
// Showing warrnings if extra unknown parameters are found
|
|
182
177
|
const {
|
|
183
178
|
error: warrning,
|
|
184
|
-
} = PaymentValidator.
|
|
179
|
+
} = PaymentValidator.addRefundBankAccountUsingOTP().validate(
|
|
185
180
|
{ body },
|
|
186
181
|
{ abortEarly: false, allowUnknown: false }
|
|
187
182
|
);
|
|
188
183
|
if (warrning) {
|
|
189
184
|
Logger({
|
|
190
185
|
level: "WARN",
|
|
191
|
-
message:
|
|
186
|
+
message:
|
|
187
|
+
"Parameter Validation warrnings for addRefundBankAccountUsingOTP",
|
|
192
188
|
});
|
|
193
189
|
Logger({ level: "WARN", message: warrning });
|
|
194
190
|
}
|
|
@@ -201,7 +197,7 @@ class Payment {
|
|
|
201
197
|
this._conf,
|
|
202
198
|
"post",
|
|
203
199
|
constructUrl({
|
|
204
|
-
url: this._urls["
|
|
200
|
+
url: this._urls["addRefundBankAccountUsingOTP"],
|
|
205
201
|
params: {},
|
|
206
202
|
}),
|
|
207
203
|
query_params,
|
|
@@ -211,7 +207,7 @@ class Payment {
|
|
|
211
207
|
|
|
212
208
|
const {
|
|
213
209
|
error: res_error,
|
|
214
|
-
} = PaymentModel.
|
|
210
|
+
} = PaymentModel.RefundAccountResponse().validate(response, {
|
|
215
211
|
abortEarly: false,
|
|
216
212
|
allowUnknown: false,
|
|
217
213
|
});
|
|
@@ -219,7 +215,8 @@ class Payment {
|
|
|
219
215
|
if (res_error) {
|
|
220
216
|
Logger({
|
|
221
217
|
level: "WARN",
|
|
222
|
-
message:
|
|
218
|
+
message:
|
|
219
|
+
"Response Validation Warnnings for addRefundBankAccountUsingOTP",
|
|
223
220
|
});
|
|
224
221
|
Logger({ level: "WARN", message: res_error });
|
|
225
222
|
}
|
|
@@ -229,14 +226,14 @@ class Payment {
|
|
|
229
226
|
|
|
230
227
|
/**
|
|
231
228
|
* @param {Object} arg - Arg object.
|
|
232
|
-
* @param {
|
|
233
|
-
* @returns {Promise<
|
|
234
|
-
* @summary:
|
|
235
|
-
* @description: Use this API to
|
|
229
|
+
* @param {AttachCardRequest} arg.body
|
|
230
|
+
* @returns {Promise<AttachCardsResponse>} - Success response
|
|
231
|
+
* @summary: Attach a saved card to customer.
|
|
232
|
+
* @description: Use this API to attach a customer's saved card at the payment gateway, such as Stripe, Juspay.
|
|
236
233
|
*/
|
|
237
|
-
async
|
|
238
|
-
const { error } = PaymentValidator.
|
|
239
|
-
{
|
|
234
|
+
async attachCardToCustomer({ body } = {}) {
|
|
235
|
+
const { error } = PaymentValidator.attachCardToCustomer().validate(
|
|
236
|
+
{ body },
|
|
240
237
|
{ abortEarly: false, allowUnknown: true }
|
|
241
238
|
);
|
|
242
239
|
if (error) {
|
|
@@ -246,38 +243,37 @@ class Payment {
|
|
|
246
243
|
// Showing warrnings if extra unknown parameters are found
|
|
247
244
|
const {
|
|
248
245
|
error: warrning,
|
|
249
|
-
} = PaymentValidator.
|
|
250
|
-
{
|
|
246
|
+
} = PaymentValidator.attachCardToCustomer().validate(
|
|
247
|
+
{ body },
|
|
251
248
|
{ abortEarly: false, allowUnknown: false }
|
|
252
249
|
);
|
|
253
250
|
if (warrning) {
|
|
254
251
|
Logger({
|
|
255
252
|
level: "WARN",
|
|
256
|
-
message: "Parameter Validation warrnings for
|
|
253
|
+
message: "Parameter Validation warrnings for attachCardToCustomer",
|
|
257
254
|
});
|
|
258
255
|
Logger({ level: "WARN", message: warrning });
|
|
259
256
|
}
|
|
260
257
|
|
|
261
258
|
const query_params = {};
|
|
262
|
-
query_params["refresh"] = refresh;
|
|
263
259
|
|
|
264
260
|
const xHeaders = {};
|
|
265
261
|
|
|
266
262
|
const response = await APIClient.execute(
|
|
267
263
|
this._conf,
|
|
268
|
-
"
|
|
264
|
+
"post",
|
|
269
265
|
constructUrl({
|
|
270
|
-
url: this._urls["
|
|
266
|
+
url: this._urls["attachCardToCustomer"],
|
|
271
267
|
params: {},
|
|
272
268
|
}),
|
|
273
269
|
query_params,
|
|
274
|
-
|
|
270
|
+
body,
|
|
275
271
|
xHeaders
|
|
276
272
|
);
|
|
277
273
|
|
|
278
274
|
const {
|
|
279
275
|
error: res_error,
|
|
280
|
-
} = PaymentModel.
|
|
276
|
+
} = PaymentModel.AttachCardsResponse().validate(response, {
|
|
281
277
|
abortEarly: false,
|
|
282
278
|
allowUnknown: false,
|
|
283
279
|
});
|
|
@@ -285,7 +281,7 @@ class Payment {
|
|
|
285
281
|
if (res_error) {
|
|
286
282
|
Logger({
|
|
287
283
|
level: "WARN",
|
|
288
|
-
message: "Response Validation Warnnings for
|
|
284
|
+
message: "Response Validation Warnnings for attachCardToCustomer",
|
|
289
285
|
});
|
|
290
286
|
Logger({ level: "WARN", message: res_error });
|
|
291
287
|
}
|
|
@@ -295,14 +291,14 @@ class Payment {
|
|
|
295
291
|
|
|
296
292
|
/**
|
|
297
293
|
* @param {Object} arg - Arg object.
|
|
298
|
-
* @param {
|
|
299
|
-
* @returns {Promise<
|
|
300
|
-
* @summary:
|
|
301
|
-
* @description: Use this API to
|
|
294
|
+
* @param {CancelOrResendPaymentLinkRequest} arg.body
|
|
295
|
+
* @returns {Promise<CancelPaymentLinkResponse>} - Success response
|
|
296
|
+
* @summary: Cancel payment link
|
|
297
|
+
* @description: Use this API to cancel a payment link for the customer
|
|
302
298
|
*/
|
|
303
|
-
async
|
|
304
|
-
const { error } = PaymentValidator.
|
|
305
|
-
{
|
|
299
|
+
async cancelPaymentLink({ body } = {}) {
|
|
300
|
+
const { error } = PaymentValidator.cancelPaymentLink().validate(
|
|
301
|
+
{ body },
|
|
306
302
|
{ abortEarly: false, allowUnknown: true }
|
|
307
303
|
);
|
|
308
304
|
if (error) {
|
|
@@ -310,38 +306,37 @@ class Payment {
|
|
|
310
306
|
}
|
|
311
307
|
|
|
312
308
|
// Showing warrnings if extra unknown parameters are found
|
|
313
|
-
const { error: warrning } = PaymentValidator.
|
|
314
|
-
{
|
|
309
|
+
const { error: warrning } = PaymentValidator.cancelPaymentLink().validate(
|
|
310
|
+
{ body },
|
|
315
311
|
{ abortEarly: false, allowUnknown: false }
|
|
316
312
|
);
|
|
317
313
|
if (warrning) {
|
|
318
314
|
Logger({
|
|
319
315
|
level: "WARN",
|
|
320
|
-
message: "Parameter Validation warrnings for
|
|
316
|
+
message: "Parameter Validation warrnings for cancelPaymentLink",
|
|
321
317
|
});
|
|
322
318
|
Logger({ level: "WARN", message: warrning });
|
|
323
319
|
}
|
|
324
320
|
|
|
325
321
|
const query_params = {};
|
|
326
|
-
query_params["force_refresh"] = forceRefresh;
|
|
327
322
|
|
|
328
323
|
const xHeaders = {};
|
|
329
324
|
|
|
330
325
|
const response = await APIClient.execute(
|
|
331
326
|
this._conf,
|
|
332
|
-
"
|
|
327
|
+
"post",
|
|
333
328
|
constructUrl({
|
|
334
|
-
url: this._urls["
|
|
329
|
+
url: this._urls["cancelPaymentLink"],
|
|
335
330
|
params: {},
|
|
336
331
|
}),
|
|
337
332
|
query_params,
|
|
338
|
-
|
|
333
|
+
body,
|
|
339
334
|
xHeaders
|
|
340
335
|
);
|
|
341
336
|
|
|
342
337
|
const {
|
|
343
338
|
error: res_error,
|
|
344
|
-
} = PaymentModel.
|
|
339
|
+
} = PaymentModel.CancelPaymentLinkResponse().validate(response, {
|
|
345
340
|
abortEarly: false,
|
|
346
341
|
allowUnknown: false,
|
|
347
342
|
});
|
|
@@ -349,7 +344,7 @@ class Payment {
|
|
|
349
344
|
if (res_error) {
|
|
350
345
|
Logger({
|
|
351
346
|
level: "WARN",
|
|
352
|
-
message: "Response Validation Warnnings for
|
|
347
|
+
message: "Response Validation Warnnings for cancelPaymentLink",
|
|
353
348
|
});
|
|
354
349
|
Logger({ level: "WARN", message: res_error });
|
|
355
350
|
}
|
|
@@ -359,13 +354,13 @@ class Payment {
|
|
|
359
354
|
|
|
360
355
|
/**
|
|
361
356
|
* @param {Object} arg - Arg object.
|
|
362
|
-
* @param {
|
|
363
|
-
* @returns {Promise<
|
|
364
|
-
* @summary:
|
|
365
|
-
* @description: Use this API to
|
|
357
|
+
* @param {PaymentStatusUpdateRequest} arg.body
|
|
358
|
+
* @returns {Promise<PaymentStatusUpdateResponse>} - Success response
|
|
359
|
+
* @summary: Performs continuous polling to check status of payment on the server
|
|
360
|
+
* @description: Use this API to perform continuous polling at intervals to check the status of payment until timeout.
|
|
366
361
|
*/
|
|
367
|
-
async
|
|
368
|
-
const { error } = PaymentValidator.
|
|
362
|
+
async checkAndUpdatePaymentStatus({ body } = {}) {
|
|
363
|
+
const { error } = PaymentValidator.checkAndUpdatePaymentStatus().validate(
|
|
369
364
|
{ body },
|
|
370
365
|
{ abortEarly: false, allowUnknown: true }
|
|
371
366
|
);
|
|
@@ -374,14 +369,17 @@ class Payment {
|
|
|
374
369
|
}
|
|
375
370
|
|
|
376
371
|
// Showing warrnings if extra unknown parameters are found
|
|
377
|
-
const {
|
|
372
|
+
const {
|
|
373
|
+
error: warrning,
|
|
374
|
+
} = PaymentValidator.checkAndUpdatePaymentStatus().validate(
|
|
378
375
|
{ body },
|
|
379
376
|
{ abortEarly: false, allowUnknown: false }
|
|
380
377
|
);
|
|
381
378
|
if (warrning) {
|
|
382
379
|
Logger({
|
|
383
380
|
level: "WARN",
|
|
384
|
-
message:
|
|
381
|
+
message:
|
|
382
|
+
"Parameter Validation warrnings for checkAndUpdatePaymentStatus",
|
|
385
383
|
});
|
|
386
384
|
Logger({ level: "WARN", message: warrning });
|
|
387
385
|
}
|
|
@@ -394,7 +392,7 @@ class Payment {
|
|
|
394
392
|
this._conf,
|
|
395
393
|
"post",
|
|
396
394
|
constructUrl({
|
|
397
|
-
url: this._urls["
|
|
395
|
+
url: this._urls["checkAndUpdatePaymentStatus"],
|
|
398
396
|
params: {},
|
|
399
397
|
}),
|
|
400
398
|
query_params,
|
|
@@ -404,7 +402,7 @@ class Payment {
|
|
|
404
402
|
|
|
405
403
|
const {
|
|
406
404
|
error: res_error,
|
|
407
|
-
} = PaymentModel.
|
|
405
|
+
} = PaymentModel.PaymentStatusUpdateResponse().validate(response, {
|
|
408
406
|
abortEarly: false,
|
|
409
407
|
allowUnknown: false,
|
|
410
408
|
});
|
|
@@ -412,7 +410,8 @@ class Payment {
|
|
|
412
410
|
if (res_error) {
|
|
413
411
|
Logger({
|
|
414
412
|
level: "WARN",
|
|
415
|
-
message:
|
|
413
|
+
message:
|
|
414
|
+
"Response Validation Warnnings for checkAndUpdatePaymentStatus",
|
|
416
415
|
});
|
|
417
416
|
Logger({ level: "WARN", message: res_error });
|
|
418
417
|
}
|
|
@@ -422,13 +421,15 @@ class Payment {
|
|
|
422
421
|
|
|
423
422
|
/**
|
|
424
423
|
* @param {Object} arg - Arg object.
|
|
425
|
-
* @param {
|
|
426
|
-
* @returns {Promise<
|
|
427
|
-
* @summary:
|
|
428
|
-
* @description: Use this API to
|
|
424
|
+
* @param {PaymentStatusUpdateRequest} arg.body
|
|
425
|
+
* @returns {Promise<PaymentStatusUpdateResponse>} - Success response
|
|
426
|
+
* @summary: Performs continuous polling to check status of payment on the server
|
|
427
|
+
* @description: Use this API to perform continuous polling at intervals to check the status of payment until timeout.
|
|
429
428
|
*/
|
|
430
|
-
async
|
|
431
|
-
const {
|
|
429
|
+
async checkAndUpdatePaymentStatusPaymentLink({ body } = {}) {
|
|
430
|
+
const {
|
|
431
|
+
error,
|
|
432
|
+
} = PaymentValidator.checkAndUpdatePaymentStatusPaymentLink().validate(
|
|
432
433
|
{ body },
|
|
433
434
|
{ abortEarly: false, allowUnknown: true }
|
|
434
435
|
);
|
|
@@ -439,14 +440,15 @@ class Payment {
|
|
|
439
440
|
// Showing warrnings if extra unknown parameters are found
|
|
440
441
|
const {
|
|
441
442
|
error: warrning,
|
|
442
|
-
} = PaymentValidator.
|
|
443
|
+
} = PaymentValidator.checkAndUpdatePaymentStatusPaymentLink().validate(
|
|
443
444
|
{ body },
|
|
444
445
|
{ abortEarly: false, allowUnknown: false }
|
|
445
446
|
);
|
|
446
447
|
if (warrning) {
|
|
447
448
|
Logger({
|
|
448
449
|
level: "WARN",
|
|
449
|
-
message:
|
|
450
|
+
message:
|
|
451
|
+
"Parameter Validation warrnings for checkAndUpdatePaymentStatusPaymentLink",
|
|
450
452
|
});
|
|
451
453
|
Logger({ level: "WARN", message: warrning });
|
|
452
454
|
}
|
|
@@ -459,7 +461,7 @@ class Payment {
|
|
|
459
461
|
this._conf,
|
|
460
462
|
"post",
|
|
461
463
|
constructUrl({
|
|
462
|
-
url: this._urls["
|
|
464
|
+
url: this._urls["checkAndUpdatePaymentStatusPaymentLink"],
|
|
463
465
|
params: {},
|
|
464
466
|
}),
|
|
465
467
|
query_params,
|
|
@@ -469,7 +471,7 @@ class Payment {
|
|
|
469
471
|
|
|
470
472
|
const {
|
|
471
473
|
error: res_error,
|
|
472
|
-
} = PaymentModel.
|
|
474
|
+
} = PaymentModel.PaymentStatusUpdateResponse().validate(response, {
|
|
473
475
|
abortEarly: false,
|
|
474
476
|
allowUnknown: false,
|
|
475
477
|
});
|
|
@@ -477,7 +479,8 @@ class Payment {
|
|
|
477
479
|
if (res_error) {
|
|
478
480
|
Logger({
|
|
479
481
|
level: "WARN",
|
|
480
|
-
message:
|
|
482
|
+
message:
|
|
483
|
+
"Response Validation Warnnings for checkAndUpdatePaymentStatusPaymentLink",
|
|
481
484
|
});
|
|
482
485
|
Logger({ level: "WARN", message: res_error });
|
|
483
486
|
}
|
|
@@ -487,14 +490,14 @@ class Payment {
|
|
|
487
490
|
|
|
488
491
|
/**
|
|
489
492
|
* @param {Object} arg - Arg object.
|
|
490
|
-
* @param {
|
|
491
|
-
* @returns {Promise<
|
|
492
|
-
* @summary:
|
|
493
|
-
* @description: Use this API to
|
|
493
|
+
* @param {string} [arg.aggregator] -
|
|
494
|
+
* @returns {Promise<CheckCreditResponse>} - Success response
|
|
495
|
+
* @summary: API to fetch the customer credit summary
|
|
496
|
+
* @description: Use this API to fetch the customer credit summary.
|
|
494
497
|
*/
|
|
495
|
-
async
|
|
496
|
-
const { error } = PaymentValidator.
|
|
497
|
-
{
|
|
498
|
+
async checkCredit({ aggregator } = {}) {
|
|
499
|
+
const { error } = PaymentValidator.checkCredit().validate(
|
|
500
|
+
{ aggregator },
|
|
498
501
|
{ abortEarly: false, allowUnknown: true }
|
|
499
502
|
);
|
|
500
503
|
if (error) {
|
|
@@ -502,39 +505,38 @@ class Payment {
|
|
|
502
505
|
}
|
|
503
506
|
|
|
504
507
|
// Showing warrnings if extra unknown parameters are found
|
|
505
|
-
const {
|
|
506
|
-
|
|
507
|
-
} = PaymentValidator.verifyAndChargePayment().validate(
|
|
508
|
-
{ body },
|
|
508
|
+
const { error: warrning } = PaymentValidator.checkCredit().validate(
|
|
509
|
+
{ aggregator },
|
|
509
510
|
{ abortEarly: false, allowUnknown: false }
|
|
510
511
|
);
|
|
511
512
|
if (warrning) {
|
|
512
513
|
Logger({
|
|
513
514
|
level: "WARN",
|
|
514
|
-
message: "Parameter Validation warrnings for
|
|
515
|
+
message: "Parameter Validation warrnings for checkCredit",
|
|
515
516
|
});
|
|
516
517
|
Logger({ level: "WARN", message: warrning });
|
|
517
518
|
}
|
|
518
519
|
|
|
519
520
|
const query_params = {};
|
|
521
|
+
query_params["aggregator"] = aggregator;
|
|
520
522
|
|
|
521
523
|
const xHeaders = {};
|
|
522
524
|
|
|
523
525
|
const response = await APIClient.execute(
|
|
524
526
|
this._conf,
|
|
525
|
-
"
|
|
527
|
+
"get",
|
|
526
528
|
constructUrl({
|
|
527
|
-
url: this._urls["
|
|
529
|
+
url: this._urls["checkCredit"],
|
|
528
530
|
params: {},
|
|
529
531
|
}),
|
|
530
532
|
query_params,
|
|
531
|
-
|
|
533
|
+
undefined,
|
|
532
534
|
xHeaders
|
|
533
535
|
);
|
|
534
536
|
|
|
535
537
|
const {
|
|
536
538
|
error: res_error,
|
|
537
|
-
} = PaymentModel.
|
|
539
|
+
} = PaymentModel.CheckCreditResponse().validate(response, {
|
|
538
540
|
abortEarly: false,
|
|
539
541
|
allowUnknown: false,
|
|
540
542
|
});
|
|
@@ -542,7 +544,7 @@ class Payment {
|
|
|
542
544
|
if (res_error) {
|
|
543
545
|
Logger({
|
|
544
546
|
level: "WARN",
|
|
545
|
-
message: "Response Validation Warnnings for
|
|
547
|
+
message: "Response Validation Warnnings for checkCredit",
|
|
546
548
|
});
|
|
547
549
|
Logger({ level: "WARN", message: res_error });
|
|
548
550
|
}
|
|
@@ -552,13 +554,13 @@ class Payment {
|
|
|
552
554
|
|
|
553
555
|
/**
|
|
554
556
|
* @param {Object} arg - Arg object.
|
|
555
|
-
* @param {
|
|
556
|
-
* @returns {Promise<
|
|
557
|
-
* @summary:
|
|
558
|
-
* @description:
|
|
557
|
+
* @param {CreateOrderUserRequest} arg.body
|
|
558
|
+
* @returns {Promise<CreateOrderUserResponse>} - Success response
|
|
559
|
+
* @summary: Create Order user
|
|
560
|
+
* @description: Use this API to create a order and payment on aggregator side
|
|
559
561
|
*/
|
|
560
|
-
async
|
|
561
|
-
const { error } = PaymentValidator.
|
|
562
|
+
async createOrderHandlerPaymentLink({ body } = {}) {
|
|
563
|
+
const { error } = PaymentValidator.createOrderHandlerPaymentLink().validate(
|
|
562
564
|
{ body },
|
|
563
565
|
{ abortEarly: false, allowUnknown: true }
|
|
564
566
|
);
|
|
@@ -567,14 +569,17 @@ class Payment {
|
|
|
567
569
|
}
|
|
568
570
|
|
|
569
571
|
// Showing warrnings if extra unknown parameters are found
|
|
570
|
-
const {
|
|
572
|
+
const {
|
|
573
|
+
error: warrning,
|
|
574
|
+
} = PaymentValidator.createOrderHandlerPaymentLink().validate(
|
|
571
575
|
{ body },
|
|
572
576
|
{ abortEarly: false, allowUnknown: false }
|
|
573
577
|
);
|
|
574
578
|
if (warrning) {
|
|
575
579
|
Logger({
|
|
576
580
|
level: "WARN",
|
|
577
|
-
message:
|
|
581
|
+
message:
|
|
582
|
+
"Parameter Validation warrnings for createOrderHandlerPaymentLink",
|
|
578
583
|
});
|
|
579
584
|
Logger({ level: "WARN", message: warrning });
|
|
580
585
|
}
|
|
@@ -587,7 +592,7 @@ class Payment {
|
|
|
587
592
|
this._conf,
|
|
588
593
|
"post",
|
|
589
594
|
constructUrl({
|
|
590
|
-
url: this._urls["
|
|
595
|
+
url: this._urls["createOrderHandlerPaymentLink"],
|
|
591
596
|
params: {},
|
|
592
597
|
}),
|
|
593
598
|
query_params,
|
|
@@ -597,7 +602,7 @@ class Payment {
|
|
|
597
602
|
|
|
598
603
|
const {
|
|
599
604
|
error: res_error,
|
|
600
|
-
} = PaymentModel.
|
|
605
|
+
} = PaymentModel.CreateOrderUserResponse().validate(response, {
|
|
601
606
|
abortEarly: false,
|
|
602
607
|
allowUnknown: false,
|
|
603
608
|
});
|
|
@@ -605,7 +610,8 @@ class Payment {
|
|
|
605
610
|
if (res_error) {
|
|
606
611
|
Logger({
|
|
607
612
|
level: "WARN",
|
|
608
|
-
message:
|
|
613
|
+
message:
|
|
614
|
+
"Response Validation Warnnings for createOrderHandlerPaymentLink",
|
|
609
615
|
});
|
|
610
616
|
Logger({ level: "WARN", message: res_error });
|
|
611
617
|
}
|
|
@@ -615,13 +621,13 @@ class Payment {
|
|
|
615
621
|
|
|
616
622
|
/**
|
|
617
623
|
* @param {Object} arg - Arg object.
|
|
618
|
-
* @param {
|
|
619
|
-
* @returns {Promise<
|
|
620
|
-
* @summary:
|
|
621
|
-
* @description: Use this API to
|
|
624
|
+
* @param {CreatePaymentLinkRequest} arg.body
|
|
625
|
+
* @returns {Promise<CreatePaymentLinkResponse>} - Success response
|
|
626
|
+
* @summary: Create payment link
|
|
627
|
+
* @description: Use this API to create a payment link for the customer
|
|
622
628
|
*/
|
|
623
|
-
async
|
|
624
|
-
const { error } = PaymentValidator.
|
|
629
|
+
async createPaymentLink({ body } = {}) {
|
|
630
|
+
const { error } = PaymentValidator.createPaymentLink().validate(
|
|
625
631
|
{ body },
|
|
626
632
|
{ abortEarly: false, allowUnknown: true }
|
|
627
633
|
);
|
|
@@ -630,17 +636,14 @@ class Payment {
|
|
|
630
636
|
}
|
|
631
637
|
|
|
632
638
|
// Showing warrnings if extra unknown parameters are found
|
|
633
|
-
const {
|
|
634
|
-
error: warrning,
|
|
635
|
-
} = PaymentValidator.checkAndUpdatePaymentStatus().validate(
|
|
639
|
+
const { error: warrning } = PaymentValidator.createPaymentLink().validate(
|
|
636
640
|
{ body },
|
|
637
641
|
{ abortEarly: false, allowUnknown: false }
|
|
638
642
|
);
|
|
639
643
|
if (warrning) {
|
|
640
644
|
Logger({
|
|
641
645
|
level: "WARN",
|
|
642
|
-
message:
|
|
643
|
-
"Parameter Validation warrnings for checkAndUpdatePaymentStatus",
|
|
646
|
+
message: "Parameter Validation warrnings for createPaymentLink",
|
|
644
647
|
});
|
|
645
648
|
Logger({ level: "WARN", message: warrning });
|
|
646
649
|
}
|
|
@@ -653,7 +656,7 @@ class Payment {
|
|
|
653
656
|
this._conf,
|
|
654
657
|
"post",
|
|
655
658
|
constructUrl({
|
|
656
|
-
url: this._urls["
|
|
659
|
+
url: this._urls["createPaymentLink"],
|
|
657
660
|
params: {},
|
|
658
661
|
}),
|
|
659
662
|
query_params,
|
|
@@ -663,7 +666,7 @@ class Payment {
|
|
|
663
666
|
|
|
664
667
|
const {
|
|
665
668
|
error: res_error,
|
|
666
|
-
} = PaymentModel.
|
|
669
|
+
} = PaymentModel.CreatePaymentLinkResponse().validate(response, {
|
|
667
670
|
abortEarly: false,
|
|
668
671
|
allowUnknown: false,
|
|
669
672
|
});
|
|
@@ -671,8 +674,7 @@ class Payment {
|
|
|
671
674
|
if (res_error) {
|
|
672
675
|
Logger({
|
|
673
676
|
level: "WARN",
|
|
674
|
-
message:
|
|
675
|
-
"Response Validation Warnnings for checkAndUpdatePaymentStatus",
|
|
677
|
+
message: "Response Validation Warnnings for createPaymentLink",
|
|
676
678
|
});
|
|
677
679
|
Logger({ level: "WARN", message: res_error });
|
|
678
680
|
}
|
|
@@ -682,40 +684,14 @@ class Payment {
|
|
|
682
684
|
|
|
683
685
|
/**
|
|
684
686
|
* @param {Object} arg - Arg object.
|
|
685
|
-
* @param {
|
|
686
|
-
* @
|
|
687
|
-
* @
|
|
688
|
-
* @
|
|
689
|
-
* @param {boolean} [arg.refresh] - This is a boolean value. Select `true`
|
|
690
|
-
* to remove temporary cache files on payment gateway and replace with the
|
|
691
|
-
* latest one.
|
|
692
|
-
* @param {string} [arg.cardReference] - Card reference id of user's debit
|
|
693
|
-
* or credit card.
|
|
694
|
-
* @param {string} [arg.userDetails] - URIencoded JSON containing details of
|
|
695
|
-
* an anonymous user.
|
|
696
|
-
* @returns {Promise<PaymentModeRouteResponse>} - Success response
|
|
697
|
-
* @summary: Get applicable payment options
|
|
698
|
-
* @description: Use this API to get all valid payment options for doing a payment.
|
|
687
|
+
* @param {string} [arg.aggregator] -
|
|
688
|
+
* @returns {Promise<CustomerCreditSummaryResponse>} - Success response
|
|
689
|
+
* @summary: API to fetch the customer credit summary
|
|
690
|
+
* @description: Use this API to fetch the customer credit summary.
|
|
699
691
|
*/
|
|
700
|
-
async
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
pincode,
|
|
704
|
-
checkoutMode,
|
|
705
|
-
refresh,
|
|
706
|
-
cardReference,
|
|
707
|
-
userDetails,
|
|
708
|
-
} = {}) {
|
|
709
|
-
const { error } = PaymentValidator.getPaymentModeRoutes().validate(
|
|
710
|
-
{
|
|
711
|
-
amount,
|
|
712
|
-
cartId,
|
|
713
|
-
pincode,
|
|
714
|
-
checkoutMode,
|
|
715
|
-
refresh,
|
|
716
|
-
cardReference,
|
|
717
|
-
userDetails,
|
|
718
|
-
},
|
|
692
|
+
async customerCreditSummary({ aggregator } = {}) {
|
|
693
|
+
const { error } = PaymentValidator.customerCreditSummary().validate(
|
|
694
|
+
{ aggregator },
|
|
719
695
|
{ abortEarly: false, allowUnknown: true }
|
|
720
696
|
);
|
|
721
697
|
if (error) {
|
|
@@ -725,34 +701,20 @@ class Payment {
|
|
|
725
701
|
// Showing warrnings if extra unknown parameters are found
|
|
726
702
|
const {
|
|
727
703
|
error: warrning,
|
|
728
|
-
} = PaymentValidator.
|
|
729
|
-
{
|
|
730
|
-
amount,
|
|
731
|
-
cartId,
|
|
732
|
-
pincode,
|
|
733
|
-
checkoutMode,
|
|
734
|
-
refresh,
|
|
735
|
-
cardReference,
|
|
736
|
-
userDetails,
|
|
737
|
-
},
|
|
704
|
+
} = PaymentValidator.customerCreditSummary().validate(
|
|
705
|
+
{ aggregator },
|
|
738
706
|
{ abortEarly: false, allowUnknown: false }
|
|
739
707
|
);
|
|
740
708
|
if (warrning) {
|
|
741
709
|
Logger({
|
|
742
710
|
level: "WARN",
|
|
743
|
-
message: "Parameter Validation warrnings for
|
|
711
|
+
message: "Parameter Validation warrnings for customerCreditSummary",
|
|
744
712
|
});
|
|
745
713
|
Logger({ level: "WARN", message: warrning });
|
|
746
714
|
}
|
|
747
715
|
|
|
748
716
|
const query_params = {};
|
|
749
|
-
query_params["
|
|
750
|
-
query_params["cart_id"] = cartId;
|
|
751
|
-
query_params["pincode"] = pincode;
|
|
752
|
-
query_params["checkout_mode"] = checkoutMode;
|
|
753
|
-
query_params["refresh"] = refresh;
|
|
754
|
-
query_params["card_reference"] = cardReference;
|
|
755
|
-
query_params["user_details"] = userDetails;
|
|
717
|
+
query_params["aggregator"] = aggregator;
|
|
756
718
|
|
|
757
719
|
const xHeaders = {};
|
|
758
720
|
|
|
@@ -760,7 +722,7 @@ class Payment {
|
|
|
760
722
|
this._conf,
|
|
761
723
|
"get",
|
|
762
724
|
constructUrl({
|
|
763
|
-
url: this._urls["
|
|
725
|
+
url: this._urls["customerCreditSummary"],
|
|
764
726
|
params: {},
|
|
765
727
|
}),
|
|
766
728
|
query_params,
|
|
@@ -770,63 +732,32 @@ class Payment {
|
|
|
770
732
|
|
|
771
733
|
const {
|
|
772
734
|
error: res_error,
|
|
773
|
-
} = PaymentModel.
|
|
735
|
+
} = PaymentModel.CustomerCreditSummaryResponse().validate(response, {
|
|
774
736
|
abortEarly: false,
|
|
775
737
|
allowUnknown: false,
|
|
776
|
-
});
|
|
777
|
-
|
|
778
|
-
if (res_error) {
|
|
779
|
-
Logger({
|
|
780
|
-
level: "WARN",
|
|
781
|
-
message: "Response Validation Warnnings for
|
|
782
|
-
});
|
|
783
|
-
Logger({ level: "WARN", message: res_error });
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
return response;
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
/**
|
|
790
|
-
* @param {Object} arg - Arg object.
|
|
791
|
-
* @param {
|
|
792
|
-
* @
|
|
793
|
-
* @
|
|
794
|
-
* @
|
|
795
|
-
* @param {boolean} [arg.refresh] - This is a boolean value. Select `true`
|
|
796
|
-
* to remove temporary cache files on payment gateway and replace with the
|
|
797
|
-
* latest one.
|
|
798
|
-
* @param {string} [arg.cardReference] - Card reference id of user's debit
|
|
799
|
-
* or credit card.
|
|
800
|
-
* @param {string} arg.orderType - The order type of shipment * HomeDelivery
|
|
801
|
-
* - If the customer wants the order home-delivered * PickAtStore - If the
|
|
802
|
-
* customer wants the handover of an order at the store itself.
|
|
803
|
-
* @param {string} [arg.userDetails] - URIencoded JSON containing details of
|
|
804
|
-
* an anonymous user.
|
|
805
|
-
* @returns {Promise<PaymentModeRouteResponse>} - Success response
|
|
806
|
-
* @summary: Get applicable payment options for Point-of-Sale (POS)
|
|
807
|
-
* @description: Use this API to get all valid payment options for doing a payment in POS.
|
|
738
|
+
});
|
|
739
|
+
|
|
740
|
+
if (res_error) {
|
|
741
|
+
Logger({
|
|
742
|
+
level: "WARN",
|
|
743
|
+
message: "Response Validation Warnnings for customerCreditSummary",
|
|
744
|
+
});
|
|
745
|
+
Logger({ level: "WARN", message: res_error });
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
return response;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
/**
|
|
752
|
+
* @param {Object} arg - Arg object.
|
|
753
|
+
* @param {CustomerOnboardingRequest} arg.body
|
|
754
|
+
* @returns {Promise<CustomerOnboardingResponse>} - Success response
|
|
755
|
+
* @summary: API to fetch the customer credit summary
|
|
756
|
+
* @description: Use this API to fetch the customer credit summary.
|
|
808
757
|
*/
|
|
809
|
-
async
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
pincode,
|
|
813
|
-
checkoutMode,
|
|
814
|
-
orderType,
|
|
815
|
-
refresh,
|
|
816
|
-
cardReference,
|
|
817
|
-
userDetails,
|
|
818
|
-
} = {}) {
|
|
819
|
-
const { error } = PaymentValidator.getPosPaymentModeRoutes().validate(
|
|
820
|
-
{
|
|
821
|
-
amount,
|
|
822
|
-
cartId,
|
|
823
|
-
pincode,
|
|
824
|
-
checkoutMode,
|
|
825
|
-
orderType,
|
|
826
|
-
refresh,
|
|
827
|
-
cardReference,
|
|
828
|
-
userDetails,
|
|
829
|
-
},
|
|
758
|
+
async customerOnboard({ body } = {}) {
|
|
759
|
+
const { error } = PaymentValidator.customerOnboard().validate(
|
|
760
|
+
{ body },
|
|
830
761
|
{ abortEarly: false, allowUnknown: true }
|
|
831
762
|
);
|
|
832
763
|
if (error) {
|
|
@@ -834,56 +765,37 @@ class Payment {
|
|
|
834
765
|
}
|
|
835
766
|
|
|
836
767
|
// Showing warrnings if extra unknown parameters are found
|
|
837
|
-
const {
|
|
838
|
-
|
|
839
|
-
} = PaymentValidator.getPosPaymentModeRoutes().validate(
|
|
840
|
-
{
|
|
841
|
-
amount,
|
|
842
|
-
cartId,
|
|
843
|
-
pincode,
|
|
844
|
-
checkoutMode,
|
|
845
|
-
orderType,
|
|
846
|
-
refresh,
|
|
847
|
-
cardReference,
|
|
848
|
-
userDetails,
|
|
849
|
-
},
|
|
768
|
+
const { error: warrning } = PaymentValidator.customerOnboard().validate(
|
|
769
|
+
{ body },
|
|
850
770
|
{ abortEarly: false, allowUnknown: false }
|
|
851
771
|
);
|
|
852
772
|
if (warrning) {
|
|
853
773
|
Logger({
|
|
854
774
|
level: "WARN",
|
|
855
|
-
message: "Parameter Validation warrnings for
|
|
775
|
+
message: "Parameter Validation warrnings for customerOnboard",
|
|
856
776
|
});
|
|
857
777
|
Logger({ level: "WARN", message: warrning });
|
|
858
778
|
}
|
|
859
779
|
|
|
860
780
|
const query_params = {};
|
|
861
|
-
query_params["amount"] = amount;
|
|
862
|
-
query_params["cart_id"] = cartId;
|
|
863
|
-
query_params["pincode"] = pincode;
|
|
864
|
-
query_params["checkout_mode"] = checkoutMode;
|
|
865
|
-
query_params["refresh"] = refresh;
|
|
866
|
-
query_params["card_reference"] = cardReference;
|
|
867
|
-
query_params["order_type"] = orderType;
|
|
868
|
-
query_params["user_details"] = userDetails;
|
|
869
781
|
|
|
870
782
|
const xHeaders = {};
|
|
871
783
|
|
|
872
784
|
const response = await APIClient.execute(
|
|
873
785
|
this._conf,
|
|
874
|
-
"
|
|
786
|
+
"post",
|
|
875
787
|
constructUrl({
|
|
876
|
-
url: this._urls["
|
|
788
|
+
url: this._urls["customerOnboard"],
|
|
877
789
|
params: {},
|
|
878
790
|
}),
|
|
879
791
|
query_params,
|
|
880
|
-
|
|
792
|
+
body,
|
|
881
793
|
xHeaders
|
|
882
794
|
);
|
|
883
795
|
|
|
884
796
|
const {
|
|
885
797
|
error: res_error,
|
|
886
|
-
} = PaymentModel.
|
|
798
|
+
} = PaymentModel.CustomerOnboardingResponse().validate(response, {
|
|
887
799
|
abortEarly: false,
|
|
888
800
|
allowUnknown: false,
|
|
889
801
|
});
|
|
@@ -891,7 +803,7 @@ class Payment {
|
|
|
891
803
|
if (res_error) {
|
|
892
804
|
Logger({
|
|
893
805
|
level: "WARN",
|
|
894
|
-
message: "Response Validation Warnnings for
|
|
806
|
+
message: "Response Validation Warnnings for customerOnboard",
|
|
895
807
|
});
|
|
896
808
|
Logger({ level: "WARN", message: res_error });
|
|
897
809
|
}
|
|
@@ -901,13 +813,14 @@ class Payment {
|
|
|
901
813
|
|
|
902
814
|
/**
|
|
903
815
|
* @param {Object} arg - Arg object.
|
|
904
|
-
* @
|
|
905
|
-
* @
|
|
906
|
-
* @
|
|
816
|
+
* @param {DeletehCardRequest} arg.body
|
|
817
|
+
* @returns {Promise<DeleteCardsResponse>} - Success response
|
|
818
|
+
* @summary: Delete a card
|
|
819
|
+
* @description: Use this API to delete a card added by a user on the payment gateway and clear the cache.
|
|
907
820
|
*/
|
|
908
|
-
async
|
|
909
|
-
const { error } = PaymentValidator.
|
|
910
|
-
{},
|
|
821
|
+
async deleteUserCard({ body } = {}) {
|
|
822
|
+
const { error } = PaymentValidator.deleteUserCard().validate(
|
|
823
|
+
{ body },
|
|
911
824
|
{ abortEarly: false, allowUnknown: true }
|
|
912
825
|
);
|
|
913
826
|
if (error) {
|
|
@@ -915,16 +828,14 @@ class Payment {
|
|
|
915
828
|
}
|
|
916
829
|
|
|
917
830
|
// Showing warrnings if extra unknown parameters are found
|
|
918
|
-
const {
|
|
919
|
-
|
|
920
|
-
} = PaymentValidator.getRupifiBannerDetails().validate(
|
|
921
|
-
{},
|
|
831
|
+
const { error: warrning } = PaymentValidator.deleteUserCard().validate(
|
|
832
|
+
{ body },
|
|
922
833
|
{ abortEarly: false, allowUnknown: false }
|
|
923
834
|
);
|
|
924
835
|
if (warrning) {
|
|
925
836
|
Logger({
|
|
926
837
|
level: "WARN",
|
|
927
|
-
message: "Parameter Validation warrnings for
|
|
838
|
+
message: "Parameter Validation warrnings for deleteUserCard",
|
|
928
839
|
});
|
|
929
840
|
Logger({ level: "WARN", message: warrning });
|
|
930
841
|
}
|
|
@@ -935,19 +846,19 @@ class Payment {
|
|
|
935
846
|
|
|
936
847
|
const response = await APIClient.execute(
|
|
937
848
|
this._conf,
|
|
938
|
-
"
|
|
849
|
+
"post",
|
|
939
850
|
constructUrl({
|
|
940
|
-
url: this._urls["
|
|
851
|
+
url: this._urls["deleteUserCard"],
|
|
941
852
|
params: {},
|
|
942
853
|
}),
|
|
943
854
|
query_params,
|
|
944
|
-
|
|
855
|
+
body,
|
|
945
856
|
xHeaders
|
|
946
857
|
);
|
|
947
858
|
|
|
948
859
|
const {
|
|
949
860
|
error: res_error,
|
|
950
|
-
} = PaymentModel.
|
|
861
|
+
} = PaymentModel.DeleteCardsResponse().validate(response, {
|
|
951
862
|
abortEarly: false,
|
|
952
863
|
allowUnknown: false,
|
|
953
864
|
});
|
|
@@ -955,7 +866,7 @@ class Payment {
|
|
|
955
866
|
if (res_error) {
|
|
956
867
|
Logger({
|
|
957
868
|
level: "WARN",
|
|
958
|
-
message: "Response Validation Warnnings for
|
|
869
|
+
message: "Response Validation Warnnings for deleteUserCard",
|
|
959
870
|
});
|
|
960
871
|
Logger({ level: "WARN", message: res_error });
|
|
961
872
|
}
|
|
@@ -965,13 +876,16 @@ class Payment {
|
|
|
965
876
|
|
|
966
877
|
/**
|
|
967
878
|
* @param {Object} arg - Arg object.
|
|
968
|
-
* @
|
|
969
|
-
* @
|
|
970
|
-
* @
|
|
879
|
+
* @param {UpdateRefundTransferModeRequest} arg.body
|
|
880
|
+
* @returns {Promise<UpdateRefundTransferModeResponse>} - Success response
|
|
881
|
+
* @summary: Enable/Disable a mode for transferring a refund
|
|
882
|
+
* @description: Activate or Deactivate Transfer Mode to collect Beneficiary Details for Refund
|
|
971
883
|
*/
|
|
972
|
-
async
|
|
973
|
-
const {
|
|
974
|
-
|
|
884
|
+
async enableOrDisableRefundTransferMode({ body } = {}) {
|
|
885
|
+
const {
|
|
886
|
+
error,
|
|
887
|
+
} = PaymentValidator.enableOrDisableRefundTransferMode().validate(
|
|
888
|
+
{ body },
|
|
975
889
|
{ abortEarly: false, allowUnknown: true }
|
|
976
890
|
);
|
|
977
891
|
if (error) {
|
|
@@ -981,14 +895,15 @@ class Payment {
|
|
|
981
895
|
// Showing warrnings if extra unknown parameters are found
|
|
982
896
|
const {
|
|
983
897
|
error: warrning,
|
|
984
|
-
} = PaymentValidator.
|
|
985
|
-
{},
|
|
898
|
+
} = PaymentValidator.enableOrDisableRefundTransferMode().validate(
|
|
899
|
+
{ body },
|
|
986
900
|
{ abortEarly: false, allowUnknown: false }
|
|
987
901
|
);
|
|
988
902
|
if (warrning) {
|
|
989
903
|
Logger({
|
|
990
904
|
level: "WARN",
|
|
991
|
-
message:
|
|
905
|
+
message:
|
|
906
|
+
"Parameter Validation warrnings for enableOrDisableRefundTransferMode",
|
|
992
907
|
});
|
|
993
908
|
Logger({ level: "WARN", message: warrning });
|
|
994
909
|
}
|
|
@@ -999,19 +914,19 @@ class Payment {
|
|
|
999
914
|
|
|
1000
915
|
const response = await APIClient.execute(
|
|
1001
916
|
this._conf,
|
|
1002
|
-
"
|
|
917
|
+
"put",
|
|
1003
918
|
constructUrl({
|
|
1004
|
-
url: this._urls["
|
|
919
|
+
url: this._urls["enableOrDisableRefundTransferMode"],
|
|
1005
920
|
params: {},
|
|
1006
921
|
}),
|
|
1007
922
|
query_params,
|
|
1008
|
-
|
|
923
|
+
body,
|
|
1009
924
|
xHeaders
|
|
1010
925
|
);
|
|
1011
926
|
|
|
1012
927
|
const {
|
|
1013
928
|
error: res_error,
|
|
1014
|
-
} = PaymentModel.
|
|
929
|
+
} = PaymentModel.UpdateRefundTransferModeResponse().validate(response, {
|
|
1015
930
|
abortEarly: false,
|
|
1016
931
|
allowUnknown: false,
|
|
1017
932
|
});
|
|
@@ -1019,7 +934,8 @@ class Payment {
|
|
|
1019
934
|
if (res_error) {
|
|
1020
935
|
Logger({
|
|
1021
936
|
level: "WARN",
|
|
1022
|
-
message:
|
|
937
|
+
message:
|
|
938
|
+
"Response Validation Warnnings for enableOrDisableRefundTransferMode",
|
|
1023
939
|
});
|
|
1024
940
|
Logger({ level: "WARN", message: res_error });
|
|
1025
941
|
}
|
|
@@ -1029,14 +945,14 @@ class Payment {
|
|
|
1029
945
|
|
|
1030
946
|
/**
|
|
1031
947
|
* @param {Object} arg - Arg object.
|
|
1032
|
-
* @param {
|
|
1033
|
-
* @returns {Promise<
|
|
1034
|
-
* @summary:
|
|
1035
|
-
* @description: Use this API to
|
|
948
|
+
* @param {boolean} [arg.refresh] -
|
|
949
|
+
* @returns {Promise<ActiveCardPaymentGatewayResponse>} - Success response
|
|
950
|
+
* @summary: Fetch active payment gateway for card payments
|
|
951
|
+
* @description: Use this API to retrieve an active payment aggregator along with the Customer ID. This is applicable for cards payments only.
|
|
1036
952
|
*/
|
|
1037
|
-
async
|
|
1038
|
-
const { error } = PaymentValidator.
|
|
1039
|
-
{
|
|
953
|
+
async getActiveCardAggregator({ refresh } = {}) {
|
|
954
|
+
const { error } = PaymentValidator.getActiveCardAggregator().validate(
|
|
955
|
+
{ refresh },
|
|
1040
956
|
{ abortEarly: false, allowUnknown: true }
|
|
1041
957
|
);
|
|
1042
958
|
if (error) {
|
|
@@ -1046,37 +962,38 @@ class Payment {
|
|
|
1046
962
|
// Showing warrnings if extra unknown parameters are found
|
|
1047
963
|
const {
|
|
1048
964
|
error: warrning,
|
|
1049
|
-
} = PaymentValidator.
|
|
1050
|
-
{
|
|
965
|
+
} = PaymentValidator.getActiveCardAggregator().validate(
|
|
966
|
+
{ refresh },
|
|
1051
967
|
{ abortEarly: false, allowUnknown: false }
|
|
1052
968
|
);
|
|
1053
969
|
if (warrning) {
|
|
1054
970
|
Logger({
|
|
1055
971
|
level: "WARN",
|
|
1056
|
-
message: "Parameter Validation warrnings for
|
|
972
|
+
message: "Parameter Validation warrnings for getActiveCardAggregator",
|
|
1057
973
|
});
|
|
1058
974
|
Logger({ level: "WARN", message: warrning });
|
|
1059
975
|
}
|
|
1060
976
|
|
|
1061
977
|
const query_params = {};
|
|
978
|
+
query_params["refresh"] = refresh;
|
|
1062
979
|
|
|
1063
980
|
const xHeaders = {};
|
|
1064
981
|
|
|
1065
982
|
const response = await APIClient.execute(
|
|
1066
983
|
this._conf,
|
|
1067
|
-
"
|
|
984
|
+
"get",
|
|
1068
985
|
constructUrl({
|
|
1069
|
-
url: this._urls["
|
|
986
|
+
url: this._urls["getActiveCardAggregator"],
|
|
1070
987
|
params: {},
|
|
1071
988
|
}),
|
|
1072
989
|
query_params,
|
|
1073
|
-
|
|
990
|
+
undefined,
|
|
1074
991
|
xHeaders
|
|
1075
992
|
);
|
|
1076
993
|
|
|
1077
994
|
const {
|
|
1078
995
|
error: res_error,
|
|
1079
|
-
} = PaymentModel.
|
|
996
|
+
} = PaymentModel.ActiveCardPaymentGatewayResponse().validate(response, {
|
|
1080
997
|
abortEarly: false,
|
|
1081
998
|
allowUnknown: false,
|
|
1082
999
|
});
|
|
@@ -1084,7 +1001,7 @@ class Payment {
|
|
|
1084
1001
|
if (res_error) {
|
|
1085
1002
|
Logger({
|
|
1086
1003
|
level: "WARN",
|
|
1087
|
-
message: "Response Validation Warnnings for
|
|
1004
|
+
message: "Response Validation Warnnings for getActiveCardAggregator",
|
|
1088
1005
|
});
|
|
1089
1006
|
Logger({ level: "WARN", message: res_error });
|
|
1090
1007
|
}
|
|
@@ -1094,14 +1011,13 @@ class Payment {
|
|
|
1094
1011
|
|
|
1095
1012
|
/**
|
|
1096
1013
|
* @param {Object} arg - Arg object.
|
|
1097
|
-
* @
|
|
1098
|
-
* @
|
|
1099
|
-
* @
|
|
1100
|
-
* @description: Use this API to decode base64 html form to plain HTML string.
|
|
1014
|
+
* @returns {Promise<TransferModeResponse>} - Success response
|
|
1015
|
+
* @summary: Lists the mode of refund
|
|
1016
|
+
* @description: Use this API to retrieve eligible refund modes (such as Netbanking) and add the beneficiary details.
|
|
1101
1017
|
*/
|
|
1102
|
-
async
|
|
1103
|
-
const { error } = PaymentValidator.
|
|
1104
|
-
{
|
|
1018
|
+
async getActiveRefundTransferModes({} = {}) {
|
|
1019
|
+
const { error } = PaymentValidator.getActiveRefundTransferModes().validate(
|
|
1020
|
+
{},
|
|
1105
1021
|
{ abortEarly: false, allowUnknown: true }
|
|
1106
1022
|
);
|
|
1107
1023
|
if (error) {
|
|
@@ -1109,14 +1025,17 @@ class Payment {
|
|
|
1109
1025
|
}
|
|
1110
1026
|
|
|
1111
1027
|
// Showing warrnings if extra unknown parameters are found
|
|
1112
|
-
const {
|
|
1113
|
-
|
|
1028
|
+
const {
|
|
1029
|
+
error: warrning,
|
|
1030
|
+
} = PaymentValidator.getActiveRefundTransferModes().validate(
|
|
1031
|
+
{},
|
|
1114
1032
|
{ abortEarly: false, allowUnknown: false }
|
|
1115
1033
|
);
|
|
1116
1034
|
if (warrning) {
|
|
1117
1035
|
Logger({
|
|
1118
1036
|
level: "WARN",
|
|
1119
|
-
message:
|
|
1037
|
+
message:
|
|
1038
|
+
"Parameter Validation warrnings for getActiveRefundTransferModes",
|
|
1120
1039
|
});
|
|
1121
1040
|
Logger({ level: "WARN", message: warrning });
|
|
1122
1041
|
}
|
|
@@ -1127,19 +1046,19 @@ class Payment {
|
|
|
1127
1046
|
|
|
1128
1047
|
const response = await APIClient.execute(
|
|
1129
1048
|
this._conf,
|
|
1130
|
-
"
|
|
1049
|
+
"get",
|
|
1131
1050
|
constructUrl({
|
|
1132
|
-
url: this._urls["
|
|
1051
|
+
url: this._urls["getActiveRefundTransferModes"],
|
|
1133
1052
|
params: {},
|
|
1134
1053
|
}),
|
|
1135
1054
|
query_params,
|
|
1136
|
-
|
|
1055
|
+
undefined,
|
|
1137
1056
|
xHeaders
|
|
1138
1057
|
);
|
|
1139
1058
|
|
|
1140
1059
|
const {
|
|
1141
1060
|
error: res_error,
|
|
1142
|
-
} = PaymentModel.
|
|
1061
|
+
} = PaymentModel.TransferModeResponse().validate(response, {
|
|
1143
1062
|
abortEarly: false,
|
|
1144
1063
|
allowUnknown: false,
|
|
1145
1064
|
});
|
|
@@ -1147,7 +1066,8 @@ class Payment {
|
|
|
1147
1066
|
if (res_error) {
|
|
1148
1067
|
Logger({
|
|
1149
1068
|
level: "WARN",
|
|
1150
|
-
message:
|
|
1069
|
+
message:
|
|
1070
|
+
"Response Validation Warnnings for getActiveRefundTransferModes",
|
|
1151
1071
|
});
|
|
1152
1072
|
Logger({ level: "WARN", message: res_error });
|
|
1153
1073
|
}
|
|
@@ -1157,14 +1077,14 @@ class Payment {
|
|
|
1157
1077
|
|
|
1158
1078
|
/**
|
|
1159
1079
|
* @param {Object} arg - Arg object.
|
|
1160
|
-
* @param {
|
|
1161
|
-
* @returns {Promise<
|
|
1162
|
-
* @summary:
|
|
1163
|
-
* @description: API to
|
|
1080
|
+
* @param {boolean} [arg.forceRefresh] -
|
|
1081
|
+
* @returns {Promise<ListCardsResponse>} - Success response
|
|
1082
|
+
* @summary: Fetch the list of cards saved by the user
|
|
1083
|
+
* @description: Use this API to retrieve a list of cards stored by user from an active payment gateway.
|
|
1164
1084
|
*/
|
|
1165
|
-
async
|
|
1166
|
-
const { error } = PaymentValidator.
|
|
1167
|
-
{
|
|
1085
|
+
async getActiveUserCards({ forceRefresh } = {}) {
|
|
1086
|
+
const { error } = PaymentValidator.getActiveUserCards().validate(
|
|
1087
|
+
{ forceRefresh },
|
|
1168
1088
|
{ abortEarly: false, allowUnknown: true }
|
|
1169
1089
|
);
|
|
1170
1090
|
if (error) {
|
|
@@ -1172,37 +1092,38 @@ class Payment {
|
|
|
1172
1092
|
}
|
|
1173
1093
|
|
|
1174
1094
|
// Showing warrnings if extra unknown parameters are found
|
|
1175
|
-
const { error: warrning } = PaymentValidator.
|
|
1176
|
-
{
|
|
1095
|
+
const { error: warrning } = PaymentValidator.getActiveUserCards().validate(
|
|
1096
|
+
{ forceRefresh },
|
|
1177
1097
|
{ abortEarly: false, allowUnknown: false }
|
|
1178
1098
|
);
|
|
1179
1099
|
if (warrning) {
|
|
1180
1100
|
Logger({
|
|
1181
1101
|
level: "WARN",
|
|
1182
|
-
message: "Parameter Validation warrnings for
|
|
1102
|
+
message: "Parameter Validation warrnings for getActiveUserCards",
|
|
1183
1103
|
});
|
|
1184
1104
|
Logger({ level: "WARN", message: warrning });
|
|
1185
1105
|
}
|
|
1186
1106
|
|
|
1187
1107
|
const query_params = {};
|
|
1108
|
+
query_params["force_refresh"] = forceRefresh;
|
|
1188
1109
|
|
|
1189
1110
|
const xHeaders = {};
|
|
1190
1111
|
|
|
1191
1112
|
const response = await APIClient.execute(
|
|
1192
1113
|
this._conf,
|
|
1193
|
-
"
|
|
1114
|
+
"get",
|
|
1194
1115
|
constructUrl({
|
|
1195
|
-
url: this._urls["
|
|
1116
|
+
url: this._urls["getActiveUserCards"],
|
|
1196
1117
|
params: {},
|
|
1197
1118
|
}),
|
|
1198
1119
|
query_params,
|
|
1199
|
-
|
|
1120
|
+
undefined,
|
|
1200
1121
|
xHeaders
|
|
1201
1122
|
);
|
|
1202
1123
|
|
|
1203
1124
|
const {
|
|
1204
1125
|
error: res_error,
|
|
1205
|
-
} = PaymentModel.
|
|
1126
|
+
} = PaymentModel.ListCardsResponse().validate(response, {
|
|
1206
1127
|
abortEarly: false,
|
|
1207
1128
|
allowUnknown: false,
|
|
1208
1129
|
});
|
|
@@ -1210,7 +1131,7 @@ class Payment {
|
|
|
1210
1131
|
if (res_error) {
|
|
1211
1132
|
Logger({
|
|
1212
1133
|
level: "WARN",
|
|
1213
|
-
message: "Response Validation Warnnings for
|
|
1134
|
+
message: "Response Validation Warnnings for getActiveUserCards",
|
|
1214
1135
|
});
|
|
1215
1136
|
Logger({ level: "WARN", message: res_error });
|
|
1216
1137
|
}
|
|
@@ -1220,13 +1141,17 @@ class Payment {
|
|
|
1220
1141
|
|
|
1221
1142
|
/**
|
|
1222
1143
|
* @param {Object} arg - Arg object.
|
|
1223
|
-
* @
|
|
1224
|
-
* @
|
|
1225
|
-
*
|
|
1144
|
+
* @param {string} [arg.xApiToken] - Used for basic authentication.
|
|
1145
|
+
* @param {boolean} [arg.refresh] - This is a boolean value. Select `true`
|
|
1146
|
+
* to remove temporary cache files on payment gateway and replace with the
|
|
1147
|
+
* latest one.
|
|
1148
|
+
* @returns {Promise<AggregatorsConfigDetailResponse>} - Success response
|
|
1149
|
+
* @summary: Get payment gateway keys
|
|
1150
|
+
* @description: Use this API to retrieve the payment gateway key, secrets, merchant, SDK/API details to complete a payment at front-end.
|
|
1226
1151
|
*/
|
|
1227
|
-
async
|
|
1228
|
-
const { error } = PaymentValidator.
|
|
1229
|
-
{},
|
|
1152
|
+
async getAggregatorsConfig({ xApiToken, refresh } = {}) {
|
|
1153
|
+
const { error } = PaymentValidator.getAggregatorsConfig().validate(
|
|
1154
|
+
{ xApiToken, refresh },
|
|
1230
1155
|
{ abortEarly: false, allowUnknown: true }
|
|
1231
1156
|
);
|
|
1232
1157
|
if (error) {
|
|
@@ -1236,28 +1161,29 @@ class Payment {
|
|
|
1236
1161
|
// Showing warrnings if extra unknown parameters are found
|
|
1237
1162
|
const {
|
|
1238
1163
|
error: warrning,
|
|
1239
|
-
} = PaymentValidator.
|
|
1240
|
-
{},
|
|
1164
|
+
} = PaymentValidator.getAggregatorsConfig().validate(
|
|
1165
|
+
{ xApiToken, refresh },
|
|
1241
1166
|
{ abortEarly: false, allowUnknown: false }
|
|
1242
1167
|
);
|
|
1243
1168
|
if (warrning) {
|
|
1244
1169
|
Logger({
|
|
1245
1170
|
level: "WARN",
|
|
1246
|
-
message:
|
|
1247
|
-
"Parameter Validation warrnings for getActiveRefundTransferModes",
|
|
1171
|
+
message: "Parameter Validation warrnings for getAggregatorsConfig",
|
|
1248
1172
|
});
|
|
1249
1173
|
Logger({ level: "WARN", message: warrning });
|
|
1250
1174
|
}
|
|
1251
1175
|
|
|
1252
1176
|
const query_params = {};
|
|
1177
|
+
query_params["refresh"] = refresh;
|
|
1253
1178
|
|
|
1254
1179
|
const xHeaders = {};
|
|
1180
|
+
xHeaders["x-api-token"] = xApiToken;
|
|
1255
1181
|
|
|
1256
1182
|
const response = await APIClient.execute(
|
|
1257
1183
|
this._conf,
|
|
1258
1184
|
"get",
|
|
1259
1185
|
constructUrl({
|
|
1260
|
-
url: this._urls["
|
|
1186
|
+
url: this._urls["getAggregatorsConfig"],
|
|
1261
1187
|
params: {},
|
|
1262
1188
|
}),
|
|
1263
1189
|
query_params,
|
|
@@ -1267,7 +1193,7 @@ class Payment {
|
|
|
1267
1193
|
|
|
1268
1194
|
const {
|
|
1269
1195
|
error: res_error,
|
|
1270
|
-
} = PaymentModel.
|
|
1196
|
+
} = PaymentModel.AggregatorsConfigDetailResponse().validate(response, {
|
|
1271
1197
|
abortEarly: false,
|
|
1272
1198
|
allowUnknown: false,
|
|
1273
1199
|
});
|
|
@@ -1275,8 +1201,7 @@ class Payment {
|
|
|
1275
1201
|
if (res_error) {
|
|
1276
1202
|
Logger({
|
|
1277
1203
|
level: "WARN",
|
|
1278
|
-
message:
|
|
1279
|
-
"Response Validation Warnnings for getActiveRefundTransferModes",
|
|
1204
|
+
message: "Response Validation Warnnings for getAggregatorsConfig",
|
|
1280
1205
|
});
|
|
1281
1206
|
Logger({ level: "WARN", message: res_error });
|
|
1282
1207
|
}
|
|
@@ -1286,16 +1211,13 @@ class Payment {
|
|
|
1286
1211
|
|
|
1287
1212
|
/**
|
|
1288
1213
|
* @param {Object} arg - Arg object.
|
|
1289
|
-
* @
|
|
1290
|
-
* @
|
|
1291
|
-
* @
|
|
1292
|
-
* @description: Activate or Deactivate Transfer Mode to collect Beneficiary Details for Refund
|
|
1214
|
+
* @returns {Promise<EpaylaterBannerResponse>} - Success response
|
|
1215
|
+
* @summary: Get Epaylater Enabled
|
|
1216
|
+
* @description: Get Epaylater Enabled if user is tentatively approved by epaylater
|
|
1293
1217
|
*/
|
|
1294
|
-
async
|
|
1295
|
-
const {
|
|
1296
|
-
|
|
1297
|
-
} = PaymentValidator.enableOrDisableRefundTransferMode().validate(
|
|
1298
|
-
{ body },
|
|
1218
|
+
async getEpaylaterBannerDetails({} = {}) {
|
|
1219
|
+
const { error } = PaymentValidator.getEpaylaterBannerDetails().validate(
|
|
1220
|
+
{},
|
|
1299
1221
|
{ abortEarly: false, allowUnknown: true }
|
|
1300
1222
|
);
|
|
1301
1223
|
if (error) {
|
|
@@ -1305,15 +1227,14 @@ class Payment {
|
|
|
1305
1227
|
// Showing warrnings if extra unknown parameters are found
|
|
1306
1228
|
const {
|
|
1307
1229
|
error: warrning,
|
|
1308
|
-
} = PaymentValidator.
|
|
1309
|
-
{
|
|
1230
|
+
} = PaymentValidator.getEpaylaterBannerDetails().validate(
|
|
1231
|
+
{},
|
|
1310
1232
|
{ abortEarly: false, allowUnknown: false }
|
|
1311
1233
|
);
|
|
1312
1234
|
if (warrning) {
|
|
1313
1235
|
Logger({
|
|
1314
1236
|
level: "WARN",
|
|
1315
|
-
message:
|
|
1316
|
-
"Parameter Validation warrnings for enableOrDisableRefundTransferMode",
|
|
1237
|
+
message: "Parameter Validation warrnings for getEpaylaterBannerDetails",
|
|
1317
1238
|
});
|
|
1318
1239
|
Logger({ level: "WARN", message: warrning });
|
|
1319
1240
|
}
|
|
@@ -1324,19 +1245,19 @@ class Payment {
|
|
|
1324
1245
|
|
|
1325
1246
|
const response = await APIClient.execute(
|
|
1326
1247
|
this._conf,
|
|
1327
|
-
"
|
|
1248
|
+
"get",
|
|
1328
1249
|
constructUrl({
|
|
1329
|
-
url: this._urls["
|
|
1250
|
+
url: this._urls["getEpaylaterBannerDetails"],
|
|
1330
1251
|
params: {},
|
|
1331
1252
|
}),
|
|
1332
1253
|
query_params,
|
|
1333
|
-
|
|
1254
|
+
undefined,
|
|
1334
1255
|
xHeaders
|
|
1335
1256
|
);
|
|
1336
1257
|
|
|
1337
1258
|
const {
|
|
1338
1259
|
error: res_error,
|
|
1339
|
-
} = PaymentModel.
|
|
1260
|
+
} = PaymentModel.EpaylaterBannerResponse().validate(response, {
|
|
1340
1261
|
abortEarly: false,
|
|
1341
1262
|
allowUnknown: false,
|
|
1342
1263
|
});
|
|
@@ -1344,8 +1265,7 @@ class Payment {
|
|
|
1344
1265
|
if (res_error) {
|
|
1345
1266
|
Logger({
|
|
1346
1267
|
level: "WARN",
|
|
1347
|
-
message:
|
|
1348
|
-
"Response Validation Warnnings for enableOrDisableRefundTransferMode",
|
|
1268
|
+
message: "Response Validation Warnnings for getEpaylaterBannerDetails",
|
|
1349
1269
|
});
|
|
1350
1270
|
Logger({ level: "WARN", message: res_error });
|
|
1351
1271
|
}
|
|
@@ -1361,8 +1281,8 @@ class Payment {
|
|
|
1361
1281
|
* @summary: Lists the beneficiary of a refund
|
|
1362
1282
|
* @description: Use this API to get the details of all active beneficiary added by a user for refund.
|
|
1363
1283
|
*/
|
|
1364
|
-
async
|
|
1365
|
-
const { error } = PaymentValidator.
|
|
1284
|
+
async getOrderBeneficiariesDetail({ orderId } = {}) {
|
|
1285
|
+
const { error } = PaymentValidator.getOrderBeneficiariesDetail().validate(
|
|
1366
1286
|
{ orderId },
|
|
1367
1287
|
{ abortEarly: false, allowUnknown: true }
|
|
1368
1288
|
);
|
|
@@ -1373,7 +1293,7 @@ class Payment {
|
|
|
1373
1293
|
// Showing warrnings if extra unknown parameters are found
|
|
1374
1294
|
const {
|
|
1375
1295
|
error: warrning,
|
|
1376
|
-
} = PaymentValidator.
|
|
1296
|
+
} = PaymentValidator.getOrderBeneficiariesDetail().validate(
|
|
1377
1297
|
{ orderId },
|
|
1378
1298
|
{ abortEarly: false, allowUnknown: false }
|
|
1379
1299
|
);
|
|
@@ -1381,7 +1301,7 @@ class Payment {
|
|
|
1381
1301
|
Logger({
|
|
1382
1302
|
level: "WARN",
|
|
1383
1303
|
message:
|
|
1384
|
-
"Parameter Validation warrnings for
|
|
1304
|
+
"Parameter Validation warrnings for getOrderBeneficiariesDetail",
|
|
1385
1305
|
});
|
|
1386
1306
|
Logger({ level: "WARN", message: warrning });
|
|
1387
1307
|
}
|
|
@@ -1395,7 +1315,7 @@ class Payment {
|
|
|
1395
1315
|
this._conf,
|
|
1396
1316
|
"get",
|
|
1397
1317
|
constructUrl({
|
|
1398
|
-
url: this._urls["
|
|
1318
|
+
url: this._urls["getOrderBeneficiariesDetail"],
|
|
1399
1319
|
params: {},
|
|
1400
1320
|
}),
|
|
1401
1321
|
query_params,
|
|
@@ -1413,7 +1333,8 @@ class Payment {
|
|
|
1413
1333
|
if (res_error) {
|
|
1414
1334
|
Logger({
|
|
1415
1335
|
level: "WARN",
|
|
1416
|
-
message:
|
|
1336
|
+
message:
|
|
1337
|
+
"Response Validation Warnnings for getOrderBeneficiariesDetail",
|
|
1417
1338
|
});
|
|
1418
1339
|
Logger({ level: "WARN", message: res_error });
|
|
1419
1340
|
}
|
|
@@ -1423,15 +1344,14 @@ class Payment {
|
|
|
1423
1344
|
|
|
1424
1345
|
/**
|
|
1425
1346
|
* @param {Object} arg - Arg object.
|
|
1426
|
-
* @param {string} [arg.
|
|
1427
|
-
*
|
|
1428
|
-
* @
|
|
1429
|
-
* @
|
|
1430
|
-
* @description: Use this API to check whether the 11-digit IFSC code is valid and to fetch the bank details for refund.
|
|
1347
|
+
* @param {string} [arg.paymentLinkId] -
|
|
1348
|
+
* @returns {Promise<GetPaymentLinkResponse>} - Success response
|
|
1349
|
+
* @summary: Get payment link
|
|
1350
|
+
* @description: Use this API to get a payment link
|
|
1431
1351
|
*/
|
|
1432
|
-
async
|
|
1433
|
-
const { error } = PaymentValidator.
|
|
1434
|
-
{
|
|
1352
|
+
async getPaymentLink({ paymentLinkId } = {}) {
|
|
1353
|
+
const { error } = PaymentValidator.getPaymentLink().validate(
|
|
1354
|
+
{ paymentLinkId },
|
|
1435
1355
|
{ abortEarly: false, allowUnknown: true }
|
|
1436
1356
|
);
|
|
1437
1357
|
if (error) {
|
|
@@ -1439,20 +1359,20 @@ class Payment {
|
|
|
1439
1359
|
}
|
|
1440
1360
|
|
|
1441
1361
|
// Showing warrnings if extra unknown parameters are found
|
|
1442
|
-
const { error: warrning } = PaymentValidator.
|
|
1443
|
-
{
|
|
1362
|
+
const { error: warrning } = PaymentValidator.getPaymentLink().validate(
|
|
1363
|
+
{ paymentLinkId },
|
|
1444
1364
|
{ abortEarly: false, allowUnknown: false }
|
|
1445
1365
|
);
|
|
1446
1366
|
if (warrning) {
|
|
1447
1367
|
Logger({
|
|
1448
1368
|
level: "WARN",
|
|
1449
|
-
message: "Parameter Validation warrnings for
|
|
1369
|
+
message: "Parameter Validation warrnings for getPaymentLink",
|
|
1450
1370
|
});
|
|
1451
1371
|
Logger({ level: "WARN", message: warrning });
|
|
1452
1372
|
}
|
|
1453
1373
|
|
|
1454
1374
|
const query_params = {};
|
|
1455
|
-
query_params["
|
|
1375
|
+
query_params["payment_link_id"] = paymentLinkId;
|
|
1456
1376
|
|
|
1457
1377
|
const xHeaders = {};
|
|
1458
1378
|
|
|
@@ -1460,7 +1380,7 @@ class Payment {
|
|
|
1460
1380
|
this._conf,
|
|
1461
1381
|
"get",
|
|
1462
1382
|
constructUrl({
|
|
1463
|
-
url: this._urls["
|
|
1383
|
+
url: this._urls["getPaymentLink"],
|
|
1464
1384
|
params: {},
|
|
1465
1385
|
}),
|
|
1466
1386
|
query_params,
|
|
@@ -1470,7 +1390,7 @@ class Payment {
|
|
|
1470
1390
|
|
|
1471
1391
|
const {
|
|
1472
1392
|
error: res_error,
|
|
1473
|
-
} = PaymentModel.
|
|
1393
|
+
} = PaymentModel.GetPaymentLinkResponse().validate(response, {
|
|
1474
1394
|
abortEarly: false,
|
|
1475
1395
|
allowUnknown: false,
|
|
1476
1396
|
});
|
|
@@ -1478,7 +1398,7 @@ class Payment {
|
|
|
1478
1398
|
if (res_error) {
|
|
1479
1399
|
Logger({
|
|
1480
1400
|
level: "WARN",
|
|
1481
|
-
message: "Response Validation Warnnings for
|
|
1401
|
+
message: "Response Validation Warnnings for getPaymentLink",
|
|
1482
1402
|
});
|
|
1483
1403
|
Logger({ level: "WARN", message: res_error });
|
|
1484
1404
|
}
|
|
@@ -1488,15 +1408,40 @@ class Payment {
|
|
|
1488
1408
|
|
|
1489
1409
|
/**
|
|
1490
1410
|
* @param {Object} arg - Arg object.
|
|
1491
|
-
* @param {
|
|
1492
|
-
*
|
|
1493
|
-
* @
|
|
1494
|
-
* @
|
|
1495
|
-
* @
|
|
1411
|
+
* @param {number} arg.amount - Payable amount.
|
|
1412
|
+
* @param {string} arg.cartId - Identifier of the cart.
|
|
1413
|
+
* @param {string} arg.pincode - The PIN Code of the destination address, e.g. 400059
|
|
1414
|
+
* @param {string} arg.checkoutMode - Option to checkout for self or for others.
|
|
1415
|
+
* @param {boolean} [arg.refresh] - This is a boolean value. Select `true`
|
|
1416
|
+
* to remove temporary cache files on payment gateway and replace with the
|
|
1417
|
+
* latest one.
|
|
1418
|
+
* @param {string} [arg.cardReference] - Card reference id of user's debit
|
|
1419
|
+
* or credit card.
|
|
1420
|
+
* @param {string} [arg.userDetails] - URIencoded JSON containing details of
|
|
1421
|
+
* an anonymous user.
|
|
1422
|
+
* @returns {Promise<PaymentModeRouteResponse>} - Success response
|
|
1423
|
+
* @summary: Get applicable payment options
|
|
1424
|
+
* @description: Use this API to get all valid payment options for doing a payment.
|
|
1496
1425
|
*/
|
|
1497
|
-
async
|
|
1498
|
-
|
|
1499
|
-
|
|
1426
|
+
async getPaymentModeRoutes({
|
|
1427
|
+
amount,
|
|
1428
|
+
cartId,
|
|
1429
|
+
pincode,
|
|
1430
|
+
checkoutMode,
|
|
1431
|
+
refresh,
|
|
1432
|
+
cardReference,
|
|
1433
|
+
userDetails,
|
|
1434
|
+
} = {}) {
|
|
1435
|
+
const { error } = PaymentValidator.getPaymentModeRoutes().validate(
|
|
1436
|
+
{
|
|
1437
|
+
amount,
|
|
1438
|
+
cartId,
|
|
1439
|
+
pincode,
|
|
1440
|
+
checkoutMode,
|
|
1441
|
+
refresh,
|
|
1442
|
+
cardReference,
|
|
1443
|
+
userDetails,
|
|
1444
|
+
},
|
|
1500
1445
|
{ abortEarly: false, allowUnknown: true }
|
|
1501
1446
|
);
|
|
1502
1447
|
if (error) {
|
|
@@ -1506,21 +1451,34 @@ class Payment {
|
|
|
1506
1451
|
// Showing warrnings if extra unknown parameters are found
|
|
1507
1452
|
const {
|
|
1508
1453
|
error: warrning,
|
|
1509
|
-
} = PaymentValidator.
|
|
1510
|
-
{
|
|
1454
|
+
} = PaymentValidator.getPaymentModeRoutes().validate(
|
|
1455
|
+
{
|
|
1456
|
+
amount,
|
|
1457
|
+
cartId,
|
|
1458
|
+
pincode,
|
|
1459
|
+
checkoutMode,
|
|
1460
|
+
refresh,
|
|
1461
|
+
cardReference,
|
|
1462
|
+
userDetails,
|
|
1463
|
+
},
|
|
1511
1464
|
{ abortEarly: false, allowUnknown: false }
|
|
1512
1465
|
);
|
|
1513
1466
|
if (warrning) {
|
|
1514
1467
|
Logger({
|
|
1515
1468
|
level: "WARN",
|
|
1516
|
-
message:
|
|
1517
|
-
"Parameter Validation warrnings for getOrderBeneficiariesDetail",
|
|
1469
|
+
message: "Parameter Validation warrnings for getPaymentModeRoutes",
|
|
1518
1470
|
});
|
|
1519
1471
|
Logger({ level: "WARN", message: warrning });
|
|
1520
1472
|
}
|
|
1521
1473
|
|
|
1522
1474
|
const query_params = {};
|
|
1523
|
-
query_params["
|
|
1475
|
+
query_params["amount"] = amount;
|
|
1476
|
+
query_params["cart_id"] = cartId;
|
|
1477
|
+
query_params["pincode"] = pincode;
|
|
1478
|
+
query_params["checkout_mode"] = checkoutMode;
|
|
1479
|
+
query_params["refresh"] = refresh;
|
|
1480
|
+
query_params["card_reference"] = cardReference;
|
|
1481
|
+
query_params["user_details"] = userDetails;
|
|
1524
1482
|
|
|
1525
1483
|
const xHeaders = {};
|
|
1526
1484
|
|
|
@@ -1528,7 +1486,7 @@ class Payment {
|
|
|
1528
1486
|
this._conf,
|
|
1529
1487
|
"get",
|
|
1530
1488
|
constructUrl({
|
|
1531
|
-
url: this._urls["
|
|
1489
|
+
url: this._urls["getPaymentModeRoutes"],
|
|
1532
1490
|
params: {},
|
|
1533
1491
|
}),
|
|
1534
1492
|
query_params,
|
|
@@ -1538,7 +1496,7 @@ class Payment {
|
|
|
1538
1496
|
|
|
1539
1497
|
const {
|
|
1540
1498
|
error: res_error,
|
|
1541
|
-
} = PaymentModel.
|
|
1499
|
+
} = PaymentModel.PaymentModeRouteResponse().validate(response, {
|
|
1542
1500
|
abortEarly: false,
|
|
1543
1501
|
allowUnknown: false,
|
|
1544
1502
|
});
|
|
@@ -1546,8 +1504,7 @@ class Payment {
|
|
|
1546
1504
|
if (res_error) {
|
|
1547
1505
|
Logger({
|
|
1548
1506
|
level: "WARN",
|
|
1549
|
-
message:
|
|
1550
|
-
"Response Validation Warnnings for getOrderBeneficiariesDetail",
|
|
1507
|
+
message: "Response Validation Warnnings for getPaymentModeRoutes",
|
|
1551
1508
|
});
|
|
1552
1509
|
Logger({ level: "WARN", message: res_error });
|
|
1553
1510
|
}
|
|
@@ -1557,16 +1514,16 @@ class Payment {
|
|
|
1557
1514
|
|
|
1558
1515
|
/**
|
|
1559
1516
|
* @param {Object} arg - Arg object.
|
|
1560
|
-
* @param {
|
|
1561
|
-
* @returns {Promise<
|
|
1562
|
-
* @summary:
|
|
1563
|
-
* @description: Use this API to
|
|
1517
|
+
* @param {string} arg.paymentLinkId - Payment link id
|
|
1518
|
+
* @returns {Promise<PaymentModeRouteResponse>} - Success response
|
|
1519
|
+
* @summary: Get applicable payment options for payment link
|
|
1520
|
+
* @description: Use this API to get all valid payment options for doing a payment through payment link
|
|
1564
1521
|
*/
|
|
1565
|
-
async
|
|
1522
|
+
async getPaymentModeRoutesPaymentLink({ paymentLinkId } = {}) {
|
|
1566
1523
|
const {
|
|
1567
1524
|
error,
|
|
1568
|
-
} = PaymentValidator.
|
|
1569
|
-
{
|
|
1525
|
+
} = PaymentValidator.getPaymentModeRoutesPaymentLink().validate(
|
|
1526
|
+
{ paymentLinkId },
|
|
1570
1527
|
{ abortEarly: false, allowUnknown: true }
|
|
1571
1528
|
);
|
|
1572
1529
|
if (error) {
|
|
@@ -1576,47 +1533,48 @@ class Payment {
|
|
|
1576
1533
|
// Showing warrnings if extra unknown parameters are found
|
|
1577
1534
|
const {
|
|
1578
1535
|
error: warrning,
|
|
1579
|
-
} = PaymentValidator.
|
|
1580
|
-
{
|
|
1536
|
+
} = PaymentValidator.getPaymentModeRoutesPaymentLink().validate(
|
|
1537
|
+
{ paymentLinkId },
|
|
1581
1538
|
{ abortEarly: false, allowUnknown: false }
|
|
1582
1539
|
);
|
|
1583
1540
|
if (warrning) {
|
|
1584
1541
|
Logger({
|
|
1585
1542
|
level: "WARN",
|
|
1586
1543
|
message:
|
|
1587
|
-
"Parameter Validation warrnings for
|
|
1544
|
+
"Parameter Validation warrnings for getPaymentModeRoutesPaymentLink",
|
|
1588
1545
|
});
|
|
1589
1546
|
Logger({ level: "WARN", message: warrning });
|
|
1590
1547
|
}
|
|
1591
1548
|
|
|
1592
1549
|
const query_params = {};
|
|
1550
|
+
query_params["payment_link_id"] = paymentLinkId;
|
|
1593
1551
|
|
|
1594
1552
|
const xHeaders = {};
|
|
1595
1553
|
|
|
1596
1554
|
const response = await APIClient.execute(
|
|
1597
1555
|
this._conf,
|
|
1598
|
-
"
|
|
1556
|
+
"get",
|
|
1599
1557
|
constructUrl({
|
|
1600
|
-
url: this._urls["
|
|
1558
|
+
url: this._urls["getPaymentModeRoutesPaymentLink"],
|
|
1601
1559
|
params: {},
|
|
1602
1560
|
}),
|
|
1603
1561
|
query_params,
|
|
1604
|
-
|
|
1562
|
+
undefined,
|
|
1605
1563
|
xHeaders
|
|
1606
1564
|
);
|
|
1607
1565
|
|
|
1608
1566
|
const {
|
|
1609
1567
|
error: res_error,
|
|
1610
|
-
} = PaymentModel.
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
);
|
|
1568
|
+
} = PaymentModel.PaymentModeRouteResponse().validate(response, {
|
|
1569
|
+
abortEarly: false,
|
|
1570
|
+
allowUnknown: false,
|
|
1571
|
+
});
|
|
1614
1572
|
|
|
1615
1573
|
if (res_error) {
|
|
1616
1574
|
Logger({
|
|
1617
1575
|
level: "WARN",
|
|
1618
1576
|
message:
|
|
1619
|
-
"Response Validation Warnnings for
|
|
1577
|
+
"Response Validation Warnnings for getPaymentModeRoutesPaymentLink",
|
|
1620
1578
|
});
|
|
1621
1579
|
Logger({ level: "WARN", message: res_error });
|
|
1622
1580
|
}
|
|
@@ -1626,14 +1584,45 @@ class Payment {
|
|
|
1626
1584
|
|
|
1627
1585
|
/**
|
|
1628
1586
|
* @param {Object} arg - Arg object.
|
|
1629
|
-
* @param {
|
|
1630
|
-
* @
|
|
1631
|
-
* @
|
|
1632
|
-
* @
|
|
1587
|
+
* @param {number} arg.amount - Payable amount.
|
|
1588
|
+
* @param {string} arg.cartId - Identifier of the cart.
|
|
1589
|
+
* @param {string} arg.pincode - The PIN Code of the destination address, e.g. 400059
|
|
1590
|
+
* @param {string} arg.checkoutMode - Option to checkout for self or for others.
|
|
1591
|
+
* @param {boolean} [arg.refresh] - This is a boolean value. Select `true`
|
|
1592
|
+
* to remove temporary cache files on payment gateway and replace with the
|
|
1593
|
+
* latest one.
|
|
1594
|
+
* @param {string} [arg.cardReference] - Card reference id of user's debit
|
|
1595
|
+
* or credit card.
|
|
1596
|
+
* @param {string} arg.orderType - The order type of shipment * HomeDelivery
|
|
1597
|
+
* - If the customer wants the order home-delivered * PickAtStore - If the
|
|
1598
|
+
* customer wants the handover of an order at the store itself.
|
|
1599
|
+
* @param {string} [arg.userDetails] - URIencoded JSON containing details of
|
|
1600
|
+
* an anonymous user.
|
|
1601
|
+
* @returns {Promise<PaymentModeRouteResponse>} - Success response
|
|
1602
|
+
* @summary: Get applicable payment options for Point-of-Sale (POS)
|
|
1603
|
+
* @description: Use this API to get all valid payment options for doing a payment in POS.
|
|
1633
1604
|
*/
|
|
1634
|
-
async
|
|
1635
|
-
|
|
1636
|
-
|
|
1605
|
+
async getPosPaymentModeRoutes({
|
|
1606
|
+
amount,
|
|
1607
|
+
cartId,
|
|
1608
|
+
pincode,
|
|
1609
|
+
checkoutMode,
|
|
1610
|
+
orderType,
|
|
1611
|
+
refresh,
|
|
1612
|
+
cardReference,
|
|
1613
|
+
userDetails,
|
|
1614
|
+
} = {}) {
|
|
1615
|
+
const { error } = PaymentValidator.getPosPaymentModeRoutes().validate(
|
|
1616
|
+
{
|
|
1617
|
+
amount,
|
|
1618
|
+
cartId,
|
|
1619
|
+
pincode,
|
|
1620
|
+
checkoutMode,
|
|
1621
|
+
orderType,
|
|
1622
|
+
refresh,
|
|
1623
|
+
cardReference,
|
|
1624
|
+
userDetails,
|
|
1625
|
+
},
|
|
1637
1626
|
{ abortEarly: false, allowUnknown: true }
|
|
1638
1627
|
);
|
|
1639
1628
|
if (error) {
|
|
@@ -1643,37 +1632,54 @@ class Payment {
|
|
|
1643
1632
|
// Showing warrnings if extra unknown parameters are found
|
|
1644
1633
|
const {
|
|
1645
1634
|
error: warrning,
|
|
1646
|
-
} = PaymentValidator.
|
|
1647
|
-
{
|
|
1635
|
+
} = PaymentValidator.getPosPaymentModeRoutes().validate(
|
|
1636
|
+
{
|
|
1637
|
+
amount,
|
|
1638
|
+
cartId,
|
|
1639
|
+
pincode,
|
|
1640
|
+
checkoutMode,
|
|
1641
|
+
orderType,
|
|
1642
|
+
refresh,
|
|
1643
|
+
cardReference,
|
|
1644
|
+
userDetails,
|
|
1645
|
+
},
|
|
1648
1646
|
{ abortEarly: false, allowUnknown: false }
|
|
1649
1647
|
);
|
|
1650
1648
|
if (warrning) {
|
|
1651
1649
|
Logger({
|
|
1652
1650
|
level: "WARN",
|
|
1653
|
-
message: "Parameter Validation warrnings for
|
|
1651
|
+
message: "Parameter Validation warrnings for getPosPaymentModeRoutes",
|
|
1654
1652
|
});
|
|
1655
1653
|
Logger({ level: "WARN", message: warrning });
|
|
1656
1654
|
}
|
|
1657
1655
|
|
|
1658
1656
|
const query_params = {};
|
|
1657
|
+
query_params["amount"] = amount;
|
|
1658
|
+
query_params["cart_id"] = cartId;
|
|
1659
|
+
query_params["pincode"] = pincode;
|
|
1660
|
+
query_params["checkout_mode"] = checkoutMode;
|
|
1661
|
+
query_params["refresh"] = refresh;
|
|
1662
|
+
query_params["card_reference"] = cardReference;
|
|
1663
|
+
query_params["order_type"] = orderType;
|
|
1664
|
+
query_params["user_details"] = userDetails;
|
|
1659
1665
|
|
|
1660
1666
|
const xHeaders = {};
|
|
1661
1667
|
|
|
1662
1668
|
const response = await APIClient.execute(
|
|
1663
1669
|
this._conf,
|
|
1664
|
-
"
|
|
1670
|
+
"get",
|
|
1665
1671
|
constructUrl({
|
|
1666
|
-
url: this._urls["
|
|
1672
|
+
url: this._urls["getPosPaymentModeRoutes"],
|
|
1667
1673
|
params: {},
|
|
1668
1674
|
}),
|
|
1669
1675
|
query_params,
|
|
1670
|
-
|
|
1676
|
+
undefined,
|
|
1671
1677
|
xHeaders
|
|
1672
1678
|
);
|
|
1673
1679
|
|
|
1674
1680
|
const {
|
|
1675
1681
|
error: res_error,
|
|
1676
|
-
} = PaymentModel.
|
|
1682
|
+
} = PaymentModel.PaymentModeRouteResponse().validate(response, {
|
|
1677
1683
|
abortEarly: false,
|
|
1678
1684
|
allowUnknown: false,
|
|
1679
1685
|
});
|
|
@@ -1681,7 +1687,7 @@ class Payment {
|
|
|
1681
1687
|
if (res_error) {
|
|
1682
1688
|
Logger({
|
|
1683
1689
|
level: "WARN",
|
|
1684
|
-
message: "Response Validation Warnnings for
|
|
1690
|
+
message: "Response Validation Warnnings for getPosPaymentModeRoutes",
|
|
1685
1691
|
});
|
|
1686
1692
|
Logger({ level: "WARN", message: res_error });
|
|
1687
1693
|
}
|
|
@@ -1691,14 +1697,13 @@ class Payment {
|
|
|
1691
1697
|
|
|
1692
1698
|
/**
|
|
1693
1699
|
* @param {Object} arg - Arg object.
|
|
1694
|
-
* @
|
|
1695
|
-
* @
|
|
1696
|
-
* @
|
|
1697
|
-
* @description: Use this API to save bank details for returned/cancelled order to refund amount in his account.
|
|
1700
|
+
* @returns {Promise<RupifiBannerResponse>} - Success response
|
|
1701
|
+
* @summary: Get CreditLine Offer
|
|
1702
|
+
* @description: Get CreditLine Offer if user is tentatively approved by rupifi
|
|
1698
1703
|
*/
|
|
1699
|
-
async
|
|
1700
|
-
const { error } = PaymentValidator.
|
|
1701
|
-
{
|
|
1704
|
+
async getRupifiBannerDetails({} = {}) {
|
|
1705
|
+
const { error } = PaymentValidator.getRupifiBannerDetails().validate(
|
|
1706
|
+
{},
|
|
1702
1707
|
{ abortEarly: false, allowUnknown: true }
|
|
1703
1708
|
);
|
|
1704
1709
|
if (error) {
|
|
@@ -1708,15 +1713,14 @@ class Payment {
|
|
|
1708
1713
|
// Showing warrnings if extra unknown parameters are found
|
|
1709
1714
|
const {
|
|
1710
1715
|
error: warrning,
|
|
1711
|
-
} = PaymentValidator.
|
|
1712
|
-
{
|
|
1716
|
+
} = PaymentValidator.getRupifiBannerDetails().validate(
|
|
1717
|
+
{},
|
|
1713
1718
|
{ abortEarly: false, allowUnknown: false }
|
|
1714
1719
|
);
|
|
1715
1720
|
if (warrning) {
|
|
1716
1721
|
Logger({
|
|
1717
1722
|
level: "WARN",
|
|
1718
|
-
message:
|
|
1719
|
-
"Parameter Validation warrnings for addRefundBankAccountUsingOTP",
|
|
1723
|
+
message: "Parameter Validation warrnings for getRupifiBannerDetails",
|
|
1720
1724
|
});
|
|
1721
1725
|
Logger({ level: "WARN", message: warrning });
|
|
1722
1726
|
}
|
|
@@ -1727,19 +1731,19 @@ class Payment {
|
|
|
1727
1731
|
|
|
1728
1732
|
const response = await APIClient.execute(
|
|
1729
1733
|
this._conf,
|
|
1730
|
-
"
|
|
1734
|
+
"get",
|
|
1731
1735
|
constructUrl({
|
|
1732
|
-
url: this._urls["
|
|
1736
|
+
url: this._urls["getRupifiBannerDetails"],
|
|
1733
1737
|
params: {},
|
|
1734
1738
|
}),
|
|
1735
1739
|
query_params,
|
|
1736
|
-
|
|
1740
|
+
undefined,
|
|
1737
1741
|
xHeaders
|
|
1738
1742
|
);
|
|
1739
1743
|
|
|
1740
1744
|
const {
|
|
1741
1745
|
error: res_error,
|
|
1742
|
-
} = PaymentModel.
|
|
1746
|
+
} = PaymentModel.RupifiBannerResponse().validate(response, {
|
|
1743
1747
|
abortEarly: false,
|
|
1744
1748
|
allowUnknown: false,
|
|
1745
1749
|
});
|
|
@@ -1747,8 +1751,7 @@ class Payment {
|
|
|
1747
1751
|
if (res_error) {
|
|
1748
1752
|
Logger({
|
|
1749
1753
|
level: "WARN",
|
|
1750
|
-
message:
|
|
1751
|
-
"Response Validation Warnnings for addRefundBankAccountUsingOTP",
|
|
1754
|
+
message: "Response Validation Warnnings for getRupifiBannerDetails",
|
|
1752
1755
|
});
|
|
1753
1756
|
Logger({ level: "WARN", message: res_error });
|
|
1754
1757
|
}
|
|
@@ -1758,16 +1761,15 @@ class Payment {
|
|
|
1758
1761
|
|
|
1759
1762
|
/**
|
|
1760
1763
|
* @param {Object} arg - Arg object.
|
|
1761
|
-
* @param {
|
|
1762
|
-
*
|
|
1763
|
-
* @
|
|
1764
|
-
* @
|
|
1764
|
+
* @param {string} arg.orderId - A unique number used for identifying and
|
|
1765
|
+
* tracking your orders.
|
|
1766
|
+
* @returns {Promise<OrderBeneficiaryResponse>} - Success response
|
|
1767
|
+
* @summary: Lists the beneficiary of a refund
|
|
1768
|
+
* @description: Use this API to get the details of all active beneficiary added by a user for refund.
|
|
1765
1769
|
*/
|
|
1766
|
-
async
|
|
1767
|
-
const {
|
|
1768
|
-
|
|
1769
|
-
} = PaymentValidator.verifyOtpAndAddBeneficiaryForWallet().validate(
|
|
1770
|
-
{ body },
|
|
1770
|
+
async getUserBeneficiariesDetail({ orderId } = {}) {
|
|
1771
|
+
const { error } = PaymentValidator.getUserBeneficiariesDetail().validate(
|
|
1772
|
+
{ orderId },
|
|
1771
1773
|
{ abortEarly: false, allowUnknown: true }
|
|
1772
1774
|
);
|
|
1773
1775
|
if (error) {
|
|
@@ -1777,38 +1779,39 @@ class Payment {
|
|
|
1777
1779
|
// Showing warrnings if extra unknown parameters are found
|
|
1778
1780
|
const {
|
|
1779
1781
|
error: warrning,
|
|
1780
|
-
} = PaymentValidator.
|
|
1781
|
-
{
|
|
1782
|
+
} = PaymentValidator.getUserBeneficiariesDetail().validate(
|
|
1783
|
+
{ orderId },
|
|
1782
1784
|
{ abortEarly: false, allowUnknown: false }
|
|
1783
1785
|
);
|
|
1784
1786
|
if (warrning) {
|
|
1785
1787
|
Logger({
|
|
1786
1788
|
level: "WARN",
|
|
1787
1789
|
message:
|
|
1788
|
-
"Parameter Validation warrnings for
|
|
1790
|
+
"Parameter Validation warrnings for getUserBeneficiariesDetail",
|
|
1789
1791
|
});
|
|
1790
1792
|
Logger({ level: "WARN", message: warrning });
|
|
1791
1793
|
}
|
|
1792
1794
|
|
|
1793
1795
|
const query_params = {};
|
|
1796
|
+
query_params["order_id"] = orderId;
|
|
1794
1797
|
|
|
1795
1798
|
const xHeaders = {};
|
|
1796
1799
|
|
|
1797
1800
|
const response = await APIClient.execute(
|
|
1798
1801
|
this._conf,
|
|
1799
|
-
"
|
|
1802
|
+
"get",
|
|
1800
1803
|
constructUrl({
|
|
1801
|
-
url: this._urls["
|
|
1804
|
+
url: this._urls["getUserBeneficiariesDetail"],
|
|
1802
1805
|
params: {},
|
|
1803
1806
|
}),
|
|
1804
1807
|
query_params,
|
|
1805
|
-
|
|
1808
|
+
undefined,
|
|
1806
1809
|
xHeaders
|
|
1807
1810
|
);
|
|
1808
1811
|
|
|
1809
1812
|
const {
|
|
1810
1813
|
error: res_error,
|
|
1811
|
-
} = PaymentModel.
|
|
1814
|
+
} = PaymentModel.OrderBeneficiaryResponse().validate(response, {
|
|
1812
1815
|
abortEarly: false,
|
|
1813
1816
|
allowUnknown: false,
|
|
1814
1817
|
});
|
|
@@ -1816,8 +1819,7 @@ class Payment {
|
|
|
1816
1819
|
if (res_error) {
|
|
1817
1820
|
Logger({
|
|
1818
1821
|
level: "WARN",
|
|
1819
|
-
message:
|
|
1820
|
-
"Response Validation Warnnings for verifyOtpAndAddBeneficiaryForWallet",
|
|
1822
|
+
message: "Response Validation Warnnings for getUserBeneficiariesDetail",
|
|
1821
1823
|
});
|
|
1822
1824
|
Logger({ level: "WARN", message: res_error });
|
|
1823
1825
|
}
|
|
@@ -1827,13 +1829,13 @@ class Payment {
|
|
|
1827
1829
|
|
|
1828
1830
|
/**
|
|
1829
1831
|
* @param {Object} arg - Arg object.
|
|
1830
|
-
* @param {
|
|
1831
|
-
* @returns {Promise<
|
|
1832
|
-
* @summary:
|
|
1833
|
-
* @description:
|
|
1832
|
+
* @param {PaymentInitializationRequest} arg.body
|
|
1833
|
+
* @returns {Promise<PaymentInitializationResponse>} - Success response
|
|
1834
|
+
* @summary: Initialize a payment (server-to-server) for UPI and BharatQR
|
|
1835
|
+
* @description: PUse this API to inititate payment using UPI, BharatQR, wherein the UPI requests are send to the app and QR code is displayed on the screen.
|
|
1834
1836
|
*/
|
|
1835
|
-
async
|
|
1836
|
-
const { error } = PaymentValidator.
|
|
1837
|
+
async initialisePayment({ body } = {}) {
|
|
1838
|
+
const { error } = PaymentValidator.initialisePayment().validate(
|
|
1837
1839
|
{ body },
|
|
1838
1840
|
{ abortEarly: false, allowUnknown: true }
|
|
1839
1841
|
);
|
|
@@ -1842,16 +1844,14 @@ class Payment {
|
|
|
1842
1844
|
}
|
|
1843
1845
|
|
|
1844
1846
|
// Showing warrnings if extra unknown parameters are found
|
|
1845
|
-
const {
|
|
1846
|
-
error: warrning,
|
|
1847
|
-
} = PaymentValidator.updateDefaultBeneficiary().validate(
|
|
1847
|
+
const { error: warrning } = PaymentValidator.initialisePayment().validate(
|
|
1848
1848
|
{ body },
|
|
1849
1849
|
{ abortEarly: false, allowUnknown: false }
|
|
1850
1850
|
);
|
|
1851
1851
|
if (warrning) {
|
|
1852
1852
|
Logger({
|
|
1853
1853
|
level: "WARN",
|
|
1854
|
-
message: "Parameter Validation warrnings for
|
|
1854
|
+
message: "Parameter Validation warrnings for initialisePayment",
|
|
1855
1855
|
});
|
|
1856
1856
|
Logger({ level: "WARN", message: warrning });
|
|
1857
1857
|
}
|
|
@@ -1864,7 +1864,7 @@ class Payment {
|
|
|
1864
1864
|
this._conf,
|
|
1865
1865
|
"post",
|
|
1866
1866
|
constructUrl({
|
|
1867
|
-
url: this._urls["
|
|
1867
|
+
url: this._urls["initialisePayment"],
|
|
1868
1868
|
params: {},
|
|
1869
1869
|
}),
|
|
1870
1870
|
query_params,
|
|
@@ -1874,7 +1874,7 @@ class Payment {
|
|
|
1874
1874
|
|
|
1875
1875
|
const {
|
|
1876
1876
|
error: res_error,
|
|
1877
|
-
} = PaymentModel.
|
|
1877
|
+
} = PaymentModel.PaymentInitializationResponse().validate(response, {
|
|
1878
1878
|
abortEarly: false,
|
|
1879
1879
|
allowUnknown: false,
|
|
1880
1880
|
});
|
|
@@ -1882,7 +1882,7 @@ class Payment {
|
|
|
1882
1882
|
if (res_error) {
|
|
1883
1883
|
Logger({
|
|
1884
1884
|
level: "WARN",
|
|
1885
|
-
message: "Response Validation Warnnings for
|
|
1885
|
+
message: "Response Validation Warnnings for initialisePayment",
|
|
1886
1886
|
});
|
|
1887
1887
|
Logger({ level: "WARN", message: res_error });
|
|
1888
1888
|
}
|
|
@@ -1892,14 +1892,14 @@ class Payment {
|
|
|
1892
1892
|
|
|
1893
1893
|
/**
|
|
1894
1894
|
* @param {Object} arg - Arg object.
|
|
1895
|
-
* @param {
|
|
1896
|
-
* @returns {Promise<
|
|
1897
|
-
* @summary:
|
|
1898
|
-
* @description: Use this API to
|
|
1895
|
+
* @param {PaymentInitializationRequest} arg.body
|
|
1896
|
+
* @returns {Promise<PaymentInitializationResponse>} - Success response
|
|
1897
|
+
* @summary: Initialize a payment (server-to-server) for UPI and BharatQR
|
|
1898
|
+
* @description: Use this API to inititate payment using UPI, BharatQR, wherein the UPI requests are send to the app and QR code is displayed on the screen.
|
|
1899
1899
|
*/
|
|
1900
|
-
async
|
|
1901
|
-
const { error } = PaymentValidator.
|
|
1902
|
-
{
|
|
1900
|
+
async initialisePaymentPaymentLink({ body } = {}) {
|
|
1901
|
+
const { error } = PaymentValidator.initialisePaymentPaymentLink().validate(
|
|
1902
|
+
{ body },
|
|
1903
1903
|
{ abortEarly: false, allowUnknown: true }
|
|
1904
1904
|
);
|
|
1905
1905
|
if (error) {
|
|
@@ -1907,38 +1907,40 @@ class Payment {
|
|
|
1907
1907
|
}
|
|
1908
1908
|
|
|
1909
1909
|
// Showing warrnings if extra unknown parameters are found
|
|
1910
|
-
const {
|
|
1911
|
-
|
|
1910
|
+
const {
|
|
1911
|
+
error: warrning,
|
|
1912
|
+
} = PaymentValidator.initialisePaymentPaymentLink().validate(
|
|
1913
|
+
{ body },
|
|
1912
1914
|
{ abortEarly: false, allowUnknown: false }
|
|
1913
1915
|
);
|
|
1914
1916
|
if (warrning) {
|
|
1915
1917
|
Logger({
|
|
1916
1918
|
level: "WARN",
|
|
1917
|
-
message:
|
|
1919
|
+
message:
|
|
1920
|
+
"Parameter Validation warrnings for initialisePaymentPaymentLink",
|
|
1918
1921
|
});
|
|
1919
1922
|
Logger({ level: "WARN", message: warrning });
|
|
1920
1923
|
}
|
|
1921
1924
|
|
|
1922
1925
|
const query_params = {};
|
|
1923
|
-
query_params["payment_link_id"] = paymentLinkId;
|
|
1924
1926
|
|
|
1925
1927
|
const xHeaders = {};
|
|
1926
1928
|
|
|
1927
1929
|
const response = await APIClient.execute(
|
|
1928
1930
|
this._conf,
|
|
1929
|
-
"
|
|
1931
|
+
"post",
|
|
1930
1932
|
constructUrl({
|
|
1931
|
-
url: this._urls["
|
|
1933
|
+
url: this._urls["initialisePaymentPaymentLink"],
|
|
1932
1934
|
params: {},
|
|
1933
1935
|
}),
|
|
1934
1936
|
query_params,
|
|
1935
|
-
|
|
1937
|
+
body,
|
|
1936
1938
|
xHeaders
|
|
1937
1939
|
);
|
|
1938
1940
|
|
|
1939
1941
|
const {
|
|
1940
1942
|
error: res_error,
|
|
1941
|
-
} = PaymentModel.
|
|
1943
|
+
} = PaymentModel.PaymentInitializationResponse().validate(response, {
|
|
1942
1944
|
abortEarly: false,
|
|
1943
1945
|
allowUnknown: false,
|
|
1944
1946
|
});
|
|
@@ -1946,7 +1948,8 @@ class Payment {
|
|
|
1946
1948
|
if (res_error) {
|
|
1947
1949
|
Logger({
|
|
1948
1950
|
level: "WARN",
|
|
1949
|
-
message:
|
|
1951
|
+
message:
|
|
1952
|
+
"Response Validation Warnnings for initialisePaymentPaymentLink",
|
|
1950
1953
|
});
|
|
1951
1954
|
Logger({ level: "WARN", message: res_error });
|
|
1952
1955
|
}
|
|
@@ -1956,14 +1959,14 @@ class Payment {
|
|
|
1956
1959
|
|
|
1957
1960
|
/**
|
|
1958
1961
|
* @param {Object} arg - Arg object.
|
|
1959
|
-
* @param {
|
|
1960
|
-
* @returns {Promise<
|
|
1961
|
-
* @summary:
|
|
1962
|
-
* @description: Use this API to
|
|
1962
|
+
* @param {string} [arg.paymentLinkId] -
|
|
1963
|
+
* @returns {Promise<PollingPaymentLinkResponse>} - Success response
|
|
1964
|
+
* @summary: Used for polling if payment successful or not
|
|
1965
|
+
* @description: Use this API to poll if payment through payment was successful or not
|
|
1963
1966
|
*/
|
|
1964
|
-
async
|
|
1965
|
-
const { error } = PaymentValidator.
|
|
1966
|
-
{
|
|
1967
|
+
async pollingPaymentLink({ paymentLinkId } = {}) {
|
|
1968
|
+
const { error } = PaymentValidator.pollingPaymentLink().validate(
|
|
1969
|
+
{ paymentLinkId },
|
|
1967
1970
|
{ abortEarly: false, allowUnknown: true }
|
|
1968
1971
|
);
|
|
1969
1972
|
if (error) {
|
|
@@ -1971,37 +1974,38 @@ class Payment {
|
|
|
1971
1974
|
}
|
|
1972
1975
|
|
|
1973
1976
|
// Showing warrnings if extra unknown parameters are found
|
|
1974
|
-
const { error: warrning } = PaymentValidator.
|
|
1975
|
-
{
|
|
1977
|
+
const { error: warrning } = PaymentValidator.pollingPaymentLink().validate(
|
|
1978
|
+
{ paymentLinkId },
|
|
1976
1979
|
{ abortEarly: false, allowUnknown: false }
|
|
1977
1980
|
);
|
|
1978
1981
|
if (warrning) {
|
|
1979
1982
|
Logger({
|
|
1980
1983
|
level: "WARN",
|
|
1981
|
-
message: "Parameter Validation warrnings for
|
|
1984
|
+
message: "Parameter Validation warrnings for pollingPaymentLink",
|
|
1982
1985
|
});
|
|
1983
1986
|
Logger({ level: "WARN", message: warrning });
|
|
1984
1987
|
}
|
|
1985
1988
|
|
|
1986
1989
|
const query_params = {};
|
|
1990
|
+
query_params["payment_link_id"] = paymentLinkId;
|
|
1987
1991
|
|
|
1988
1992
|
const xHeaders = {};
|
|
1989
1993
|
|
|
1990
1994
|
const response = await APIClient.execute(
|
|
1991
1995
|
this._conf,
|
|
1992
|
-
"
|
|
1996
|
+
"get",
|
|
1993
1997
|
constructUrl({
|
|
1994
|
-
url: this._urls["
|
|
1998
|
+
url: this._urls["pollingPaymentLink"],
|
|
1995
1999
|
params: {},
|
|
1996
2000
|
}),
|
|
1997
2001
|
query_params,
|
|
1998
|
-
|
|
2002
|
+
undefined,
|
|
1999
2003
|
xHeaders
|
|
2000
2004
|
);
|
|
2001
2005
|
|
|
2002
2006
|
const {
|
|
2003
2007
|
error: res_error,
|
|
2004
|
-
} = PaymentModel.
|
|
2008
|
+
} = PaymentModel.PollingPaymentLinkResponse().validate(response, {
|
|
2005
2009
|
abortEarly: false,
|
|
2006
2010
|
allowUnknown: false,
|
|
2007
2011
|
});
|
|
@@ -2009,7 +2013,7 @@ class Payment {
|
|
|
2009
2013
|
if (res_error) {
|
|
2010
2014
|
Logger({
|
|
2011
2015
|
level: "WARN",
|
|
2012
|
-
message: "Response Validation Warnnings for
|
|
2016
|
+
message: "Response Validation Warnnings for pollingPaymentLink",
|
|
2013
2017
|
});
|
|
2014
2018
|
Logger({ level: "WARN", message: res_error });
|
|
2015
2019
|
}
|
|
@@ -2019,14 +2023,17 @@ class Payment {
|
|
|
2019
2023
|
|
|
2020
2024
|
/**
|
|
2021
2025
|
* @param {Object} arg - Arg object.
|
|
2022
|
-
* @param {
|
|
2023
|
-
*
|
|
2024
|
-
* @
|
|
2025
|
-
*
|
|
2026
|
+
* @param {string} [arg.source] - This is a String value that contains
|
|
2027
|
+
* callback URL as value.
|
|
2028
|
+
* @param {string} [arg.aggregator] - This is a String value that contains
|
|
2029
|
+
* aggregator name as value.
|
|
2030
|
+
* @returns {Promise<RedirectToAggregatorResponse>} - Success response
|
|
2031
|
+
* @summary: API to get the redirect url to redirect the user to aggregator's page
|
|
2032
|
+
* @description: Use this API to get the redirect url to redirect the user to aggregator's page
|
|
2026
2033
|
*/
|
|
2027
|
-
async
|
|
2028
|
-
const { error } = PaymentValidator.
|
|
2029
|
-
{
|
|
2034
|
+
async redirectToAggregator({ source, aggregator } = {}) {
|
|
2035
|
+
const { error } = PaymentValidator.redirectToAggregator().validate(
|
|
2036
|
+
{ source, aggregator },
|
|
2030
2037
|
{ abortEarly: false, allowUnknown: true }
|
|
2031
2038
|
);
|
|
2032
2039
|
if (error) {
|
|
@@ -2034,37 +2041,41 @@ class Payment {
|
|
|
2034
2041
|
}
|
|
2035
2042
|
|
|
2036
2043
|
// Showing warrnings if extra unknown parameters are found
|
|
2037
|
-
const {
|
|
2038
|
-
|
|
2044
|
+
const {
|
|
2045
|
+
error: warrning,
|
|
2046
|
+
} = PaymentValidator.redirectToAggregator().validate(
|
|
2047
|
+
{ source, aggregator },
|
|
2039
2048
|
{ abortEarly: false, allowUnknown: false }
|
|
2040
2049
|
);
|
|
2041
2050
|
if (warrning) {
|
|
2042
2051
|
Logger({
|
|
2043
2052
|
level: "WARN",
|
|
2044
|
-
message: "Parameter Validation warrnings for
|
|
2053
|
+
message: "Parameter Validation warrnings for redirectToAggregator",
|
|
2045
2054
|
});
|
|
2046
2055
|
Logger({ level: "WARN", message: warrning });
|
|
2047
2056
|
}
|
|
2048
2057
|
|
|
2049
2058
|
const query_params = {};
|
|
2059
|
+
query_params["source"] = source;
|
|
2060
|
+
query_params["aggregator"] = aggregator;
|
|
2050
2061
|
|
|
2051
2062
|
const xHeaders = {};
|
|
2052
2063
|
|
|
2053
2064
|
const response = await APIClient.execute(
|
|
2054
2065
|
this._conf,
|
|
2055
|
-
"
|
|
2066
|
+
"get",
|
|
2056
2067
|
constructUrl({
|
|
2057
|
-
url: this._urls["
|
|
2068
|
+
url: this._urls["redirectToAggregator"],
|
|
2058
2069
|
params: {},
|
|
2059
2070
|
}),
|
|
2060
2071
|
query_params,
|
|
2061
|
-
|
|
2072
|
+
undefined,
|
|
2062
2073
|
xHeaders
|
|
2063
2074
|
);
|
|
2064
2075
|
|
|
2065
2076
|
const {
|
|
2066
2077
|
error: res_error,
|
|
2067
|
-
} = PaymentModel.
|
|
2078
|
+
} = PaymentModel.RedirectToAggregatorResponse().validate(response, {
|
|
2068
2079
|
abortEarly: false,
|
|
2069
2080
|
allowUnknown: false,
|
|
2070
2081
|
});
|
|
@@ -2072,7 +2083,7 @@ class Payment {
|
|
|
2072
2083
|
if (res_error) {
|
|
2073
2084
|
Logger({
|
|
2074
2085
|
level: "WARN",
|
|
2075
|
-
message: "Response Validation Warnnings for
|
|
2086
|
+
message: "Response Validation Warnnings for redirectToAggregator",
|
|
2076
2087
|
});
|
|
2077
2088
|
Logger({ level: "WARN", message: res_error });
|
|
2078
2089
|
}
|
|
@@ -2082,13 +2093,13 @@ class Payment {
|
|
|
2082
2093
|
|
|
2083
2094
|
/**
|
|
2084
2095
|
* @param {Object} arg - Arg object.
|
|
2085
|
-
* @param {
|
|
2086
|
-
* @returns {Promise<
|
|
2087
|
-
* @summary:
|
|
2088
|
-
* @description: Use this API to
|
|
2096
|
+
* @param {renderHTMLRequest} arg.body
|
|
2097
|
+
* @returns {Promise<renderHTMLResponse>} - Success response
|
|
2098
|
+
* @summary: Convert base64 string to HTML form
|
|
2099
|
+
* @description: Use this API to decode base64 html form to plain HTML string.
|
|
2089
2100
|
*/
|
|
2090
|
-
async
|
|
2091
|
-
const { error } = PaymentValidator.
|
|
2101
|
+
async renderHTML({ body } = {}) {
|
|
2102
|
+
const { error } = PaymentValidator.renderHTML().validate(
|
|
2092
2103
|
{ body },
|
|
2093
2104
|
{ abortEarly: false, allowUnknown: true }
|
|
2094
2105
|
);
|
|
@@ -2097,14 +2108,14 @@ class Payment {
|
|
|
2097
2108
|
}
|
|
2098
2109
|
|
|
2099
2110
|
// Showing warrnings if extra unknown parameters are found
|
|
2100
|
-
const { error: warrning } = PaymentValidator.
|
|
2111
|
+
const { error: warrning } = PaymentValidator.renderHTML().validate(
|
|
2101
2112
|
{ body },
|
|
2102
2113
|
{ abortEarly: false, allowUnknown: false }
|
|
2103
2114
|
);
|
|
2104
2115
|
if (warrning) {
|
|
2105
2116
|
Logger({
|
|
2106
2117
|
level: "WARN",
|
|
2107
|
-
message: "Parameter Validation warrnings for
|
|
2118
|
+
message: "Parameter Validation warrnings for renderHTML",
|
|
2108
2119
|
});
|
|
2109
2120
|
Logger({ level: "WARN", message: warrning });
|
|
2110
2121
|
}
|
|
@@ -2117,7 +2128,7 @@ class Payment {
|
|
|
2117
2128
|
this._conf,
|
|
2118
2129
|
"post",
|
|
2119
2130
|
constructUrl({
|
|
2120
|
-
url: this._urls["
|
|
2131
|
+
url: this._urls["renderHTML"],
|
|
2121
2132
|
params: {},
|
|
2122
2133
|
}),
|
|
2123
2134
|
query_params,
|
|
@@ -2127,7 +2138,7 @@ class Payment {
|
|
|
2127
2138
|
|
|
2128
2139
|
const {
|
|
2129
2140
|
error: res_error,
|
|
2130
|
-
} = PaymentModel.
|
|
2141
|
+
} = PaymentModel.renderHTMLResponse().validate(response, {
|
|
2131
2142
|
abortEarly: false,
|
|
2132
2143
|
allowUnknown: false,
|
|
2133
2144
|
});
|
|
@@ -2135,7 +2146,7 @@ class Payment {
|
|
|
2135
2146
|
if (res_error) {
|
|
2136
2147
|
Logger({
|
|
2137
2148
|
level: "WARN",
|
|
2138
|
-
message: "Response Validation Warnnings for
|
|
2149
|
+
message: "Response Validation Warnnings for renderHTML",
|
|
2139
2150
|
});
|
|
2140
2151
|
Logger({ level: "WARN", message: res_error });
|
|
2141
2152
|
}
|
|
@@ -2145,16 +2156,14 @@ class Payment {
|
|
|
2145
2156
|
|
|
2146
2157
|
/**
|
|
2147
2158
|
* @param {Object} arg - Arg object.
|
|
2148
|
-
* @param {
|
|
2149
|
-
* @returns {Promise<
|
|
2150
|
-
* @summary:
|
|
2151
|
-
* @description: Use this API to
|
|
2159
|
+
* @param {ResendOrCancelPaymentRequest} arg.body
|
|
2160
|
+
* @returns {Promise<ResendOrCancelPaymentResponse>} - Success response
|
|
2161
|
+
* @summary: API to resend and cancel a payment link which was already generated.
|
|
2162
|
+
* @description: Use this API to perform resend or cancel a payment link based on request payload.
|
|
2152
2163
|
*/
|
|
2153
|
-
async
|
|
2154
|
-
const {
|
|
2155
|
-
|
|
2156
|
-
} = PaymentValidator.getPaymentModeRoutesPaymentLink().validate(
|
|
2157
|
-
{ paymentLinkId },
|
|
2164
|
+
async resendOrCancelPayment({ body } = {}) {
|
|
2165
|
+
const { error } = PaymentValidator.resendOrCancelPayment().validate(
|
|
2166
|
+
{ body },
|
|
2158
2167
|
{ abortEarly: false, allowUnknown: true }
|
|
2159
2168
|
);
|
|
2160
2169
|
if (error) {
|
|
@@ -2164,39 +2173,37 @@ class Payment {
|
|
|
2164
2173
|
// Showing warrnings if extra unknown parameters are found
|
|
2165
2174
|
const {
|
|
2166
2175
|
error: warrning,
|
|
2167
|
-
} = PaymentValidator.
|
|
2168
|
-
{
|
|
2176
|
+
} = PaymentValidator.resendOrCancelPayment().validate(
|
|
2177
|
+
{ body },
|
|
2169
2178
|
{ abortEarly: false, allowUnknown: false }
|
|
2170
2179
|
);
|
|
2171
2180
|
if (warrning) {
|
|
2172
2181
|
Logger({
|
|
2173
2182
|
level: "WARN",
|
|
2174
|
-
message:
|
|
2175
|
-
"Parameter Validation warrnings for getPaymentModeRoutesPaymentLink",
|
|
2183
|
+
message: "Parameter Validation warrnings for resendOrCancelPayment",
|
|
2176
2184
|
});
|
|
2177
2185
|
Logger({ level: "WARN", message: warrning });
|
|
2178
2186
|
}
|
|
2179
2187
|
|
|
2180
2188
|
const query_params = {};
|
|
2181
|
-
query_params["payment_link_id"] = paymentLinkId;
|
|
2182
2189
|
|
|
2183
2190
|
const xHeaders = {};
|
|
2184
2191
|
|
|
2185
2192
|
const response = await APIClient.execute(
|
|
2186
2193
|
this._conf,
|
|
2187
|
-
"
|
|
2194
|
+
"post",
|
|
2188
2195
|
constructUrl({
|
|
2189
|
-
url: this._urls["
|
|
2196
|
+
url: this._urls["resendOrCancelPayment"],
|
|
2190
2197
|
params: {},
|
|
2191
2198
|
}),
|
|
2192
2199
|
query_params,
|
|
2193
|
-
|
|
2200
|
+
body,
|
|
2194
2201
|
xHeaders
|
|
2195
2202
|
);
|
|
2196
2203
|
|
|
2197
2204
|
const {
|
|
2198
2205
|
error: res_error,
|
|
2199
|
-
} = PaymentModel.
|
|
2206
|
+
} = PaymentModel.ResendOrCancelPaymentResponse().validate(response, {
|
|
2200
2207
|
abortEarly: false,
|
|
2201
2208
|
allowUnknown: false,
|
|
2202
2209
|
});
|
|
@@ -2204,8 +2211,7 @@ class Payment {
|
|
|
2204
2211
|
if (res_error) {
|
|
2205
2212
|
Logger({
|
|
2206
2213
|
level: "WARN",
|
|
2207
|
-
message:
|
|
2208
|
-
"Response Validation Warnnings for getPaymentModeRoutesPaymentLink",
|
|
2214
|
+
message: "Response Validation Warnnings for resendOrCancelPayment",
|
|
2209
2215
|
});
|
|
2210
2216
|
Logger({ level: "WARN", message: res_error });
|
|
2211
2217
|
}
|
|
@@ -2215,14 +2221,14 @@ class Payment {
|
|
|
2215
2221
|
|
|
2216
2222
|
/**
|
|
2217
2223
|
* @param {Object} arg - Arg object.
|
|
2218
|
-
* @param {
|
|
2219
|
-
* @returns {Promise<
|
|
2220
|
-
* @summary:
|
|
2221
|
-
* @description: Use this API to
|
|
2224
|
+
* @param {CancelOrResendPaymentLinkRequest} arg.body
|
|
2225
|
+
* @returns {Promise<ResendPaymentLinkResponse>} - Success response
|
|
2226
|
+
* @summary: Resend payment link
|
|
2227
|
+
* @description: Use this API to resend a payment link for the customer
|
|
2222
2228
|
*/
|
|
2223
|
-
async
|
|
2224
|
-
const { error } = PaymentValidator.
|
|
2225
|
-
{
|
|
2229
|
+
async resendPaymentLink({ body } = {}) {
|
|
2230
|
+
const { error } = PaymentValidator.resendPaymentLink().validate(
|
|
2231
|
+
{ body },
|
|
2226
2232
|
{ abortEarly: false, allowUnknown: true }
|
|
2227
2233
|
);
|
|
2228
2234
|
if (error) {
|
|
@@ -2230,38 +2236,37 @@ class Payment {
|
|
|
2230
2236
|
}
|
|
2231
2237
|
|
|
2232
2238
|
// Showing warrnings if extra unknown parameters are found
|
|
2233
|
-
const { error: warrning } = PaymentValidator.
|
|
2234
|
-
{
|
|
2239
|
+
const { error: warrning } = PaymentValidator.resendPaymentLink().validate(
|
|
2240
|
+
{ body },
|
|
2235
2241
|
{ abortEarly: false, allowUnknown: false }
|
|
2236
2242
|
);
|
|
2237
2243
|
if (warrning) {
|
|
2238
2244
|
Logger({
|
|
2239
2245
|
level: "WARN",
|
|
2240
|
-
message: "Parameter Validation warrnings for
|
|
2246
|
+
message: "Parameter Validation warrnings for resendPaymentLink",
|
|
2241
2247
|
});
|
|
2242
2248
|
Logger({ level: "WARN", message: warrning });
|
|
2243
2249
|
}
|
|
2244
2250
|
|
|
2245
2251
|
const query_params = {};
|
|
2246
|
-
query_params["payment_link_id"] = paymentLinkId;
|
|
2247
2252
|
|
|
2248
2253
|
const xHeaders = {};
|
|
2249
2254
|
|
|
2250
2255
|
const response = await APIClient.execute(
|
|
2251
2256
|
this._conf,
|
|
2252
|
-
"
|
|
2257
|
+
"post",
|
|
2253
2258
|
constructUrl({
|
|
2254
|
-
url: this._urls["
|
|
2259
|
+
url: this._urls["resendPaymentLink"],
|
|
2255
2260
|
params: {},
|
|
2256
2261
|
}),
|
|
2257
2262
|
query_params,
|
|
2258
|
-
|
|
2263
|
+
body,
|
|
2259
2264
|
xHeaders
|
|
2260
2265
|
);
|
|
2261
2266
|
|
|
2262
2267
|
const {
|
|
2263
2268
|
error: res_error,
|
|
2264
|
-
} = PaymentModel.
|
|
2269
|
+
} = PaymentModel.ResendPaymentLinkResponse().validate(response, {
|
|
2265
2270
|
abortEarly: false,
|
|
2266
2271
|
allowUnknown: false,
|
|
2267
2272
|
});
|
|
@@ -2269,7 +2274,7 @@ class Payment {
|
|
|
2269
2274
|
if (res_error) {
|
|
2270
2275
|
Logger({
|
|
2271
2276
|
level: "WARN",
|
|
2272
|
-
message: "Response Validation Warnnings for
|
|
2277
|
+
message: "Response Validation Warnnings for resendPaymentLink",
|
|
2273
2278
|
});
|
|
2274
2279
|
Logger({ level: "WARN", message: res_error });
|
|
2275
2280
|
}
|
|
@@ -2279,13 +2284,13 @@ class Payment {
|
|
|
2279
2284
|
|
|
2280
2285
|
/**
|
|
2281
2286
|
* @param {Object} arg - Arg object.
|
|
2282
|
-
* @param {
|
|
2283
|
-
* @returns {Promise<
|
|
2284
|
-
* @summary:
|
|
2285
|
-
* @description: Use this API to
|
|
2287
|
+
* @param {SetDefaultBeneficiaryRequest} arg.body
|
|
2288
|
+
* @returns {Promise<SetDefaultBeneficiaryResponse>} - Success response
|
|
2289
|
+
* @summary: Set a default beneficiary for a refund
|
|
2290
|
+
* @description: Use this API to set a default beneficiary for getting a refund.
|
|
2286
2291
|
*/
|
|
2287
|
-
async
|
|
2288
|
-
const { error } = PaymentValidator.
|
|
2292
|
+
async updateDefaultBeneficiary({ body } = {}) {
|
|
2293
|
+
const { error } = PaymentValidator.updateDefaultBeneficiary().validate(
|
|
2289
2294
|
{ body },
|
|
2290
2295
|
{ abortEarly: false, allowUnknown: true }
|
|
2291
2296
|
);
|
|
@@ -2296,15 +2301,14 @@ class Payment {
|
|
|
2296
2301
|
// Showing warrnings if extra unknown parameters are found
|
|
2297
2302
|
const {
|
|
2298
2303
|
error: warrning,
|
|
2299
|
-
} = PaymentValidator.
|
|
2304
|
+
} = PaymentValidator.updateDefaultBeneficiary().validate(
|
|
2300
2305
|
{ body },
|
|
2301
2306
|
{ abortEarly: false, allowUnknown: false }
|
|
2302
2307
|
);
|
|
2303
2308
|
if (warrning) {
|
|
2304
2309
|
Logger({
|
|
2305
2310
|
level: "WARN",
|
|
2306
|
-
message:
|
|
2307
|
-
"Parameter Validation warrnings for createOrderHandlerPaymentLink",
|
|
2311
|
+
message: "Parameter Validation warrnings for updateDefaultBeneficiary",
|
|
2308
2312
|
});
|
|
2309
2313
|
Logger({ level: "WARN", message: warrning });
|
|
2310
2314
|
}
|
|
@@ -2317,7 +2321,7 @@ class Payment {
|
|
|
2317
2321
|
this._conf,
|
|
2318
2322
|
"post",
|
|
2319
2323
|
constructUrl({
|
|
2320
|
-
url: this._urls["
|
|
2324
|
+
url: this._urls["updateDefaultBeneficiary"],
|
|
2321
2325
|
params: {},
|
|
2322
2326
|
}),
|
|
2323
2327
|
query_params,
|
|
@@ -2327,7 +2331,7 @@ class Payment {
|
|
|
2327
2331
|
|
|
2328
2332
|
const {
|
|
2329
2333
|
error: res_error,
|
|
2330
|
-
} = PaymentModel.
|
|
2334
|
+
} = PaymentModel.SetDefaultBeneficiaryResponse().validate(response, {
|
|
2331
2335
|
abortEarly: false,
|
|
2332
2336
|
allowUnknown: false,
|
|
2333
2337
|
});
|
|
@@ -2335,8 +2339,7 @@ class Payment {
|
|
|
2335
2339
|
if (res_error) {
|
|
2336
2340
|
Logger({
|
|
2337
2341
|
level: "WARN",
|
|
2338
|
-
message:
|
|
2339
|
-
"Response Validation Warnnings for createOrderHandlerPaymentLink",
|
|
2342
|
+
message: "Response Validation Warnnings for updateDefaultBeneficiary",
|
|
2340
2343
|
});
|
|
2341
2344
|
Logger({ level: "WARN", message: res_error });
|
|
2342
2345
|
}
|
|
@@ -2346,13 +2349,13 @@ class Payment {
|
|
|
2346
2349
|
|
|
2347
2350
|
/**
|
|
2348
2351
|
* @param {Object} arg - Arg object.
|
|
2349
|
-
* @param {
|
|
2350
|
-
* @returns {Promise<
|
|
2351
|
-
* @summary:
|
|
2352
|
-
* @description:
|
|
2352
|
+
* @param {ValidateVPARequest} arg.body
|
|
2353
|
+
* @returns {Promise<ValidateVPAResponse>} - Success response
|
|
2354
|
+
* @summary: API to Validate UPI ID
|
|
2355
|
+
* @description: API to Validate UPI ID
|
|
2353
2356
|
*/
|
|
2354
|
-
async
|
|
2355
|
-
const { error } = PaymentValidator.
|
|
2357
|
+
async validateVPA({ body } = {}) {
|
|
2358
|
+
const { error } = PaymentValidator.validateVPA().validate(
|
|
2356
2359
|
{ body },
|
|
2357
2360
|
{ abortEarly: false, allowUnknown: true }
|
|
2358
2361
|
);
|
|
@@ -2361,17 +2364,14 @@ class Payment {
|
|
|
2361
2364
|
}
|
|
2362
2365
|
|
|
2363
2366
|
// Showing warrnings if extra unknown parameters are found
|
|
2364
|
-
const {
|
|
2365
|
-
error: warrning,
|
|
2366
|
-
} = PaymentValidator.initialisePaymentPaymentLink().validate(
|
|
2367
|
+
const { error: warrning } = PaymentValidator.validateVPA().validate(
|
|
2367
2368
|
{ body },
|
|
2368
2369
|
{ abortEarly: false, allowUnknown: false }
|
|
2369
2370
|
);
|
|
2370
2371
|
if (warrning) {
|
|
2371
2372
|
Logger({
|
|
2372
2373
|
level: "WARN",
|
|
2373
|
-
message:
|
|
2374
|
-
"Parameter Validation warrnings for initialisePaymentPaymentLink",
|
|
2374
|
+
message: "Parameter Validation warrnings for validateVPA",
|
|
2375
2375
|
});
|
|
2376
2376
|
Logger({ level: "WARN", message: warrning });
|
|
2377
2377
|
}
|
|
@@ -2384,7 +2384,7 @@ class Payment {
|
|
|
2384
2384
|
this._conf,
|
|
2385
2385
|
"post",
|
|
2386
2386
|
constructUrl({
|
|
2387
|
-
url: this._urls["
|
|
2387
|
+
url: this._urls["validateVPA"],
|
|
2388
2388
|
params: {},
|
|
2389
2389
|
}),
|
|
2390
2390
|
query_params,
|
|
@@ -2394,7 +2394,7 @@ class Payment {
|
|
|
2394
2394
|
|
|
2395
2395
|
const {
|
|
2396
2396
|
error: res_error,
|
|
2397
|
-
} = PaymentModel.
|
|
2397
|
+
} = PaymentModel.ValidateVPAResponse().validate(response, {
|
|
2398
2398
|
abortEarly: false,
|
|
2399
2399
|
allowUnknown: false,
|
|
2400
2400
|
});
|
|
@@ -2402,8 +2402,7 @@ class Payment {
|
|
|
2402
2402
|
if (res_error) {
|
|
2403
2403
|
Logger({
|
|
2404
2404
|
level: "WARN",
|
|
2405
|
-
message:
|
|
2406
|
-
"Response Validation Warnnings for initialisePaymentPaymentLink",
|
|
2405
|
+
message: "Response Validation Warnnings for validateVPA",
|
|
2407
2406
|
});
|
|
2408
2407
|
Logger({ level: "WARN", message: res_error });
|
|
2409
2408
|
}
|
|
@@ -2413,15 +2412,13 @@ class Payment {
|
|
|
2413
2412
|
|
|
2414
2413
|
/**
|
|
2415
2414
|
* @param {Object} arg - Arg object.
|
|
2416
|
-
* @param {
|
|
2417
|
-
* @returns {Promise<
|
|
2418
|
-
* @summary:
|
|
2419
|
-
* @description: Use this API to
|
|
2415
|
+
* @param {ChargeCustomerRequest} arg.body
|
|
2416
|
+
* @returns {Promise<ChargeCustomerResponse>} - Success response
|
|
2417
|
+
* @summary: Verify and charge payment
|
|
2418
|
+
* @description: Use this API to verify and check the status of a payment transaction (server-to-server) made through aggregators like Simpl and Mswipe.
|
|
2420
2419
|
*/
|
|
2421
|
-
async
|
|
2422
|
-
const {
|
|
2423
|
-
error,
|
|
2424
|
-
} = PaymentValidator.checkAndUpdatePaymentStatusPaymentLink().validate(
|
|
2420
|
+
async verifyAndChargePayment({ body } = {}) {
|
|
2421
|
+
const { error } = PaymentValidator.verifyAndChargePayment().validate(
|
|
2425
2422
|
{ body },
|
|
2426
2423
|
{ abortEarly: false, allowUnknown: true }
|
|
2427
2424
|
);
|
|
@@ -2432,15 +2429,14 @@ class Payment {
|
|
|
2432
2429
|
// Showing warrnings if extra unknown parameters are found
|
|
2433
2430
|
const {
|
|
2434
2431
|
error: warrning,
|
|
2435
|
-
} = PaymentValidator.
|
|
2432
|
+
} = PaymentValidator.verifyAndChargePayment().validate(
|
|
2436
2433
|
{ body },
|
|
2437
2434
|
{ abortEarly: false, allowUnknown: false }
|
|
2438
2435
|
);
|
|
2439
2436
|
if (warrning) {
|
|
2440
2437
|
Logger({
|
|
2441
2438
|
level: "WARN",
|
|
2442
|
-
message:
|
|
2443
|
-
"Parameter Validation warrnings for checkAndUpdatePaymentStatusPaymentLink",
|
|
2439
|
+
message: "Parameter Validation warrnings for verifyAndChargePayment",
|
|
2444
2440
|
});
|
|
2445
2441
|
Logger({ level: "WARN", message: warrning });
|
|
2446
2442
|
}
|
|
@@ -2453,7 +2449,7 @@ class Payment {
|
|
|
2453
2449
|
this._conf,
|
|
2454
2450
|
"post",
|
|
2455
2451
|
constructUrl({
|
|
2456
|
-
url: this._urls["
|
|
2452
|
+
url: this._urls["verifyAndChargePayment"],
|
|
2457
2453
|
params: {},
|
|
2458
2454
|
}),
|
|
2459
2455
|
query_params,
|
|
@@ -2463,7 +2459,7 @@ class Payment {
|
|
|
2463
2459
|
|
|
2464
2460
|
const {
|
|
2465
2461
|
error: res_error,
|
|
2466
|
-
} = PaymentModel.
|
|
2462
|
+
} = PaymentModel.ChargeCustomerResponse().validate(response, {
|
|
2467
2463
|
abortEarly: false,
|
|
2468
2464
|
allowUnknown: false,
|
|
2469
2465
|
});
|
|
@@ -2471,8 +2467,7 @@ class Payment {
|
|
|
2471
2467
|
if (res_error) {
|
|
2472
2468
|
Logger({
|
|
2473
2469
|
level: "WARN",
|
|
2474
|
-
message:
|
|
2475
|
-
"Response Validation Warnnings for checkAndUpdatePaymentStatusPaymentLink",
|
|
2470
|
+
message: "Response Validation Warnnings for verifyAndChargePayment",
|
|
2476
2471
|
});
|
|
2477
2472
|
Logger({ level: "WARN", message: res_error });
|
|
2478
2473
|
}
|
|
@@ -2482,14 +2477,14 @@ class Payment {
|
|
|
2482
2477
|
|
|
2483
2478
|
/**
|
|
2484
2479
|
* @param {Object} arg - Arg object.
|
|
2485
|
-
* @param {
|
|
2486
|
-
* @returns {Promise<
|
|
2487
|
-
* @summary:
|
|
2488
|
-
* @description: Use this API to
|
|
2480
|
+
* @param {ValidateCustomerRequest} arg.body
|
|
2481
|
+
* @returns {Promise<ValidateCustomerResponse>} - Success response
|
|
2482
|
+
* @summary: Validate customer for payment
|
|
2483
|
+
* @description: Use this API to check if the customer is eligible to use credit-line facilities such as Simpl Pay Later and Rupifi.
|
|
2489
2484
|
*/
|
|
2490
|
-
async
|
|
2491
|
-
const { error } = PaymentValidator.
|
|
2492
|
-
{
|
|
2485
|
+
async verifyCustomerForPayment({ body } = {}) {
|
|
2486
|
+
const { error } = PaymentValidator.verifyCustomerForPayment().validate(
|
|
2487
|
+
{ body },
|
|
2493
2488
|
{ abortEarly: false, allowUnknown: true }
|
|
2494
2489
|
);
|
|
2495
2490
|
if (error) {
|
|
@@ -2499,38 +2494,37 @@ class Payment {
|
|
|
2499
2494
|
// Showing warrnings if extra unknown parameters are found
|
|
2500
2495
|
const {
|
|
2501
2496
|
error: warrning,
|
|
2502
|
-
} = PaymentValidator.
|
|
2503
|
-
{
|
|
2497
|
+
} = PaymentValidator.verifyCustomerForPayment().validate(
|
|
2498
|
+
{ body },
|
|
2504
2499
|
{ abortEarly: false, allowUnknown: false }
|
|
2505
2500
|
);
|
|
2506
2501
|
if (warrning) {
|
|
2507
2502
|
Logger({
|
|
2508
2503
|
level: "WARN",
|
|
2509
|
-
message: "Parameter Validation warrnings for
|
|
2504
|
+
message: "Parameter Validation warrnings for verifyCustomerForPayment",
|
|
2510
2505
|
});
|
|
2511
2506
|
Logger({ level: "WARN", message: warrning });
|
|
2512
2507
|
}
|
|
2513
2508
|
|
|
2514
2509
|
const query_params = {};
|
|
2515
|
-
query_params["aggregator"] = aggregator;
|
|
2516
2510
|
|
|
2517
2511
|
const xHeaders = {};
|
|
2518
2512
|
|
|
2519
2513
|
const response = await APIClient.execute(
|
|
2520
2514
|
this._conf,
|
|
2521
|
-
"
|
|
2515
|
+
"post",
|
|
2522
2516
|
constructUrl({
|
|
2523
|
-
url: this._urls["
|
|
2517
|
+
url: this._urls["verifyCustomerForPayment"],
|
|
2524
2518
|
params: {},
|
|
2525
2519
|
}),
|
|
2526
2520
|
query_params,
|
|
2527
|
-
|
|
2521
|
+
body,
|
|
2528
2522
|
xHeaders
|
|
2529
2523
|
);
|
|
2530
2524
|
|
|
2531
2525
|
const {
|
|
2532
2526
|
error: res_error,
|
|
2533
|
-
} = PaymentModel.
|
|
2527
|
+
} = PaymentModel.ValidateCustomerResponse().validate(response, {
|
|
2534
2528
|
abortEarly: false,
|
|
2535
2529
|
allowUnknown: false,
|
|
2536
2530
|
});
|
|
@@ -2538,7 +2532,7 @@ class Payment {
|
|
|
2538
2532
|
if (res_error) {
|
|
2539
2533
|
Logger({
|
|
2540
2534
|
level: "WARN",
|
|
2541
|
-
message: "Response Validation Warnnings for
|
|
2535
|
+
message: "Response Validation Warnnings for verifyCustomerForPayment",
|
|
2542
2536
|
});
|
|
2543
2537
|
Logger({ level: "WARN", message: res_error });
|
|
2544
2538
|
}
|
|
@@ -2548,17 +2542,15 @@ class Payment {
|
|
|
2548
2542
|
|
|
2549
2543
|
/**
|
|
2550
2544
|
* @param {Object} arg - Arg object.
|
|
2551
|
-
* @param {string} [arg.
|
|
2552
|
-
*
|
|
2553
|
-
* @
|
|
2554
|
-
*
|
|
2555
|
-
* @
|
|
2556
|
-
* @summary: API to get the redirect url to redirect the user to aggregator's page
|
|
2557
|
-
* @description: Use this API to get the redirect url to redirect the user to aggregator's page
|
|
2545
|
+
* @param {string} [arg.ifscCode] - A 11-digit alphanumeric code that
|
|
2546
|
+
* uniquely identifies a bank branch.
|
|
2547
|
+
* @returns {Promise<IfscCodeResponse>} - Success response
|
|
2548
|
+
* @summary: Verify IFSC Code
|
|
2549
|
+
* @description: Use this API to check whether the 11-digit IFSC code is valid and to fetch the bank details for refund.
|
|
2558
2550
|
*/
|
|
2559
|
-
async
|
|
2560
|
-
const { error } = PaymentValidator.
|
|
2561
|
-
{
|
|
2551
|
+
async verifyIfscCode({ ifscCode } = {}) {
|
|
2552
|
+
const { error } = PaymentValidator.verifyIfscCode().validate(
|
|
2553
|
+
{ ifscCode },
|
|
2562
2554
|
{ abortEarly: false, allowUnknown: true }
|
|
2563
2555
|
);
|
|
2564
2556
|
if (error) {
|
|
@@ -2566,23 +2558,20 @@ class Payment {
|
|
|
2566
2558
|
}
|
|
2567
2559
|
|
|
2568
2560
|
// Showing warrnings if extra unknown parameters are found
|
|
2569
|
-
const {
|
|
2570
|
-
|
|
2571
|
-
} = PaymentValidator.redirectToAggregator().validate(
|
|
2572
|
-
{ source, aggregator },
|
|
2561
|
+
const { error: warrning } = PaymentValidator.verifyIfscCode().validate(
|
|
2562
|
+
{ ifscCode },
|
|
2573
2563
|
{ abortEarly: false, allowUnknown: false }
|
|
2574
2564
|
);
|
|
2575
2565
|
if (warrning) {
|
|
2576
2566
|
Logger({
|
|
2577
2567
|
level: "WARN",
|
|
2578
|
-
message: "Parameter Validation warrnings for
|
|
2568
|
+
message: "Parameter Validation warrnings for verifyIfscCode",
|
|
2579
2569
|
});
|
|
2580
2570
|
Logger({ level: "WARN", message: warrning });
|
|
2581
2571
|
}
|
|
2582
2572
|
|
|
2583
2573
|
const query_params = {};
|
|
2584
|
-
query_params["
|
|
2585
|
-
query_params["aggregator"] = aggregator;
|
|
2574
|
+
query_params["ifsc_code"] = ifscCode;
|
|
2586
2575
|
|
|
2587
2576
|
const xHeaders = {};
|
|
2588
2577
|
|
|
@@ -2590,7 +2579,7 @@ class Payment {
|
|
|
2590
2579
|
this._conf,
|
|
2591
2580
|
"get",
|
|
2592
2581
|
constructUrl({
|
|
2593
|
-
url: this._urls["
|
|
2582
|
+
url: this._urls["verifyIfscCode"],
|
|
2594
2583
|
params: {},
|
|
2595
2584
|
}),
|
|
2596
2585
|
query_params,
|
|
@@ -2600,7 +2589,7 @@ class Payment {
|
|
|
2600
2589
|
|
|
2601
2590
|
const {
|
|
2602
2591
|
error: res_error,
|
|
2603
|
-
} = PaymentModel.
|
|
2592
|
+
} = PaymentModel.IfscCodeResponse().validate(response, {
|
|
2604
2593
|
abortEarly: false,
|
|
2605
2594
|
allowUnknown: false,
|
|
2606
2595
|
});
|
|
@@ -2608,7 +2597,7 @@ class Payment {
|
|
|
2608
2597
|
if (res_error) {
|
|
2609
2598
|
Logger({
|
|
2610
2599
|
level: "WARN",
|
|
2611
|
-
message: "Response Validation Warnnings for
|
|
2600
|
+
message: "Response Validation Warnnings for verifyIfscCode",
|
|
2612
2601
|
});
|
|
2613
2602
|
Logger({ level: "WARN", message: res_error });
|
|
2614
2603
|
}
|
|
@@ -2618,14 +2607,16 @@ class Payment {
|
|
|
2618
2607
|
|
|
2619
2608
|
/**
|
|
2620
2609
|
* @param {Object} arg - Arg object.
|
|
2621
|
-
* @param {
|
|
2622
|
-
* @returns {Promise<
|
|
2623
|
-
* @summary:
|
|
2624
|
-
* @description: Use this API to
|
|
2610
|
+
* @param {AddBeneficiaryViaOtpVerificationRequest} arg.body
|
|
2611
|
+
* @returns {Promise<AddBeneficiaryViaOtpVerificationResponse>} - Success response
|
|
2612
|
+
* @summary: Verify the beneficiary details using OTP
|
|
2613
|
+
* @description: Use this API to perform an OTP validation before saving the beneficiary details added for a refund.
|
|
2625
2614
|
*/
|
|
2626
|
-
async
|
|
2627
|
-
const {
|
|
2628
|
-
|
|
2615
|
+
async verifyOtpAndAddBeneficiaryForBank({ body } = {}) {
|
|
2616
|
+
const {
|
|
2617
|
+
error,
|
|
2618
|
+
} = PaymentValidator.verifyOtpAndAddBeneficiaryForBank().validate(
|
|
2619
|
+
{ body },
|
|
2629
2620
|
{ abortEarly: false, allowUnknown: true }
|
|
2630
2621
|
);
|
|
2631
2622
|
if (error) {
|
|
@@ -2633,46 +2624,49 @@ class Payment {
|
|
|
2633
2624
|
}
|
|
2634
2625
|
|
|
2635
2626
|
// Showing warrnings if extra unknown parameters are found
|
|
2636
|
-
const {
|
|
2637
|
-
|
|
2627
|
+
const {
|
|
2628
|
+
error: warrning,
|
|
2629
|
+
} = PaymentValidator.verifyOtpAndAddBeneficiaryForBank().validate(
|
|
2630
|
+
{ body },
|
|
2638
2631
|
{ abortEarly: false, allowUnknown: false }
|
|
2639
2632
|
);
|
|
2640
2633
|
if (warrning) {
|
|
2641
2634
|
Logger({
|
|
2642
2635
|
level: "WARN",
|
|
2643
|
-
message:
|
|
2636
|
+
message:
|
|
2637
|
+
"Parameter Validation warrnings for verifyOtpAndAddBeneficiaryForBank",
|
|
2644
2638
|
});
|
|
2645
2639
|
Logger({ level: "WARN", message: warrning });
|
|
2646
2640
|
}
|
|
2647
2641
|
|
|
2648
2642
|
const query_params = {};
|
|
2649
|
-
query_params["aggregator"] = aggregator;
|
|
2650
2643
|
|
|
2651
2644
|
const xHeaders = {};
|
|
2652
2645
|
|
|
2653
2646
|
const response = await APIClient.execute(
|
|
2654
2647
|
this._conf,
|
|
2655
|
-
"
|
|
2648
|
+
"post",
|
|
2656
2649
|
constructUrl({
|
|
2657
|
-
url: this._urls["
|
|
2650
|
+
url: this._urls["verifyOtpAndAddBeneficiaryForBank"],
|
|
2658
2651
|
params: {},
|
|
2659
2652
|
}),
|
|
2660
2653
|
query_params,
|
|
2661
|
-
|
|
2654
|
+
body,
|
|
2662
2655
|
xHeaders
|
|
2663
2656
|
);
|
|
2664
2657
|
|
|
2665
2658
|
const {
|
|
2666
2659
|
error: res_error,
|
|
2667
|
-
} = PaymentModel.
|
|
2668
|
-
|
|
2669
|
-
allowUnknown: false
|
|
2670
|
-
|
|
2660
|
+
} = PaymentModel.AddBeneficiaryViaOtpVerificationResponse().validate(
|
|
2661
|
+
response,
|
|
2662
|
+
{ abortEarly: false, allowUnknown: false }
|
|
2663
|
+
);
|
|
2671
2664
|
|
|
2672
2665
|
if (res_error) {
|
|
2673
2666
|
Logger({
|
|
2674
2667
|
level: "WARN",
|
|
2675
|
-
message:
|
|
2668
|
+
message:
|
|
2669
|
+
"Response Validation Warnnings for verifyOtpAndAddBeneficiaryForBank",
|
|
2676
2670
|
});
|
|
2677
2671
|
Logger({ level: "WARN", message: res_error });
|
|
2678
2672
|
}
|
|
@@ -2682,13 +2676,15 @@ class Payment {
|
|
|
2682
2676
|
|
|
2683
2677
|
/**
|
|
2684
2678
|
* @param {Object} arg - Arg object.
|
|
2685
|
-
* @param {
|
|
2686
|
-
* @returns {Promise<
|
|
2687
|
-
* @summary:
|
|
2688
|
-
* @description: Use this API to
|
|
2679
|
+
* @param {WalletOtpRequest} arg.body
|
|
2680
|
+
* @returns {Promise<WalletOtpResponse>} - Success response
|
|
2681
|
+
* @summary: Send OTP on adding a wallet beneficiary
|
|
2682
|
+
* @description: Use this API to send an OTP while adding a wallet beneficiary by mobile no. verification.
|
|
2689
2683
|
*/
|
|
2690
|
-
async
|
|
2691
|
-
const {
|
|
2684
|
+
async verifyOtpAndAddBeneficiaryForWallet({ body } = {}) {
|
|
2685
|
+
const {
|
|
2686
|
+
error,
|
|
2687
|
+
} = PaymentValidator.verifyOtpAndAddBeneficiaryForWallet().validate(
|
|
2692
2688
|
{ body },
|
|
2693
2689
|
{ abortEarly: false, allowUnknown: true }
|
|
2694
2690
|
);
|
|
@@ -2697,14 +2693,17 @@ class Payment {
|
|
|
2697
2693
|
}
|
|
2698
2694
|
|
|
2699
2695
|
// Showing warrnings if extra unknown parameters are found
|
|
2700
|
-
const {
|
|
2696
|
+
const {
|
|
2697
|
+
error: warrning,
|
|
2698
|
+
} = PaymentValidator.verifyOtpAndAddBeneficiaryForWallet().validate(
|
|
2701
2699
|
{ body },
|
|
2702
2700
|
{ abortEarly: false, allowUnknown: false }
|
|
2703
2701
|
);
|
|
2704
2702
|
if (warrning) {
|
|
2705
2703
|
Logger({
|
|
2706
2704
|
level: "WARN",
|
|
2707
|
-
message:
|
|
2705
|
+
message:
|
|
2706
|
+
"Parameter Validation warrnings for verifyOtpAndAddBeneficiaryForWallet",
|
|
2708
2707
|
});
|
|
2709
2708
|
Logger({ level: "WARN", message: warrning });
|
|
2710
2709
|
}
|
|
@@ -2717,7 +2716,7 @@ class Payment {
|
|
|
2717
2716
|
this._conf,
|
|
2718
2717
|
"post",
|
|
2719
2718
|
constructUrl({
|
|
2720
|
-
url: this._urls["
|
|
2719
|
+
url: this._urls["verifyOtpAndAddBeneficiaryForWallet"],
|
|
2721
2720
|
params: {},
|
|
2722
2721
|
}),
|
|
2723
2722
|
query_params,
|
|
@@ -2727,7 +2726,7 @@ class Payment {
|
|
|
2727
2726
|
|
|
2728
2727
|
const {
|
|
2729
2728
|
error: res_error,
|
|
2730
|
-
} = PaymentModel.
|
|
2729
|
+
} = PaymentModel.WalletOtpResponse().validate(response, {
|
|
2731
2730
|
abortEarly: false,
|
|
2732
2731
|
allowUnknown: false,
|
|
2733
2732
|
});
|
|
@@ -2735,7 +2734,8 @@ class Payment {
|
|
|
2735
2734
|
if (res_error) {
|
|
2736
2735
|
Logger({
|
|
2737
2736
|
level: "WARN",
|
|
2738
|
-
message:
|
|
2737
|
+
message:
|
|
2738
|
+
"Response Validation Warnnings for verifyOtpAndAddBeneficiaryForWallet",
|
|
2739
2739
|
});
|
|
2740
2740
|
Logger({ level: "WARN", message: res_error });
|
|
2741
2741
|
}
|