@gofynd/fdk-client-javascript 1.1.6 → 1.2.0

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 (321) hide show
  1. package/README.md +12 -0
  2. package/index.js +0 -3
  3. package/package.json +1 -1
  4. package/sdk/application/ApplicationAPIClient.d.ts +15 -1
  5. package/sdk/application/ApplicationAPIClient.js +8 -1
  6. package/sdk/application/ApplicationClient.d.ts +37 -6
  7. package/sdk/application/ApplicationClient.js +31 -0
  8. package/sdk/application/ApplicationConfig.d.ts +52 -12
  9. package/sdk/application/ApplicationConfig.js +37 -2
  10. package/sdk/application/ApplicationModels.d.ts +46 -1
  11. package/sdk/application/ApplicationModels.js +18 -0
  12. package/sdk/application/Cart/CartApplicationClient.d.ts +172 -357
  13. package/sdk/application/Cart/CartApplicationClient.js +620 -483
  14. package/sdk/application/Cart/CartApplicationModel.d.ts +2054 -96
  15. package/sdk/application/Cart/CartApplicationModel.js +1224 -93
  16. package/sdk/application/Cart/CartApplicationValidator.d.ts +508 -30
  17. package/sdk/application/Cart/CartApplicationValidator.js +270 -15
  18. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +234 -413
  19. package/sdk/application/Catalog/CatalogApplicationClient.js +777 -630
  20. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +2218 -117
  21. package/sdk/application/Catalog/CatalogApplicationModel.js +1499 -170
  22. package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +798 -31
  23. package/sdk/application/Catalog/CatalogApplicationValidator.js +318 -3
  24. package/sdk/application/Common/CommonApplicationClient.d.ts +14 -21
  25. package/sdk/application/Common/CommonApplicationClient.js +50 -33
  26. package/sdk/application/Common/CommonApplicationModel.d.ts +448 -19
  27. package/sdk/application/Common/CommonApplicationModel.js +224 -16
  28. package/sdk/application/Common/CommonApplicationValidator.d.ts +42 -4
  29. package/sdk/application/Common/CommonApplicationValidator.js +21 -3
  30. package/sdk/application/Communication/CommunicationApplicationClient.d.ts +25 -18
  31. package/sdk/application/Communication/CommunicationApplicationClient.js +74 -47
  32. package/sdk/application/Communication/CommunicationApplicationModel.d.ts +190 -14
  33. package/sdk/application/Communication/CommunicationApplicationModel.js +124 -7
  34. package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +27 -4
  35. package/sdk/application/Communication/CommunicationApplicationValidator.js +21 -5
  36. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +113 -112
  37. package/sdk/application/Configuration/ConfigurationApplicationClient.js +381 -260
  38. package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +2453 -110
  39. package/sdk/application/Configuration/ConfigurationApplicationModel.js +1254 -108
  40. package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +160 -8
  41. package/sdk/application/Configuration/ConfigurationApplicationValidator.js +88 -4
  42. package/sdk/application/Content/ContentApplicationClient.d.ts +120 -138
  43. package/sdk/application/Content/ContentApplicationClient.js +409 -277
  44. package/sdk/application/Content/ContentApplicationModel.d.ts +1627 -105
  45. package/sdk/application/Content/ContentApplicationModel.js +1202 -109
  46. package/sdk/application/Content/ContentApplicationValidator.d.ts +214 -12
  47. package/sdk/application/Content/ContentApplicationValidator.js +113 -3
  48. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +20 -29
  49. package/sdk/application/FileStorage/FileStorageApplicationClient.js +68 -47
  50. package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +299 -20
  51. package/sdk/application/FileStorage/FileStorageApplicationModel.js +209 -16
  52. package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +55 -5
  53. package/sdk/application/FileStorage/FileStorageApplicationValidator.js +33 -6
  54. package/sdk/application/Lead/LeadApplicationClient.d.ts +50 -53
  55. package/sdk/application/Lead/LeadApplicationClient.js +169 -103
  56. package/sdk/application/Lead/LeadApplicationModel.d.ts +1405 -54
  57. package/sdk/application/Lead/LeadApplicationModel.js +619 -73
  58. package/sdk/application/Lead/LeadApplicationValidator.d.ts +91 -9
  59. package/sdk/application/Lead/LeadApplicationValidator.js +51 -6
  60. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +34 -33
  61. package/sdk/application/Logistic/LogisticApplicationClient.js +110 -73
  62. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +399 -28
  63. package/sdk/application/Logistic/LogisticApplicationModel.js +293 -24
  64. package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +48 -6
  65. package/sdk/application/Logistic/LogisticApplicationValidator.js +34 -6
  66. package/sdk/application/Order/OrderApplicationClient.d.ts +81 -133
  67. package/sdk/application/Order/OrderApplicationClient.js +297 -217
  68. package/sdk/application/Order/OrderApplicationModel.d.ts +1101 -66
  69. package/sdk/application/Order/OrderApplicationModel.js +776 -57
  70. package/sdk/application/Order/OrderApplicationValidator.d.ts +249 -14
  71. package/sdk/application/Order/OrderApplicationValidator.js +114 -5
  72. package/sdk/application/Payment/PaymentApplicationClient.d.ts +341 -356
  73. package/sdk/application/Payment/PaymentApplicationClient.js +1077 -703
  74. package/sdk/application/Payment/PaymentApplicationModel.d.ts +3125 -99
  75. package/sdk/application/Payment/PaymentApplicationModel.js +1158 -62
  76. package/sdk/application/Payment/PaymentApplicationValidator.d.ts +494 -41
  77. package/sdk/application/Payment/PaymentApplicationValidator.js +297 -25
  78. package/sdk/application/PosCart/PosCartApplicationClient.d.ts +178 -350
  79. package/sdk/application/PosCart/PosCartApplicationClient.js +636 -491
  80. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +1823 -89
  81. package/sdk/application/PosCart/PosCartApplicationModel.js +1117 -85
  82. package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +480 -29
  83. package/sdk/application/PosCart/PosCartApplicationValidator.js +262 -15
  84. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +49 -47
  85. package/sdk/application/Rewards/RewardsApplicationClient.js +160 -102
  86. package/sdk/application/Rewards/RewardsApplicationModel.d.ts +343 -22
  87. package/sdk/application/Rewards/RewardsApplicationModel.js +230 -15
  88. package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +70 -7
  89. package/sdk/application/Rewards/RewardsApplicationValidator.js +45 -6
  90. package/sdk/application/Share/ShareApplicationClient.d.ts +44 -50
  91. package/sdk/application/Share/ShareApplicationClient.js +165 -97
  92. package/sdk/application/Share/ShareApplicationModel.d.ts +230 -15
  93. package/sdk/application/Share/ShareApplicationModel.js +154 -16
  94. package/sdk/application/Share/ShareApplicationValidator.d.ts +86 -8
  95. package/sdk/application/Share/ShareApplicationValidator.js +48 -4
  96. package/sdk/application/Theme/ThemeApplicationClient.d.ts +25 -27
  97. package/sdk/application/Theme/ThemeApplicationClient.js +83 -54
  98. package/sdk/application/Theme/ThemeApplicationModel.d.ts +621 -48
  99. package/sdk/application/Theme/ThemeApplicationModel.js +464 -40
  100. package/sdk/application/Theme/ThemeApplicationValidator.d.ts +49 -5
  101. package/sdk/application/Theme/ThemeApplicationValidator.js +26 -3
  102. package/sdk/application/User/UserApplicationClient.d.ts +219 -303
  103. package/sdk/application/User/UserApplicationClient.js +819 -522
  104. package/sdk/application/User/UserApplicationModel.d.ts +1390 -101
  105. package/sdk/application/User/UserApplicationModel.js +983 -44
  106. package/sdk/application/User/UserApplicationValidator.d.ts +457 -33
  107. package/sdk/application/User/UserApplicationValidator.js +265 -31
  108. package/sdk/common/AxiosHelper.js +8 -2
  109. package/sdk/common/Paginator.d.ts +27 -12
  110. package/sdk/common/Paginator.js +15 -0
  111. package/sdk/common/RequestSigner.js +0 -1
  112. package/sdk/partner/PartnerAPIClient.d.ts +15 -1
  113. package/sdk/partner/PartnerAPIClient.js +8 -1
  114. package/sdk/partner/PartnerClient.d.ts +20 -3
  115. package/sdk/partner/PartnerClient.js +17 -0
  116. package/sdk/partner/PartnerConfig.d.ts +40 -14
  117. package/sdk/partner/PartnerConfig.js +31 -6
  118. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +26 -25
  119. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +82 -53
  120. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +202 -17
  121. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +139 -10
  122. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +42 -5
  123. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +26 -4
  124. package/sdk/platform/Billing/BillingPlatformClient.d.ts +88 -97
  125. package/sdk/platform/Billing/BillingPlatformClient.js +310 -191
  126. package/sdk/platform/Billing/BillingPlatformModel.d.ts +1211 -68
  127. package/sdk/platform/Billing/BillingPlatformModel.js +824 -59
  128. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +153 -12
  129. package/sdk/platform/Billing/BillingPlatformValidator.js +87 -8
  130. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +392 -634
  131. package/sdk/platform/Cart/CartPlatformApplicationClient.js +1480 -957
  132. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +827 -57
  133. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +492 -34
  134. package/sdk/platform/Cart/CartPlatformModel.d.ts +3639 -175
  135. package/sdk/platform/Cart/CartPlatformModel.js +2368 -212
  136. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +438 -615
  137. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1449 -984
  138. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +1081 -49
  139. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +482 -23
  140. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +573 -824
  141. package/sdk/platform/Catalog/CatalogPlatformClient.js +1773 -1264
  142. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +6871 -326
  143. package/sdk/platform/Catalog/CatalogPlatformModel.js +4215 -349
  144. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +1331 -71
  145. package/sdk/platform/Catalog/CatalogPlatformValidator.js +611 -30
  146. package/sdk/platform/Common/CommonPlatformClient.d.ts +14 -21
  147. package/sdk/platform/Common/CommonPlatformClient.js +48 -33
  148. package/sdk/platform/Common/CommonPlatformModel.d.ts +448 -19
  149. package/sdk/platform/Common/CommonPlatformModel.js +224 -16
  150. package/sdk/platform/Common/CommonPlatformValidator.d.ts +42 -4
  151. package/sdk/platform/Common/CommonPlatformValidator.js +21 -3
  152. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +457 -279
  153. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +1423 -553
  154. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +581 -42
  155. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +294 -22
  156. package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +18 -5
  157. package/sdk/platform/Communication/CommunicationPlatformClient.js +58 -19
  158. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +1630 -102
  159. package/sdk/platform/Communication/CommunicationPlatformModel.js +1150 -85
  160. package/sdk/platform/Communication/CommunicationPlatformValidator.d.ts +16 -3
  161. package/sdk/platform/Communication/CommunicationPlatformValidator.js +11 -3
  162. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +102 -111
  163. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +321 -225
  164. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +830 -43
  165. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +612 -78
  166. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +180 -13
  167. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +98 -10
  168. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +232 -212
  169. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +737 -438
  170. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +293 -22
  171. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +184 -17
  172. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +166 -178
  173. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +519 -310
  174. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +4504 -188
  175. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +2242 -204
  176. package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +332 -19
  177. package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +153 -10
  178. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +495 -560
  179. package/sdk/platform/Content/ContentPlatformApplicationClient.js +1777 -987
  180. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +872 -62
  181. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +487 -35
  182. package/sdk/platform/Content/ContentPlatformModel.d.ts +1661 -108
  183. package/sdk/platform/Content/ContentPlatformModel.js +1217 -113
  184. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +67 -101
  185. package/sdk/platform/Discount/DiscountPlatformClient.js +240 -176
  186. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +242 -15
  187. package/sdk/platform/Discount/DiscountPlatformModel.js +162 -10
  188. package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +185 -13
  189. package/sdk/platform/Discount/DiscountPlatformValidator.js +88 -8
  190. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +32 -41
  191. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +106 -74
  192. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +77 -6
  193. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +41 -6
  194. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +39 -54
  195. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +124 -99
  196. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +299 -20
  197. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +207 -16
  198. package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +98 -8
  199. package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +54 -7
  200. package/sdk/platform/Finance/FinancePlatformClient.d.ts +85 -91
  201. package/sdk/platform/Finance/FinancePlatformClient.js +272 -180
  202. package/sdk/platform/Finance/FinancePlatformModel.d.ts +619 -50
  203. package/sdk/platform/Finance/FinancePlatformModel.js +458 -30
  204. package/sdk/platform/Finance/FinancePlatformValidator.d.ts +123 -15
  205. package/sdk/platform/Finance/FinancePlatformValidator.js +95 -16
  206. package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +99 -97
  207. package/sdk/platform/Inventory/InventoryPlatformClient.js +288 -199
  208. package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +1354 -61
  209. package/sdk/platform/Inventory/InventoryPlatformModel.js +916 -83
  210. package/sdk/platform/Inventory/InventoryPlatformValidator.d.ts +168 -12
  211. package/sdk/platform/Inventory/InventoryPlatformValidator.js +82 -6
  212. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +86 -106
  213. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +326 -186
  214. package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +180 -14
  215. package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +94 -9
  216. package/sdk/platform/Lead/LeadPlatformClient.d.ts +75 -101
  217. package/sdk/platform/Lead/LeadPlatformClient.js +240 -174
  218. package/sdk/platform/Lead/LeadPlatformModel.d.ts +1403 -54
  219. package/sdk/platform/Lead/LeadPlatformModel.js +618 -73
  220. package/sdk/platform/Lead/LeadPlatformValidator.d.ts +173 -12
  221. package/sdk/platform/Lead/LeadPlatformValidator.js +85 -8
  222. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +18 -14
  223. package/sdk/platform/Order/OrderPlatformApplicationClient.js +56 -29
  224. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +26 -4
  225. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +16 -3
  226. package/sdk/platform/Order/OrderPlatformClient.d.ts +343 -556
  227. package/sdk/platform/Order/OrderPlatformClient.js +969 -762
  228. package/sdk/platform/Order/OrderPlatformModel.d.ts +4967 -247
  229. package/sdk/platform/Order/OrderPlatformModel.js +3249 -259
  230. package/sdk/platform/Order/OrderPlatformValidator.d.ts +758 -37
  231. package/sdk/platform/Order/OrderPlatformValidator.js +351 -22
  232. package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +28 -36
  233. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +103 -59
  234. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +66 -6
  235. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +32 -4
  236. package/sdk/platform/Partner/PartnerPlatformClient.d.ts +68 -107
  237. package/sdk/platform/Partner/PartnerPlatformClient.js +253 -174
  238. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +767 -45
  239. package/sdk/platform/Partner/PartnerPlatformModel.js +524 -41
  240. package/sdk/platform/Partner/PartnerPlatformValidator.d.ts +207 -13
  241. package/sdk/platform/Partner/PartnerPlatformValidator.js +87 -5
  242. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +255 -260
  243. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +860 -504
  244. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +348 -30
  245. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +221 -19
  246. package/sdk/platform/Payment/PaymentPlatformClient.d.ts +73 -73
  247. package/sdk/platform/Payment/PaymentPlatformClient.js +238 -154
  248. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +2658 -93
  249. package/sdk/platform/Payment/PaymentPlatformModel.js +1035 -36
  250. package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +111 -11
  251. package/sdk/platform/Payment/PaymentPlatformValidator.js +68 -7
  252. package/sdk/platform/PlatformAPIClient.d.ts +16 -1
  253. package/sdk/platform/PlatformAPIClient.js +9 -1
  254. package/sdk/platform/PlatformApplicationClient.d.ts +22 -1798
  255. package/sdk/platform/PlatformApplicationClient.js +17 -1899
  256. package/sdk/platform/PlatformClient.d.ts +29 -12579
  257. package/sdk/platform/PlatformClient.js +26 -15085
  258. package/sdk/platform/PlatformConfig.d.ts +37 -11
  259. package/sdk/platform/PlatformConfig.js +32 -6
  260. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +80 -92
  261. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +307 -177
  262. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +149 -12
  263. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +82 -8
  264. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +371 -23
  265. package/sdk/platform/Rewards/RewardsPlatformModel.js +246 -16
  266. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +120 -89
  267. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +349 -201
  268. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +128 -12
  269. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +85 -11
  270. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +148 -178
  271. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +454 -329
  272. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +1399 -96
  273. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +1022 -71
  274. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +280 -18
  275. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +134 -11
  276. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +38 -47
  277. package/sdk/platform/Share/SharePlatformApplicationClient.js +137 -73
  278. package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +87 -7
  279. package/sdk/platform/Share/SharePlatformApplicationValidator.js +42 -5
  280. package/sdk/platform/Share/SharePlatformModel.d.ts +250 -16
  281. package/sdk/platform/Share/SharePlatformModel.js +165 -17
  282. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +149 -183
  283. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +579 -330
  284. package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +308 -24
  285. package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +162 -10
  286. package/sdk/platform/Theme/ThemePlatformModel.d.ts +621 -48
  287. package/sdk/platform/Theme/ThemePlatformModel.js +464 -40
  288. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +119 -151
  289. package/sdk/platform/User/UserPlatformApplicationClient.js +411 -244
  290. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +235 -18
  291. package/sdk/platform/User/UserPlatformApplicationValidator.js +126 -12
  292. package/sdk/platform/User/UserPlatformModel.d.ts +1390 -101
  293. package/sdk/platform/User/UserPlatformModel.js +983 -44
  294. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +38 -47
  295. package/sdk/platform/Webhook/WebhookPlatformClient.js +137 -87
  296. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +242 -16
  297. package/sdk/platform/Webhook/WebhookPlatformModel.js +167 -18
  298. package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +83 -7
  299. package/sdk/platform/Webhook/WebhookPlatformValidator.js +43 -5
  300. package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +14 -21
  301. package/sdk/public/Configuration/ConfigurationPublicClient.js +46 -33
  302. package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +473 -19
  303. package/sdk/public/Configuration/ConfigurationPublicModel.js +224 -16
  304. package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +42 -4
  305. package/sdk/public/Configuration/ConfigurationPublicValidator.js +21 -3
  306. package/sdk/public/Inventory/InventoryPublicClient.d.ts +48 -48
  307. package/sdk/public/Inventory/InventoryPublicClient.js +146 -98
  308. package/sdk/public/Inventory/InventoryPublicModel.d.ts +392 -21
  309. package/sdk/public/Inventory/InventoryPublicModel.js +267 -27
  310. package/sdk/public/Inventory/InventoryPublicValidator.d.ts +90 -8
  311. package/sdk/public/Inventory/InventoryPublicValidator.js +44 -4
  312. package/sdk/public/PublicClient.d.ts +19 -3
  313. package/sdk/public/PublicClient.js +16 -0
  314. package/sdk/public/PublicConfig.d.ts +27 -6
  315. package/sdk/public/PublicConfig.js +17 -1
  316. package/sdk/public/Webhook/WebhookPublicClient.d.ts +13 -11
  317. package/sdk/public/Webhook/WebhookPublicClient.js +42 -27
  318. package/sdk/public/Webhook/WebhookPublicModel.d.ts +242 -16
  319. package/sdk/public/Webhook/WebhookPublicModel.js +167 -18
  320. package/sdk/public/Webhook/WebhookPublicValidator.d.ts +18 -3
  321. package/sdk/public/Webhook/WebhookPublicValidator.js +14 -4
@@ -2,8 +2,8 @@ const ApplicationAPIClient = require("../ApplicationAPIClient");
2
2
  const { FDKClientValidationError } = require("../../common/FDKError");
3
3
  const constructUrl = require("../constructUrl");
4
4
  const Paginator = require("../../common/Paginator");
5
- const PaymentValidator = require("./PaymentApplicationValidator");
6
- const PaymentModel = require("./PaymentApplicationModel");
5
+ const PaymentApplicationValidator = require("./PaymentApplicationValidator");
6
+ const PaymentApplicationModel = require("./PaymentApplicationModel");
7
7
  const { Logger } = require("./../../common/Logger");
8
8
  const Joi = require("joi");
9
9
 
@@ -99,14 +99,18 @@ class Payment {
99
99
  }
100
100
 
101
101
  /**
102
- * @param {Object} arg - Arg object.
103
- * @param {AddBeneficiaryDetailsRequest} arg.body
104
- * @returns {Promise<RefundAccountResponse>} - Success response
102
+ * @param {PaymentApplicationValidator.AddBeneficiaryDetailsParam} arg - Arg object.
103
+ * @param {import("../ApplicationAPIClient").Options} - Options
104
+ * @returns {Promise<PaymentApplicationModel.RefundAccountResponse>} -
105
+ * Success response
106
+ * @name addBeneficiaryDetails
105
107
  * @summary: Save bank details for cancelled/returned order
106
- * @description: Use this API to save the bank details for a returned or cancelled order to refund the amount.
108
+ * @description: Use this API to save the bank details for a returned or cancelled order to refund the amount. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/addBeneficiaryDetails/).
107
109
  */
