@gofynd/fdk-client-javascript 1.0.2 → 1.0.4

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