108
- async addBeneficiaryDetails({ body } = {}) {
109
- const { error } = PaymentValidator.addBeneficiaryDetails().validate(
110
+ async addBeneficiaryDetails({ body } = {}, { headers } = { headers: false }) {
111
+ const {
112
+ error,
113
+ } = PaymentApplicationValidator.addBeneficiaryDetails().validate(
110
114
  { body },
111
115
  { abortEarly: false, allowUnknown: true }
112
116
  );
@@ -117,16 +121,15 @@ class Payment {
117
121
  // Showing warrnings if extra unknown parameters are found
118
122
  const {
119
123
  error: warrning,
120
- } = PaymentValidator.addBeneficiaryDetails().validate(
124
+ } = PaymentApplicationValidator.addBeneficiaryDetails().validate(
121
125
  { body },
122
126
  { abortEarly: false, allowUnknown: false }
123
127
  );
124
128
  if (warrning) {
125
129
  Logger({
126
130
  level: "WARN",
127
- message: "Parameter Validation warrnings for addBeneficiaryDetails",
131
+ message: `Parameter Validation warrnings for application > Payment > addBeneficiaryDetails \n ${warrning}`,
128
132
  });
129
- Logger({ level: "WARN", message: warrning });
130
133
  }
131
134
 
132
135
  const query_params = {};
@@ -142,12 +145,18 @@ class Payment {
142
145
  }),
143
146
  query_params,
144
147
  body,
145
- xHeaders
148
+ xHeaders,
149
+ { headers }
146
150
  );
147
151
 
152
+ let responseData = response;
153
+ if (headers) {
154
+ responseData = response[0];
155
+ }
156
+
148
157
  const {
149
158
  error: res_error,
150
- } = PaymentModel.RefundAccountResponse().validate(response, {
159
+ } = PaymentApplicationModel.RefundAccountResponse().validate(responseData, {
151
160
  abortEarly: false,
152
161
  allowUnknown: false,
153
162
  });
@@ -155,23 +164,31 @@ class Payment {
155
164
  if (res_error) {
156
165
  Logger({
157
166
  level: "WARN",
158
- message: "Response Validation Warnnings for addBeneficiaryDetails",
167
+ message: `Response Validation Warnnings for application > Payment > addBeneficiaryDetails \n ${res_error}`,
159
168
  });
160
- Logger({ level: "WARN", message: res_error });
161
169
  }
162
170
 
163
171
  return response;
164
172
  }
165
173
 
166
174
  /**
167
- * @param {Object} arg - Arg object.
168
- * @param {AddBeneficiaryDetailsOTPRequest} arg.body
169
- * @returns {Promise<RefundAccountResponse>} - Success response
175
+ * @param {PaymentApplicationValidator.AddRefundBankAccountUsingOTPParam} arg
176
+ * - Arg object.
177
+ *
178
+ * @param {import("../ApplicationAPIClient").Options} - Options
179
+ * @returns {Promise<PaymentApplicationModel.RefundAccountResponse>} -
180
+ * Success response
181
+ * @name addRefundBankAccountUsingOTP
170
182
  * @summary: Save bank details for cancelled/returned order
171
- * @description: Use this API to save bank details for returned/cancelled order to refund amount in his account.
183
+ * @description: Use this API to save bank details for returned/cancelled order to refund amount in his account. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/addRefundBankAccountUsingOTP/).
172
184
  */
173
- async addRefundBankAccountUsingOTP({ body } = {}) {
174
- const { error } = PaymentValidator.addRefundBankAccountUsingOTP().validate(
185
+ async addRefundBankAccountUsingOTP(
186
+ { body } = {},
187
+ { headers } = { headers: false }
188
+ ) {
189
+ const {
190
+ error,
191
+ } = PaymentApplicationValidator.addRefundBankAccountUsingOTP().validate(
175
192
  { body },
176
193
  { abortEarly: false, allowUnknown: true }
177
194
  );
@@ -182,17 +199,15 @@ class Payment {
182
199
  // Showing warrnings if extra unknown parameters are found
183
200
  const {
184
201
  error: warrning,
185
- } = PaymentValidator.addRefundBankAccountUsingOTP().validate(
202
+ } = PaymentApplicationValidator.addRefundBankAccountUsingOTP().validate(
186
203
  { body },
187
204
  { abortEarly: false, allowUnknown: false }
188
205
  );
189
206
  if (warrning) {
190
207
  Logger({
191
208
  level: "WARN",
192
- message:
193
- "Parameter Validation warrnings for addRefundBankAccountUsingOTP",
209
+ message: `Parameter Validation warrnings for application > Payment > addRefundBankAccountUsingOTP \n ${warrning}`,
194
210
  });
195
- Logger({ level: "WARN", message: warrning });
196
211
  }
197
212
 
198
213
  const query_params = {};
@@ -208,12 +223,18 @@ class Payment {
208
223
  }),
209
224
  query_params,
210
225
  body,
211
- xHeaders
226
+ xHeaders,
227
+ { headers }
212
228
  );
213
229
 
230
+ let responseData = response;
231
+ if (headers) {
232
+ responseData = response[0];
233
+ }
234
+
214
235
  const {
215
236
  error: res_error,
216
- } = PaymentModel.RefundAccountResponse().validate(response, {
237
+ } = PaymentApplicationModel.RefundAccountResponse().validate(responseData, {
217
238
  abortEarly: false,
218
239
  allowUnknown: false,
219
240
  });
@@ -221,24 +242,25 @@ class Payment {
221
242
  if (res_error) {
222
243
  Logger({
223
244
  level: "WARN",
224
- message:
225
- "Response Validation Warnnings for addRefundBankAccountUsingOTP",
245
+ message: `Response Validation Warnnings for application > Payment > addRefundBankAccountUsingOTP \n ${res_error}`,
226
246
  });
227
- Logger({ level: "WARN", message: res_error });
228
247
  }
229
248
 
230
249
  return response;
231
250
  }
232
251
 
233
252
  /**
234
- * @param {Object} arg - Arg object.
235
- * @param {AttachCardRequest} arg.body
236
- * @returns {Promise<AttachCardsResponse>} - Success response
253
+ * @param {PaymentApplicationValidator.AttachCardToCustomerParam} arg - Arg object.
254
+ * @param {import("../ApplicationAPIClient").Options} - Options
255
+ * @returns {Promise<PaymentApplicationModel.AttachCardsResponse>} - Success response
256
+ * @name attachCardToCustomer
237
257
  * @summary: Attach a saved card to customer.
238
- * @description: Use this API to attach a customer's saved card at the payment gateway, such as Stripe, Juspay.
258
+ * @description: Use this API to attach a customer's saved card at the payment gateway, such as Stripe, Juspay. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/attachCardToCustomer/).
239
259
  */
240
- async attachCardToCustomer({ body } = {}) {
241
- const { error } = PaymentValidator.attachCardToCustomer().validate(
260
+ async attachCardToCustomer({ body } = {}, { headers } = { headers: false }) {
261
+ const {
262
+ error,
263
+ } = PaymentApplicationValidator.attachCardToCustomer().validate(
242
264
  { body },
243
265
  { abortEarly: false, allowUnknown: true }
244
266
  );
@@ -249,16 +271,15 @@ class Payment {
249
271
  // Showing warrnings if extra unknown parameters are found
250
272
  const {
251
273
  error: warrning,
252
- } = PaymentValidator.attachCardToCustomer().validate(
274
+ } = PaymentApplicationValidator.attachCardToCustomer().validate(
253
275
  { body },
254
276
  { abortEarly: false, allowUnknown: false }
255
277
  );
256
278
  if (warrning) {
257
279
  Logger({
258
280
  level: "WARN",
259
- message: "Parameter Validation warrnings for attachCardToCustomer",
281
+ message: `Parameter Validation warrnings for application > Payment > attachCardToCustomer \n ${warrning}`,
260
282
  });
261
- Logger({ level: "WARN", message: warrning });
262
283
  }
263
284
 
264
285
  const query_params = {};
@@ -274,12 +295,18 @@ class Payment {
274
295
  }),
275
296
  query_params,
276
297
  body,
277
- xHeaders
298
+ xHeaders,
299
+ { headers }
278
300
  );
279
301
 
302
+ let responseData = response;
303
+ if (headers) {
304
+ responseData = response[0];
305
+ }
306
+
280
307
  const {
281
308
  error: res_error,
282
- } = PaymentModel.AttachCardsResponse().validate(response, {
309
+ } = PaymentApplicationModel.AttachCardsResponse().validate(responseData, {
283
310
  abortEarly: false,
284
311
  allowUnknown: false,
285
312
  });
@@ -287,23 +314,24 @@ class Payment {
287
314
  if (res_error) {
288
315
  Logger({
289
316
  level: "WARN",
290
- message: "Response Validation Warnnings for attachCardToCustomer",
317
+ message: `Response Validation Warnnings for application > Payment > attachCardToCustomer \n ${res_error}`,
291
318
  });
292
- Logger({ level: "WARN", message: res_error });
293
319
  }
294
320
 
295
321
  return response;
296
322
  }
297
323
 
298
324
  /**
299
- * @param {Object} arg - Arg object.
300
- * @param {CancelOrResendPaymentLinkRequest} arg.body
301
- * @returns {Promise<CancelPaymentLinkResponse>} - Success response
325
+ * @param {PaymentApplicationValidator.CancelPaymentLinkParam} arg - Arg object.
326
+ * @param {import("../ApplicationAPIClient").Options} - Options
327
+ * @returns {Promise<PaymentApplicationModel.CancelPaymentLinkResponse>} -
328
+ * Success response
329
+ * @name cancelPaymentLink
302
330
  * @summary: Cancel payment link
303
- * @description: Use this API to cancel a payment link for the customer
331
+ * @description: Use this API to cancel a payment link for the customer - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/cancelPaymentLink/).
304
332
  */
305
- async cancelPaymentLink({ body } = {}) {
306
- const { error } = PaymentValidator.cancelPaymentLink().validate(
333
+ async cancelPaymentLink({ body } = {}, { headers } = { headers: false }) {
334
+ const { error } = PaymentApplicationValidator.cancelPaymentLink().validate(
307
335
  { body },
308
336
  { abortEarly: false, allowUnknown: true }
309
337
  );
@@ -312,16 +340,17 @@ class Payment {
312
340
  }
313
341
 
314
342
  // Showing warrnings if extra unknown parameters are found
315
- const { error: warrning } = PaymentValidator.cancelPaymentLink().validate(
343
+ const {
344
+ error: warrning,
345
+ } = PaymentApplicationValidator.cancelPaymentLink().validate(
316
346
  { body },
317
347
  { abortEarly: false, allowUnknown: false }
318
348
  );
319
349
  if (warrning) {
320
350
  Logger({
321
351
  level: "WARN",
322
- message: "Parameter Validation warrnings for cancelPaymentLink",
352
+ message: `Parameter Validation warrnings for application > Payment > cancelPaymentLink \n ${warrning}`,
323
353
  });
324
- Logger({ level: "WARN", message: warrning });
325
354
  }
326
355
 
327
356
  const query_params = {};
@@ -337,37 +366,45 @@ class Payment {
337
366
  }),
338
367
  query_params,
339
368
  body,
340
- xHeaders
369
+ xHeaders,
370
+ { headers }
341
371
  );
342
372
 
373
+ let responseData = response;
374
+ if (headers) {
375
+ responseData = response[0];
376
+ }
377
+
343
378
  const {
344
379
  error: res_error,
345
- } = PaymentModel.CancelPaymentLinkResponse().validate(response, {
346
- abortEarly: false,
347
- allowUnknown: false,
348
- });
380
+ } = PaymentApplicationModel.CancelPaymentLinkResponse().validate(
381
+ responseData,
382
+ { abortEarly: false, allowUnknown: false }
383
+ );
349
384
 
350
385
  if (res_error) {
351
386
  Logger({
352
387
  level: "WARN",
353
- message: "Response Validation Warnnings for cancelPaymentLink",
388
+ message: `Response Validation Warnnings for application > Payment > cancelPaymentLink \n ${res_error}`,
354
389
  });
355
- Logger({ level: "WARN", message: res_error });
356
390
  }
357
391
 
358
392
  return response;
359
393
  }
360
394
 
361
395
  /**
362
- * @param {Object} arg - Arg object.
363
- * @param {string} arg.cardInfo - Card first 6 digit IIN(prefix) number.
364
- * @param {string} [arg.aggregator] -
365
- * @returns {Promise<CardDetailsResponse>} - Success response
396
+ * @param {PaymentApplicationValidator.CardDetailsParam} arg - Arg object.
397
+ * @param {import("../ApplicationAPIClient").Options} - Options
398
+ * @returns {Promise<PaymentApplicationModel.CardDetailsResponse>} - Success response
399
+ * @name cardDetails
366
400
  * @summary: API to get Card info from PG
367
- * @description: API to get Card info from PG
401
+ * @description: API to get Card info from PG - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/cardDetails/).
368
402
  */
369
- async cardDetails({ cardInfo, aggregator } = {}) {
370
- const { error } = PaymentValidator.cardDetails().validate(
403
+ async cardDetails(
404
+ { cardInfo, aggregator } = {},
405
+ { headers } = { headers: false }
406
+ ) {
407
+ const { error } = PaymentApplicationValidator.cardDetails().validate(
371
408
  { cardInfo, aggregator },
372
409
  { abortEarly: false, allowUnknown: true }
373
410
  );
@@ -376,16 +413,17 @@ class Payment {
376
413
  }
377
414
 
378
415
  // Showing warrnings if extra unknown parameters are found
379
- const { error: warrning } = PaymentValidator.cardDetails().validate(
416
+ const {
417
+ error: warrning,
418
+ } = PaymentApplicationValidator.cardDetails().validate(
380
419
  { cardInfo, aggregator },
381
420
  { abortEarly: false, allowUnknown: false }
382
421
  );
383
422
  if (warrning) {
384
423
  Logger({
385
424
  level: "WARN",
386
- message: "Parameter Validation warrnings for cardDetails",
425
+ message: `Parameter Validation warrnings for application > Payment > cardDetails \n ${warrning}`,
387
426
  });
388
- Logger({ level: "WARN", message: warrning });
389
427
  }
390
428
 
391
429
  const query_params = {};
@@ -402,12 +440,18 @@ class Payment {
402
440
  }),
403
441
  query_params,
404
442
  undefined,
405
- xHeaders
443
+ xHeaders,
444
+ { headers }
406
445
  );
407
446
 
447
+ let responseData = response;
448
+ if (headers) {
449
+ responseData = response[0];
450
+ }
451
+
408
452
  const {
409
453
  error: res_error,
410
- } = PaymentModel.CardDetailsResponse().validate(response, {
454
+ } = PaymentApplicationModel.CardDetailsResponse().validate(responseData, {
411
455
  abortEarly: false,
412
456
  allowUnknown: false,
413
457
  });
@@ -415,23 +459,32 @@ class Payment {
415
459
  if (res_error) {
416
460
  Logger({
417
461
  level: "WARN",
418
- message: "Response Validation Warnnings for cardDetails",
462
+ message: `Response Validation Warnnings for application > Payment > cardDetails \n ${res_error}`,
419
463
  });
420
- Logger({ level: "WARN", message: res_error });
421
464
  }
422
465
 
423
466
  return response;
424
467
  }
425
468
 
426
469
  /**
427
- * @param {Object} arg - Arg object.
428
- * @param {PaymentStatusUpdateRequest} arg.body
429
- * @returns {Promise<PaymentStatusUpdateResponse>} - Success response
470
+ * @param {PaymentApplicationValidator.CheckAndUpdatePaymentStatusParam} arg
471
+ * - Arg object.
472
+ *
473
+ * @param {import("../ApplicationAPIClient").Options} - Options
474
+ * @returns {Promise<PaymentApplicationModel.PaymentStatusUpdateResponse>}
475
+ * - Success response
476
+ *
477
+ * @name checkAndUpdatePaymentStatus
430
478
  * @summary: Performs continuous polling to check status of payment on the server
431
- * @description: Use this API to perform continuous polling at intervals to check the status of payment until timeout.
479
+ * @description: Use this API to perform continuous polling at intervals to check the status of payment until timeout. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/checkAndUpdatePaymentStatus/).
432
480
  */
433
- async checkAndUpdatePaymentStatus({ body } = {}) {
434
- const { error } = PaymentValidator.checkAndUpdatePaymentStatus().validate(
481
+ async checkAndUpdatePaymentStatus(
482
+ { body } = {},
483
+ { headers } = { headers: false }
484
+ ) {
485
+ const {
486
+ error,
487
+ } = PaymentApplicationValidator.checkAndUpdatePaymentStatus().validate(
435
488
  { body },
436
489
  { abortEarly: false, allowUnknown: true }
437
490
  );
@@ -442,17 +495,15 @@ class Payment {
442
495
  // Showing warrnings if extra unknown parameters are found
443
496
  const {
444
497
  error: warrning,
445
- } = PaymentValidator.checkAndUpdatePaymentStatus().validate(
498
+ } = PaymentApplicationValidator.checkAndUpdatePaymentStatus().validate(
446
499
  { body },
447
500
  { abortEarly: false, allowUnknown: false }
448
501
  );
449
502
  if (warrning) {
450
503
  Logger({
451
504
  level: "WARN",
452
- message:
453
- "Parameter Validation warrnings for checkAndUpdatePaymentStatus",
505
+ message: `Parameter Validation warrnings for application > Payment > checkAndUpdatePaymentStatus \n ${warrning}`,
454
506
  });
455
- Logger({ level: "WARN", message: warrning });
456
507
  }
457
508
 
458
509
  const query_params = {};
@@ -468,39 +519,51 @@ class Payment {
468
519
  }),
469
520
  query_params,
470
521
  body,
471
- xHeaders
522
+ xHeaders,
523
+ { headers }
472
524
  );
473
525
 
526
+ let responseData = response;
527
+ if (headers) {
528
+ responseData = response[0];
529
+ }
530
+
474
531
  const {
475
532
  error: res_error,
476
- } = PaymentModel.PaymentStatusUpdateResponse().validate(response, {
477
- abortEarly: false,
478
- allowUnknown: false,
479
- });
533
+ } = PaymentApplicationModel.PaymentStatusUpdateResponse().validate(
534
+ responseData,
535
+ { abortEarly: false, allowUnknown: false }
536
+ );
480
537
 
481
538
  if (res_error) {
482
539
  Logger({
483
540
  level: "WARN",
484
- message:
485
- "Response Validation Warnnings for checkAndUpdatePaymentStatus",
541
+ message: `Response Validation Warnnings for application > Payment > checkAndUpdatePaymentStatus \n ${res_error}`,
486
542
  });
487
- Logger({ level: "WARN", message: res_error });
488
543
  }
489
544
 
490
545
  return response;
491
546
  }
492
547
 
493
548
  /**
494
- * @param {Object} arg - Arg object.
495
- * @param {PaymentStatusUpdateRequest} arg.body
496
- * @returns {Promise<PaymentStatusUpdateResponse>} - Success response
549
+ * @param {PaymentApplicationValidator.CheckAndUpdatePaymentStatusPaymentLinkParam} arg
550
+ * - Arg object.
551
+ *
552
+ * @param {import("../ApplicationAPIClient").Options} - Options
553
+ * @returns {Promise<PaymentApplicationModel.PaymentStatusUpdateResponse>}
554
+ * - Success response
555
+ *
556
+ * @name checkAndUpdatePaymentStatusPaymentLink
497
557
  * @summary: Performs continuous polling to check status of payment on the server
498
- * @description: Use this API to perform continuous polling at intervals to check the status of payment until timeout.
558
+ * @description: Use this API to perform continuous polling at intervals to check the status of payment until timeout. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/checkAndUpdatePaymentStatusPaymentLink/).
499
559
  */
500
- async checkAndUpdatePaymentStatusPaymentLink({ body } = {}) {
560
+ async checkAndUpdatePaymentStatusPaymentLink(
561
+ { body } = {},
562
+ { headers } = { headers: false }
563
+ ) {
501
564
  const {
502
565
  error,
503
- } = PaymentValidator.checkAndUpdatePaymentStatusPaymentLink().validate(
566
+ } = PaymentApplicationValidator.checkAndUpdatePaymentStatusPaymentLink().validate(
504
567
  { body },
505
568
  { abortEarly: false, allowUnknown: true }
506
569
  );
@@ -511,17 +574,15 @@ class Payment {
511
574
  // Showing warrnings if extra unknown parameters are found
512
575
  const {
513
576
  error: warrning,
514
- } = PaymentValidator.checkAndUpdatePaymentStatusPaymentLink().validate(
577
+ } = PaymentApplicationValidator.checkAndUpdatePaymentStatusPaymentLink().validate(
515
578
  { body },
516
579
  { abortEarly: false, allowUnknown: false }
517
580
  );
518
581
  if (warrning) {
519
582
  Logger({
520
583
  level: "WARN",
521
- message:
522
- "Parameter Validation warrnings for checkAndUpdatePaymentStatusPaymentLink",
584
+ message: `Parameter Validation warrnings for application > Payment > checkAndUpdatePaymentStatusPaymentLink \n ${warrning}`,
523
585
  });
524
- Logger({ level: "WARN", message: warrning });
525
586
  }
526
587
 
527
588
  const query_params = {};
@@ -537,37 +598,42 @@ class Payment {
537
598
  }),
538
599
  query_params,
539
600
  body,
540
- xHeaders
601
+ xHeaders,
602
+ { headers }
541
603
  );
542
604
 
605
+ let responseData = response;
606
+ if (headers) {
607
+ responseData = response[0];
608
+ }
609
+
543
610
  const {
544
611
  error: res_error,
545
- } = PaymentModel.PaymentStatusUpdateResponse().validate(response, {
546
- abortEarly: false,
547
- allowUnknown: false,
548
- });
612
+ } = PaymentApplicationModel.PaymentStatusUpdateResponse().validate(
613
+ responseData,
614
+ { abortEarly: false, allowUnknown: false }
615
+ );
549
616
 
550
617
  if (res_error) {
551
618
  Logger({
552
619
  level: "WARN",
553
- message:
554
- "Response Validation Warnnings for checkAndUpdatePaymentStatusPaymentLink",
620
+ message: `Response Validation Warnnings for application > Payment > checkAndUpdatePaymentStatusPaymentLink \n ${res_error}`,
555
621
  });
556
- Logger({ level: "WARN", message: res_error });
557
622
  }
558
623
 
559
624
  return response;
560
625
  }
561
626
 
562
627
  /**
563
- * @param {Object} arg - Arg object.
564
- * @param {string} [arg.aggregator] -
565
- * @returns {Promise<CheckCreditResponse>} - Success response
628
+ * @param {PaymentApplicationValidator.CheckCreditParam} arg - Arg object.
629
+ * @param {import("../ApplicationAPIClient").Options} - Options
630
+ * @returns {Promise<PaymentApplicationModel.CheckCreditResponse>} - Success response
631
+ * @name checkCredit
566
632
  * @summary: API to fetch the customer credit summary
567
- * @description: Use this API to fetch the customer credit summary.
633
+ * @description: Use this API to fetch the customer credit summary. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/checkCredit/).
568
634
  */
569
- async checkCredit({ aggregator } = {}) {
570
- const { error } = PaymentValidator.checkCredit().validate(
635
+ async checkCredit({ aggregator } = {}, { headers } = { headers: false }) {
636
+ const { error } = PaymentApplicationValidator.checkCredit().validate(
571
637
  { aggregator },
572
638
  { abortEarly: false, allowUnknown: true }
573
639
  );
@@ -576,16 +642,17 @@ class Payment {
576
642
  }
577
643
 
578
644
  // Showing warrnings if extra unknown parameters are found
579
- const { error: warrning } = PaymentValidator.checkCredit().validate(
645
+ const {
646
+ error: warrning,
647
+ } = PaymentApplicationValidator.checkCredit().validate(
580
648
  { aggregator },
581
649
  { abortEarly: false, allowUnknown: false }
582
650
  );
583
651
  if (warrning) {
584
652
  Logger({
585
653
  level: "WARN",
586
- message: "Parameter Validation warrnings for checkCredit",
654
+ message: `Parameter Validation warrnings for application > Payment > checkCredit \n ${warrning}`,
587
655
  });
588
- Logger({ level: "WARN", message: warrning });
589
656
  }
590
657
 
591
658
  const query_params = {};
@@ -602,12 +669,18 @@ class Payment {
602
669
  }),
603
670
  query_params,
604
671
  undefined,
605
- xHeaders
672
+ xHeaders,
673
+ { headers }
606
674
  );
607
675
 
676
+ let responseData = response;
677
+ if (headers) {
678
+ responseData = response[0];
679
+ }
680
+
608
681
  const {
609
682
  error: res_error,
610
- } = PaymentModel.CheckCreditResponse().validate(response, {
683
+ } = PaymentApplicationModel.CheckCreditResponse().validate(responseData, {
611
684
  abortEarly: false,
612
685
  allowUnknown: false,
613
686
  });
@@ -615,23 +688,31 @@ class Payment {
615
688
  if (res_error) {
616
689
  Logger({
617
690
  level: "WARN",
618
- message: "Response Validation Warnnings for checkCredit",
691
+ message: `Response Validation Warnnings for application > Payment > checkCredit \n ${res_error}`,
619
692
  });
620
- Logger({ level: "WARN", message: res_error });
621
693
  }
622
694
 
623
695
  return response;
624
696
  }
625
697
 
626
698
  /**
627
- * @param {Object} arg - Arg object.
628
- * @param {CreateOrderUserRequest} arg.body
629
- * @returns {Promise<CreateOrderUserResponse>} - Success response
699
+ * @param {PaymentApplicationValidator.CreateOrderHandlerPaymentLinkParam} arg
700
+ * - Arg object.
701
+ *
702
+ * @param {import("../ApplicationAPIClient").Options} - Options
703
+ * @returns {Promise<PaymentApplicationModel.CreateOrderUserResponse>} -
704
+ * Success response
705
+ * @name createOrderHandlerPaymentLink
630
706
  * @summary: Create Order user
631
- * @description: Use this API to create a order and payment on aggregator side
707
+ * @description: Use this API to create a order and payment on aggregator side - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/createOrderHandlerPaymentLink/).
632
708
  */
633
- async createOrderHandlerPaymentLink({ body } = {}) {
634
- const { error } = PaymentValidator.createOrderHandlerPaymentLink().validate(
709
+ async createOrderHandlerPaymentLink(
710
+ { body } = {},
711
+ { headers } = { headers: false }
712
+ ) {
713
+ const {
714
+ error,
715
+ } = PaymentApplicationValidator.createOrderHandlerPaymentLink().validate(
635
716
  { body },
636
717
  { abortEarly: false, allowUnknown: true }
637
718
  );
@@ -642,17 +723,15 @@ class Payment {
642
723
  // Showing warrnings if extra unknown parameters are found
643
724
  const {
644
725
  error: warrning,
645
- } = PaymentValidator.createOrderHandlerPaymentLink().validate(
726
+ } = PaymentApplicationValidator.createOrderHandlerPaymentLink().validate(
646
727
  { body },
647
728
  { abortEarly: false, allowUnknown: false }
648
729
  );
649
730
  if (warrning) {
650
731
  Logger({
651
732
  level: "WARN",
652
- message:
653
- "Parameter Validation warrnings for createOrderHandlerPaymentLink",
733
+ message: `Parameter Validation warrnings for application > Payment > createOrderHandlerPaymentLink \n ${warrning}`,
654
734
  });
655
- Logger({ level: "WARN", message: warrning });
656
735
  }
657
736
 
658
737
  const query_params = {};
@@ -668,37 +747,43 @@ class Payment {
668
747
  }),
669
748
  query_params,
670
749
  body,
671
- xHeaders
750
+ xHeaders,
751
+ { headers }
672
752
  );
673
753
 
754
+ let responseData = response;
755
+ if (headers) {
756
+ responseData = response[0];
757
+ }
758
+
674
759
  const {
675
760
  error: res_error,
676
- } = PaymentModel.CreateOrderUserResponse().validate(response, {
677
- abortEarly: false,
678
- allowUnknown: false,
679
- });
761
+ } = PaymentApplicationModel.CreateOrderUserResponse().validate(
762
+ responseData,
763
+ { abortEarly: false, allowUnknown: false }
764
+ );
680
765
 
681
766
  if (res_error) {
682
767
  Logger({
683
768
  level: "WARN",
684
- message:
685
- "Response Validation Warnnings for createOrderHandlerPaymentLink",
769
+ message: `Response Validation Warnnings for application > Payment > createOrderHandlerPaymentLink \n ${res_error}`,
686
770
  });
687
- Logger({ level: "WARN", message: res_error });
688
771
  }
689
772
 
690
773
  return response;
691
774
  }
692
775
 
693
776
  /**
694
- * @param {Object} arg - Arg object.
695
- * @param {CreatePaymentLinkRequest} arg.body
696
- * @returns {Promise<CreatePaymentLinkResponse>} - Success response
777
+ * @param {PaymentApplicationValidator.CreatePaymentLinkParam} arg - Arg object.
778
+ * @param {import("../ApplicationAPIClient").Options} - Options
779
+ * @returns {Promise<PaymentApplicationModel.CreatePaymentLinkResponse>} -
780
+ * Success response
781
+ * @name createPaymentLink
697
782
  * @summary: Create payment link
698
- * @description: Use this API to create a payment link for the customer
783
+ * @description: Use this API to create a payment link for the customer - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/createPaymentLink/).
699
784
  */
700
- async createPaymentLink({ body } = {}) {
701
- const { error } = PaymentValidator.createPaymentLink().validate(
785
+ async createPaymentLink({ body } = {}, { headers } = { headers: false }) {
786
+ const { error } = PaymentApplicationValidator.createPaymentLink().validate(
702
787
  { body },
703
788
  { abortEarly: false, allowUnknown: true }
704
789
  );
@@ -707,16 +792,17 @@ class Payment {
707
792
  }
708
793
 
709
794
  // Showing warrnings if extra unknown parameters are found
710
- const { error: warrning } = PaymentValidator.createPaymentLink().validate(
795
+ const {
796
+ error: warrning,
797
+ } = PaymentApplicationValidator.createPaymentLink().validate(
711
798
  { body },
712
799
  { abortEarly: false, allowUnknown: false }
713
800
  );
714
801
  if (warrning) {
715
802
  Logger({
716
803
  level: "WARN",
717
- message: "Parameter Validation warrnings for createPaymentLink",
804
+ message: `Parameter Validation warrnings for application > Payment > createPaymentLink \n ${warrning}`,
718
805
  });
719
- Logger({ level: "WARN", message: warrning });
720
806
  }
721
807
 
722
808
  const query_params = {};
@@ -732,36 +818,49 @@ class Payment {
732
818
  }),
733
819
  query_params,
734
820
  body,
735
- xHeaders
821
+ xHeaders,
822
+ { headers }
736
823
  );
737
824
 
825
+ let responseData = response;
826
+ if (headers) {
827
+ responseData = response[0];
828
+ }
829
+
738
830
  const {
739
831
  error: res_error,
740
- } = PaymentModel.CreatePaymentLinkResponse().validate(response, {
741
- abortEarly: false,
742
- allowUnknown: false,
743
- });
832
+ } = PaymentApplicationModel.CreatePaymentLinkResponse().validate(
833
+ responseData,
834
+ { abortEarly: false, allowUnknown: false }
835
+ );
744
836
 
745
837
  if (res_error) {
746
838
  Logger({
747
839
  level: "WARN",
748
- message: "Response Validation Warnnings for createPaymentLink",
840
+ message: `Response Validation Warnnings for application > Payment > createPaymentLink \n ${res_error}`,
749
841
  });
750
- Logger({ level: "WARN", message: res_error });
751
842
  }
752
843
 
753
844
  return response;
754
845
  }
755
846
 
756
847
  /**
757
- * @param {Object} arg - Arg object.
758
- * @param {string} [arg.aggregator] -
759
- * @returns {Promise<CustomerCreditSummaryResponse>} - Success response
848
+ * @param {PaymentApplicationValidator.CustomerCreditSummaryParam} arg - Arg object.
849
+ * @param {import("../ApplicationAPIClient").Options} - Options
850
+ * @returns {Promise<PaymentApplicationModel.CustomerCreditSummaryResponse>}
851
+ * - Success response
852
+ *
853
+ * @name customerCreditSummary
760
854
  * @summary: API to fetch the customer credit summary
761
- * @description: Use this API to fetch the customer credit summary.
855
+ * @description: Use this API to fetch the customer credit summary. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/customerCreditSummary/).
762
856
  */
763
- async customerCreditSummary({ aggregator } = {}) {
764
- const { error } = PaymentValidator.customerCreditSummary().validate(
857
+ async customerCreditSummary(
858
+ { aggregator } = {},
859
+ { headers } = { headers: false }
860
+ ) {
861
+ const {
862
+ error,
863
+ } = PaymentApplicationValidator.customerCreditSummary().validate(
765
864
  { aggregator },
766
865
  { abortEarly: false, allowUnknown: true }
767
866
  );
@@ -772,16 +871,15 @@ class Payment {
772
871
  // Showing warrnings if extra unknown parameters are found
773
872
  const {
774
873
  error: warrning,
775
- } = PaymentValidator.customerCreditSummary().validate(
874
+ } = PaymentApplicationValidator.customerCreditSummary().validate(
776
875
  { aggregator },
777
876
  { abortEarly: false, allowUnknown: false }
778
877
  );
779
878
  if (warrning) {
780
879
  Logger({
781
880
  level: "WARN",
782
- message: "Parameter Validation warrnings for customerCreditSummary",
881
+ message: `Parameter Validation warrnings for application > Payment > customerCreditSummary \n ${warrning}`,
783
882
  });
784
- Logger({ level: "WARN", message: warrning });
785
883
  }
786
884
 
787
885
  const query_params = {};
@@ -798,36 +896,43 @@ class Payment {
798
896
  }),
799
897
  query_params,
800
898
  undefined,
801
- xHeaders
899
+ xHeaders,
900
+ { headers }
802
901
  );
803
902
 
903
+ let responseData = response;
904
+ if (headers) {
905
+ responseData = response[0];
906
+ }
907
+
804
908
  const {
805
909
  error: res_error,
806
- } = PaymentModel.CustomerCreditSummaryResponse().validate(response, {
807
- abortEarly: false,
808
- allowUnknown: false,
809
- });
910
+ } = PaymentApplicationModel.CustomerCreditSummaryResponse().validate(
911
+ responseData,
912
+ { abortEarly: false, allowUnknown: false }
913
+ );
810
914
 
811
915
  if (res_error) {
812
916
  Logger({
813
917
  level: "WARN",
814
- message: "Response Validation Warnnings for customerCreditSummary",
918
+ message: `Response Validation Warnnings for application > Payment > customerCreditSummary \n ${res_error}`,
815
919
  });
816
- Logger({ level: "WARN", message: res_error });
817
920
  }
818
921
 
819
922
  return response;
820
923
  }
821
924
 
822
925
  /**
823
- * @param {Object} arg - Arg object.
824
- * @param {CustomerOnboardingRequest} arg.body
825
- * @returns {Promise<CustomerOnboardingResponse>} - Success response
926
+ * @param {PaymentApplicationValidator.CustomerOnboardParam} arg - Arg object.
927
+ * @param {import("../ApplicationAPIClient").Options} - Options
928
+ * @returns {Promise<PaymentApplicationModel.CustomerOnboardingResponse>} -
929
+ * Success response
930
+ * @name customerOnboard
826
931
  * @summary: API to fetch the customer credit summary
827
- * @description: Use this API to fetch the customer credit summary.
932
+ * @description: Use this API to fetch the customer credit summary. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/customerOnboard/).
828
933
  */
829
- async customerOnboard({ body } = {}) {
830
- const { error } = PaymentValidator.customerOnboard().validate(
934
+ async customerOnboard({ body } = {}, { headers } = { headers: false }) {
935
+ const { error } = PaymentApplicationValidator.customerOnboard().validate(
831
936
  { body },
832
937
  { abortEarly: false, allowUnknown: true }
833
938
  );
@@ -836,16 +941,17 @@ class Payment {
836
941
  }
837
942
 
838
943
  // Showing warrnings if extra unknown parameters are found
839
- const { error: warrning } = PaymentValidator.customerOnboard().validate(
944
+ const {
945
+ error: warrning,
946
+ } = PaymentApplicationValidator.customerOnboard().validate(
840
947
  { body },
841
948
  { abortEarly: false, allowUnknown: false }
842
949
  );
843
950
  if (warrning) {
844
951
  Logger({
845
952
  level: "WARN",
846
- message: "Parameter Validation warrnings for customerOnboard",
953
+ message: `Parameter Validation warrnings for application > Payment > customerOnboard \n ${warrning}`,
847
954
  });
848
- Logger({ level: "WARN", message: warrning });
849
955
  }
850
956
 
851
957
  const query_params = {};
@@ -861,36 +967,42 @@ class Payment {
861
967
  }),
862
968
  query_params,
863
969
  body,
864
- xHeaders
970
+ xHeaders,
971
+ { headers }
865
972
  );
866
973
 
974
+ let responseData = response;
975
+ if (headers) {
976
+ responseData = response[0];
977
+ }
978
+
867
979
  const {
868
980
  error: res_error,
869
- } = PaymentModel.CustomerOnboardingResponse().validate(response, {
870
- abortEarly: false,
871
- allowUnknown: false,
872
- });
981
+ } = PaymentApplicationModel.CustomerOnboardingResponse().validate(
982
+ responseData,
983
+ { abortEarly: false, allowUnknown: false }
984
+ );
873
985
 
874
986
  if (res_error) {
875
987
  Logger({
876
988
  level: "WARN",
877
- message: "Response Validation Warnnings for customerOnboard",
989
+ message: `Response Validation Warnnings for application > Payment > customerOnboard \n ${res_error}`,
878
990
  });
879
- Logger({ level: "WARN", message: res_error });
880
991
  }
881
992
 
882
993
  return response;
883
994
  }
884
995
 
885
996
  /**
886
- * @param {Object} arg - Arg object.
887
- * @param {DeletehCardRequest} arg.body
888
- * @returns {Promise<DeleteCardsResponse>} - Success response
997
+ * @param {PaymentApplicationValidator.DeleteUserCardParam} arg - Arg object.
998
+ * @param {import("../ApplicationAPIClient").Options} - Options
999
+ * @returns {Promise<PaymentApplicationModel.DeleteCardsResponse>} - Success response
1000
+ * @name deleteUserCard
889
1001
  * @summary: Delete a card
890
- * @description: Use this API to delete a card added by a user on the payment gateway and clear the cache.
1002
+ * @description: Use this API to delete a card added by a user on the payment gateway and clear the cache. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/deleteUserCard/).
891
1003
  */
892
- async deleteUserCard({ body } = {}) {
893
- const { error } = PaymentValidator.deleteUserCard().validate(
1004
+ async deleteUserCard({ body } = {}, { headers } = { headers: false }) {
1005
+ const { error } = PaymentApplicationValidator.deleteUserCard().validate(
894
1006
  { body },
895
1007
  { abortEarly: false, allowUnknown: true }
896
1008
  );
@@ -899,16 +1011,17 @@ class Payment {
899
1011
  }
900
1012
 
901
1013
  // Showing warrnings if extra unknown parameters are found
902
- const { error: warrning } = PaymentValidator.deleteUserCard().validate(
1014
+ const {
1015
+ error: warrning,
1016
+ } = PaymentApplicationValidator.deleteUserCard().validate(
903
1017
  { body },
904
1018
  { abortEarly: false, allowUnknown: false }
905
1019
  );
906
1020
  if (warrning) {
907
1021
  Logger({
908
1022
  level: "WARN",
909
- message: "Parameter Validation warrnings for deleteUserCard",
1023
+ message: `Parameter Validation warrnings for application > Payment > deleteUserCard \n ${warrning}`,
910
1024
  });
911
- Logger({ level: "WARN", message: warrning });
912
1025
  }
913
1026
 
914
1027
  const query_params = {};
@@ -924,12 +1037,18 @@ class Payment {
924
1037
  }),
925
1038
  query_params,
926
1039
  body,
927
- xHeaders
1040
+ xHeaders,
1041
+ { headers }
928
1042
  );
929
1043
 
1044
+ let responseData = response;
1045
+ if (headers) {
1046
+ responseData = response[0];
1047
+ }
1048
+
930
1049
  const {
931
1050
  error: res_error,
932
- } = PaymentModel.DeleteCardsResponse().validate(response, {
1051
+ } = PaymentApplicationModel.DeleteCardsResponse().validate(responseData, {
933
1052
  abortEarly: false,
934
1053
  allowUnknown: false,
935
1054
  });
@@ -937,25 +1056,32 @@ class Payment {
937
1056
  if (res_error) {
938
1057
  Logger({
939
1058
  level: "WARN",
940
- message: "Response Validation Warnnings for deleteUserCard",
1059
+ message: `Response Validation Warnnings for application > Payment > deleteUserCard \n ${res_error}`,
941
1060
  });
942
- Logger({ level: "WARN", message: res_error });
943
1061
  }
944
1062
 
945
1063
  return response;
946
1064
  }
947
1065
 
948
1066
  /**
949
- * @param {Object} arg - Arg object.
950
- * @param {UpdateRefundTransferModeRequest} arg.body
951
- * @returns {Promise<UpdateRefundTransferModeResponse>} - Success response
1067
+ * @param {PaymentApplicationValidator.EnableOrDisableRefundTransferModeParam} arg
1068
+ * - Arg object.
1069
+ *
1070
+ * @param {import("../ApplicationAPIClient").Options} - Options
1071
+ * @returns {Promise<PaymentApplicationModel.UpdateRefundTransferModeResponse>}
1072
+ * - Success response
1073
+ *
1074
+ * @name enableOrDisableRefundTransferMode
952
1075
  * @summary: Enable/Disable a mode for transferring a refund
953
- * @description: Activate or Deactivate Transfer Mode to collect Beneficiary Details for Refund
1076
+ * @description: Activate or Deactivate Transfer Mode to collect Beneficiary Details for Refund - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/enableOrDisableRefundTransferMode/).
954
1077
  */
955
- async enableOrDisableRefundTransferMode({ body } = {}) {
1078
+ async enableOrDisableRefundTransferMode(
1079
+ { body } = {},
1080
+ { headers } = { headers: false }
1081
+ ) {
956
1082
  const {
957
1083
  error,
958
- } = PaymentValidator.enableOrDisableRefundTransferMode().validate(
1084
+ } = PaymentApplicationValidator.enableOrDisableRefundTransferMode().validate(
959
1085
  { body },
960
1086
  { abortEarly: false, allowUnknown: true }
961
1087
  );
@@ -966,17 +1092,15 @@ class Payment {
966
1092
  // Showing warrnings if extra unknown parameters are found
967
1093
  const {
968
1094
  error: warrning,
969
- } = PaymentValidator.enableOrDisableRefundTransferMode().validate(
1095
+ } = PaymentApplicationValidator.enableOrDisableRefundTransferMode().validate(
970
1096
  { body },
971
1097
  { abortEarly: false, allowUnknown: false }
972
1098
  );
973
1099
  if (warrning) {
974
1100
  Logger({
975
1101
  level: "WARN",
976
- message:
977
- "Parameter Validation warrnings for enableOrDisableRefundTransferMode",
1102
+ message: `Parameter Validation warrnings for application > Payment > enableOrDisableRefundTransferMode \n ${warrning}`,
978
1103
  });
979
- Logger({ level: "WARN", message: warrning });
980
1104
  }
981
1105
 
982
1106
  const query_params = {};
@@ -992,37 +1116,49 @@ class Payment {
992
1116
  }),
993
1117
  query_params,
994
1118
  body,
995
- xHeaders
1119
+ xHeaders,
1120
+ { headers }
996
1121
  );
997
1122
 
1123
+ let responseData = response;
1124
+ if (headers) {
1125
+ responseData = response[0];
1126
+ }
1127
+
998
1128
  const {
999
1129
  error: res_error,
1000
- } = PaymentModel.UpdateRefundTransferModeResponse().validate(response, {
1001
- abortEarly: false,
1002
- allowUnknown: false,
1003
- });
1130
+ } = PaymentApplicationModel.UpdateRefundTransferModeResponse().validate(
1131
+ responseData,
1132
+ { abortEarly: false, allowUnknown: false }
1133
+ );
1004
1134
 
1005
1135
  if (res_error) {
1006
1136
  Logger({
1007
1137
  level: "WARN",
1008
- message:
1009
- "Response Validation Warnnings for enableOrDisableRefundTransferMode",
1138
+ message: `Response Validation Warnnings for application > Payment > enableOrDisableRefundTransferMode \n ${res_error}`,
1010
1139
  });
1011
- Logger({ level: "WARN", message: res_error });
1012
1140
  }
1013
1141
 
1014
1142
  return response;
1015
1143
  }
1016
1144
 
1017
1145
  /**
1018
- * @param {Object} arg - Arg object.
1019
- * @param {boolean} [arg.refresh] -
1020
- * @returns {Promise<ActiveCardPaymentGatewayResponse>} - Success response
1146
+ * @param {PaymentApplicationValidator.GetActiveCardAggregatorParam} arg - Arg object.
1147
+ * @param {import("../ApplicationAPIClient").Options} - Options
1148
+ * @returns {Promise<PaymentApplicationModel.ActiveCardPaymentGatewayResponse>}
1149
+ * - Success response
1150
+ *
1151
+ * @name getActiveCardAggregator
1021
1152
  * @summary: Fetch active payment gateway for card payments
1022
- * @description: Use this API to retrieve an active payment aggregator along with the Customer ID. This is applicable for cards payments only.
1153
+ * @description: Use this API to retrieve an active payment aggregator along with the Customer ID. This is applicable for cards payments only. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/getActiveCardAggregator/).
1023
1154
  */
1024
- async getActiveCardAggregator({ refresh } = {}) {
1025
- const { error } = PaymentValidator.getActiveCardAggregator().validate(
1155
+ async getActiveCardAggregator(
1156
+ { refresh } = {},
1157
+ { headers } = { headers: false }
1158
+ ) {
1159
+ const {
1160
+ error,
1161
+ } = PaymentApplicationValidator.getActiveCardAggregator().validate(
1026
1162
  { refresh },
1027
1163
  { abortEarly: false, allowUnknown: true }
1028
1164
  );
@@ -1033,16 +1169,15 @@ class Payment {
1033
1169
  // Showing warrnings if extra unknown parameters are found
1034
1170
  const {
1035
1171
  error: warrning,
1036
- } = PaymentValidator.getActiveCardAggregator().validate(
1172
+ } = PaymentApplicationValidator.getActiveCardAggregator().validate(
1037
1173
  { refresh },
1038
1174
  { abortEarly: false, allowUnknown: false }
1039
1175
  );
1040
1176
  if (warrning) {
1041
1177
  Logger({
1042
1178
  level: "WARN",
1043
- message: "Parameter Validation warrnings for getActiveCardAggregator",
1179
+ message: `Parameter Validation warrnings for application > Payment > getActiveCardAggregator \n ${warrning}`,
1044
1180
  });
1045
- Logger({ level: "WARN", message: warrning });
1046
1181
  }
1047
1182
 
1048
1183
  const query_params = {};
@@ -1059,35 +1194,43 @@ class Payment {
1059
1194
  }),
1060
1195
  query_params,
1061
1196
  undefined,
1062
- xHeaders
1197
+ xHeaders,
1198
+ { headers }
1063
1199
  );
1064
1200
 
1201
+ let responseData = response;
1202
+ if (headers) {
1203
+ responseData = response[0];
1204
+ }
1205
+
1065
1206
  const {
1066
1207
  error: res_error,
1067
- } = PaymentModel.ActiveCardPaymentGatewayResponse().validate(response, {
1068
- abortEarly: false,
1069
- allowUnknown: false,
1070
- });
1208
+ } = PaymentApplicationModel.ActiveCardPaymentGatewayResponse().validate(
1209
+ responseData,
1210
+ { abortEarly: false, allowUnknown: false }
1211
+ );
1071
1212
 
1072
1213
  if (res_error) {
1073
1214
  Logger({
1074
1215
  level: "WARN",
1075
- message: "Response Validation Warnnings for getActiveCardAggregator",
1216
+ message: `Response Validation Warnnings for application > Payment > getActiveCardAggregator \n ${res_error}`,
1076
1217
  });
1077
- Logger({ level: "WARN", message: res_error });
1078
1218
  }
1079
1219
 
1080
1220
  return response;
1081
1221
  }
1082
1222
 
1083
1223
  /**
1084
- * @param {Object} arg - Arg object.
1085
- * @returns {Promise<TransferModeResponse>} - Success response
1224
+ * @param {import("../ApplicationAPIClient").Options} - Options
1225
+ * @returns {Promise<PaymentApplicationModel.TransferModeResponse>} - Success response
1226
+ * @name getActiveRefundTransferModes
1086
1227
  * @summary: Lists the mode of refund
1087
- * @description: Use this API to retrieve eligible refund modes (such as Netbanking) and add the beneficiary details.
1228
+ * @description: Use this API to retrieve eligible refund modes (such as Netbanking) and add the beneficiary details. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/getActiveRefundTransferModes/).
1088
1229
  */
1089
- async getActiveRefundTransferModes({} = {}) {
1090
- const { error } = PaymentValidator.getActiveRefundTransferModes().validate(
1230
+ async getActiveRefundTransferModes({ headers } = { headers: false }) {
1231
+ const {
1232
+ error,
1233
+ } = PaymentApplicationValidator.getActiveRefundTransferModes().validate(
1091
1234
  {},
1092
1235
  { abortEarly: false, allowUnknown: true }
1093
1236
  );
@@ -1098,17 +1241,15 @@ class Payment {
1098
1241
  // Showing warrnings if extra unknown parameters are found
1099
1242
  const {
1100
1243
  error: warrning,
1101
- } = PaymentValidator.getActiveRefundTransferModes().validate(
1244
+ } = PaymentApplicationValidator.getActiveRefundTransferModes().validate(
1102
1245
  {},
1103
1246
  { abortEarly: false, allowUnknown: false }
1104
1247
  );
1105
1248
  if (warrning) {
1106
1249
  Logger({
1107
1250
  level: "WARN",
1108
- message:
1109
- "Parameter Validation warrnings for getActiveRefundTransferModes",
1251
+ message: `Parameter Validation warrnings for application > Payment > getActiveRefundTransferModes \n ${warrning}`,
1110
1252
  });
1111
- Logger({ level: "WARN", message: warrning });
1112
1253
  }
1113
1254
 
1114
1255
  const query_params = {};
@@ -1124,12 +1265,18 @@ class Payment {
1124
1265
  }),
1125
1266
  query_params,
1126
1267
  undefined,
1127
- xHeaders
1268
+ xHeaders,
1269
+ { headers }
1128
1270
  );
1129
1271
 
1272
+ let responseData = response;
1273
+ if (headers) {
1274
+ responseData = response[0];
1275
+ }
1276
+
1130
1277
  const {
1131
1278
  error: res_error,
1132
- } = PaymentModel.TransferModeResponse().validate(response, {
1279
+ } = PaymentApplicationModel.TransferModeResponse().validate(responseData, {
1133
1280
  abortEarly: false,
1134
1281
  allowUnknown: false,
1135
1282
  });
@@ -1137,24 +1284,26 @@ class Payment {
1137
1284
  if (res_error) {
1138
1285
  Logger({
1139
1286
  level: "WARN",
1140
- message:
1141
- "Response Validation Warnnings for getActiveRefundTransferModes",
1287
+ message: `Response Validation Warnnings for application > Payment > getActiveRefundTransferModes \n ${res_error}`,
1142
1288
  });
1143
- Logger({ level: "WARN", message: res_error });
1144
1289
  }
1145
1290
 
1146
1291
  return response;
1147
1292
  }
1148
1293
 
1149
1294
  /**
1150
- * @param {Object} arg - Arg object.
1151
- * @param {boolean} [arg.forceRefresh] -
1152
- * @returns {Promise<ListCardsResponse>} - Success response
1295
+ * @param {PaymentApplicationValidator.GetActiveUserCardsParam} arg - Arg object.
1296
+ * @param {import("../ApplicationAPIClient").Options} - Options
1297
+ * @returns {Promise<PaymentApplicationModel.ListCardsResponse>} - Success response
1298
+ * @name getActiveUserCards
1153
1299
  * @summary: Fetch the list of cards saved by the user
1154
- * @description: Use this API to retrieve a list of cards stored by user from an active payment gateway.
1300
+ * @description: Use this API to retrieve a list of cards stored by user from an active payment gateway. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/getActiveUserCards/).
1155
1301
  */
1156
- async getActiveUserCards({ forceRefresh } = {}) {
1157
- const { error } = PaymentValidator.getActiveUserCards().validate(
1302
+ async getActiveUserCards(
1303
+ { forceRefresh } = {},
1304
+ { headers } = { headers: false }
1305
+ ) {
1306
+ const { error } = PaymentApplicationValidator.getActiveUserCards().validate(
1158
1307
  { forceRefresh },
1159
1308
  { abortEarly: false, allowUnknown: true }
1160
1309
  );
@@ -1163,16 +1312,17 @@ class Payment {
1163
1312
  }
1164
1313
 
1165
1314
  // Showing warrnings if extra unknown parameters are found
1166
- const { error: warrning } = PaymentValidator.getActiveUserCards().validate(
1315
+ const {
1316
+ error: warrning,
1317
+ } = PaymentApplicationValidator.getActiveUserCards().validate(
1167
1318
  { forceRefresh },
1168
1319
  { abortEarly: false, allowUnknown: false }
1169
1320
  );
1170
1321
  if (warrning) {
1171
1322
  Logger({
1172
1323
  level: "WARN",
1173
- message: "Parameter Validation warrnings for getActiveUserCards",
1324
+ message: `Parameter Validation warrnings for application > Payment > getActiveUserCards \n ${warrning}`,
1174
1325
  });
1175
- Logger({ level: "WARN", message: warrning });
1176
1326
  }
1177
1327
 
1178
1328
  const query_params = {};
@@ -1189,12 +1339,18 @@ class Payment {
1189
1339
  }),
1190
1340
  query_params,
1191
1341
  undefined,
1192
- xHeaders
1342
+ xHeaders,
1343
+ { headers }
1193
1344
  );
1194
1345
 
1346
+ let responseData = response;
1347
+ if (headers) {
1348
+ responseData = response[0];
1349
+ }
1350
+
1195
1351
  const {
1196
1352
  error: res_error,
1197
- } = PaymentModel.ListCardsResponse().validate(response, {
1353
+ } = PaymentApplicationModel.ListCardsResponse().validate(responseData, {
1198
1354
  abortEarly: false,
1199
1355
  allowUnknown: false,
1200
1356
  });
@@ -1202,26 +1358,30 @@ class Payment {
1202
1358
  if (res_error) {
1203
1359
  Logger({
1204
1360
  level: "WARN",
1205
- message: "Response Validation Warnnings for getActiveUserCards",
1361
+ message: `Response Validation Warnnings for application > Payment > getActiveUserCards \n ${res_error}`,
1206
1362
  });
1207
- Logger({ level: "WARN", message: res_error });
1208
1363
  }
1209
1364
 
1210
1365
  return response;
1211
1366
  }
1212
1367
 
1213
1368
  /**
1214
- * @param {Object} arg - Arg object.
1215
- * @param {string} [arg.xApiToken] - Used for basic authentication.
1216
- * @param {boolean} [arg.refresh] - This is a boolean value. Select `true`
1217
- * to remove temporary cache files on payment gateway and replace with the
1218
- * latest one.
1219
- * @returns {Promise<AggregatorsConfigDetailResponse>} - Success response
1369
+ * @param {PaymentApplicationValidator.GetAggregatorsConfigParam} arg - Arg object.
1370
+ * @param {import("../ApplicationAPIClient").Options} - Options
1371
+ * @returns {Promise<PaymentApplicationModel.AggregatorsConfigDetailResponse>}
1372
+ * - Success response
1373
+ *
1374
+ * @name getAggregatorsConfig
1220
1375
  * @summary: Get payment gateway keys
1221
- * @description: Use this API to retrieve the payment gateway key, secrets, merchant, SDK/API details to complete a payment at front-end.
1376
+ * @description: Use this API to retrieve the payment gateway key, secrets, merchant, SDK/API details to complete a payment at front-end. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/getAggregatorsConfig/).
1222
1377
  */
1223
- async getAggregatorsConfig({ xApiToken, refresh } = {}) {
1224
- const { error } = PaymentValidator.getAggregatorsConfig().validate(
1378
+ async getAggregatorsConfig(
1379
+ { xApiToken, refresh } = {},
1380
+ { headers } = { headers: false }
1381
+ ) {
1382
+ const {
1383
+ error,
1384
+ } = PaymentApplicationValidator.getAggregatorsConfig().validate(
1225
1385
  { xApiToken, refresh },
1226
1386
  { abortEarly: false, allowUnknown: true }
1227
1387
  );
@@ -1232,16 +1392,15 @@ class Payment {
1232
1392
  // Showing warrnings if extra unknown parameters are found
1233
1393
  const {
1234
1394
  error: warrning,
1235
- } = PaymentValidator.getAggregatorsConfig().validate(
1395
+ } = PaymentApplicationValidator.getAggregatorsConfig().validate(
1236
1396
  { xApiToken, refresh },
1237
1397
  { abortEarly: false, allowUnknown: false }
1238
1398
  );
1239
1399
  if (warrning) {
1240
1400
  Logger({
1241
1401
  level: "WARN",
1242
- message: "Parameter Validation warrnings for getAggregatorsConfig",
1402
+ message: `Parameter Validation warrnings for application > Payment > getAggregatorsConfig \n ${warrning}`,
1243
1403
  });
1244
- Logger({ level: "WARN", message: warrning });
1245
1404
  }
1246
1405
 
1247
1406
  const query_params = {};
@@ -1259,35 +1418,44 @@ class Payment {
1259
1418
  }),
1260
1419
  query_params,
1261
1420
  undefined,
1262
- xHeaders
1421
+ xHeaders,
1422
+ { headers }
1263
1423
  );
1264
1424
 
1425
+ let responseData = response;
1426
+ if (headers) {
1427
+ responseData = response[0];
1428
+ }
1429
+
1265
1430
  const {
1266
1431
  error: res_error,
1267
- } = PaymentModel.AggregatorsConfigDetailResponse().validate(response, {
1268
- abortEarly: false,
1269
- allowUnknown: false,
1270
- });
1432
+ } = PaymentApplicationModel.AggregatorsConfigDetailResponse().validate(
1433
+ responseData,
1434
+ { abortEarly: false, allowUnknown: false }
1435
+ );
1271
1436
 
1272
1437
  if (res_error) {
1273
1438
  Logger({
1274
1439
  level: "WARN",
1275
- message: "Response Validation Warnnings for getAggregatorsConfig",
1440
+ message: `Response Validation Warnnings for application > Payment > getAggregatorsConfig \n ${res_error}`,
1276
1441
  });
1277
- Logger({ level: "WARN", message: res_error });
1278
1442
  }
1279
1443
 
1280
1444
  return response;
1281
1445
  }
1282
1446
 
1283
1447
  /**
1284
- * @param {Object} arg - Arg object.
1285
- * @returns {Promise<EpaylaterBannerResponse>} - Success response
1448
+ * @param {import("../ApplicationAPIClient").Options} - Options
1449
+ * @returns {Promise<PaymentApplicationModel.EpaylaterBannerResponse>} -
1450
+ * Success response
1451
+ * @name getEpaylaterBannerDetails
1286
1452
  * @summary: Get Epaylater Enabled
1287
- * @description: Get Epaylater Enabled if user is tentatively approved by epaylater
1453
+ * @description: Get Epaylater Enabled if user is tentatively approved by epaylater - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/getEpaylaterBannerDetails/).
1288
1454
  */
1289
- async getEpaylaterBannerDetails({} = {}) {
1290
- const { error } = PaymentValidator.getEpaylaterBannerDetails().validate(
1455
+ async getEpaylaterBannerDetails({ headers } = { headers: false }) {
1456
+ const {
1457
+ error,
1458
+ } = PaymentApplicationValidator.getEpaylaterBannerDetails().validate(
1291
1459
  {},
1292
1460
  { abortEarly: false, allowUnknown: true }
1293
1461
  );
@@ -1298,16 +1466,15 @@ class Payment {
1298
1466
  // Showing warrnings if extra unknown parameters are found
1299
1467
  const {
1300
1468
  error: warrning,
1301
- } = PaymentValidator.getEpaylaterBannerDetails().validate(
1469
+ } = PaymentApplicationValidator.getEpaylaterBannerDetails().validate(
1302
1470
  {},
1303
1471
  { abortEarly: false, allowUnknown: false }
1304
1472
  );
1305
1473
  if (warrning) {
1306
1474
  Logger({
1307
1475
  level: "WARN",
1308
- message: "Parameter Validation warrnings for getEpaylaterBannerDetails",
1476
+ message: `Parameter Validation warrnings for application > Payment > getEpaylaterBannerDetails \n ${warrning}`,
1309
1477
  });
1310
- Logger({ level: "WARN", message: warrning });
1311
1478
  }
1312
1479
 
1313
1480
  const query_params = {};
@@ -1323,37 +1490,50 @@ class Payment {
1323
1490
  }),
1324
1491
  query_params,
1325
1492
  undefined,
1326
- xHeaders
1493
+ xHeaders,
1494
+ { headers }
1327
1495
  );
1328
1496
 
1497
+ let responseData = response;
1498
+ if (headers) {
1499
+ responseData = response[0];
1500
+ }
1501
+
1329
1502
  const {
1330
1503
  error: res_error,
1331
- } = PaymentModel.EpaylaterBannerResponse().validate(response, {
1332
- abortEarly: false,
1333
- allowUnknown: false,
1334
- });
1504
+ } = PaymentApplicationModel.EpaylaterBannerResponse().validate(
1505
+ responseData,
1506
+ { abortEarly: false, allowUnknown: false }
1507
+ );
1335
1508
 
1336
1509
  if (res_error) {
1337
1510
  Logger({
1338
1511
  level: "WARN",
1339
- message: "Response Validation Warnnings for getEpaylaterBannerDetails",
1512
+ message: `Response Validation Warnnings for application > Payment > getEpaylaterBannerDetails \n ${res_error}`,
1340
1513
  });
1341
- Logger({ level: "WARN", message: res_error });
1342
1514
  }
1343
1515
 
1344
1516
  return response;
1345
1517
  }
1346
1518
 
1347
1519
  /**
1348
- * @param {Object} arg - Arg object.
1349
- * @param {string} arg.orderId - A unique number used for identifying and
1350
- * tracking your orders.
1351
- * @returns {Promise<OrderBeneficiaryResponse>} - Success response
1520
+ * @param {PaymentApplicationValidator.GetOrderBeneficiariesDetailParam} arg
1521
+ * - Arg object.
1522
+ *
1523
+ * @param {import("../ApplicationAPIClient").Options} - Options
1524
+ * @returns {Promise<PaymentApplicationModel.OrderBeneficiaryResponse>} -
1525
+ * Success response
1526
+ * @name getOrderBeneficiariesDetail
1352
1527
  * @summary: Lists the beneficiary of a refund
1353
- * @description: Use this API to get the details of all active beneficiary added by a user for refund.
1528
+ * @description: Use this API to get the details of all active beneficiary added by a user for refund. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/getOrderBeneficiariesDetail/).
1354
1529
  */
1355
- async getOrderBeneficiariesDetail({ orderId } = {}) {
1356
- const { error } = PaymentValidator.getOrderBeneficiariesDetail().validate(
1530
+ async getOrderBeneficiariesDetail(
1531
+ { orderId } = {},
1532
+ { headers } = { headers: false }
1533
+ ) {
1534
+ const {
1535
+ error,
1536
+ } = PaymentApplicationValidator.getOrderBeneficiariesDetail().validate(
1357
1537
  { orderId },
1358
1538
  { abortEarly: false, allowUnknown: true }
1359
1539
  );
@@ -1364,17 +1544,15 @@ class Payment {
1364
1544
  // Showing warrnings if extra unknown parameters are found
1365
1545
  const {
1366
1546
  error: warrning,
1367
- } = PaymentValidator.getOrderBeneficiariesDetail().validate(
1547
+ } = PaymentApplicationValidator.getOrderBeneficiariesDetail().validate(
1368
1548
  { orderId },
1369
1549
  { abortEarly: false, allowUnknown: false }
1370
1550
  );
1371
1551
  if (warrning) {
1372
1552
  Logger({
1373
1553
  level: "WARN",
1374
- message:
1375
- "Parameter Validation warrnings for getOrderBeneficiariesDetail",
1554
+ message: `Parameter Validation warrnings for application > Payment > getOrderBeneficiariesDetail \n ${warrning}`,
1376
1555
  });
1377
- Logger({ level: "WARN", message: warrning });
1378
1556
  }
1379
1557
 
1380
1558
  const query_params = {};
@@ -1391,37 +1569,46 @@ class Payment {
1391
1569
  }),
1392
1570
  query_params,
1393
1571
  undefined,
1394
- xHeaders
1572
+ xHeaders,
1573
+ { headers }
1395
1574
  );
1396
1575
 
1576
+ let responseData = response;
1577
+ if (headers) {
1578
+ responseData = response[0];
1579
+ }
1580
+
1397
1581
  const {
1398
1582
  error: res_error,
1399
- } = PaymentModel.OrderBeneficiaryResponse().validate(response, {
1400
- abortEarly: false,
1401
- allowUnknown: false,
1402
- });
1583
+ } = PaymentApplicationModel.OrderBeneficiaryResponse().validate(
1584
+ responseData,
1585
+ { abortEarly: false, allowUnknown: false }
1586
+ );
1403
1587
 
1404
1588
  if (res_error) {
1405
1589
  Logger({
1406
1590
  level: "WARN",
1407
- message:
1408
- "Response Validation Warnnings for getOrderBeneficiariesDetail",
1591
+ message: `Response Validation Warnnings for application > Payment > getOrderBeneficiariesDetail \n ${res_error}`,
1409
1592
  });
1410
- Logger({ level: "WARN", message: res_error });
1411
1593
  }
1412
1594
 
1413
1595
  return response;
1414
1596
  }
1415
1597
 
1416
1598
  /**
1417
- * @param {Object} arg - Arg object.
1418
- * @param {string} [arg.paymentLinkId] -
1419
- * @returns {Promise<GetPaymentLinkResponse>} - Success response
1599
+ * @param {PaymentApplicationValidator.GetPaymentLinkParam} arg - Arg object.
1600
+ * @param {import("../ApplicationAPIClient").Options} - Options
1601
+ * @returns {Promise<PaymentApplicationModel.GetPaymentLinkResponse>} -
1602
+ * Success response
1603
+ * @name getPaymentLink
1420
1604
  * @summary: Get payment link
1421
- * @description: Use this API to get a payment link
1605
+ * @description: Use this API to get a payment link - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/getPaymentLink/).
1422
1606
  */
1423
- async getPaymentLink({ paymentLinkId } = {}) {
1424
- const { error } = PaymentValidator.getPaymentLink().validate(
1607
+ async getPaymentLink(
1608
+ { paymentLinkId } = {},
1609
+ { headers } = { headers: false }
1610
+ ) {
1611
+ const { error } = PaymentApplicationValidator.getPaymentLink().validate(
1425
1612
  { paymentLinkId },
1426
1613
  { abortEarly: false, allowUnknown: true }
1427
1614
  );
@@ -1430,16 +1617,17 @@ class Payment {
1430
1617
  }
1431
1618
 
1432
1619
  // Showing warrnings if extra unknown parameters are found
1433
- const { error: warrning } = PaymentValidator.getPaymentLink().validate(
1620
+ const {
1621
+ error: warrning,
1622
+ } = PaymentApplicationValidator.getPaymentLink().validate(
1434
1623
  { paymentLinkId },
1435
1624
  { abortEarly: false, allowUnknown: false }
1436
1625
  );
1437
1626
  if (warrning) {
1438
1627
  Logger({
1439
1628
  level: "WARN",
1440
- message: "Parameter Validation warrnings for getPaymentLink",
1629
+ message: `Parameter Validation warrnings for application > Payment > getPaymentLink \n ${warrning}`,
1441
1630
  });
1442
- Logger({ level: "WARN", message: warrning });
1443
1631
  }
1444
1632
 
1445
1633
  const query_params = {};
@@ -1456,54 +1644,56 @@ class Payment {
1456
1644
  }),
1457
1645
  query_params,
1458
1646
  undefined,
1459
- xHeaders
1647
+ xHeaders,
1648
+ { headers }
1460
1649
  );
1461
1650
 
1651
+ let responseData = response;
1652
+ if (headers) {
1653
+ responseData = response[0];
1654
+ }
1655
+
1462
1656
  const {
1463
1657
  error: res_error,
1464
- } = PaymentModel.GetPaymentLinkResponse().validate(response, {
1465
- abortEarly: false,
1466
- allowUnknown: false,
1467
- });
1658
+ } = PaymentApplicationModel.GetPaymentLinkResponse().validate(
1659
+ responseData,
1660
+ { abortEarly: false, allowUnknown: false }
1661
+ );
1468
1662
 
1469
1663
  if (res_error) {
1470
1664
  Logger({
1471
1665
  level: "WARN",
1472
- message: "Response Validation Warnnings for getPaymentLink",
1666
+ message: `Response Validation Warnnings for application > Payment > getPaymentLink \n ${res_error}`,
1473
1667
  });
1474
- Logger({ level: "WARN", message: res_error });
1475
1668
  }
1476
1669
 
1477
1670
  return response;
1478
1671
  }
1479
1672
 
1480
1673
  /**
1481
- * @param {Object} arg - Arg object.
1482
- * @param {number} arg.amount - Payable amount.
1483
- * @param {string} arg.cartId - Identifier of the cart.
1484
- * @param {string} arg.pincode - The PIN Code of the destination address, e.g. 400059
1485
- * @param {string} arg.checkoutMode - Option to checkout for self or for others.
1486
- * @param {boolean} [arg.refresh] - This is a boolean value. Select `true`
1487
- * to remove temporary cache files on payment gateway and replace with the
1488
- * latest one.
1489
- * @param {string} [arg.cardReference] - Card reference id of user's debit
1490
- * or credit card.
1491
- * @param {string} [arg.userDetails] - URIencoded JSON containing details of
1492
- * an anonymous user.
1493
- * @returns {Promise<PaymentModeRouteResponse>} - Success response
1674
+ * @param {PaymentApplicationValidator.GetPaymentModeRoutesParam} arg - Arg object.
1675
+ * @param {import("../ApplicationAPIClient").Options} - Options
1676
+ * @returns {Promise<PaymentApplicationModel.PaymentModeRouteResponse>} -
1677
+ * Success response
1678
+ * @name getPaymentModeRoutes
1494
1679
  * @summary: Get applicable payment options
1495
- * @description: Use this API to get all valid payment options for doing a payment.
1680
+ * @description: Use this API to get all valid payment options for doing a payment. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/getPaymentModeRoutes/).
1496
1681
  */
1497
- async getPaymentModeRoutes({
1498
- amount,
1499
- cartId,
1500
- pincode,
1501
- checkoutMode,
1502
- refresh,
1503
- cardReference,
1504
- userDetails,
1505
- } = {}) {
1506
- const { error } = PaymentValidator.getPaymentModeRoutes().validate(
1682
+ async getPaymentModeRoutes(
1683
+ {
1684
+ amount,
1685
+ cartId,
1686
+ pincode,
1687
+ checkoutMode,
1688
+ refresh,
1689
+ cardReference,
1690
+ userDetails,
1691
+ } = {},
1692
+ { headers } = { headers: false }
1693
+ ) {
1694
+ const {
1695
+ error,
1696
+ } = PaymentApplicationValidator.getPaymentModeRoutes().validate(
1507
1697
  {
1508
1698
  amount,
1509
1699
  cartId,
@@ -1522,7 +1712,7 @@ class Payment {
1522
1712
  // Showing warrnings if extra unknown parameters are found
1523
1713
  const {
1524
1714
  error: warrning,
1525
- } = PaymentValidator.getPaymentModeRoutes().validate(
1715
+ } = PaymentApplicationValidator.getPaymentModeRoutes().validate(
1526
1716
  {
1527
1717
  amount,
1528
1718
  cartId,
@@ -1537,9 +1727,8 @@ class Payment {
1537
1727
  if (warrning) {
1538
1728
  Logger({
1539
1729
  level: "WARN",
1540
- message: "Parameter Validation warrnings for getPaymentModeRoutes",
1730
+ message: `Parameter Validation warrnings for application > Payment > getPaymentModeRoutes \n ${warrning}`,
1541
1731
  });
1542
- Logger({ level: "WARN", message: warrning });
1543
1732
  }
1544
1733
 
1545
1734
  const query_params = {};
@@ -1562,38 +1751,50 @@ class Payment {
1562
1751
  }),
1563
1752
  query_params,
1564
1753
  undefined,
1565
- xHeaders
1754
+ xHeaders,
1755
+ { headers }
1566
1756
  );
1567
1757
 
1758
+ let responseData = response;
1759
+ if (headers) {
1760
+ responseData = response[0];
1761
+ }
1762
+
1568
1763
  const {
1569
1764
  error: res_error,
1570
- } = PaymentModel.PaymentModeRouteResponse().validate(response, {
1571
- abortEarly: false,
1572
- allowUnknown: false,
1573
- });
1765
+ } = PaymentApplicationModel.PaymentModeRouteResponse().validate(
1766
+ responseData,
1767
+ { abortEarly: false, allowUnknown: false }
1768
+ );
1574
1769
 
1575
1770
  if (res_error) {
1576
1771
  Logger({
1577
1772
  level: "WARN",
1578
- message: "Response Validation Warnnings for getPaymentModeRoutes",
1773
+ message: `Response Validation Warnnings for application > Payment > getPaymentModeRoutes \n ${res_error}`,
1579
1774
  });
1580
- Logger({ level: "WARN", message: res_error });
1581
1775
  }
1582
1776
 
1583
1777
  return response;
1584
1778
  }
1585
1779
 
1586
1780
  /**
1587
- * @param {Object} arg - Arg object.
1588
- * @param {string} arg.paymentLinkId - Payment link id
1589
- * @returns {Promise<PaymentModeRouteResponse>} - Success response
1781
+ * @param {PaymentApplicationValidator.GetPaymentModeRoutesPaymentLinkParam} arg
1782
+ * - Arg object.
1783
+ *
1784
+ * @param {import("../ApplicationAPIClient").Options} - Options
1785
+ * @returns {Promise<PaymentApplicationModel.PaymentModeRouteResponse>} -
1786
+ * Success response
1787
+ * @name getPaymentModeRoutesPaymentLink
1590
1788
  * @summary: Get applicable payment options for payment link
1591
- * @description: Use this API to get all valid payment options for doing a payment through payment link
1789
+ * @description: Use this API to get all valid payment options for doing a payment through payment link - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/getPaymentModeRoutesPaymentLink/).
1592
1790
  */
1593
- async getPaymentModeRoutesPaymentLink({ paymentLinkId } = {}) {
1791
+ async getPaymentModeRoutesPaymentLink(
1792
+ { paymentLinkId } = {},
1793
+ { headers } = { headers: false }
1794
+ ) {
1594
1795
  const {
1595
1796
  error,
1596
- } = PaymentValidator.getPaymentModeRoutesPaymentLink().validate(
1797
+ } = PaymentApplicationValidator.getPaymentModeRoutesPaymentLink().validate(
1597
1798
  { paymentLinkId },
1598
1799
  { abortEarly: false, allowUnknown: true }
1599
1800
  );
@@ -1604,17 +1805,15 @@ class Payment {
1604
1805
  // Showing warrnings if extra unknown parameters are found
1605
1806
  const {
1606
1807
  error: warrning,
1607
- } = PaymentValidator.getPaymentModeRoutesPaymentLink().validate(
1808
+ } = PaymentApplicationValidator.getPaymentModeRoutesPaymentLink().validate(
1608
1809
  { paymentLinkId },
1609
1810
  { abortEarly: false, allowUnknown: false }
1610
1811
  );
1611
1812
  if (warrning) {
1612
1813
  Logger({
1613
1814
  level: "WARN",
1614
- message:
1615
- "Parameter Validation warrnings for getPaymentModeRoutesPaymentLink",
1815
+ message: `Parameter Validation warrnings for application > Payment > getPaymentModeRoutesPaymentLink \n ${warrning}`,
1616
1816
  });
1617
- Logger({ level: "WARN", message: warrning });
1618
1817
  }
1619
1818
 
1620
1819
  const query_params = {};
@@ -1631,59 +1830,57 @@ class Payment {
1631
1830
  }),
1632
1831
  query_params,
1633
1832
  undefined,
1634
- xHeaders
1833
+ xHeaders,
1834
+ { headers }
1635
1835
  );
1636
1836
 
1837
+ let responseData = response;
1838
+ if (headers) {
1839
+ responseData = response[0];
1840
+ }
1841
+
1637
1842
  const {
1638
1843
  error: res_error,
1639
- } = PaymentModel.PaymentModeRouteResponse().validate(response, {
1640
- abortEarly: false,
1641
- allowUnknown: false,
1642
- });
1844
+ } = PaymentApplicationModel.PaymentModeRouteResponse().validate(
1845
+ responseData,
1846
+ { abortEarly: false, allowUnknown: false }
1847
+ );
1643
1848
 
1644
1849
  if (res_error) {
1645
1850
  Logger({
1646
1851
  level: "WARN",
1647
- message:
1648
- "Response Validation Warnnings for getPaymentModeRoutesPaymentLink",
1852
+ message: `Response Validation Warnnings for application > Payment > getPaymentModeRoutesPaymentLink \n ${res_error}`,
1649
1853
  });
1650
- Logger({ level: "WARN", message: res_error });
1651
1854
  }
1652
1855
 
1653
1856
  return response;
1654
1857
  }
1655
1858
 
1656
1859
  /**
1657
- * @param {Object} arg - Arg object.
1658
- * @param {number} arg.amount - Payable amount.
1659
- * @param {string} arg.cartId - Identifier of the cart.
1660
- * @param {string} arg.pincode - The PIN Code of the destination address, e.g. 400059
1661
- * @param {string} arg.checkoutMode - Option to checkout for self or for others.
1662
- * @param {boolean} [arg.refresh] - This is a boolean value. Select `true`
1663
- * to remove temporary cache files on payment gateway and replace with the
1664
- * latest one.
1665
- * @param {string} [arg.cardReference] - Card reference id of user's debit
1666
- * or credit card.
1667
- * @param {string} arg.orderType - The order type of shipment * HomeDelivery
1668
- * - If the customer wants the order home-delivered * PickAtStore - If the
1669
- * customer wants the handover of an order at the store itself.
1670
- * @param {string} [arg.userDetails] - URIencoded JSON containing details of
1671
- * an anonymous user.
1672
- * @returns {Promise<PaymentModeRouteResponse>} - Success response
1860
+ * @param {PaymentApplicationValidator.GetPosPaymentModeRoutesParam} arg - Arg object.
1861
+ * @param {import("../ApplicationAPIClient").Options} - Options
1862
+ * @returns {Promise<PaymentApplicationModel.PaymentModeRouteResponse>} -
1863
+ * Success response
1864
+ * @name getPosPaymentModeRoutes
1673
1865
  * @summary: Get applicable payment options for Point-of-Sale (POS)
1674
- * @description: Use this API to get all valid payment options for doing a payment in POS.
1866
+ * @description: Use this API to get all valid payment options for doing a payment in POS. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/getPosPaymentModeRoutes/).
1675
1867
  */
1676
- async getPosPaymentModeRoutes({
1677
- amount,
1678
- cartId,
1679
- pincode,
1680
- checkoutMode,
1681
- orderType,
1682
- refresh,
1683
- cardReference,
1684
- userDetails,
1685
- } = {}) {
1686
- const { error } = PaymentValidator.getPosPaymentModeRoutes().validate(
1868
+ async getPosPaymentModeRoutes(
1869
+ {
1870
+ amount,
1871
+ cartId,
1872
+ pincode,
1873
+ checkoutMode,
1874
+ orderType,
1875
+ refresh,
1876
+ cardReference,
1877
+ userDetails,
1878
+ } = {},
1879
+ { headers } = { headers: false }
1880
+ ) {
1881
+ const {
1882
+ error,
1883
+ } = PaymentApplicationValidator.getPosPaymentModeRoutes().validate(
1687
1884
  {
1688
1885
  amount,
1689
1886
  cartId,
@@ -1703,7 +1900,7 @@ class Payment {
1703
1900
  // Showing warrnings if extra unknown parameters are found
1704
1901
  const {
1705
1902
  error: warrning,
1706
- } = PaymentValidator.getPosPaymentModeRoutes().validate(
1903
+ } = PaymentApplicationValidator.getPosPaymentModeRoutes().validate(
1707
1904
  {
1708
1905
  amount,
1709
1906
  cartId,
@@ -1719,9 +1916,8 @@ class Payment {
1719
1916
  if (warrning) {
1720
1917
  Logger({
1721
1918
  level: "WARN",
1722
- message: "Parameter Validation warrnings for getPosPaymentModeRoutes",
1919
+ message: `Parameter Validation warrnings for application > Payment > getPosPaymentModeRoutes \n ${warrning}`,
1723
1920
  });
1724
- Logger({ level: "WARN", message: warrning });
1725
1921
  }
1726
1922
 
1727
1923
  const query_params = {};
@@ -1745,35 +1941,43 @@ class Payment {
1745
1941
  }),
1746
1942
  query_params,
1747
1943
  undefined,
1748
- xHeaders
1944
+ xHeaders,
1945
+ { headers }
1749
1946
  );
1750
1947
 
1948
+ let responseData = response;
1949
+ if (headers) {
1950
+ responseData = response[0];
1951
+ }
1952
+
1751
1953
  const {
1752
1954
  error: res_error,
1753
- } = PaymentModel.PaymentModeRouteResponse().validate(response, {
1754
- abortEarly: false,
1755
- allowUnknown: false,
1756
- });
1955
+ } = PaymentApplicationModel.PaymentModeRouteResponse().validate(
1956
+ responseData,
1957
+ { abortEarly: false, allowUnknown: false }
1958
+ );
1757
1959
 
1758
1960
  if (res_error) {
1759
1961
  Logger({
1760
1962
  level: "WARN",
1761
- message: "Response Validation Warnnings for getPosPaymentModeRoutes",
1963
+ message: `Response Validation Warnnings for application > Payment > getPosPaymentModeRoutes \n ${res_error}`,
1762
1964
  });
1763
- Logger({ level: "WARN", message: res_error });
1764
1965
  }
1765
1966
 
1766
1967
  return response;
1767
1968
  }
1768
1969
 
1769
1970
  /**
1770
- * @param {Object} arg - Arg object.
1771
- * @returns {Promise<RupifiBannerResponse>} - Success response
1971
+ * @param {import("../ApplicationAPIClient").Options} - Options
1972
+ * @returns {Promise<PaymentApplicationModel.RupifiBannerResponse>} - Success response
1973
+ * @name getRupifiBannerDetails
1772
1974
  * @summary: Get CreditLine Offer
1773
- * @description: Get CreditLine Offer if user is tentatively approved by rupifi
1975
+ * @description: Get CreditLine Offer if user is tentatively approved by rupifi - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/getRupifiBannerDetails/).
1774
1976
  */
1775
- async getRupifiBannerDetails({} = {}) {
1776
- const { error } = PaymentValidator.getRupifiBannerDetails().validate(
1977
+ async getRupifiBannerDetails({ headers } = { headers: false }) {
1978
+ const {
1979
+ error,
1980
+ } = PaymentApplicationValidator.getRupifiBannerDetails().validate(
1777
1981
  {},
1778
1982
  { abortEarly: false, allowUnknown: true }
1779
1983
  );
@@ -1784,16 +1988,15 @@ class Payment {
1784
1988
  // Showing warrnings if extra unknown parameters are found
1785
1989
  const {
1786
1990
  error: warrning,
1787
- } = PaymentValidator.getRupifiBannerDetails().validate(
1991
+ } = PaymentApplicationValidator.getRupifiBannerDetails().validate(
1788
1992
  {},
1789
1993
  { abortEarly: false, allowUnknown: false }
1790
1994
  );
1791
1995
  if (warrning) {
1792
1996
  Logger({
1793
1997
  level: "WARN",
1794
- message: "Parameter Validation warrnings for getRupifiBannerDetails",
1998
+ message: `Parameter Validation warrnings for application > Payment > getRupifiBannerDetails \n ${warrning}`,
1795
1999
  });
1796
- Logger({ level: "WARN", message: warrning });
1797
2000
  }
1798
2001
 
1799
2002
  const query_params = {};
@@ -1809,12 +2012,18 @@ class Payment {
1809
2012
  }),
1810
2013
  query_params,
1811
2014
  undefined,
1812
- xHeaders
2015
+ xHeaders,
2016
+ { headers }
1813
2017
  );
1814
2018
 
2019
+ let responseData = response;
2020
+ if (headers) {
2021
+ responseData = response[0];
2022
+ }
2023
+
1815
2024
  const {
1816
2025
  error: res_error,
1817
- } = PaymentModel.RupifiBannerResponse().validate(response, {
2026
+ } = PaymentApplicationModel.RupifiBannerResponse().validate(responseData, {
1818
2027
  abortEarly: false,
1819
2028
  allowUnknown: false,
1820
2029
  });
@@ -1822,24 +2031,31 @@ class Payment {
1822
2031
  if (res_error) {
1823
2032
  Logger({
1824
2033
  level: "WARN",
1825
- message: "Response Validation Warnnings for getRupifiBannerDetails",
2034
+ message: `Response Validation Warnnings for application > Payment > getRupifiBannerDetails \n ${res_error}`,
1826
2035
  });
1827
- Logger({ level: "WARN", message: res_error });
1828
2036
  }
1829
2037
 
1830
2038
  return response;
1831
2039
  }
1832
2040
 
1833
2041
  /**
1834
- * @param {Object} arg - Arg object.
1835
- * @param {string} arg.orderId - A unique number used for identifying and
1836
- * tracking your orders.
1837
- * @returns {Promise<OrderBeneficiaryResponse>} - Success response
2042
+ * @param {PaymentApplicationValidator.GetUserBeneficiariesDetailParam} arg
2043
+ * - Arg object.
2044
+ *
2045
+ * @param {import("../ApplicationAPIClient").Options} - Options
2046
+ * @returns {Promise<PaymentApplicationModel.OrderBeneficiaryResponse>} -
2047
+ * Success response
2048
+ * @name getUserBeneficiariesDetail
1838
2049
  * @summary: Lists the beneficiary of a refund
1839
- * @description: Use this API to get the details of all active beneficiary added by a user for refund.
2050
+ * @description: Use this API to get the details of all active beneficiary added by a user for refund. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/getUserBeneficiariesDetail/).
1840
2051
  */
1841
- async getUserBeneficiariesDetail({ orderId } = {}) {
1842
- const { error } = PaymentValidator.getUserBeneficiariesDetail().validate(
2052
+ async getUserBeneficiariesDetail(
2053
+ { orderId } = {},
2054
+ { headers } = { headers: false }
2055
+ ) {
2056
+ const {
2057
+ error,
2058
+ } = PaymentApplicationValidator.getUserBeneficiariesDetail().validate(
1843
2059
  { orderId },
1844
2060
  { abortEarly: false, allowUnknown: true }
1845
2061
  );
@@ -1850,17 +2066,15 @@ class Payment {
1850
2066
  // Showing warrnings if extra unknown parameters are found
1851
2067
  const {
1852
2068
  error: warrning,
1853
- } = PaymentValidator.getUserBeneficiariesDetail().validate(
2069
+ } = PaymentApplicationValidator.getUserBeneficiariesDetail().validate(
1854
2070
  { orderId },
1855
2071
  { abortEarly: false, allowUnknown: false }
1856
2072
  );
1857
2073
  if (warrning) {
1858
2074
  Logger({
1859
2075
  level: "WARN",
1860
- message:
1861
- "Parameter Validation warrnings for getUserBeneficiariesDetail",
2076
+ message: `Parameter Validation warrnings for application > Payment > getUserBeneficiariesDetail \n ${warrning}`,
1862
2077
  });
1863
- Logger({ level: "WARN", message: warrning });
1864
2078
  }
1865
2079
 
1866
2080
  const query_params = {};
@@ -1877,36 +2091,44 @@ class Payment {
1877
2091
  }),
1878
2092
  query_params,
1879
2093
  undefined,
1880
- xHeaders
2094
+ xHeaders,
2095
+ { headers }
1881
2096
  );
1882
2097
 
2098
+ let responseData = response;
2099
+ if (headers) {
2100
+ responseData = response[0];
2101
+ }
2102
+
1883
2103
  const {
1884
2104
  error: res_error,
1885
- } = PaymentModel.OrderBeneficiaryResponse().validate(response, {
1886
- abortEarly: false,
1887
- allowUnknown: false,
1888
- });
2105
+ } = PaymentApplicationModel.OrderBeneficiaryResponse().validate(
2106
+ responseData,
2107
+ { abortEarly: false, allowUnknown: false }
2108
+ );
1889
2109
 
1890
2110
  if (res_error) {
1891
2111
  Logger({
1892
2112
  level: "WARN",
1893
- message: "Response Validation Warnnings for getUserBeneficiariesDetail",
2113
+ message: `Response Validation Warnnings for application > Payment > getUserBeneficiariesDetail \n ${res_error}`,
1894
2114
  });
1895
- Logger({ level: "WARN", message: res_error });
1896
2115
  }
1897
2116
 
1898
2117
  return response;
1899
2118
  }
1900
2119
 
1901
2120
  /**
1902
- * @param {Object} arg - Arg object.
1903
- * @param {PaymentInitializationRequest} arg.body
1904
- * @returns {Promise<PaymentInitializationResponse>} - Success response
2121
+ * @param {PaymentApplicationValidator.InitialisePaymentParam} arg - Arg object.
2122
+ * @param {import("../ApplicationAPIClient").Options} - Options
2123
+ * @returns {Promise<PaymentApplicationModel.PaymentInitializationResponse>}
2124
+ * - Success response
2125
+ *
2126
+ * @name initialisePayment
1905
2127
  * @summary: Initialize a payment (server-to-server) for UPI and BharatQR
1906
- * @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.
2128
+ * @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. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/initialisePayment/).
1907
2129
  */
1908
- async initialisePayment({ body } = {}) {
1909
- const { error } = PaymentValidator.initialisePayment().validate(
2130
+ async initialisePayment({ body } = {}, { headers } = { headers: false }) {
2131
+ const { error } = PaymentApplicationValidator.initialisePayment().validate(
1910
2132
  { body },
1911
2133
  { abortEarly: false, allowUnknown: true }
1912
2134
  );
@@ -1915,16 +2137,17 @@ class Payment {
1915
2137
  }
1916
2138
 
1917
2139
  // Showing warrnings if extra unknown parameters are found
1918
- const { error: warrning } = PaymentValidator.initialisePayment().validate(
2140
+ const {
2141
+ error: warrning,
2142
+ } = PaymentApplicationValidator.initialisePayment().validate(
1919
2143
  { body },
1920
2144
  { abortEarly: false, allowUnknown: false }
1921
2145
  );
1922
2146
  if (warrning) {
1923
2147
  Logger({
1924
2148
  level: "WARN",
1925
- message: "Parameter Validation warrnings for initialisePayment",
2149
+ message: `Parameter Validation warrnings for application > Payment > initialisePayment \n ${warrning}`,
1926
2150
  });
1927
- Logger({ level: "WARN", message: warrning });
1928
2151
  }
1929
2152
 
1930
2153
  const query_params = {};
@@ -1940,36 +2163,51 @@ class Payment {
1940
2163
  }),
1941
2164
  query_params,
1942
2165
  body,
1943
- xHeaders
2166
+ xHeaders,
2167
+ { headers }
1944
2168
  );
1945
2169
 
2170
+ let responseData = response;
2171
+ if (headers) {
2172
+ responseData = response[0];
2173
+ }
2174
+
1946
2175
  const {
1947
2176
  error: res_error,
1948
- } = PaymentModel.PaymentInitializationResponse().validate(response, {
1949
- abortEarly: false,
1950
- allowUnknown: false,
1951
- });
2177
+ } = PaymentApplicationModel.PaymentInitializationResponse().validate(
2178
+ responseData,
2179
+ { abortEarly: false, allowUnknown: false }
2180
+ );
1952
2181
 
1953
2182
  if (res_error) {
1954
2183
  Logger({
1955
2184
  level: "WARN",
1956
- message: "Response Validation Warnnings for initialisePayment",
2185
+ message: `Response Validation Warnnings for application > Payment > initialisePayment \n ${res_error}`,
1957
2186
  });
1958
- Logger({ level: "WARN", message: res_error });
1959
2187
  }
1960
2188
 
1961
2189
  return response;
1962
2190
  }
1963
2191
 
1964
2192
  /**
1965
- * @param {Object} arg - Arg object.
1966
- * @param {PaymentInitializationRequest} arg.body
1967
- * @returns {Promise<PaymentInitializationResponse>} - Success response
2193
+ * @param {PaymentApplicationValidator.InitialisePaymentPaymentLinkParam} arg
2194
+ * - Arg object.
2195
+ *
2196
+ * @param {import("../ApplicationAPIClient").Options} - Options
2197
+ * @returns {Promise<PaymentApplicationModel.PaymentInitializationResponse>}
2198
+ * - Success response
2199
+ *
2200
+ * @name initialisePaymentPaymentLink
1968
2201
  * @summary: Initialize a payment (server-to-server) for UPI and BharatQR
1969
- * @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.
2202
+ * @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. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/initialisePaymentPaymentLink/).
1970
2203
  */
1971
- async initialisePaymentPaymentLink({ body } = {}) {
1972
- const { error } = PaymentValidator.initialisePaymentPaymentLink().validate(
2204
+ async initialisePaymentPaymentLink(
2205
+ { body } = {},
2206
+ { headers } = { headers: false }
2207
+ ) {
2208
+ const {
2209
+ error,
2210
+ } = PaymentApplicationValidator.initialisePaymentPaymentLink().validate(
1973
2211
  { body },
1974
2212
  { abortEarly: false, allowUnknown: true }
1975
2213
  );
@@ -1980,17 +2218,15 @@ class Payment {
1980
2218
  // Showing warrnings if extra unknown parameters are found
1981
2219
  const {
1982
2220
  error: warrning,
1983
- } = PaymentValidator.initialisePaymentPaymentLink().validate(
2221
+ } = PaymentApplicationValidator.initialisePaymentPaymentLink().validate(
1984
2222
  { body },
1985
2223
  { abortEarly: false, allowUnknown: false }
1986
2224
  );
1987
2225
  if (warrning) {
1988
2226
  Logger({
1989
2227
  level: "WARN",
1990
- message:
1991
- "Parameter Validation warrnings for initialisePaymentPaymentLink",
2228
+ message: `Parameter Validation warrnings for application > Payment > initialisePaymentPaymentLink \n ${warrning}`,
1992
2229
  });
1993
- Logger({ level: "WARN", message: warrning });
1994
2230
  }
1995
2231
 
1996
2232
  const query_params = {};
@@ -2006,37 +2242,49 @@ class Payment {
2006
2242
  }),
2007
2243
  query_params,
2008
2244
  body,
2009
- xHeaders
2245
+ xHeaders,
2246
+ { headers }
2010
2247
  );
2011
2248
 
2249
+ let responseData = response;
2250
+ if (headers) {
2251
+ responseData = response[0];
2252
+ }
2253
+
2012
2254
  const {
2013
2255
  error: res_error,
2014
- } = PaymentModel.PaymentInitializationResponse().validate(response, {
2015
- abortEarly: false,
2016
- allowUnknown: false,
2017
- });
2256
+ } = PaymentApplicationModel.PaymentInitializationResponse().validate(
2257
+ responseData,
2258
+ { abortEarly: false, allowUnknown: false }
2259
+ );
2018
2260
 
2019
2261
  if (res_error) {
2020
2262
  Logger({
2021
2263
  level: "WARN",
2022
- message:
2023
- "Response Validation Warnnings for initialisePaymentPaymentLink",
2264
+ message: `Response Validation Warnnings for application > Payment > initialisePaymentPaymentLink \n ${res_error}`,
2024
2265
  });
2025
- Logger({ level: "WARN", message: res_error });
2026
2266
  }
2027
2267
 
2028
2268
  return response;
2029
2269
  }
2030
2270
 
2031
2271
  /**
2032
- * @param {Object} arg - Arg object.
2033
- * @param {string} [arg.aggregator] -
2034
- * @returns {Promise<OutstandingOrderDetailsResponse>} - Success response
2272
+ * @param {PaymentApplicationValidator.OutstandingOrderDetailsParam} arg - Arg object.
2273
+ * @param {import("../ApplicationAPIClient").Options} - Options
2274
+ * @returns {Promise<PaymentApplicationModel.OutstandingOrderDetailsResponse>}
2275
+ * - Success response
2276
+ *
2277
+ * @name outstandingOrderDetails
2035
2278
  * @summary: API to fetch the outstanding order details
2036
- * @description: Use this API to fetch the outstanding order details.
2279
+ * @description: Use this API to fetch the outstanding order details. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/outstandingOrderDetails/).
2037
2280
  */
2038
- async outstandingOrderDetails({ aggregator } = {}) {
2039
- const { error } = PaymentValidator.outstandingOrderDetails().validate(
2281
+ async outstandingOrderDetails(
2282
+ { aggregator } = {},
2283
+ { headers } = { headers: false }
2284
+ ) {
2285
+ const {
2286
+ error,
2287
+ } = PaymentApplicationValidator.outstandingOrderDetails().validate(
2040
2288
  { aggregator },
2041
2289
  { abortEarly: false, allowUnknown: true }
2042
2290
  );
@@ -2047,16 +2295,15 @@ class Payment {
2047
2295
  // Showing warrnings if extra unknown parameters are found
2048
2296
  const {
2049
2297
  error: warrning,
2050
- } = PaymentValidator.outstandingOrderDetails().validate(
2298
+ } = PaymentApplicationValidator.outstandingOrderDetails().validate(
2051
2299
  { aggregator },
2052
2300
  { abortEarly: false, allowUnknown: false }
2053
2301
  );
2054
2302
  if (warrning) {
2055
2303
  Logger({
2056
2304
  level: "WARN",
2057
- message: "Parameter Validation warrnings for outstandingOrderDetails",
2305
+ message: `Parameter Validation warrnings for application > Payment > outstandingOrderDetails \n ${warrning}`,
2058
2306
  });
2059
- Logger({ level: "WARN", message: warrning });
2060
2307
  }
2061
2308
 
2062
2309
  const query_params = {};
@@ -2073,36 +2320,46 @@ class Payment {
2073
2320
  }),
2074
2321
  query_params,
2075
2322
  undefined,
2076
- xHeaders
2323
+ xHeaders,
2324
+ { headers }
2077
2325
  );
2078
2326
 
2327
+ let responseData = response;
2328
+ if (headers) {
2329
+ responseData = response[0];
2330
+ }
2331
+
2079
2332
  const {
2080
2333
  error: res_error,
2081
- } = PaymentModel.OutstandingOrderDetailsResponse().validate(response, {
2082
- abortEarly: false,
2083
- allowUnknown: false,
2084
- });
2334
+ } = PaymentApplicationModel.OutstandingOrderDetailsResponse().validate(
2335
+ responseData,
2336
+ { abortEarly: false, allowUnknown: false }
2337
+ );
2085
2338
 
2086
2339
  if (res_error) {
2087
2340
  Logger({
2088
2341
  level: "WARN",
2089
- message: "Response Validation Warnnings for outstandingOrderDetails",
2342
+ message: `Response Validation Warnnings for application > Payment > outstandingOrderDetails \n ${res_error}`,
2090
2343
  });
2091
- Logger({ level: "WARN", message: res_error });
2092
2344
  }
2093
2345
 
2094
2346
  return response;
2095
2347
  }
2096
2348
 
2097
2349
  /**
2098
- * @param {Object} arg - Arg object.
2099
- * @param {string} [arg.aggregator] -
2100
- * @returns {Promise<PaidOrderDetailsResponse>} - Success response
2350
+ * @param {PaymentApplicationValidator.PaidOrderDetailsParam} arg - Arg object.
2351
+ * @param {import("../ApplicationAPIClient").Options} - Options
2352
+ * @returns {Promise<PaymentApplicationModel.PaidOrderDetailsResponse>} -
2353
+ * Success response
2354
+ * @name paidOrderDetails
2101
2355
  * @summary: API to fetch the paid order details
2102
- * @description: Use this API to fetch the paid order details.
2356
+ * @description: Use this API to fetch the paid order details. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/paidOrderDetails/).
2103
2357
  */
2104
- async paidOrderDetails({ aggregator } = {}) {
2105
- const { error } = PaymentValidator.paidOrderDetails().validate(
2358
+ async paidOrderDetails(
2359
+ { aggregator } = {},
2360
+ { headers } = { headers: false }
2361
+ ) {
2362
+ const { error } = PaymentApplicationValidator.paidOrderDetails().validate(
2106
2363
  { aggregator },
2107
2364
  { abortEarly: false, allowUnknown: true }
2108
2365
  );
@@ -2111,16 +2368,17 @@ class Payment {
2111
2368
  }
2112
2369
 
2113
2370
  // Showing warrnings if extra unknown parameters are found
2114
- const { error: warrning } = PaymentValidator.paidOrderDetails().validate(
2371
+ const {
2372
+ error: warrning,
2373
+ } = PaymentApplicationValidator.paidOrderDetails().validate(
2115
2374
  { aggregator },
2116
2375
  { abortEarly: false, allowUnknown: false }
2117
2376
  );
2118
2377
  if (warrning) {
2119
2378
  Logger({
2120
2379
  level: "WARN",
2121
- message: "Parameter Validation warrnings for paidOrderDetails",
2380
+ message: `Parameter Validation warrnings for application > Payment > paidOrderDetails \n ${warrning}`,
2122
2381
  });
2123
- Logger({ level: "WARN", message: warrning });
2124
2382
  }
2125
2383
 
2126
2384
  const query_params = {};
@@ -2137,36 +2395,46 @@ class Payment {
2137
2395
  }),
2138
2396
  query_params,
2139
2397
  undefined,
2140
- xHeaders
2398
+ xHeaders,
2399
+ { headers }
2141
2400
  );
2142
2401
 
2402
+ let responseData = response;
2403
+ if (headers) {
2404
+ responseData = response[0];
2405
+ }
2406
+
2143
2407
  const {
2144
2408
  error: res_error,
2145
- } = PaymentModel.PaidOrderDetailsResponse().validate(response, {
2146
- abortEarly: false,
2147
- allowUnknown: false,
2148
- });
2409
+ } = PaymentApplicationModel.PaidOrderDetailsResponse().validate(
2410
+ responseData,
2411
+ { abortEarly: false, allowUnknown: false }
2412
+ );
2149
2413
 
2150
2414
  if (res_error) {
2151
2415
  Logger({
2152
2416
  level: "WARN",
2153
- message: "Response Validation Warnnings for paidOrderDetails",
2417
+ message: `Response Validation Warnnings for application > Payment > paidOrderDetails \n ${res_error}`,
2154
2418
  });
2155
- Logger({ level: "WARN", message: res_error });
2156
2419
  }
2157
2420
 
2158
2421
  return response;
2159
2422
  }
2160
2423
 
2161
2424
  /**
2162
- * @param {Object} arg - Arg object.
2163
- * @param {string} [arg.paymentLinkId] -
2164
- * @returns {Promise<PollingPaymentLinkResponse>} - Success response
2425
+ * @param {PaymentApplicationValidator.PollingPaymentLinkParam} arg - Arg object.
2426
+ * @param {import("../ApplicationAPIClient").Options} - Options
2427
+ * @returns {Promise<PaymentApplicationModel.PollingPaymentLinkResponse>} -
2428
+ * Success response
2429
+ * @name pollingPaymentLink
2165
2430
  * @summary: Used for polling if payment successful or not
2166
- * @description: Use this API to poll if payment through payment was successful or not
2431
+ * @description: Use this API to poll if payment through payment was successful or not - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/pollingPaymentLink/).
2167
2432
  */
2168
- async pollingPaymentLink({ paymentLinkId } = {}) {
2169
- const { error } = PaymentValidator.pollingPaymentLink().validate(
2433
+ async pollingPaymentLink(
2434
+ { paymentLinkId } = {},
2435
+ { headers } = { headers: false }
2436
+ ) {
2437
+ const { error } = PaymentApplicationValidator.pollingPaymentLink().validate(
2170
2438
  { paymentLinkId },
2171
2439
  { abortEarly: false, allowUnknown: true }
2172
2440
  );
@@ -2175,16 +2443,17 @@ class Payment {
2175
2443
  }
2176
2444
 
2177
2445
  // Showing warrnings if extra unknown parameters are found
2178
- const { error: warrning } = PaymentValidator.pollingPaymentLink().validate(
2446
+ const {
2447
+ error: warrning,
2448
+ } = PaymentApplicationValidator.pollingPaymentLink().validate(
2179
2449
  { paymentLinkId },
2180
2450
  { abortEarly: false, allowUnknown: false }
2181
2451
  );
2182
2452
  if (warrning) {
2183
2453
  Logger({
2184
2454
  level: "WARN",
2185
- message: "Parameter Validation warrnings for pollingPaymentLink",
2455
+ message: `Parameter Validation warrnings for application > Payment > pollingPaymentLink \n ${warrning}`,
2186
2456
  });
2187
- Logger({ level: "WARN", message: warrning });
2188
2457
  }
2189
2458
 
2190
2459
  const query_params = {};
@@ -2201,39 +2470,49 @@ class Payment {
2201
2470
  }),
2202
2471
  query_params,
2203
2472
  undefined,
2204
- xHeaders
2473
+ xHeaders,
2474
+ { headers }
2205
2475
  );
2206
2476
 
2477
+ let responseData = response;
2478
+ if (headers) {
2479
+ responseData = response[0];
2480
+ }
2481
+
2207
2482
  const {
2208
2483
  error: res_error,
2209
- } = PaymentModel.PollingPaymentLinkResponse().validate(response, {
2210
- abortEarly: false,
2211
- allowUnknown: false,
2212
- });
2484
+ } = PaymentApplicationModel.PollingPaymentLinkResponse().validate(
2485
+ responseData,
2486
+ { abortEarly: false, allowUnknown: false }
2487
+ );
2213
2488
 
2214
2489
  if (res_error) {
2215
2490
  Logger({
2216
2491
  level: "WARN",
2217
- message: "Response Validation Warnnings for pollingPaymentLink",
2492
+ message: `Response Validation Warnnings for application > Payment > pollingPaymentLink \n ${res_error}`,
2218
2493
  });
2219
- Logger({ level: "WARN", message: res_error });
2220
2494
  }
2221
2495
 
2222
2496
  return response;
2223
2497
  }
2224
2498
 
2225
2499
  /**
2226
- * @param {Object} arg - Arg object.
2227
- * @param {string} [arg.source] - This is a String value that contains
2228
- * callback URL as value.
2229
- * @param {string} [arg.aggregator] - This is a String value that contains
2230
- * aggregator name as value.
2231
- * @returns {Promise<RedirectToAggregatorResponse>} - Success response
2500
+ * @param {PaymentApplicationValidator.RedirectToAggregatorParam} arg - Arg object.
2501
+ * @param {import("../ApplicationAPIClient").Options} - Options
2502
+ * @returns {Promise<PaymentApplicationModel.RedirectToAggregatorResponse>}
2503
+ * - Success response
2504
+ *
2505
+ * @name redirectToAggregator
2232
2506
  * @summary: API to get the redirect url to redirect the user to aggregator's page
2233
- * @description: Use this API to get the redirect url to redirect the user to aggregator's page
2507
+ * @description: Use this API to get the redirect url to redirect the user to aggregator's page - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/redirectToAggregator/).
2234
2508
  */
2235
- async redirectToAggregator({ source, aggregator } = {}) {
2236
- const { error } = PaymentValidator.redirectToAggregator().validate(
2509
+ async redirectToAggregator(
2510
+ { source, aggregator } = {},
2511
+ { headers } = { headers: false }
2512
+ ) {
2513
+ const {
2514
+ error,
2515
+ } = PaymentApplicationValidator.redirectToAggregator().validate(
2237
2516
  { source, aggregator },
2238
2517
  { abortEarly: false, allowUnknown: true }
2239
2518
  );
@@ -2244,16 +2523,15 @@ class Payment {
2244
2523
  // Showing warrnings if extra unknown parameters are found
2245
2524
  const {
2246
2525
  error: warrning,
2247
- } = PaymentValidator.redirectToAggregator().validate(
2526
+ } = PaymentApplicationValidator.redirectToAggregator().validate(
2248
2527
  { source, aggregator },
2249
2528
  { abortEarly: false, allowUnknown: false }
2250
2529
  );
2251
2530
  if (warrning) {
2252
2531
  Logger({
2253
2532
  level: "WARN",
2254
- message: "Parameter Validation warrnings for redirectToAggregator",
2533
+ message: `Parameter Validation warrnings for application > Payment > redirectToAggregator \n ${warrning}`,
2255
2534
  });
2256
- Logger({ level: "WARN", message: warrning });
2257
2535
  }
2258
2536
 
2259
2537
  const query_params = {};
@@ -2271,36 +2549,42 @@ class Payment {
2271
2549
  }),
2272
2550
  query_params,
2273
2551
  undefined,
2274
- xHeaders
2552
+ xHeaders,
2553
+ { headers }
2275
2554
  );
2276
2555
 
2556
+ let responseData = response;
2557
+ if (headers) {
2558
+ responseData = response[0];
2559
+ }
2560
+
2277
2561
  const {
2278
2562
  error: res_error,
2279
- } = PaymentModel.RedirectToAggregatorResponse().validate(response, {
2280
- abortEarly: false,
2281
- allowUnknown: false,
2282
- });
2563
+ } = PaymentApplicationModel.RedirectToAggregatorResponse().validate(
2564
+ responseData,
2565
+ { abortEarly: false, allowUnknown: false }
2566
+ );
2283
2567
 
2284
2568
  if (res_error) {
2285
2569
  Logger({
2286
2570
  level: "WARN",
2287
- message: "Response Validation Warnnings for redirectToAggregator",
2571
+ message: `Response Validation Warnnings for application > Payment > redirectToAggregator \n ${res_error}`,
2288
2572
  });
2289
- Logger({ level: "WARN", message: res_error });
2290
2573
  }
2291
2574
 
2292
2575
  return response;
2293
2576
  }
2294
2577
 
2295
2578
  /**
2296
- * @param {Object} arg - Arg object.
2297
- * @param {renderHTMLRequest} arg.body
2298
- * @returns {Promise<renderHTMLResponse>} - Success response
2579
+ * @param {PaymentApplicationValidator.RenderHTMLParam} arg - Arg object.
2580
+ * @param {import("../ApplicationAPIClient").Options} - Options
2581
+ * @returns {Promise<PaymentApplicationModel.renderHTMLResponse>} - Success response
2582
+ * @name renderHTML
2299
2583
  * @summary: Convert base64 string to HTML form
2300
- * @description: Use this API to decode base64 html form to plain HTML string.
2584
+ * @description: Use this API to decode base64 html form to plain HTML string. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/renderHTML/).
2301
2585
  */
2302
- async renderHTML({ body } = {}) {
2303
- const { error } = PaymentValidator.renderHTML().validate(
2586
+ async renderHTML({ body } = {}, { headers } = { headers: false }) {
2587
+ const { error } = PaymentApplicationValidator.renderHTML().validate(
2304
2588
  { body },
2305
2589
  { abortEarly: false, allowUnknown: true }
2306
2590
  );
@@ -2309,16 +2593,17 @@ class Payment {
2309
2593
  }
2310
2594
 
2311
2595
  // Showing warrnings if extra unknown parameters are found
2312
- const { error: warrning } = PaymentValidator.renderHTML().validate(
2596
+ const {
2597
+ error: warrning,
2598
+ } = PaymentApplicationValidator.renderHTML().validate(
2313
2599
  { body },
2314
2600
  { abortEarly: false, allowUnknown: false }
2315
2601
  );
2316
2602
  if (warrning) {
2317
2603
  Logger({
2318
2604
  level: "WARN",
2319
- message: "Parameter Validation warrnings for renderHTML",
2605
+ message: `Parameter Validation warrnings for application > Payment > renderHTML \n ${warrning}`,
2320
2606
  });
2321
- Logger({ level: "WARN", message: warrning });
2322
2607
  }
2323
2608
 
2324
2609
  const query_params = {};
@@ -2334,12 +2619,18 @@ class Payment {
2334
2619
  }),
2335
2620
  query_params,
2336
2621
  body,
2337
- xHeaders
2622
+ xHeaders,
2623
+ { headers }
2338
2624
  );
2339
2625
 
2626
+ let responseData = response;
2627
+ if (headers) {
2628
+ responseData = response[0];
2629
+ }
2630
+
2340
2631
  const {
2341
2632
  error: res_error,
2342
- } = PaymentModel.renderHTMLResponse().validate(response, {
2633
+ } = PaymentApplicationModel.renderHTMLResponse().validate(responseData, {
2343
2634
  abortEarly: false,
2344
2635
  allowUnknown: false,
2345
2636
  });
@@ -2347,23 +2638,27 @@ class Payment {
2347
2638
  if (res_error) {
2348
2639
  Logger({
2349
2640
  level: "WARN",
2350
- message: "Response Validation Warnnings for renderHTML",
2641
+ message: `Response Validation Warnnings for application > Payment > renderHTML \n ${res_error}`,
2351
2642
  });
2352
- Logger({ level: "WARN", message: res_error });
2353
2643
  }
2354
2644
 
2355
2645
  return response;
2356
2646
  }
2357
2647
 
2358
2648
  /**
2359
- * @param {Object} arg - Arg object.
2360
- * @param {ResendOrCancelPaymentRequest} arg.body
2361
- * @returns {Promise<ResendOrCancelPaymentResponse>} - Success response
2649
+ * @param {PaymentApplicationValidator.ResendOrCancelPaymentParam} arg - Arg object.
2650
+ * @param {import("../ApplicationAPIClient").Options} - Options
2651
+ * @returns {Promise<PaymentApplicationModel.ResendOrCancelPaymentResponse>}
2652
+ * - Success response
2653
+ *
2654
+ * @name resendOrCancelPayment
2362
2655
  * @summary: API to resend and cancel a payment link which was already generated.
2363
- * @description: Use this API to perform resend or cancel a payment link based on request payload.
2656
+ * @description: Use this API to perform resend or cancel a payment link based on request payload. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/resendOrCancelPayment/).
2364
2657
  */
2365
- async resendOrCancelPayment({ body } = {}) {
2366
- const { error } = PaymentValidator.resendOrCancelPayment().validate(
2658
+ async resendOrCancelPayment({ body } = {}, { headers } = { headers: false }) {
2659
+ const {
2660
+ error,
2661
+ } = PaymentApplicationValidator.resendOrCancelPayment().validate(
2367
2662
  { body },
2368
2663
  { abortEarly: false, allowUnknown: true }
2369
2664
  );
@@ -2374,16 +2669,15 @@ class Payment {
2374
2669
  // Showing warrnings if extra unknown parameters are found
2375
2670
  const {
2376
2671
  error: warrning,
2377
- } = PaymentValidator.resendOrCancelPayment().validate(
2672
+ } = PaymentApplicationValidator.resendOrCancelPayment().validate(
2378
2673
  { body },
2379
2674
  { abortEarly: false, allowUnknown: false }
2380
2675
  );
2381
2676
  if (warrning) {
2382
2677
  Logger({
2383
2678
  level: "WARN",
2384
- message: "Parameter Validation warrnings for resendOrCancelPayment",
2679
+ message: `Parameter Validation warrnings for application > Payment > resendOrCancelPayment \n ${warrning}`,
2385
2680
  });
2386
- Logger({ level: "WARN", message: warrning });
2387
2681
  }
2388
2682
 
2389
2683
  const query_params = {};
@@ -2399,36 +2693,43 @@ class Payment {
2399
2693
  }),
2400
2694
  query_params,
2401
2695
  body,
2402
- xHeaders
2696
+ xHeaders,
2697
+ { headers }
2403
2698
  );
2404
2699
 
2700
+ let responseData = response;
2701
+ if (headers) {
2702
+ responseData = response[0];
2703
+ }
2704
+
2405
2705
  const {
2406
2706
  error: res_error,
2407
- } = PaymentModel.ResendOrCancelPaymentResponse().validate(response, {
2408
- abortEarly: false,
2409
- allowUnknown: false,
2410
- });
2707
+ } = PaymentApplicationModel.ResendOrCancelPaymentResponse().validate(
2708
+ responseData,
2709
+ { abortEarly: false, allowUnknown: false }
2710
+ );
2411
2711
 
2412
2712
  if (res_error) {
2413
2713
  Logger({
2414
2714
  level: "WARN",
2415
- message: "Response Validation Warnnings for resendOrCancelPayment",
2715
+ message: `Response Validation Warnnings for application > Payment > resendOrCancelPayment \n ${res_error}`,
2416
2716
  });
2417
- Logger({ level: "WARN", message: res_error });
2418
2717
  }
2419
2718
 
2420
2719
  return response;
2421
2720
  }
2422
2721
 
2423
2722
  /**
2424
- * @param {Object} arg - Arg object.
2425
- * @param {CancelOrResendPaymentLinkRequest} arg.body
2426
- * @returns {Promise<ResendPaymentLinkResponse>} - Success response
2723
+ * @param {PaymentApplicationValidator.ResendPaymentLinkParam} arg - Arg object.
2724
+ * @param {import("../ApplicationAPIClient").Options} - Options
2725
+ * @returns {Promise<PaymentApplicationModel.ResendPaymentLinkResponse>} -
2726
+ * Success response
2727
+ * @name resendPaymentLink
2427
2728
  * @summary: Resend payment link
2428
- * @description: Use this API to resend a payment link for the customer
2729
+ * @description: Use this API to resend a payment link for the customer - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/resendPaymentLink/).
2429
2730
  */
2430
- async resendPaymentLink({ body } = {}) {
2431
- const { error } = PaymentValidator.resendPaymentLink().validate(
2731
+ async resendPaymentLink({ body } = {}, { headers } = { headers: false }) {
2732
+ const { error } = PaymentApplicationValidator.resendPaymentLink().validate(
2432
2733
  { body },
2433
2734
  { abortEarly: false, allowUnknown: true }
2434
2735
  );
@@ -2437,16 +2738,17 @@ class Payment {
2437
2738
  }
2438
2739
 
2439
2740
  // Showing warrnings if extra unknown parameters are found
2440
- const { error: warrning } = PaymentValidator.resendPaymentLink().validate(
2741
+ const {
2742
+ error: warrning,
2743
+ } = PaymentApplicationValidator.resendPaymentLink().validate(
2441
2744
  { body },
2442
2745
  { abortEarly: false, allowUnknown: false }
2443
2746
  );
2444
2747
  if (warrning) {
2445
2748
  Logger({
2446
2749
  level: "WARN",
2447
- message: "Parameter Validation warrnings for resendPaymentLink",
2750
+ message: `Parameter Validation warrnings for application > Payment > resendPaymentLink \n ${warrning}`,
2448
2751
  });
2449
- Logger({ level: "WARN", message: warrning });
2450
2752
  }
2451
2753
 
2452
2754
  const query_params = {};
@@ -2462,36 +2764,50 @@ class Payment {
2462
2764
  }),
2463
2765
  query_params,
2464
2766
  body,
2465
- xHeaders
2767
+ xHeaders,
2768
+ { headers }
2466
2769
  );
2467
2770
 
2771
+ let responseData = response;
2772
+ if (headers) {
2773
+ responseData = response[0];
2774
+ }
2775
+
2468
2776
  const {
2469
2777
  error: res_error,
2470
- } = PaymentModel.ResendPaymentLinkResponse().validate(response, {
2471
- abortEarly: false,
2472
- allowUnknown: false,
2473
- });
2778
+ } = PaymentApplicationModel.ResendPaymentLinkResponse().validate(
2779
+ responseData,
2780
+ { abortEarly: false, allowUnknown: false }
2781
+ );
2474
2782
 
2475
2783
  if (res_error) {
2476
2784
  Logger({
2477
2785
  level: "WARN",
2478
- message: "Response Validation Warnnings for resendPaymentLink",
2786
+ message: `Response Validation Warnnings for application > Payment > resendPaymentLink \n ${res_error}`,
2479
2787
  });
2480
- Logger({ level: "WARN", message: res_error });
2481
2788
  }
2482
2789
 
2483
2790
  return response;
2484
2791
  }
2485
2792
 
2486
2793
  /**
2487
- * @param {Object} arg - Arg object.
2488
- * @param {SetDefaultBeneficiaryRequest} arg.body
2489
- * @returns {Promise<SetDefaultBeneficiaryResponse>} - Success response
2794
+ * @param {PaymentApplicationValidator.UpdateDefaultBeneficiaryParam} arg -
2795
+ * Arg object.
2796
+ * @param {import("../ApplicationAPIClient").Options} - Options
2797
+ * @returns {Promise<PaymentApplicationModel.SetDefaultBeneficiaryResponse>}
2798
+ * - Success response
2799
+ *
2800
+ * @name updateDefaultBeneficiary
2490
2801
  * @summary: Set a default beneficiary for a refund
2491
- * @description: Use this API to set a default beneficiary for getting a refund.
2802
+ * @description: Use this API to set a default beneficiary for getting a refund. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/updateDefaultBeneficiary/).
2492
2803
  */
2493
- async updateDefaultBeneficiary({ body } = {}) {
2494
- const { error } = PaymentValidator.updateDefaultBeneficiary().validate(
2804
+ async updateDefaultBeneficiary(
2805
+ { body } = {},
2806
+ { headers } = { headers: false }
2807
+ ) {
2808
+ const {
2809
+ error,
2810
+ } = PaymentApplicationValidator.updateDefaultBeneficiary().validate(
2495
2811
  { body },
2496
2812
  { abortEarly: false, allowUnknown: true }
2497
2813
  );
@@ -2502,16 +2818,15 @@ class Payment {
2502
2818
  // Showing warrnings if extra unknown parameters are found
2503
2819
  const {
2504
2820
  error: warrning,
2505
- } = PaymentValidator.updateDefaultBeneficiary().validate(
2821
+ } = PaymentApplicationValidator.updateDefaultBeneficiary().validate(
2506
2822
  { body },
2507
2823
  { abortEarly: false, allowUnknown: false }
2508
2824
  );
2509
2825
  if (warrning) {
2510
2826
  Logger({
2511
2827
  level: "WARN",
2512
- message: "Parameter Validation warrnings for updateDefaultBeneficiary",
2828
+ message: `Parameter Validation warrnings for application > Payment > updateDefaultBeneficiary \n ${warrning}`,
2513
2829
  });
2514
- Logger({ level: "WARN", message: warrning });
2515
2830
  }
2516
2831
 
2517
2832
  const query_params = {};
@@ -2527,36 +2842,42 @@ class Payment {
2527
2842
  }),
2528
2843
  query_params,
2529
2844
  body,
2530
- xHeaders
2845
+ xHeaders,
2846
+ { headers }
2531
2847
  );
2532
2848
 
2849
+ let responseData = response;
2850
+ if (headers) {
2851
+ responseData = response[0];
2852
+ }
2853
+
2533
2854
  const {
2534
2855
  error: res_error,
2535
- } = PaymentModel.SetDefaultBeneficiaryResponse().validate(response, {
2536
- abortEarly: false,
2537
- allowUnknown: false,
2538
- });
2856
+ } = PaymentApplicationModel.SetDefaultBeneficiaryResponse().validate(
2857
+ responseData,
2858
+ { abortEarly: false, allowUnknown: false }
2859
+ );
2539
2860
 
2540
2861
  if (res_error) {
2541
2862
  Logger({
2542
2863
  level: "WARN",
2543
- message: "Response Validation Warnnings for updateDefaultBeneficiary",
2864
+ message: `Response Validation Warnnings for application > Payment > updateDefaultBeneficiary \n ${res_error}`,
2544
2865
  });
2545
- Logger({ level: "WARN", message: res_error });
2546
2866
  }
2547
2867
 
2548
2868
  return response;
2549
2869
  }
2550
2870
 
2551
2871
  /**
2552
- * @param {Object} arg - Arg object.
2553
- * @param {ValidateVPARequest} arg.body
2554
- * @returns {Promise<ValidateVPAResponse>} - Success response
2872
+ * @param {PaymentApplicationValidator.ValidateVPAParam} arg - Arg object.
2873
+ * @param {import("../ApplicationAPIClient").Options} - Options
2874
+ * @returns {Promise<PaymentApplicationModel.ValidateVPAResponse>} - Success response
2875
+ * @name validateVPA
2555
2876
  * @summary: API to Validate UPI ID
2556
- * @description: API to Validate UPI ID
2877
+ * @description: API to Validate UPI ID - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/validateVPA/).
2557
2878
  */
2558
- async validateVPA({ body } = {}) {
2559
- const { error } = PaymentValidator.validateVPA().validate(
2879
+ async validateVPA({ body } = {}, { headers } = { headers: false }) {
2880
+ const { error } = PaymentApplicationValidator.validateVPA().validate(
2560
2881
  { body },
2561
2882
  { abortEarly: false, allowUnknown: true }
2562
2883
  );
@@ -2565,16 +2886,17 @@ class Payment {
2565
2886
  }
2566
2887
 
2567
2888
  // Showing warrnings if extra unknown parameters are found
2568
- const { error: warrning } = PaymentValidator.validateVPA().validate(
2889
+ const {
2890
+ error: warrning,
2891
+ } = PaymentApplicationValidator.validateVPA().validate(
2569
2892
  { body },
2570
2893
  { abortEarly: false, allowUnknown: false }
2571
2894
  );
2572
2895
  if (warrning) {
2573
2896
  Logger({
2574
2897
  level: "WARN",
2575
- message: "Parameter Validation warrnings for validateVPA",
2898
+ message: `Parameter Validation warrnings for application > Payment > validateVPA \n ${warrning}`,
2576
2899
  });
2577
- Logger({ level: "WARN", message: warrning });
2578
2900
  }
2579
2901
 
2580
2902
  const query_params = {};
@@ -2590,12 +2912,18 @@ class Payment {
2590
2912
  }),
2591
2913
  query_params,
2592
2914
  body,
2593
- xHeaders
2915
+ xHeaders,
2916
+ { headers }
2594
2917
  );
2595
2918
 
2919
+ let responseData = response;
2920
+ if (headers) {
2921
+ responseData = response[0];
2922
+ }
2923
+
2596
2924
  const {
2597
2925
  error: res_error,
2598
- } = PaymentModel.ValidateVPAResponse().validate(response, {
2926
+ } = PaymentApplicationModel.ValidateVPAResponse().validate(responseData, {
2599
2927
  abortEarly: false,
2600
2928
  allowUnknown: false,
2601
2929
  });
@@ -2603,23 +2931,29 @@ class Payment {
2603
2931
  if (res_error) {
2604
2932
  Logger({
2605
2933
  level: "WARN",
2606
- message: "Response Validation Warnnings for validateVPA",
2934
+ message: `Response Validation Warnnings for application > Payment > validateVPA \n ${res_error}`,
2607
2935
  });
2608
- Logger({ level: "WARN", message: res_error });
2609
2936
  }
2610
2937
 
2611
2938
  return response;
2612
2939
  }
2613
2940
 
2614
2941
  /**
2615
- * @param {Object} arg - Arg object.
2616
- * @param {ChargeCustomerRequest} arg.body
2617
- * @returns {Promise<ChargeCustomerResponse>} - Success response
2942
+ * @param {PaymentApplicationValidator.VerifyAndChargePaymentParam} arg - Arg object.
2943
+ * @param {import("../ApplicationAPIClient").Options} - Options
2944
+ * @returns {Promise<PaymentApplicationModel.ChargeCustomerResponse>} -
2945
+ * Success response
2946
+ * @name verifyAndChargePayment
2618
2947
  * @summary: Verify and charge payment
2619
- * @description: Use this API to verify and check the status of a payment transaction (server-to-server) made through aggregators like Simpl and Mswipe.
2948
+ * @description: Use this API to verify and check the status of a payment transaction (server-to-server) made through aggregators like Simpl and Mswipe. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/verifyAndChargePayment/).
2620
2949
  */
2621
- async verifyAndChargePayment({ body } = {}) {
2622
- const { error } = PaymentValidator.verifyAndChargePayment().validate(
2950
+ async verifyAndChargePayment(
2951
+ { body } = {},
2952
+ { headers } = { headers: false }
2953
+ ) {
2954
+ const {
2955
+ error,
2956
+ } = PaymentApplicationValidator.verifyAndChargePayment().validate(
2623
2957
  { body },
2624
2958
  { abortEarly: false, allowUnknown: true }
2625
2959
  );
@@ -2630,16 +2964,15 @@ class Payment {
2630
2964
  // Showing warrnings if extra unknown parameters are found
2631
2965
  const {
2632
2966
  error: warrning,
2633
- } = PaymentValidator.verifyAndChargePayment().validate(
2967
+ } = PaymentApplicationValidator.verifyAndChargePayment().validate(
2634
2968
  { body },
2635
2969
  { abortEarly: false, allowUnknown: false }
2636
2970
  );
2637
2971
  if (warrning) {
2638
2972
  Logger({
2639
2973
  level: "WARN",
2640
- message: "Parameter Validation warrnings for verifyAndChargePayment",
2974
+ message: `Parameter Validation warrnings for application > Payment > verifyAndChargePayment \n ${warrning}`,
2641
2975
  });
2642
- Logger({ level: "WARN", message: warrning });
2643
2976
  }
2644
2977
 
2645
2978
  const query_params = {};
@@ -2655,36 +2988,49 @@ class Payment {
2655
2988
  }),
2656
2989
  query_params,
2657
2990
  body,
2658
- xHeaders
2991
+ xHeaders,
2992
+ { headers }
2659
2993
  );
2660
2994
 
2995
+ let responseData = response;
2996
+ if (headers) {
2997
+ responseData = response[0];
2998
+ }
2999
+
2661
3000
  const {
2662
3001
  error: res_error,
2663
- } = PaymentModel.ChargeCustomerResponse().validate(response, {
2664
- abortEarly: false,
2665
- allowUnknown: false,
2666
- });
3002
+ } = PaymentApplicationModel.ChargeCustomerResponse().validate(
3003
+ responseData,
3004
+ { abortEarly: false, allowUnknown: false }
3005
+ );
2667
3006
 
2668
3007
  if (res_error) {
2669
3008
  Logger({
2670
3009
  level: "WARN",
2671
- message: "Response Validation Warnnings for verifyAndChargePayment",
3010
+ message: `Response Validation Warnnings for application > Payment > verifyAndChargePayment \n ${res_error}`,
2672
3011
  });
2673
- Logger({ level: "WARN", message: res_error });
2674
3012
  }
2675
3013
 
2676
3014
  return response;
2677
3015
  }
2678
3016
 
2679
3017
  /**
2680
- * @param {Object} arg - Arg object.
2681
- * @param {ValidateCustomerRequest} arg.body
2682
- * @returns {Promise<ValidateCustomerResponse>} - Success response
3018
+ * @param {PaymentApplicationValidator.VerifyCustomerForPaymentParam} arg -
3019
+ * Arg object.
3020
+ * @param {import("../ApplicationAPIClient").Options} - Options
3021
+ * @returns {Promise<PaymentApplicationModel.ValidateCustomerResponse>} -
3022
+ * Success response
3023
+ * @name verifyCustomerForPayment
2683
3024
  * @summary: Validate customer for payment
2684
- * @description: Use this API to check if the customer is eligible to use credit-line facilities such as Simpl Pay Later and Rupifi.
3025
+ * @description: Use this API to check if the customer is eligible to use credit-line facilities such as Simpl Pay Later and Rupifi. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/verifyCustomerForPayment/).
2685
3026
  */
2686
- async verifyCustomerForPayment({ body } = {}) {
2687
- const { error } = PaymentValidator.verifyCustomerForPayment().validate(
3027
+ async verifyCustomerForPayment(
3028
+ { body } = {},
3029
+ { headers } = { headers: false }
3030
+ ) {
3031
+ const {
3032
+ error,
3033
+ } = PaymentApplicationValidator.verifyCustomerForPayment().validate(
2688
3034
  { body },
2689
3035
  { abortEarly: false, allowUnknown: true }
2690
3036
  );
@@ -2695,16 +3041,15 @@ class Payment {
2695
3041
  // Showing warrnings if extra unknown parameters are found
2696
3042
  const {
2697
3043
  error: warrning,
2698
- } = PaymentValidator.verifyCustomerForPayment().validate(
3044
+ } = PaymentApplicationValidator.verifyCustomerForPayment().validate(
2699
3045
  { body },
2700
3046
  { abortEarly: false, allowUnknown: false }
2701
3047
  );
2702
3048
  if (warrning) {
2703
3049
  Logger({
2704
3050
  level: "WARN",
2705
- message: "Parameter Validation warrnings for verifyCustomerForPayment",
3051
+ message: `Parameter Validation warrnings for application > Payment > verifyCustomerForPayment \n ${warrning}`,
2706
3052
  });
2707
- Logger({ level: "WARN", message: warrning });
2708
3053
  }
2709
3054
 
2710
3055
  const query_params = {};
@@ -2720,37 +3065,42 @@ class Payment {
2720
3065
  }),
2721
3066
  query_params,
2722
3067
  body,
2723
- xHeaders
3068
+ xHeaders,
3069
+ { headers }
2724
3070
  );
2725
3071
 
3072
+ let responseData = response;
3073
+ if (headers) {
3074
+ responseData = response[0];
3075
+ }
3076
+
2726
3077
  const {
2727
3078
  error: res_error,
2728
- } = PaymentModel.ValidateCustomerResponse().validate(response, {
2729
- abortEarly: false,
2730
- allowUnknown: false,
2731
- });
3079
+ } = PaymentApplicationModel.ValidateCustomerResponse().validate(
3080
+ responseData,
3081
+ { abortEarly: false, allowUnknown: false }
3082
+ );
2732
3083
 
2733
3084
  if (res_error) {
2734
3085
  Logger({
2735
3086
  level: "WARN",
2736
- message: "Response Validation Warnnings for verifyCustomerForPayment",
3087
+ message: `Response Validation Warnnings for application > Payment > verifyCustomerForPayment \n ${res_error}`,
2737
3088
  });
2738
- Logger({ level: "WARN", message: res_error });
2739
3089
  }
2740
3090
 
2741
3091
  return response;
2742
3092
  }
2743
3093
 
2744
3094
  /**
2745
- * @param {Object} arg - Arg object.
2746
- * @param {string} [arg.ifscCode] - A 11-digit alphanumeric code that
2747
- * uniquely identifies a bank branch.
2748
- * @returns {Promise<IfscCodeResponse>} - Success response
3095
+ * @param {PaymentApplicationValidator.VerifyIfscCodeParam} arg - Arg object.
3096
+ * @param {import("../ApplicationAPIClient").Options} - Options
3097
+ * @returns {Promise<PaymentApplicationModel.IfscCodeResponse>} - Success response
3098
+ * @name verifyIfscCode
2749
3099
  * @summary: Verify IFSC Code
2750
- * @description: Use this API to check whether the 11-digit IFSC code is valid and to fetch the bank details for refund.
3100
+ * @description: Use this API to check whether the 11-digit IFSC code is valid and to fetch the bank details for refund. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/verifyIfscCode/).
2751
3101
  */
2752
- async verifyIfscCode({ ifscCode } = {}) {
2753
- const { error } = PaymentValidator.verifyIfscCode().validate(
3102
+ async verifyIfscCode({ ifscCode } = {}, { headers } = { headers: false }) {
3103
+ const { error } = PaymentApplicationValidator.verifyIfscCode().validate(
2754
3104
  { ifscCode },
2755
3105
  { abortEarly: false, allowUnknown: true }
2756
3106
  );
@@ -2759,16 +3109,17 @@ class Payment {
2759
3109
  }
2760
3110
 
2761
3111
  // Showing warrnings if extra unknown parameters are found
2762
- const { error: warrning } = PaymentValidator.verifyIfscCode().validate(
3112
+ const {
3113
+ error: warrning,
3114
+ } = PaymentApplicationValidator.verifyIfscCode().validate(
2763
3115
  { ifscCode },
2764
3116
  { abortEarly: false, allowUnknown: false }
2765
3117
  );
2766
3118
  if (warrning) {
2767
3119
  Logger({
2768
3120
  level: "WARN",
2769
- message: "Parameter Validation warrnings for verifyIfscCode",
3121
+ message: `Parameter Validation warrnings for application > Payment > verifyIfscCode \n ${warrning}`,
2770
3122
  });
2771
- Logger({ level: "WARN", message: warrning });
2772
3123
  }
2773
3124
 
2774
3125
  const query_params = {};
@@ -2785,12 +3136,18 @@ class Payment {
2785
3136
  }),
2786
3137
  query_params,
2787
3138
  undefined,
2788
- xHeaders
3139
+ xHeaders,
3140
+ { headers }
2789
3141
  );
2790
3142
 
3143
+ let responseData = response;
3144
+ if (headers) {
3145
+ responseData = response[0];
3146
+ }
3147
+
2791
3148
  const {
2792
3149
  error: res_error,
2793
- } = PaymentModel.IfscCodeResponse().validate(response, {
3150
+ } = PaymentApplicationModel.IfscCodeResponse().validate(responseData, {
2794
3151
  abortEarly: false,
2795
3152
  allowUnknown: false,
2796
3153
  });
@@ -2798,25 +3155,32 @@ class Payment {
2798
3155
  if (res_error) {
2799
3156
  Logger({
2800
3157
  level: "WARN",
2801
- message: "Response Validation Warnnings for verifyIfscCode",
3158
+ message: `Response Validation Warnnings for application > Payment > verifyIfscCode \n ${res_error}`,
2802
3159
  });
2803
- Logger({ level: "WARN", message: res_error });
2804
3160
  }
2805
3161
 
2806
3162
  return response;
2807
3163
  }
2808
3164
 
2809
3165
  /**
2810
- * @param {Object} arg - Arg object.
2811
- * @param {AddBeneficiaryViaOtpVerificationRequest} arg.body
2812
- * @returns {Promise<AddBeneficiaryViaOtpVerificationResponse>} - Success response
3166
+ * @param {PaymentApplicationValidator.VerifyOtpAndAddBeneficiaryForBankParam} arg
3167
+ * - Arg object.
3168
+ *
3169
+ * @param {import("../ApplicationAPIClient").Options} - Options
3170
+ * @returns {Promise<PaymentApplicationModel.AddBeneficiaryViaOtpVerificationResponse>}
3171
+ * - Success response
3172
+ *
3173
+ * @name verifyOtpAndAddBeneficiaryForBank
2813
3174
  * @summary: Verify the beneficiary details using OTP
2814
- * @description: Use this API to perform an OTP validation before saving the beneficiary details added for a refund.
3175
+ * @description: Use this API to perform an OTP validation before saving the beneficiary details added for a refund. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/verifyOtpAndAddBeneficiaryForBank/).
2815
3176
  */
2816
- async verifyOtpAndAddBeneficiaryForBank({ body } = {}) {
3177
+ async verifyOtpAndAddBeneficiaryForBank(
3178
+ { body } = {},
3179
+ { headers } = { headers: false }
3180
+ ) {
2817
3181
  const {
2818
3182
  error,
2819
- } = PaymentValidator.verifyOtpAndAddBeneficiaryForBank().validate(
3183
+ } = PaymentApplicationValidator.verifyOtpAndAddBeneficiaryForBank().validate(
2820
3184
  { body },
2821
3185
  { abortEarly: false, allowUnknown: true }
2822
3186
  );
@@ -2827,17 +3191,15 @@ class Payment {
2827
3191
  // Showing warrnings if extra unknown parameters are found
2828
3192
  const {
2829
3193
  error: warrning,
2830
- } = PaymentValidator.verifyOtpAndAddBeneficiaryForBank().validate(
3194
+ } = PaymentApplicationValidator.verifyOtpAndAddBeneficiaryForBank().validate(
2831
3195
  { body },
2832
3196
  { abortEarly: false, allowUnknown: false }
2833
3197
  );
2834
3198
  if (warrning) {
2835
3199
  Logger({
2836
3200
  level: "WARN",
2837
- message:
2838
- "Parameter Validation warrnings for verifyOtpAndAddBeneficiaryForBank",
3201
+ message: `Parameter Validation warrnings for application > Payment > verifyOtpAndAddBeneficiaryForBank \n ${warrning}`,
2839
3202
  });
2840
- Logger({ level: "WARN", message: warrning });
2841
3203
  }
2842
3204
 
2843
3205
  const query_params = {};
@@ -2853,39 +3215,49 @@ class Payment {
2853
3215
  }),
2854
3216
  query_params,
2855
3217
  body,
2856
- xHeaders
3218
+ xHeaders,
3219
+ { headers }
2857
3220
  );
2858
3221
 
3222
+ let responseData = response;
3223
+ if (headers) {
3224
+ responseData = response[0];
3225
+ }
3226
+
2859
3227
  const {
2860
3228
  error: res_error,
2861
- } = PaymentModel.AddBeneficiaryViaOtpVerificationResponse().validate(
2862
- response,
3229
+ } = PaymentApplicationModel.AddBeneficiaryViaOtpVerificationResponse().validate(
3230
+ responseData,
2863
3231
  { abortEarly: false, allowUnknown: false }
2864
3232
  );
2865
3233
 
2866
3234
  if (res_error) {
2867
3235
  Logger({
2868
3236
  level: "WARN",
2869
- message:
2870
- "Response Validation Warnnings for verifyOtpAndAddBeneficiaryForBank",
3237
+ message: `Response Validation Warnnings for application > Payment > verifyOtpAndAddBeneficiaryForBank \n ${res_error}`,
2871
3238
  });
2872
- Logger({ level: "WARN", message: res_error });
2873
3239
  }
2874
3240
 
2875
3241
  return response;
2876
3242
  }
2877
3243
 
2878
3244
  /**
2879
- * @param {Object} arg - Arg object.
2880
- * @param {WalletOtpRequest} arg.body
2881
- * @returns {Promise<WalletOtpResponse>} - Success response
3245
+ * @param {PaymentApplicationValidator.VerifyOtpAndAddBeneficiaryForWalletParam} arg
3246
+ * - Arg object.
3247
+ *
3248
+ * @param {import("../ApplicationAPIClient").Options} - Options
3249
+ * @returns {Promise<PaymentApplicationModel.WalletOtpResponse>} - Success response
3250
+ * @name verifyOtpAndAddBeneficiaryForWallet
2882
3251
  * @summary: Send OTP on adding a wallet beneficiary
2883
- * @description: Use this API to send an OTP while adding a wallet beneficiary by mobile no. verification.
3252
+ * @description: Use this API to send an OTP while adding a wallet beneficiary by mobile no. verification. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/payment/verifyOtpAndAddBeneficiaryForWallet/).
2884
3253
  */
2885
- async verifyOtpAndAddBeneficiaryForWallet({ body } = {}) {
3254
+ async verifyOtpAndAddBeneficiaryForWallet(
3255
+ { body } = {},
3256
+ { headers } = { headers: false }
3257
+ ) {
2886
3258
  const {
2887
3259
  error,
2888
- } = PaymentValidator.verifyOtpAndAddBeneficiaryForWallet().validate(
3260
+ } = PaymentApplicationValidator.verifyOtpAndAddBeneficiaryForWallet().validate(
2889
3261
  { body },
2890
3262
  { abortEarly: false, allowUnknown: true }
2891
3263
  );
@@ -2896,17 +3268,15 @@ class Payment {
2896
3268
  // Showing warrnings if extra unknown parameters are found
2897
3269
  const {
2898
3270
  error: warrning,
2899
- } = PaymentValidator.verifyOtpAndAddBeneficiaryForWallet().validate(
3271
+ } = PaymentApplicationValidator.verifyOtpAndAddBeneficiaryForWallet().validate(
2900
3272
  { body },
2901
3273
  { abortEarly: false, allowUnknown: false }
2902
3274
  );
2903
3275
  if (warrning) {
2904
3276
  Logger({
2905
3277
  level: "WARN",
2906
- message:
2907
- "Parameter Validation warrnings for verifyOtpAndAddBeneficiaryForWallet",
3278
+ message: `Parameter Validation warrnings for application > Payment > verifyOtpAndAddBeneficiaryForWallet \n ${warrning}`,
2908
3279
  });
2909
- Logger({ level: "WARN", message: warrning });
2910
3280
  }
2911
3281
 
2912
3282
  const query_params = {};
@@ -2922,12 +3292,18 @@ class Payment {
2922
3292
  }),
2923
3293
  query_params,
2924
3294
  body,
2925
- xHeaders
3295
+ xHeaders,
3296
+ { headers }
2926
3297
  );
2927
3298
 
3299
+ let responseData = response;
3300
+ if (headers) {
3301
+ responseData = response[0];
3302
+ }
3303
+
2928
3304
  const {
2929
3305
  error: res_error,
2930
- } = PaymentModel.WalletOtpResponse().validate(response, {
3306
+ } = PaymentApplicationModel.WalletOtpResponse().validate(responseData, {
2931
3307
  abortEarly: false,
2932
3308
  allowUnknown: false,
2933
3309
  });
@@ -2935,10 +3311,8 @@ class Payment {
2935
3311
  if (res_error) {
2936
3312
  Logger({
2937
3313
  level: "WARN",
2938
- message:
2939
- "Response Validation Warnnings for verifyOtpAndAddBeneficiaryForWallet",
3314
+ message: `Response Validation Warnnings for application > Payment > verifyOtpAndAddBeneficiaryForWallet \n ${res_error}`,
2940
3315
  });
2941
- Logger({ level: "WARN", message: res_error });
2942
3316
  }
2943
3317
 
2944
3318
  return response;