@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
@@ -1,8 +1,8 @@
1
1
  const PlatformAPIClient = require("../PlatformAPIClient");
2
2
  const { FDKClientValidationError } = require("../../common/FDKError");
3
3
  const Paginator = require("../../common/Paginator");
4
- const PaymentValidator = require("./PaymentPlatformApplicationValidator");
5
- const PaymentModel = require("./PaymentPlatformModel");
4
+ const PaymentPlatformApplicationValidator = require("./PaymentPlatformApplicationValidator");
5
+ const PaymentPlatformModel = require("./PaymentPlatformModel");
6
6
  const { Logger } = require("./../../common/Logger");
7
7
  const Joi = require("joi");
8
8
 
@@ -13,15 +13,20 @@ class Payment {
13
13
  }
14
14
 
15
15
  /**
16
- * @param {Object} arg - Arg object.
17
- * @param {string} arg.terminalUniqueIdentifier - Terminal unique identifier
18
- * @param {EdcUpdateRequest} arg.body
19
- * @returns {Promise<EdcDeviceUpdateResponse>} - Success response
16
+ * @param {PaymentPlatformApplicationValidator.AddEdcDeviceParam} arg - Arg object
17
+ * @param {import("../PlatformAPIClient").Options} - Options
18
+ * @returns {Promise<PaymentPlatformModel.EdcDeviceUpdateResponse>} - Success response
19
+ * @name addEdcDevice
20
20
  * @summary: Update store id and device tag of edc device
21
- * @description: Use this API to Update store id and device tag of edc device
21
+ * @description: Use this API to Update store id and device tag of edc device - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/addEdcDevice/).
22
22
  */
23
- async addEdcDevice({ terminalUniqueIdentifier, body } = {}) {
24
- const { error } = PaymentValidator.addEdcDevice().validate(
23
+ async addEdcDevice(
24
+ { terminalUniqueIdentifier, body } = {},
25
+ { headers } = { headers: false }
26
+ ) {
27
+ const {
28
+ error,
29
+ } = PaymentPlatformApplicationValidator.addEdcDevice().validate(
25
30
  {
26
31
  terminalUniqueIdentifier,
27
32
  body,
@@ -33,7 +38,9 @@ class Payment {
33
38
  }
34
39
 
35
40
  // Showing warrnings if extra unknown parameters are found
36
- const { error: warrning } = PaymentValidator.addEdcDevice().validate(
41
+ const {
42
+ error: warrning,
43
+ } = PaymentPlatformApplicationValidator.addEdcDevice().validate(
37
44
  {
38
45
  terminalUniqueIdentifier,
39
46
  body,
@@ -43,9 +50,8 @@ class Payment {
43
50
  if (warrning) {
44
51
  Logger({
45
52
  level: "WARN",
46
- message: "Parameter Validation warrnings for addEdcDevice",
53
+ message: `Parameter Validation warrnings for platform > Payment > addEdcDevice \n ${warrning}`,
47
54
  });
48
- Logger({ level: "WARN", message: warrning });
49
55
  }
50
56
 
51
57
  const query_params = {};
@@ -55,12 +61,19 @@ class Payment {
55
61
  "put",
56
62
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/edc-device/${terminalUniqueIdentifier}`,
57
63
  query_params,
58
- body
64
+ body,
65
+ undefined,
66
+ { headers }
59
67
  );
60
68
 
69
+ let responseData = response;
70
+ if (headers) {
71
+ responseData = response[0];
72
+ }
73
+
61
74
  const {
62
75
  error: res_error,
63
- } = PaymentModel.EdcDeviceUpdateResponse().validate(response, {
76
+ } = PaymentPlatformModel.EdcDeviceUpdateResponse().validate(responseData, {
64
77
  abortEarly: false,
65
78
  allowUnknown: false,
66
79
  });
@@ -68,23 +81,30 @@ class Payment {
68
81
  if (res_error) {
69
82
  Logger({
70
83
  level: "WARN",
71
- message: "Response Validation Warnnings for addEdcDevice",
84
+ message: `Response Validation Warnnings for platform > Payment > addEdcDevice \n ${res_error}`,
72
85
  });
73
- Logger({ level: "WARN", message: res_error });
74
86
  }
75
87
 
76
88
  return response;
77
89
  }
78
90
 
79
91
  /**
80
- * @param {Object} arg - Arg object.
81
- * @param {AddBeneficiaryDetailsOTPRequest} arg.body
82
- * @returns {Promise<RefundAccountResponse>} - Success response
92
+ * @param {PaymentPlatformApplicationValidator.AddRefundBankAccountUsingOTPParam} arg
93
+ * - Arg object
94
+ *
95
+ * @param {import("../PlatformAPIClient").Options} - Options
96
+ * @returns {Promise<PaymentPlatformModel.RefundAccountResponse>} - Success response
97
+ * @name addRefundBankAccountUsingOTP
83
98
  * @summary: Save bank details for cancelled/returned order
84
- * @description: Use this API to save bank details for returned/cancelled order to refund amount in his account.
99
+ * @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/platform/payment/addRefundBankAccountUsingOTP/).
85
100
  */
86
- async addRefundBankAccountUsingOTP({ body } = {}) {
87
- const { error } = PaymentValidator.addRefundBankAccountUsingOTP().validate(
101
+ async addRefundBankAccountUsingOTP(
102
+ { body } = {},
103
+ { headers } = { headers: false }
104
+ ) {
105
+ const {
106
+ error,
107
+ } = PaymentPlatformApplicationValidator.addRefundBankAccountUsingOTP().validate(
88
108
  {
89
109
  body,
90
110
  },
@@ -97,7 +117,7 @@ class Payment {
97
117
  // Showing warrnings if extra unknown parameters are found
98
118
  const {
99
119
  error: warrning,
100
- } = PaymentValidator.addRefundBankAccountUsingOTP().validate(
120
+ } = PaymentPlatformApplicationValidator.addRefundBankAccountUsingOTP().validate(
101
121
  {
102
122
  body,
103
123
  },
@@ -106,10 +126,8 @@ class Payment {
106
126
  if (warrning) {
107
127
  Logger({
108
128
  level: "WARN",
109
- message:
110
- "Parameter Validation warrnings for addRefundBankAccountUsingOTP",
129
+ message: `Parameter Validation warrnings for platform > Payment > addRefundBankAccountUsingOTP \n ${warrning}`,
111
130
  });
112
- Logger({ level: "WARN", message: warrning });
113
131
  }
114
132
 
115
133
  const query_params = {};
@@ -119,12 +137,19 @@ class Payment {
119
137
  "post",
120
138
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/refund/account`,
121
139
  query_params,
122
- body
140
+ body,
141
+ undefined,
142
+ { headers }
123
143
  );
124
144
 
145
+ let responseData = response;
146
+ if (headers) {
147
+ responseData = response[0];
148
+ }
149
+
125
150
  const {
126
151
  error: res_error,
127
- } = PaymentModel.RefundAccountResponse().validate(response, {
152
+ } = PaymentPlatformModel.RefundAccountResponse().validate(responseData, {
128
153
  abortEarly: false,
129
154
  allowUnknown: false,
130
155
  });
@@ -132,24 +157,28 @@ class Payment {
132
157
  if (res_error) {
133
158
  Logger({
134
159
  level: "WARN",
135
- message:
136
- "Response Validation Warnnings for addRefundBankAccountUsingOTP",
160
+ message: `Response Validation Warnnings for platform > Payment > addRefundBankAccountUsingOTP \n ${res_error}`,
137
161
  });
138
- Logger({ level: "WARN", message: res_error });
139
162
  }
140
163
 
141
164
  return response;
142
165
  }
143
166
 
144
167
  /**
145
- * @param {Object} arg - Arg object.
146
- * @param {CancelOrResendPaymentLinkRequest} arg.body
147
- * @returns {Promise<CancelPaymentLinkResponse>} - Success response
168
+ * @param {PaymentPlatformApplicationValidator.CancelPaymentLinkParam} arg
169
+ * - Arg object
170
+ *
171
+ * @param {import("../PlatformAPIClient").Options} - Options
172
+ * @returns {Promise<PaymentPlatformModel.CancelPaymentLinkResponse>} -
173
+ * Success response
174
+ * @name cancelPaymentLink
148
175
  * @summary: Cancel payment link
149
- * @description: Use this API to cancel a payment link for the customer
176
+ * @description: Use this API to cancel a payment link for the customer - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/cancelPaymentLink/).
150
177
  */
151
- async cancelPaymentLink({ body } = {}) {
152
- const { error } = PaymentValidator.cancelPaymentLink().validate(
178
+ async cancelPaymentLink({ body } = {}, { headers } = { headers: false }) {
179
+ const {
180
+ error,
181
+ } = PaymentPlatformApplicationValidator.cancelPaymentLink().validate(
153
182
  {
154
183
  body,
155
184
  },
@@ -160,7 +189,9 @@ class Payment {
160
189
  }
161
190
 
162
191
  // Showing warrnings if extra unknown parameters are found
163
- const { error: warrning } = PaymentValidator.cancelPaymentLink().validate(
192
+ const {
193
+ error: warrning,
194
+ } = PaymentPlatformApplicationValidator.cancelPaymentLink().validate(
164
195
  {
165
196
  body,
166
197
  },
@@ -169,9 +200,8 @@ class Payment {
169
200
  if (warrning) {
170
201
  Logger({
171
202
  level: "WARN",
172
- message: "Parameter Validation warrnings for cancelPaymentLink",
203
+ message: `Parameter Validation warrnings for platform > Payment > cancelPaymentLink \n ${warrning}`,
173
204
  });
174
- Logger({ level: "WARN", message: warrning });
175
205
  }
176
206
 
177
207
  const query_params = {};
@@ -181,36 +211,51 @@ class Payment {
181
211
  "post",
182
212
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/cancel-payment-link/`,
183
213
  query_params,
184
- body
214
+ body,
215
+ undefined,
216
+ { headers }
185
217
  );
186
218
 
219
+ let responseData = response;
220
+ if (headers) {
221
+ responseData = response[0];
222
+ }
223
+
187
224
  const {
188
225
  error: res_error,
189
- } = PaymentModel.CancelPaymentLinkResponse().validate(response, {
190
- abortEarly: false,
191
- allowUnknown: false,
192
- });
226
+ } = PaymentPlatformModel.CancelPaymentLinkResponse().validate(
227
+ responseData,
228
+ { abortEarly: false, allowUnknown: false }
229
+ );
193
230
 
194
231
  if (res_error) {
195
232
  Logger({
196
233
  level: "WARN",
197
- message: "Response Validation Warnnings for cancelPaymentLink",
234
+ message: `Response Validation Warnnings for platform > Payment > cancelPaymentLink \n ${res_error}`,
198
235
  });
199
- Logger({ level: "WARN", message: res_error });
200
236
  }
201
237
 
202
238
  return response;
203
239
  }
204
240
 
205
241
  /**
206
- * @param {Object} arg - Arg object.
207
- * @param {PaymentStatusUpdateRequest} arg.body
208
- * @returns {Promise<PaymentStatusUpdateResponse>} - Success response
242
+ * @param {PaymentPlatformApplicationValidator.CheckAndUpdatePaymentStatusParam} arg
243
+ * - Arg object
244
+ *
245
+ * @param {import("../PlatformAPIClient").Options} - Options
246
+ * @returns {Promise<PaymentPlatformModel.PaymentStatusUpdateResponse>} -
247
+ * Success response
248
+ * @name checkAndUpdatePaymentStatus
209
249
  * @summary: Performs continuous polling to check status of payment on the server
210
- * @description: Use this API to perform continuous polling at intervals to check the status of payment until timeout.
250
+ * @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/platform/payment/checkAndUpdatePaymentStatus/).
211
251
  */
212
- async checkAndUpdatePaymentStatus({ body } = {}) {
213
- const { error } = PaymentValidator.checkAndUpdatePaymentStatus().validate(
252
+ async checkAndUpdatePaymentStatus(
253
+ { body } = {},
254
+ { headers } = { headers: false }
255
+ ) {
256
+ const {
257
+ error,
258
+ } = PaymentPlatformApplicationValidator.checkAndUpdatePaymentStatus().validate(
214
259
  {
215
260
  body,
216
261
  },
@@ -223,7 +268,7 @@ class Payment {
223
268
  // Showing warrnings if extra unknown parameters are found
224
269
  const {
225
270
  error: warrning,
226
- } = PaymentValidator.checkAndUpdatePaymentStatus().validate(
271
+ } = PaymentPlatformApplicationValidator.checkAndUpdatePaymentStatus().validate(
227
272
  {
228
273
  body,
229
274
  },
@@ -232,10 +277,8 @@ class Payment {
232
277
  if (warrning) {
233
278
  Logger({
234
279
  level: "WARN",
235
- message:
236
- "Parameter Validation warrnings for checkAndUpdatePaymentStatus",
280
+ message: `Parameter Validation warrnings for platform > Payment > checkAndUpdatePaymentStatus \n ${warrning}`,
237
281
  });
238
- Logger({ level: "WARN", message: warrning });
239
282
  }
240
283
 
241
284
  const query_params = {};
@@ -245,37 +288,46 @@ class Payment {
245
288
  "post",
246
289
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/confirm/polling`,
247
290
  query_params,
248
- body
291
+ body,
292
+ undefined,
293
+ { headers }
249
294
  );
250
295
 
296
+ let responseData = response;
297
+ if (headers) {
298
+ responseData = response[0];
299
+ }
300
+
251
301
  const {
252
302
  error: res_error,
253
- } = PaymentModel.PaymentStatusUpdateResponse().validate(response, {
254
- abortEarly: false,
255
- allowUnknown: false,
256
- });
303
+ } = PaymentPlatformModel.PaymentStatusUpdateResponse().validate(
304
+ responseData,
305
+ { abortEarly: false, allowUnknown: false }
306
+ );
257
307
 
258
308
  if (res_error) {
259
309
  Logger({
260
310
  level: "WARN",
261
- message:
262
- "Response Validation Warnnings for checkAndUpdatePaymentStatus",
311
+ message: `Response Validation Warnnings for platform > Payment > checkAndUpdatePaymentStatus \n ${res_error}`,
263
312
  });
264
- Logger({ level: "WARN", message: res_error });
265
313
  }
266
314
 
267
315
  return response;
268
316
  }
269
317
 
270
318
  /**
271
- * @param {Object} arg - Arg object.
272
- * @param {PaymentConfirmationRequest} arg.body
273
- * @returns {Promise<PaymentConfirmationResponse>} - Success response
319
+ * @param {PaymentPlatformApplicationValidator.ConfirmPaymentParam} arg - Arg object
320
+ * @param {import("../PlatformAPIClient").Options} - Options
321
+ * @returns {Promise<PaymentPlatformModel.PaymentConfirmationResponse>} -
322
+ * Success response
323
+ * @name confirmPayment
274
324
  * @summary: Confirm payment after successful payment from payment gateway
275
- * @description: Use this API to confirm payment after payment gateway accepted payment.
325
+ * @description: Use this API to confirm payment after payment gateway accepted payment. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/confirmPayment/).
276
326
  */
277
- async confirmPayment({ body } = {}) {
278
- const { error } = PaymentValidator.confirmPayment().validate(
327
+ async confirmPayment({ body } = {}, { headers } = { headers: false }) {
328
+ const {
329
+ error,
330
+ } = PaymentPlatformApplicationValidator.confirmPayment().validate(
279
331
  {
280
332
  body,
281
333
  },
@@ -286,7 +338,9 @@ class Payment {
286
338
  }
287
339
 
288
340
  // Showing warrnings if extra unknown parameters are found
289
- const { error: warrning } = PaymentValidator.confirmPayment().validate(
341
+ const {
342
+ error: warrning,
343
+ } = PaymentPlatformApplicationValidator.confirmPayment().validate(
290
344
  {
291
345
  body,
292
346
  },
@@ -295,9 +349,8 @@ class Payment {
295
349
  if (warrning) {
296
350
  Logger({
297
351
  level: "WARN",
298
- message: "Parameter Validation warrnings for confirmPayment",
352
+ message: `Parameter Validation warrnings for platform > Payment > confirmPayment \n ${warrning}`,
299
353
  });
300
- Logger({ level: "WARN", message: warrning });
301
354
  }
302
355
 
303
356
  const query_params = {};
@@ -307,36 +360,48 @@ class Payment {
307
360
  "post",
308
361
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/confirm`,
309
362
  query_params,
310
- body
363
+ body,
364
+ undefined,
365
+ { headers }
311
366
  );
312
367
 
368
+ let responseData = response;
369
+ if (headers) {
370
+ responseData = response[0];
371
+ }
372
+
313
373
  const {
314
374
  error: res_error,
315
- } = PaymentModel.PaymentConfirmationResponse().validate(response, {
316
- abortEarly: false,
317
- allowUnknown: false,
318
- });
375
+ } = PaymentPlatformModel.PaymentConfirmationResponse().validate(
376
+ responseData,
377
+ { abortEarly: false, allowUnknown: false }
378
+ );
319
379
 
320
380
  if (res_error) {
321
381
  Logger({
322
382
  level: "WARN",
323
- message: "Response Validation Warnnings for confirmPayment",
383
+ message: `Response Validation Warnnings for platform > Payment > confirmPayment \n ${res_error}`,
324
384
  });
325
- Logger({ level: "WARN", message: res_error });
326
385
  }
327
386
 
328
387
  return response;
329
388
  }
330
389
 
331
390
  /**
332
- * @param {Object} arg - Arg object.
333
- * @param {CreatePaymentLinkRequest} arg.body
334
- * @returns {Promise<CreatePaymentLinkResponse>} - Success response
391
+ * @param {PaymentPlatformApplicationValidator.CreatePaymentLinkParam} arg
392
+ * - Arg object
393
+ *
394
+ * @param {import("../PlatformAPIClient").Options} - Options
395
+ * @returns {Promise<PaymentPlatformModel.CreatePaymentLinkResponse>} -
396
+ * Success response
397
+ * @name createPaymentLink
335
398
  * @summary: Create payment link
336
- * @description: Use this API to create a payment link for the customer
399
+ * @description: Use this API to create a payment link for the customer - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/createPaymentLink/).
337
400
  */
338
- async createPaymentLink({ body } = {}) {
339
- const { error } = PaymentValidator.createPaymentLink().validate(
401
+ async createPaymentLink({ body } = {}, { headers } = { headers: false }) {
402
+ const {
403
+ error,
404
+ } = PaymentPlatformApplicationValidator.createPaymentLink().validate(
340
405
  {
341
406
  body,
342
407
  },
@@ -347,7 +412,9 @@ class Payment {
347
412
  }
348
413
 
349
414
  // Showing warrnings if extra unknown parameters are found
350
- const { error: warrning } = PaymentValidator.createPaymentLink().validate(
415
+ const {
416
+ error: warrning,
417
+ } = PaymentPlatformApplicationValidator.createPaymentLink().validate(
351
418
  {
352
419
  body,
353
420
  },
@@ -356,9 +423,8 @@ class Payment {
356
423
  if (warrning) {
357
424
  Logger({
358
425
  level: "WARN",
359
- message: "Parameter Validation warrnings for createPaymentLink",
426
+ message: `Parameter Validation warrnings for platform > Payment > createPaymentLink \n ${warrning}`,
360
427
  });
361
- Logger({ level: "WARN", message: warrning });
362
428
  }
363
429
 
364
430
  const query_params = {};
@@ -368,35 +434,46 @@ class Payment {
368
434
  "post",
369
435
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/create-payment-link/`,
370
436
  query_params,
371
- body
437
+ body,
438
+ undefined,
439
+ { headers }
372
440
  );
373
441
 
442
+ let responseData = response;
443
+ if (headers) {
444
+ responseData = response[0];
445
+ }
446
+
374
447
  const {
375
448
  error: res_error,
376
- } = PaymentModel.CreatePaymentLinkResponse().validate(response, {
377
- abortEarly: false,
378
- allowUnknown: false,
379
- });
449
+ } = PaymentPlatformModel.CreatePaymentLinkResponse().validate(
450
+ responseData,
451
+ { abortEarly: false, allowUnknown: false }
452
+ );
380
453
 
381
454
  if (res_error) {
382
455
  Logger({
383
456
  level: "WARN",
384
- message: "Response Validation Warnnings for createPaymentLink",
457
+ message: `Response Validation Warnnings for platform > Payment > createPaymentLink \n ${res_error}`,
385
458
  });
386
- Logger({ level: "WARN", message: res_error });
387
459
  }
388
460
 
389
461
  return response;
390
462
  }
391
463
 
392
464
  /**
393
- * @param {Object} arg - Arg object.
394
- * @returns {Promise<EdcAggregatorAndModelListResponse>} - Success response
465
+ * @param {import("../PlatformAPIClient").Options} - Options
466
+ * @returns {Promise<PaymentPlatformModel.EdcAggregatorAndModelListResponse>}
467
+ * - Success response
468
+ *
469
+ * @name edcAggregatorsAndModelList
395
470
  * @summary: get some information about the store and edc device
396
- * @description: Use this API to get info of devices linked to a particular app.
471
+ * @description: Use this API to get info of devices linked to a particular app. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/edcAggregatorsAndModelList/).
397
472
  */
398
- async edcAggregatorsAndModelList({} = {}) {
399
- const { error } = PaymentValidator.edcAggregatorsAndModelList().validate(
473
+ async edcAggregatorsAndModelList({ headers } = { headers: false }) {
474
+ const {
475
+ error,
476
+ } = PaymentPlatformApplicationValidator.edcAggregatorsAndModelList().validate(
400
477
  {},
401
478
  { abortEarly: false, allowUnknown: true }
402
479
  );
@@ -407,17 +484,15 @@ class Payment {
407
484
  // Showing warrnings if extra unknown parameters are found
408
485
  const {
409
486
  error: warrning,
410
- } = PaymentValidator.edcAggregatorsAndModelList().validate(
487
+ } = PaymentPlatformApplicationValidator.edcAggregatorsAndModelList().validate(
411
488
  {},
412
489
  { abortEarly: false, allowUnknown: false }
413
490
  );
414
491
  if (warrning) {
415
492
  Logger({
416
493
  level: "WARN",
417
- message:
418
- "Parameter Validation warrnings for edcAggregatorsAndModelList",
494
+ message: `Parameter Validation warrnings for platform > Payment > edcAggregatorsAndModelList \n ${warrning}`,
419
495
  });
420
- Logger({ level: "WARN", message: warrning });
421
496
  }
422
497
 
423
498
  const query_params = {};
@@ -427,40 +502,48 @@ class Payment {
427
502
  "get",
428
503
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/edc-aggregator-list`,
429
504
  query_params,
430
- undefined
505
+ undefined,
506
+ undefined,
507
+ { headers }
431
508
  );
432
509
 
510
+ let responseData = response;
511
+ if (headers) {
512
+ responseData = response[0];
513
+ }
514
+
433
515
  const {
434
516
  error: res_error,
435
- } = PaymentModel.EdcAggregatorAndModelListResponse().validate(response, {
436
- abortEarly: false,
437
- allowUnknown: false,
438
- });
517
+ } = PaymentPlatformModel.EdcAggregatorAndModelListResponse().validate(
518
+ responseData,
519
+ { abortEarly: false, allowUnknown: false }
520
+ );
439
521
 
440
522
  if (res_error) {
441
523
  Logger({
442
524
  level: "WARN",
443
- message: "Response Validation Warnnings for edcAggregatorsAndModelList",
525
+ message: `Response Validation Warnnings for platform > Payment > edcAggregatorsAndModelList \n ${res_error}`,
444
526
  });
445
- Logger({ level: "WARN", message: res_error });
446
527
  }
447
528
 
448
529
  return response;
449
530
  }
450
531
 
451
532
  /**
452
- * @param {Object} arg - Arg object.
453
- * @param {number} [arg.pageNo] -
454
- * @param {number} [arg.pageSize] -
455
- * @param {boolean} [arg.isActive] -
456
- * @param {number} [arg.storeId] -
457
- * @param {string} [arg.deviceTag] -
458
- * @returns {Promise<EdcDeviceListResponse>} - Success response
533
+ * @param {PaymentPlatformApplicationValidator.EdcDeviceListParam} arg - Arg object
534
+ * @param {import("../PlatformAPIClient").Options} - Options
535
+ * @returns {Promise<PaymentPlatformModel.EdcDeviceListResponse>} - Success response
536
+ * @name edcDeviceList
459
537
  * @summary: get all the device list of an app
460
- * @description: Use this API to get all devices linked to a particular app.
538
+ * @description: Use this API to get all devices linked to a particular app. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/edcDeviceList/).
461
539
  */
462
- async edcDeviceList({ pageNo, pageSize, isActive, storeId, deviceTag } = {}) {
463
- const { error } = PaymentValidator.edcDeviceList().validate(
540
+ async edcDeviceList(
541
+ { pageNo, pageSize, isActive, storeId, deviceTag } = {},
542
+ { headers } = { headers: false }
543
+ ) {
544
+ const {
545
+ error,
546
+ } = PaymentPlatformApplicationValidator.edcDeviceList().validate(
464
547
  {
465
548
  pageNo,
466
549
  pageSize,
@@ -475,7 +558,9 @@ class Payment {
475
558
  }
476
559
 
477
560
  // Showing warrnings if extra unknown parameters are found
478
- const { error: warrning } = PaymentValidator.edcDeviceList().validate(
561
+ const {
562
+ error: warrning,
563
+ } = PaymentPlatformApplicationValidator.edcDeviceList().validate(
479
564
  {
480
565
  pageNo,
481
566
  pageSize,
@@ -488,9 +573,8 @@ class Payment {
488
573
  if (warrning) {
489
574
  Logger({
490
575
  level: "WARN",
491
- message: "Parameter Validation warrnings for edcDeviceList",
576
+ message: `Parameter Validation warrnings for platform > Payment > edcDeviceList \n ${warrning}`,
492
577
  });
493
- Logger({ level: "WARN", message: warrning });
494
578
  }
495
579
 
496
580
  const query_params = {};
@@ -505,12 +589,19 @@ class Payment {
505
589
  "get",
506
590
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/edc-device-list`,
507
591
  query_params,
508
- undefined
592
+ undefined,
593
+ undefined,
594
+ { headers }
509
595
  );
510
596
 
597
+ let responseData = response;
598
+ if (headers) {
599
+ responseData = response[0];
600
+ }
601
+
511
602
  const {
512
603
  error: res_error,
513
- } = PaymentModel.EdcDeviceListResponse().validate(response, {
604
+ } = PaymentPlatformModel.EdcDeviceListResponse().validate(responseData, {
514
605
  abortEarly: false,
515
606
  allowUnknown: false,
516
607
  });
@@ -518,22 +609,24 @@ class Payment {
518
609
  if (res_error) {
519
610
  Logger({
520
611
  level: "WARN",
521
- message: "Response Validation Warnnings for edcDeviceList",
612
+ message: `Response Validation Warnnings for platform > Payment > edcDeviceList \n ${res_error}`,
522
613
  });
523
- Logger({ level: "WARN", message: res_error });
524
614
  }
525
615
 
526
616
  return response;
527
617
  }
528
618
 
529
619
  /**
530
- * @param {Object} arg - Arg object.
531
- * @returns {Promise<EdcDeviceStatsResponse>} - Success response
620
+ * @param {import("../PlatformAPIClient").Options} - Options
621
+ * @returns {Promise<PaymentPlatformModel.EdcDeviceStatsResponse>} - Success response
622
+ * @name edcDeviceStats
532
623
  * @summary: get some information about the store and edc device
533
- * @description: Use this API to get info of devices linked to a particular app.
624
+ * @description: Use this API to get info of devices linked to a particular app. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/edcDeviceStats/).
534
625
  */
535
- async edcDeviceStats({} = {}) {
536
- const { error } = PaymentValidator.edcDeviceStats().validate(
626
+ async edcDeviceStats({ headers } = { headers: false }) {
627
+ const {
628
+ error,
629
+ } = PaymentPlatformApplicationValidator.edcDeviceStats().validate(
537
630
  {},
538
631
  { abortEarly: false, allowUnknown: true }
539
632
  );
@@ -542,16 +635,17 @@ class Payment {
542
635
  }
543
636
 
544
637
  // Showing warrnings if extra unknown parameters are found
545
- const { error: warrning } = PaymentValidator.edcDeviceStats().validate(
638
+ const {
639
+ error: warrning,
640
+ } = PaymentPlatformApplicationValidator.edcDeviceStats().validate(
546
641
  {},
547
642
  { abortEarly: false, allowUnknown: false }
548
643
  );
549
644
  if (warrning) {
550
645
  Logger({
551
646
  level: "WARN",
552
- message: "Parameter Validation warrnings for edcDeviceStats",
647
+ message: `Parameter Validation warrnings for platform > Payment > edcDeviceStats \n ${warrning}`,
553
648
  });
554
- Logger({ level: "WARN", message: warrning });
555
649
  }
556
650
 
557
651
  const query_params = {};
@@ -561,12 +655,19 @@ class Payment {
561
655
  "get",
562
656
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/edc-device-stats`,
563
657
  query_params,
564
- undefined
658
+ undefined,
659
+ undefined,
660
+ { headers }
565
661
  );
566
662
 
663
+ let responseData = response;
664
+ if (headers) {
665
+ responseData = response[0];
666
+ }
667
+
567
668
  const {
568
669
  error: res_error,
569
- } = PaymentModel.EdcDeviceStatsResponse().validate(response, {
670
+ } = PaymentPlatformModel.EdcDeviceStatsResponse().validate(responseData, {
570
671
  abortEarly: false,
571
672
  allowUnknown: false,
572
673
  });
@@ -574,28 +675,30 @@ class Payment {
574
675
  if (res_error) {
575
676
  Logger({
576
677
  level: "WARN",
577
- message: "Response Validation Warnnings for edcDeviceStats",
678
+ message: `Response Validation Warnnings for platform > Payment > edcDeviceStats \n ${res_error}`,
578
679
  });
579
- Logger({ level: "WARN", message: res_error });
580
680
  }
581
681
 
582
682
  return response;
583
683
  }
584
684
 
585
685
  /**
586
- * @param {Object} arg - Arg object.
587
- * @param {string} arg.orderId -
588
- * @param {string} [arg.requestHash] -
589
- * @returns {Promise<RefundAccountResponse>} - Success response
686
+ * @param {PaymentPlatformApplicationValidator.GetBankAccountDetailsOpenAPIParam} arg
687
+ * - Arg object
688
+ *
689
+ * @param {import("../PlatformAPIClient").Options} - Options
690
+ * @returns {Promise<PaymentPlatformModel.RefundAccountResponse>} - Success response
691
+ * @name getBankAccountDetailsOpenAPI
590
692
  * @summary: Get bank details
591
- * @description: Use this API to get saved bank details for returned/cancelled order using order id.
693
+ * @description: Use this API to get saved bank details for returned/cancelled order using order id. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/getBankAccountDetailsOpenAPI/).
592
694
  */
593
- async getBankAccountDetailsOpenAPI({
594
- orderId,
595
-
596
- requestHash,
597
- } = {}) {
598
- const { error } = PaymentValidator.getBankAccountDetailsOpenAPI().validate(
695
+ async getBankAccountDetailsOpenAPI(
696
+ { orderId, requestHash } = {},
697
+ { headers } = { headers: false }
698
+ ) {
699
+ const {
700
+ error,
701
+ } = PaymentPlatformApplicationValidator.getBankAccountDetailsOpenAPI().validate(
599
702
  {
600
703
  orderId,
601
704
 
@@ -610,7 +713,7 @@ class Payment {
610
713
  // Showing warrnings if extra unknown parameters are found
611
714
  const {
612
715
  error: warrning,
613
- } = PaymentValidator.getBankAccountDetailsOpenAPI().validate(
716
+ } = PaymentPlatformApplicationValidator.getBankAccountDetailsOpenAPI().validate(
614
717
  {
615
718
  orderId,
616
719
 
@@ -621,10 +724,8 @@ class Payment {
621
724
  if (warrning) {
622
725
  Logger({
623
726
  level: "WARN",
624
- message:
625
- "Parameter Validation warrnings for getBankAccountDetailsOpenAPI",
727
+ message: `Parameter Validation warrnings for platform > Payment > getBankAccountDetailsOpenAPI \n ${warrning}`,
626
728
  });
627
- Logger({ level: "WARN", message: warrning });
628
729
  }
629
730
 
630
731
  const query_params = {};
@@ -636,12 +737,19 @@ class Payment {
636
737
  "get",
637
738
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/refund/account`,
638
739
  query_params,
639
- undefined
740
+ undefined,
741
+ undefined,
742
+ { headers }
640
743
  );
641
744
 
745
+ let responseData = response;
746
+ if (headers) {
747
+ responseData = response[0];
748
+ }
749
+
642
750
  const {
643
751
  error: res_error,
644
- } = PaymentModel.RefundAccountResponse().validate(response, {
752
+ } = PaymentPlatformModel.RefundAccountResponse().validate(responseData, {
645
753
  abortEarly: false,
646
754
  allowUnknown: false,
647
755
  });
@@ -649,23 +757,25 @@ class Payment {
649
757
  if (res_error) {
650
758
  Logger({
651
759
  level: "WARN",
652
- message:
653
- "Response Validation Warnnings for getBankAccountDetailsOpenAPI",
760
+ message: `Response Validation Warnnings for platform > Payment > getBankAccountDetailsOpenAPI \n ${res_error}`,
654
761
  });
655
- Logger({ level: "WARN", message: res_error });
656
762
  }
657
763
 
658
764
  return response;
659
765
  }
660
766
 
661
767
  /**
662
- * @param {Object} arg - Arg object.
663
- * @returns {Promise<PaymentGatewayConfigResponse>} - Success response
768
+ * @param {import("../PlatformAPIClient").Options} - Options
769
+ * @returns {Promise<PaymentPlatformModel.PaymentGatewayConfigResponse>} -
770
+ * Success response
771
+ * @name getBrandPaymentGatewayConfig
664
772
  * @summary: Get All Brand Payment Gateway Config Secret
665
- * @description: Get All Brand Payment Gateway Config Secret
773
+ * @description: Get All Brand Payment Gateway Config Secret - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/getBrandPaymentGatewayConfig/).
666
774
  */
667
- async getBrandPaymentGatewayConfig({} = {}) {
668
- const { error } = PaymentValidator.getBrandPaymentGatewayConfig().validate(
775
+ async getBrandPaymentGatewayConfig({ headers } = { headers: false }) {
776
+ const {
777
+ error,
778
+ } = PaymentPlatformApplicationValidator.getBrandPaymentGatewayConfig().validate(
669
779
  {},
670
780
  { abortEarly: false, allowUnknown: true }
671
781
  );
@@ -676,17 +786,15 @@ class Payment {
676
786
  // Showing warrnings if extra unknown parameters are found
677
787
  const {
678
788
  error: warrning,
679
- } = PaymentValidator.getBrandPaymentGatewayConfig().validate(
789
+ } = PaymentPlatformApplicationValidator.getBrandPaymentGatewayConfig().validate(
680
790
  {},
681
791
  { abortEarly: false, allowUnknown: false }
682
792
  );
683
793
  if (warrning) {
684
794
  Logger({
685
795
  level: "WARN",
686
- message:
687
- "Parameter Validation warrnings for getBrandPaymentGatewayConfig",
796
+ message: `Parameter Validation warrnings for platform > Payment > getBrandPaymentGatewayConfig \n ${warrning}`,
688
797
  });
689
- Logger({ level: "WARN", message: warrning });
690
798
  }
691
799
 
692
800
  const query_params = {};
@@ -696,37 +804,49 @@ class Payment {
696
804
  "get",
697
805
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/aggregator/request`,
698
806
  query_params,
699
- undefined
807
+ undefined,
808
+ undefined,
809
+ { headers }
700
810
  );
701
811
 
812
+ let responseData = response;
813
+ if (headers) {
814
+ responseData = response[0];
815
+ }
816
+
702
817
  const {
703
818
  error: res_error,
704
- } = PaymentModel.PaymentGatewayConfigResponse().validate(response, {
705
- abortEarly: false,
706
- allowUnknown: false,
707
- });
819
+ } = PaymentPlatformModel.PaymentGatewayConfigResponse().validate(
820
+ responseData,
821
+ { abortEarly: false, allowUnknown: false }
822
+ );
708
823
 
709
824
  if (res_error) {
710
825
  Logger({
711
826
  level: "WARN",
712
- message:
713
- "Response Validation Warnnings for getBrandPaymentGatewayConfig",
827
+ message: `Response Validation Warnnings for platform > Payment > getBrandPaymentGatewayConfig \n ${res_error}`,
714
828
  });
715
- Logger({ level: "WARN", message: res_error });
716
829
  }
717
830
 
718
831
  return response;
719
832
  }
720
833
 
721
834
  /**
722
- * @param {Object} arg - Arg object.
723
- * @param {string} arg.terminalUniqueIdentifier - Terminal unique identifier
724
- * @returns {Promise<EdcDeviceDetailsResponse>} - Success response
835
+ * @param {PaymentPlatformApplicationValidator.GetEdcDeviceParam} arg - Arg object
836
+ * @param {import("../PlatformAPIClient").Options} - Options
837
+ * @returns {Promise<PaymentPlatformModel.EdcDeviceDetailsResponse>} -
838
+ * Success response
839
+ * @name getEdcDevice
725
840
  * @summary: get details of a single edc device
726
- * @description: Use this API to get details of a single edc device
841
+ * @description: Use this API to get details of a single edc device - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/getEdcDevice/).
727
842
  */
728
- async getEdcDevice({ terminalUniqueIdentifier } = {}) {
729
- const { error } = PaymentValidator.getEdcDevice().validate(
843
+ async getEdcDevice(
844
+ { terminalUniqueIdentifier } = {},
845
+ { headers } = { headers: false }
846
+ ) {
847
+ const {
848
+ error,
849
+ } = PaymentPlatformApplicationValidator.getEdcDevice().validate(
730
850
  {
731
851
  terminalUniqueIdentifier,
732
852
  },
@@ -737,7 +857,9 @@ class Payment {
737
857
  }
738
858
 
739
859
  // Showing warrnings if extra unknown parameters are found
740
- const { error: warrning } = PaymentValidator.getEdcDevice().validate(
860
+ const {
861
+ error: warrning,
862
+ } = PaymentPlatformApplicationValidator.getEdcDevice().validate(
741
863
  {
742
864
  terminalUniqueIdentifier,
743
865
  },
@@ -746,9 +868,8 @@ class Payment {
746
868
  if (warrning) {
747
869
  Logger({
748
870
  level: "WARN",
749
- message: "Parameter Validation warrnings for getEdcDevice",
871
+ message: `Parameter Validation warrnings for platform > Payment > getEdcDevice \n ${warrning}`,
750
872
  });
751
- Logger({ level: "WARN", message: warrning });
752
873
  }
753
874
 
754
875
  const query_params = {};
@@ -758,12 +879,19 @@ class Payment {
758
879
  "get",
759
880
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/edc-device/${terminalUniqueIdentifier}`,
760
881
  query_params,
761
- undefined
882
+ undefined,
883
+ undefined,
884
+ { headers }
762
885
  );
763
886
 
887
+ let responseData = response;
888
+ if (headers) {
889
+ responseData = response[0];
890
+ }
891
+
764
892
  const {
765
893
  error: res_error,
766
- } = PaymentModel.EdcDeviceDetailsResponse().validate(response, {
894
+ } = PaymentPlatformModel.EdcDeviceDetailsResponse().validate(responseData, {
767
895
  abortEarly: false,
768
896
  allowUnknown: false,
769
897
  });
@@ -771,22 +899,24 @@ class Payment {
771
899
  if (res_error) {
772
900
  Logger({
773
901
  level: "WARN",
774
- message: "Response Validation Warnnings for getEdcDevice",
902
+ message: `Response Validation Warnnings for platform > Payment > getEdcDevice \n ${res_error}`,
775
903
  });
776
- Logger({ level: "WARN", message: res_error });
777
904
  }
778
905
 
779
906
  return response;
780
907
  }
781
908
 
782
909
  /**
783
- * @param {Object} arg - Arg object.
784
- * @returns {Promise<GetPaymentCodeResponse>} - Success response
910
+ * @param {import("../PlatformAPIClient").Options} - Options
911
+ * @returns {Promise<PaymentPlatformModel.GetPaymentCodeResponse>} - Success response
912
+ * @name getPaymentCodeOption
785
913
  * @summary: List Payment Options Method Codes
786
- * @description: Get all active List Payment Options Method Codes
914
+ * @description: Get all active List Payment Options Method Codes - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/getPaymentCodeOption/).
787
915
  */
788
- async getPaymentCodeOption({} = {}) {
789
- const { error } = PaymentValidator.getPaymentCodeOption().validate(
916
+ async getPaymentCodeOption({ headers } = { headers: false }) {
917
+ const {
918
+ error,
919
+ } = PaymentPlatformApplicationValidator.getPaymentCodeOption().validate(
790
920
  {},
791
921
  { abortEarly: false, allowUnknown: true }
792
922
  );
@@ -797,16 +927,15 @@ class Payment {
797
927
  // Showing warrnings if extra unknown parameters are found
798
928
  const {
799
929
  error: warrning,
800
- } = PaymentValidator.getPaymentCodeOption().validate(
930
+ } = PaymentPlatformApplicationValidator.getPaymentCodeOption().validate(
801
931
  {},
802
932
  { abortEarly: false, allowUnknown: false }
803
933
  );
804
934
  if (warrning) {
805
935
  Logger({
806
936
  level: "WARN",
807
- message: "Parameter Validation warrnings for getPaymentCodeOption",
937
+ message: `Parameter Validation warrnings for platform > Payment > getPaymentCodeOption \n ${warrning}`,
808
938
  });
809
- Logger({ level: "WARN", message: warrning });
810
939
  }
811
940
 
812
941
  const query_params = {};
@@ -816,12 +945,19 @@ class Payment {
816
945
  "get",
817
946
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/codes`,
818
947
  query_params,
819
- undefined
948
+ undefined,
949
+ undefined,
950
+ { headers }
820
951
  );
821
952
 
953
+ let responseData = response;
954
+ if (headers) {
955
+ responseData = response[0];
956
+ }
957
+
822
958
  const {
823
959
  error: res_error,
824
- } = PaymentModel.GetPaymentCodeResponse().validate(response, {
960
+ } = PaymentPlatformModel.GetPaymentCodeResponse().validate(responseData, {
825
961
  abortEarly: false,
826
962
  allowUnknown: false,
827
963
  });
@@ -829,23 +965,28 @@ class Payment {
829
965
  if (res_error) {
830
966
  Logger({
831
967
  level: "WARN",
832
- message: "Response Validation Warnnings for getPaymentCodeOption",
968
+ message: `Response Validation Warnnings for platform > Payment > getPaymentCodeOption \n ${res_error}`,
833
969
  });
834
- Logger({ level: "WARN", message: res_error });
835
970
  }
836
971
 
837
972
  return response;
838
973
  }
839
974
 
840
975
  /**
841
- * @param {Object} arg - Arg object.
842
- * @param {string} [arg.paymentLinkId] -
843
- * @returns {Promise<GetPaymentLinkResponse>} - Success response
976
+ * @param {PaymentPlatformApplicationValidator.GetPaymentLinkParam} arg - Arg object
977
+ * @param {import("../PlatformAPIClient").Options} - Options
978
+ * @returns {Promise<PaymentPlatformModel.GetPaymentLinkResponse>} - Success response
979
+ * @name getPaymentLink
844
980
  * @summary: Get payment link
845
- * @description: Use this API to get a payment link
981
+ * @description: Use this API to get a payment link - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/getPaymentLink/).
846
982
  */
847
- async getPaymentLink({ paymentLinkId } = {}) {
848
- const { error } = PaymentValidator.getPaymentLink().validate(
983
+ async getPaymentLink(
984
+ { paymentLinkId } = {},
985
+ { headers } = { headers: false }
986
+ ) {
987
+ const {
988
+ error,
989
+ } = PaymentPlatformApplicationValidator.getPaymentLink().validate(
849
990
  {
850
991
  paymentLinkId,
851
992
  },
@@ -856,7 +997,9 @@ class Payment {
856
997
  }
857
998
 
858
999
  // Showing warrnings if extra unknown parameters are found
859
- const { error: warrning } = PaymentValidator.getPaymentLink().validate(
1000
+ const {
1001
+ error: warrning,
1002
+ } = PaymentPlatformApplicationValidator.getPaymentLink().validate(
860
1003
  {
861
1004
  paymentLinkId,
862
1005
  },
@@ -865,9 +1008,8 @@ class Payment {
865
1008
  if (warrning) {
866
1009
  Logger({
867
1010
  level: "WARN",
868
- message: "Parameter Validation warrnings for getPaymentLink",
1011
+ message: `Parameter Validation warrnings for platform > Payment > getPaymentLink \n ${warrning}`,
869
1012
  });
870
- Logger({ level: "WARN", message: warrning });
871
1013
  }
872
1014
 
873
1015
  const query_params = {};
@@ -878,12 +1020,19 @@ class Payment {
878
1020
  "get",
879
1021
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/create-payment-link/`,
880
1022
  query_params,
881
- undefined
1023
+ undefined,
1024
+ undefined,
1025
+ { headers }
882
1026
  );
883
1027
 
1028
+ let responseData = response;
1029
+ if (headers) {
1030
+ responseData = response[0];
1031
+ }
1032
+
884
1033
  const {
885
1034
  error: res_error,
886
- } = PaymentModel.GetPaymentLinkResponse().validate(response, {
1035
+ } = PaymentPlatformModel.GetPaymentLinkResponse().validate(responseData, {
887
1036
  abortEarly: false,
888
1037
  allowUnknown: false,
889
1038
  });
@@ -891,24 +1040,30 @@ class Payment {
891
1040
  if (res_error) {
892
1041
  Logger({
893
1042
  level: "WARN",
894
- message: "Response Validation Warnnings for getPaymentLink",
1043
+ message: `Response Validation Warnnings for platform > Payment > getPaymentLink \n ${res_error}`,
895
1044
  });
896
- Logger({ level: "WARN", message: res_error });
897
1045
  }
898
1046
 
899
1047
  return response;
900
1048
  }
901
1049
 
902
1050
  /**
903
- * @param {Object} arg - Arg object.
904
- * @param {boolean} arg.refresh -
905
- * @param {string} arg.requestType -
906
- * @returns {Promise<PaymentOptionsResponse>} - Success response
1051
+ * @param {PaymentPlatformApplicationValidator.GetPaymentModeRoutesParam} arg
1052
+ * - Arg object
1053
+ *
1054
+ * @param {import("../PlatformAPIClient").Options} - Options
1055
+ * @returns {Promise<PaymentPlatformModel.PaymentOptionsResponse>} - Success response
1056
+ * @name getPaymentModeRoutes
907
1057
  * @summary: Get All Valid Payment Options
908
- * @description: Use this API to get Get All Valid Payment Options for making payment
1058
+ * @description: Use this API to get Get All Valid Payment Options for making payment - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/getPaymentModeRoutes/).
909
1059
  */
910
- async getPaymentModeRoutes({ refresh, requestType } = {}) {
911
- const { error } = PaymentValidator.getPaymentModeRoutes().validate(
1060
+ async getPaymentModeRoutes(
1061
+ { refresh, requestType } = {},
1062
+ { headers } = { headers: false }
1063
+ ) {
1064
+ const {
1065
+ error,
1066
+ } = PaymentPlatformApplicationValidator.getPaymentModeRoutes().validate(
912
1067
  {
913
1068
  refresh,
914
1069
  requestType,
@@ -922,7 +1077,7 @@ class Payment {
922
1077
  // Showing warrnings if extra unknown parameters are found
923
1078
  const {
924
1079
  error: warrning,
925
- } = PaymentValidator.getPaymentModeRoutes().validate(
1080
+ } = PaymentPlatformApplicationValidator.getPaymentModeRoutes().validate(
926
1081
  {
927
1082
  refresh,
928
1083
  requestType,
@@ -932,9 +1087,8 @@ class Payment {
932
1087
  if (warrning) {
933
1088
  Logger({
934
1089
  level: "WARN",
935
- message: "Parameter Validation warrnings for getPaymentModeRoutes",
1090
+ message: `Parameter Validation warrnings for platform > Payment > getPaymentModeRoutes \n ${warrning}`,
936
1091
  });
937
- Logger({ level: "WARN", message: warrning });
938
1092
  }
939
1093
 
940
1094
  const query_params = {};
@@ -946,12 +1100,19 @@ class Payment {
946
1100
  "get",
947
1101
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/options`,
948
1102
  query_params,
949
- undefined
1103
+ undefined,
1104
+ undefined,
1105
+ { headers }
950
1106
  );
951
1107
 
1108
+ let responseData = response;
1109
+ if (headers) {
1110
+ responseData = response[0];
1111
+ }
1112
+
952
1113
  const {
953
1114
  error: res_error,
954
- } = PaymentModel.PaymentOptionsResponse().validate(response, {
1115
+ } = PaymentPlatformModel.PaymentOptionsResponse().validate(responseData, {
955
1116
  abortEarly: false,
956
1117
  allowUnknown: false,
957
1118
  });
@@ -959,45 +1120,39 @@ class Payment {
959
1120
  if (res_error) {
960
1121
  Logger({
961
1122
  level: "WARN",
962
- message: "Response Validation Warnnings for getPaymentModeRoutes",
1123
+ message: `Response Validation Warnnings for platform > Payment > getPaymentModeRoutes \n ${res_error}`,
963
1124
  });
964
- Logger({ level: "WARN", message: res_error });
965
1125
  }
966
1126
 
967
1127
  return response;
968
1128
  }
969
1129
 
970
1130
  /**
971
- * @param {Object} arg - Arg object.
972
- * @param {number} arg.amount - Payable amount.
973
- * @param {string} arg.cartId - Identifier of the cart.
974
- * @param {string} arg.pincode - The PIN Code of the destination address, e.g. 400059
975
- * @param {string} arg.checkoutMode - Option to checkout for self or for others.
976
- * @param {boolean} [arg.refresh] - This is a boolean value. Select `true`
977
- * to remove temporary cache files on payment gateway and replace with the
978
- * latest one.
979
- * @param {string} [arg.cardReference] - Card reference id of user's debit
980
- * or credit card.
981
- * @param {string} arg.orderType - The order type of shipment * HomeDelivery
982
- * - If the customer wants the order home-delivered * PickAtStore - If the
983
- * customer wants the handover of an order at the store itself.
984
- * @param {string} [arg.userDetails] - URIencoded JSON containing details of
985
- * an anonymous user.
986
- * @returns {Promise<PaymentOptionsResponse>} - Success response
1131
+ * @param {PaymentPlatformApplicationValidator.GetPosPaymentModeRoutesParam} arg
1132
+ * - Arg object
1133
+ *
1134
+ * @param {import("../PlatformAPIClient").Options} - Options
1135
+ * @returns {Promise<PaymentPlatformModel.PaymentOptionsResponse>} - Success response
1136
+ * @name getPosPaymentModeRoutes
987
1137
  * @summary: Get All Valid Payment Options
988
- * @description: Use this API to get Get All Valid Payment Options for making payment
1138
+ * @description: Use this API to get Get All Valid Payment Options for making payment - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/getPosPaymentModeRoutes/).
989
1139
  */
990
- async getPosPaymentModeRoutes({
991
- amount,
992
- cartId,
993
- pincode,
994
- checkoutMode,
995
- orderType,
996
- refresh,
997
- cardReference,
998
- userDetails,
999
- } = {}) {
1000
- const { error } = PaymentValidator.getPosPaymentModeRoutes().validate(
1140
+ async getPosPaymentModeRoutes(
1141
+ {
1142
+ amount,
1143
+ cartId,
1144
+ pincode,
1145
+ checkoutMode,
1146
+ orderType,
1147
+ refresh,
1148
+ cardReference,
1149
+ userDetails,
1150
+ } = {},
1151
+ { headers } = { headers: false }
1152
+ ) {
1153
+ const {
1154
+ error,
1155
+ } = PaymentPlatformApplicationValidator.getPosPaymentModeRoutes().validate(
1001
1156
  {
1002
1157
  amount,
1003
1158
  cartId,
@@ -1017,7 +1172,7 @@ class Payment {
1017
1172
  // Showing warrnings if extra unknown parameters are found
1018
1173
  const {
1019
1174
  error: warrning,
1020
- } = PaymentValidator.getPosPaymentModeRoutes().validate(
1175
+ } = PaymentPlatformApplicationValidator.getPosPaymentModeRoutes().validate(
1021
1176
  {
1022
1177
  amount,
1023
1178
  cartId,
@@ -1033,9 +1188,8 @@ class Payment {
1033
1188
  if (warrning) {
1034
1189
  Logger({
1035
1190
  level: "WARN",
1036
- message: "Parameter Validation warrnings for getPosPaymentModeRoutes",
1191
+ message: `Parameter Validation warrnings for platform > Payment > getPosPaymentModeRoutes \n ${warrning}`,
1037
1192
  });
1038
- Logger({ level: "WARN", message: warrning });
1039
1193
  }
1040
1194
 
1041
1195
  const query_params = {};
@@ -1053,12 +1207,19 @@ class Payment {
1053
1207
  "get",
1054
1208
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/options/pos`,
1055
1209
  query_params,
1056
- undefined
1210
+ undefined,
1211
+ undefined,
1212
+ { headers }
1057
1213
  );
1058
1214
 
1215
+ let responseData = response;
1216
+ if (headers) {
1217
+ responseData = response[0];
1218
+ }
1219
+
1059
1220
  const {
1060
1221
  error: res_error,
1061
- } = PaymentModel.PaymentOptionsResponse().validate(response, {
1222
+ } = PaymentPlatformModel.PaymentOptionsResponse().validate(responseData, {
1062
1223
  abortEarly: false,
1063
1224
  allowUnknown: false,
1064
1225
  });
@@ -1066,23 +1227,31 @@ class Payment {
1066
1227
  if (res_error) {
1067
1228
  Logger({
1068
1229
  level: "WARN",
1069
- message: "Response Validation Warnnings for getPosPaymentModeRoutes",
1230
+ message: `Response Validation Warnnings for platform > Payment > getPosPaymentModeRoutes \n ${res_error}`,
1070
1231
  });
1071
- Logger({ level: "WARN", message: res_error });
1072
1232
  }
1073
1233
 
1074
1234
  return response;
1075
1235
  }
1076
1236
 
1077
1237
  /**
1078
- * @param {Object} arg - Arg object.
1079
- * @param {string} arg.orderId -
1080
- * @returns {Promise<OrderBeneficiaryResponse>} - Success response
1238
+ * @param {PaymentPlatformApplicationValidator.GetUserBeneficiariesParam} arg
1239
+ * - Arg object
1240
+ *
1241
+ * @param {import("../PlatformAPIClient").Options} - Options
1242
+ * @returns {Promise<PaymentPlatformModel.OrderBeneficiaryResponse>} -
1243
+ * Success response
1244
+ * @name getUserBeneficiaries
1081
1245
  * @summary: List User Beneficiary
1082
- * @description: Get all active beneficiary details added by the user for refund
1246
+ * @description: Get all active beneficiary details added by the user for refund - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/getUserBeneficiaries/).
1083
1247
  */
1084
- async getUserBeneficiaries({ orderId } = {}) {
1085
- const { error } = PaymentValidator.getUserBeneficiaries().validate(
1248
+ async getUserBeneficiaries(
1249
+ { orderId } = {},
1250
+ { headers } = { headers: false }
1251
+ ) {
1252
+ const {
1253
+ error,
1254
+ } = PaymentPlatformApplicationValidator.getUserBeneficiaries().validate(
1086
1255
  { orderId },
1087
1256
  { abortEarly: false, allowUnknown: true }
1088
1257
  );
@@ -1093,16 +1262,15 @@ class Payment {
1093
1262
  // Showing warrnings if extra unknown parameters are found
1094
1263
  const {
1095
1264
  error: warrning,
1096
- } = PaymentValidator.getUserBeneficiaries().validate(
1265
+ } = PaymentPlatformApplicationValidator.getUserBeneficiaries().validate(
1097
1266
  { orderId },
1098
1267
  { abortEarly: false, allowUnknown: false }
1099
1268
  );
1100
1269
  if (warrning) {
1101
1270
  Logger({
1102
1271
  level: "WARN",
1103
- message: "Parameter Validation warrnings for getUserBeneficiaries",
1272
+ message: `Parameter Validation warrnings for platform > Payment > getUserBeneficiaries \n ${warrning}`,
1104
1273
  });
1105
- Logger({ level: "WARN", message: warrning });
1106
1274
  }
1107
1275
 
1108
1276
  const query_params = {};
@@ -1113,12 +1281,19 @@ class Payment {
1113
1281
  "get",
1114
1282
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/refund/accounts/user`,
1115
1283
  query_params,
1116
- undefined
1284
+ undefined,
1285
+ undefined,
1286
+ { headers }
1117
1287
  );
1118
1288
 
1289
+ let responseData = response;
1290
+ if (headers) {
1291
+ responseData = response[0];
1292
+ }
1293
+
1119
1294
  const {
1120
1295
  error: res_error,
1121
- } = PaymentModel.OrderBeneficiaryResponse().validate(response, {
1296
+ } = PaymentPlatformModel.OrderBeneficiaryResponse().validate(responseData, {
1122
1297
  abortEarly: false,
1123
1298
  allowUnknown: false,
1124
1299
  });
@@ -1126,24 +1301,30 @@ class Payment {
1126
1301
  if (res_error) {
1127
1302
  Logger({
1128
1303
  level: "WARN",
1129
- message: "Response Validation Warnnings for getUserBeneficiaries",
1304
+ message: `Response Validation Warnnings for platform > Payment > getUserBeneficiaries \n ${res_error}`,
1130
1305
  });
1131
- Logger({ level: "WARN", message: res_error });
1132
1306
  }
1133
1307
 
1134
1308
  return response;
1135
1309
  }
1136
1310
 
1137
1311
  /**
1138
- * @param {Object} arg - Arg object.
1139
- * @param {string} arg.merchantUserId -
1140
- * @param {string} arg.mobileNo -
1141
- * @returns {Promise<GetUserCODLimitResponse>} - Success response
1312
+ * @param {PaymentPlatformApplicationValidator.GetUserCODlimitRoutesParam} arg
1313
+ * - Arg object
1314
+ *
1315
+ * @param {import("../PlatformAPIClient").Options} - Options
1316
+ * @returns {Promise<PaymentPlatformModel.GetUserCODLimitResponse>} - Success response
1317
+ * @name getUserCODlimitRoutes
1142
1318
  * @summary: Get COD limit for user
1143
- * @description: Use this API to get user cod limit and reamining limit for the payment
1319
+ * @description: Use this API to get user cod limit and reamining limit for the payment - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/getUserCODlimitRoutes/).
1144
1320
  */
1145
- async getUserCODlimitRoutes({ merchantUserId, mobileNo } = {}) {
1146
- const { error } = PaymentValidator.getUserCODlimitRoutes().validate(
1321
+ async getUserCODlimitRoutes(
1322
+ { merchantUserId, mobileNo } = {},
1323
+ { headers } = { headers: false }
1324
+ ) {
1325
+ const {
1326
+ error,
1327
+ } = PaymentPlatformApplicationValidator.getUserCODlimitRoutes().validate(
1147
1328
  {
1148
1329
  merchantUserId,
1149
1330
  mobileNo,
@@ -1157,7 +1338,7 @@ class Payment {
1157
1338
  // Showing warrnings if extra unknown parameters are found
1158
1339
  const {
1159
1340
  error: warrning,
1160
- } = PaymentValidator.getUserCODlimitRoutes().validate(
1341
+ } = PaymentPlatformApplicationValidator.getUserCODlimitRoutes().validate(
1161
1342
  {
1162
1343
  merchantUserId,
1163
1344
  mobileNo,
@@ -1167,9 +1348,8 @@ class Payment {
1167
1348
  if (warrning) {
1168
1349
  Logger({
1169
1350
  level: "WARN",
1170
- message: "Parameter Validation warrnings for getUserCODlimitRoutes",
1351
+ message: `Parameter Validation warrnings for platform > Payment > getUserCODlimitRoutes \n ${warrning}`,
1171
1352
  });
1172
- Logger({ level: "WARN", message: warrning });
1173
1353
  }
1174
1354
 
1175
1355
  const query_params = {};
@@ -1181,12 +1361,19 @@ class Payment {
1181
1361
  "get",
1182
1362
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/user-cod`,
1183
1363
  query_params,
1184
- undefined
1364
+ undefined,
1365
+ undefined,
1366
+ { headers }
1185
1367
  );
1186
1368
 
1369
+ let responseData = response;
1370
+ if (headers) {
1371
+ responseData = response[0];
1372
+ }
1373
+
1187
1374
  const {
1188
1375
  error: res_error,
1189
- } = PaymentModel.GetUserCODLimitResponse().validate(response, {
1376
+ } = PaymentPlatformModel.GetUserCODLimitResponse().validate(responseData, {
1190
1377
  abortEarly: false,
1191
1378
  allowUnknown: false,
1192
1379
  });
@@ -1194,23 +1381,31 @@ class Payment {
1194
1381
  if (res_error) {
1195
1382
  Logger({
1196
1383
  level: "WARN",
1197
- message: "Response Validation Warnnings for getUserCODlimitRoutes",
1384
+ message: `Response Validation Warnnings for platform > Payment > getUserCODlimitRoutes \n ${res_error}`,
1198
1385
  });
1199
- Logger({ level: "WARN", message: res_error });
1200
1386
  }
1201
1387
 
1202
1388
  return response;
1203
1389
  }
1204
1390
 
1205
1391
  /**
1206
- * @param {Object} arg - Arg object.
1207
- * @param {string} arg.orderId -
1208
- * @returns {Promise<OrderBeneficiaryResponse>} - Success response
1392
+ * @param {PaymentPlatformApplicationValidator.GetUserOrderBeneficiariesParam} arg
1393
+ * - Arg object
1394
+ *
1395
+ * @param {import("../PlatformAPIClient").Options} - Options
1396
+ * @returns {Promise<PaymentPlatformModel.OrderBeneficiaryResponse>} -
1397
+ * Success response
1398
+ * @name getUserOrderBeneficiaries
1209
1399
  * @summary: List Order Beneficiary
1210
- * @description: Get all active beneficiary details added by the user for refund
1400
+ * @description: Get all active beneficiary details added by the user for refund - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/getUserOrderBeneficiaries/).
1211
1401
  */
1212
- async getUserOrderBeneficiaries({ orderId } = {}) {
1213
- const { error } = PaymentValidator.getUserOrderBeneficiaries().validate(
1402
+ async getUserOrderBeneficiaries(
1403
+ { orderId } = {},
1404
+ { headers } = { headers: false }
1405
+ ) {
1406
+ const {
1407
+ error,
1408
+ } = PaymentPlatformApplicationValidator.getUserOrderBeneficiaries().validate(
1214
1409
  { orderId },
1215
1410
  { abortEarly: false, allowUnknown: true }
1216
1411
  );
@@ -1221,16 +1416,15 @@ class Payment {
1221
1416
  // Showing warrnings if extra unknown parameters are found
1222
1417
  const {
1223
1418
  error: warrning,
1224
- } = PaymentValidator.getUserOrderBeneficiaries().validate(
1419
+ } = PaymentPlatformApplicationValidator.getUserOrderBeneficiaries().validate(
1225
1420
  { orderId },
1226
1421
  { abortEarly: false, allowUnknown: false }
1227
1422
  );
1228
1423
  if (warrning) {
1229
1424
  Logger({
1230
1425
  level: "WARN",
1231
- message: "Parameter Validation warrnings for getUserOrderBeneficiaries",
1426
+ message: `Parameter Validation warrnings for platform > Payment > getUserOrderBeneficiaries \n ${warrning}`,
1232
1427
  });
1233
- Logger({ level: "WARN", message: warrning });
1234
1428
  }
1235
1429
 
1236
1430
  const query_params = {};
@@ -1241,12 +1435,19 @@ class Payment {
1241
1435
  "get",
1242
1436
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/refund/accounts/order`,
1243
1437
  query_params,
1244
- undefined
1438
+ undefined,
1439
+ undefined,
1440
+ { headers }
1245
1441
  );
1246
1442
 
1443
+ let responseData = response;
1444
+ if (headers) {
1445
+ responseData = response[0];
1446
+ }
1447
+
1247
1448
  const {
1248
1449
  error: res_error,
1249
- } = PaymentModel.OrderBeneficiaryResponse().validate(response, {
1450
+ } = PaymentPlatformModel.OrderBeneficiaryResponse().validate(responseData, {
1250
1451
  abortEarly: false,
1251
1452
  allowUnknown: false,
1252
1453
  });
@@ -1254,23 +1455,28 @@ class Payment {
1254
1455
  if (res_error) {
1255
1456
  Logger({
1256
1457
  level: "WARN",
1257
- message: "Response Validation Warnnings for getUserOrderBeneficiaries",
1458
+ message: `Response Validation Warnnings for platform > Payment > getUserOrderBeneficiaries \n ${res_error}`,
1258
1459
  });
1259
- Logger({ level: "WARN", message: res_error });
1260
1460
  }
1261
1461
 
1262
1462
  return response;
1263
1463
  }
1264
1464
 
1265
1465
  /**
1266
- * @param {Object} arg - Arg object.
1267
- * @param {PaymentInitializationRequest} arg.body
1268
- * @returns {Promise<PaymentInitializationResponse>} - Success response
1466
+ * @param {PaymentPlatformApplicationValidator.InitialisePaymentParam} arg
1467
+ * - Arg object
1468
+ *
1469
+ * @param {import("../PlatformAPIClient").Options} - Options
1470
+ * @returns {Promise<PaymentPlatformModel.PaymentInitializationResponse>} -
1471
+ * Success response
1472
+ * @name initialisePayment
1269
1473
  * @summary: Initialize a payment (server-to-server) for UPI and BharatQR
1270
- * @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.
1474
+ * @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/platform/payment/initialisePayment/).
1271
1475
  */
1272
- async initialisePayment({ body } = {}) {
1273
- const { error } = PaymentValidator.initialisePayment().validate(
1476
+ async initialisePayment({ body } = {}, { headers } = { headers: false }) {
1477
+ const {
1478
+ error,
1479
+ } = PaymentPlatformApplicationValidator.initialisePayment().validate(
1274
1480
  {
1275
1481
  body,
1276
1482
  },
@@ -1281,7 +1487,9 @@ class Payment {
1281
1487
  }
1282
1488
 
1283
1489
  // Showing warrnings if extra unknown parameters are found
1284
- const { error: warrning } = PaymentValidator.initialisePayment().validate(
1490
+ const {
1491
+ error: warrning,
1492
+ } = PaymentPlatformApplicationValidator.initialisePayment().validate(
1285
1493
  {
1286
1494
  body,
1287
1495
  },
@@ -1290,9 +1498,8 @@ class Payment {
1290
1498
  if (warrning) {
1291
1499
  Logger({
1292
1500
  level: "WARN",
1293
- message: "Parameter Validation warrnings for initialisePayment",
1501
+ message: `Parameter Validation warrnings for platform > Payment > initialisePayment \n ${warrning}`,
1294
1502
  });
1295
- Logger({ level: "WARN", message: warrning });
1296
1503
  }
1297
1504
 
1298
1505
  const query_params = {};
@@ -1302,36 +1509,48 @@ class Payment {
1302
1509
  "post",
1303
1510
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/request`,
1304
1511
  query_params,
1305
- body
1512
+ body,
1513
+ undefined,
1514
+ { headers }
1306
1515
  );
1307
1516
 
1517
+ let responseData = response;
1518
+ if (headers) {
1519
+ responseData = response[0];
1520
+ }
1521
+
1308
1522
  const {
1309
1523
  error: res_error,
1310
- } = PaymentModel.PaymentInitializationResponse().validate(response, {
1311
- abortEarly: false,
1312
- allowUnknown: false,
1313
- });
1524
+ } = PaymentPlatformModel.PaymentInitializationResponse().validate(
1525
+ responseData,
1526
+ { abortEarly: false, allowUnknown: false }
1527
+ );
1314
1528
 
1315
1529
  if (res_error) {
1316
1530
  Logger({
1317
1531
  level: "WARN",
1318
- message: "Response Validation Warnnings for initialisePayment",
1532
+ message: `Response Validation Warnnings for platform > Payment > initialisePayment \n ${res_error}`,
1319
1533
  });
1320
- Logger({ level: "WARN", message: res_error });
1321
1534
  }
1322
1535
 
1323
1536
  return response;
1324
1537
  }
1325
1538
 
1326
1539
  /**
1327
- * @param {Object} arg - Arg object.
1328
- * @param {MerchantOnBoardingRequest} arg.body
1329
- * @returns {Promise<MerchantOnBoardingResponse>} - Success response
1540
+ * @param {PaymentPlatformApplicationValidator.MerchantOnBoardingParam} arg
1541
+ * - Arg object
1542
+ *
1543
+ * @param {import("../PlatformAPIClient").Options} - Options
1544
+ * @returns {Promise<PaymentPlatformModel.MerchantOnBoardingResponse>} -
1545
+ * Success response
1546
+ * @name merchantOnBoarding
1330
1547
  * @summary: API to push Ajiodhan merchant data to Gringotts system
1331
- * @description: Use this API to push Ajiodhan merchant data to Gringotts system
1548
+ * @description: Use this API to push Ajiodhan merchant data to Gringotts system - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/merchantOnBoarding/).
1332
1549
  */
1333
- async merchantOnBoarding({ body } = {}) {
1334
- const { error } = PaymentValidator.merchantOnBoarding().validate(
1550
+ async merchantOnBoarding({ body } = {}, { headers } = { headers: false }) {
1551
+ const {
1552
+ error,
1553
+ } = PaymentPlatformApplicationValidator.merchantOnBoarding().validate(
1335
1554
  {
1336
1555
  body,
1337
1556
  },
@@ -1342,7 +1561,9 @@ class Payment {
1342
1561
  }
1343
1562
 
1344
1563
  // Showing warrnings if extra unknown parameters are found
1345
- const { error: warrning } = PaymentValidator.merchantOnBoarding().validate(
1564
+ const {
1565
+ error: warrning,
1566
+ } = PaymentPlatformApplicationValidator.merchantOnBoarding().validate(
1346
1567
  {
1347
1568
  body,
1348
1569
  },
@@ -1351,9 +1572,8 @@ class Payment {
1351
1572
  if (warrning) {
1352
1573
  Logger({
1353
1574
  level: "WARN",
1354
- message: "Parameter Validation warrnings for merchantOnBoarding",
1575
+ message: `Parameter Validation warrnings for platform > Payment > merchantOnBoarding \n ${warrning}`,
1355
1576
  });
1356
- Logger({ level: "WARN", message: warrning });
1357
1577
  }
1358
1578
 
1359
1579
  const query_params = {};
@@ -1363,42 +1583,48 @@ class Payment {
1363
1583
  "post",
1364
1584
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/merchant-onboarding`,
1365
1585
  query_params,
1366
- body
1586
+ body,
1587
+ undefined,
1588
+ { headers }
1367
1589
  );
1368
1590
 
1591
+ let responseData = response;
1592
+ if (headers) {
1593
+ responseData = response[0];
1594
+ }
1595
+
1369
1596
  const {
1370
1597
  error: res_error,
1371
- } = PaymentModel.MerchantOnBoardingResponse().validate(response, {
1372
- abortEarly: false,
1373
- allowUnknown: false,
1374
- });
1598
+ } = PaymentPlatformModel.MerchantOnBoardingResponse().validate(
1599
+ responseData,
1600
+ { abortEarly: false, allowUnknown: false }
1601
+ );
1375
1602
 
1376
1603
  if (res_error) {
1377
1604
  Logger({
1378
1605
  level: "WARN",
1379
- message: "Response Validation Warnnings for merchantOnBoarding",
1606
+ message: `Response Validation Warnnings for platform > Payment > merchantOnBoarding \n ${res_error}`,
1380
1607
  });
1381
- Logger({ level: "WARN", message: res_error });
1382
1608
  }
1383
1609
 
1384
1610
  return response;
1385
1611
  }
1386
1612
 
1387
1613
  /**
1388
- * @param {Object} arg - Arg object.
1389
- * @param {string} arg.aggregator - Aggregator
1390
- * @param {string} [arg.successRedirectUrl] -
1391
- * @param {string} [arg.failureRedirectUrl] -
1392
- * @returns {Promise<GetOauthUrlResponse>} - Success response
1614
+ * @param {PaymentPlatformApplicationValidator.OauthGetUrlParam} arg - Arg object
1615
+ * @param {import("../PlatformAPIClient").Options} - Options
1616
+ * @returns {Promise<PaymentPlatformModel.GetOauthUrlResponse>} - Success response
1617
+ * @name oauthGetUrl
1393
1618
  * @summary: API to Get the url to call for oauth
1394
- * @description: Use this API to Get the url to call for oauth.
1619
+ * @description: Use this API to Get the url to call for oauth. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/oauthGetUrl/).
1395
1620
  */
1396
- async oauthGetUrl({
1397
- aggregator,
1398
- successRedirectUrl,
1399
- failureRedirectUrl,
1400
- } = {}) {
1401
- const { error } = PaymentValidator.oauthGetUrl().validate(
1621
+ async oauthGetUrl(
1622
+ { aggregator, successRedirectUrl, failureRedirectUrl } = {},
1623
+ { headers } = { headers: false }
1624
+ ) {
1625
+ const {
1626
+ error,
1627
+ } = PaymentPlatformApplicationValidator.oauthGetUrl().validate(
1402
1628
  {
1403
1629
  aggregator,
1404
1630
  successRedirectUrl,
@@ -1411,7 +1637,9 @@ class Payment {
1411
1637
  }
1412
1638
 
1413
1639
  // Showing warrnings if extra unknown parameters are found
1414
- const { error: warrning } = PaymentValidator.oauthGetUrl().validate(
1640
+ const {
1641
+ error: warrning,
1642
+ } = PaymentPlatformApplicationValidator.oauthGetUrl().validate(
1415
1643
  {
1416
1644
  aggregator,
1417
1645
  successRedirectUrl,
@@ -1422,9 +1650,8 @@ class Payment {
1422
1650
  if (warrning) {
1423
1651
  Logger({
1424
1652
  level: "WARN",
1425
- message: "Parameter Validation warrnings for oauthGetUrl",
1653
+ message: `Parameter Validation warrnings for platform > Payment > oauthGetUrl \n ${warrning}`,
1426
1654
  });
1427
- Logger({ level: "WARN", message: warrning });
1428
1655
  }
1429
1656
 
1430
1657
  const query_params = {};
@@ -1436,12 +1663,19 @@ class Payment {
1436
1663
  "get",
1437
1664
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/onboard/${aggregator}/`,
1438
1665
  query_params,
1439
- undefined
1666
+ undefined,
1667
+ undefined,
1668
+ { headers }
1440
1669
  );
1441
1670
 
1671
+ let responseData = response;
1672
+ if (headers) {
1673
+ responseData = response[0];
1674
+ }
1675
+
1442
1676
  const {
1443
1677
  error: res_error,
1444
- } = PaymentModel.GetOauthUrlResponse().validate(response, {
1678
+ } = PaymentPlatformModel.GetOauthUrlResponse().validate(responseData, {
1445
1679
  abortEarly: false,
1446
1680
  allowUnknown: false,
1447
1681
  });
@@ -1449,23 +1683,29 @@ class Payment {
1449
1683
  if (res_error) {
1450
1684
  Logger({
1451
1685
  level: "WARN",
1452
- message: "Response Validation Warnnings for oauthGetUrl",
1686
+ message: `Response Validation Warnnings for platform > Payment > oauthGetUrl \n ${res_error}`,
1453
1687
  });
1454
- Logger({ level: "WARN", message: res_error });
1455
1688
  }
1456
1689
 
1457
1690
  return response;
1458
1691
  }
1459
1692
 
1460
1693
  /**
1461
- * @param {Object} arg - Arg object.
1462
- * @param {PaymentStatusBulkHandlerRequest} arg.body
1463
- * @returns {Promise<PaymentStatusBulkHandlerResponse>} - Success response
1694
+ * @param {PaymentPlatformApplicationValidator.PaymentStatusBulkParam} arg
1695
+ * - Arg object
1696
+ *
1697
+ * @param {import("../PlatformAPIClient").Options} - Options
1698
+ * @returns {Promise<PaymentPlatformModel.PaymentStatusBulkHandlerResponse>}
1699
+ * - Success response
1700
+ *
1701
+ * @name paymentStatusBulk
1464
1702
  * @summary: Get Payment status and information for a list of order_ids
1465
- * @description: Use this API to get Payment status and information for a list of order_ids
1703
+ * @description: Use this API to get Payment status and information for a list of order_ids - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/paymentStatusBulk/).
1466
1704
  */
1467
- async paymentStatusBulk({ body } = {}) {
1468
- const { error } = PaymentValidator.paymentStatusBulk().validate(
1705
+ async paymentStatusBulk({ body } = {}, { headers } = { headers: false }) {
1706
+ const {
1707
+ error,
1708
+ } = PaymentPlatformApplicationValidator.paymentStatusBulk().validate(
1469
1709
  {
1470
1710
  body,
1471
1711
  },
@@ -1476,7 +1716,9 @@ class Payment {
1476
1716
  }
1477
1717
 
1478
1718
  // Showing warrnings if extra unknown parameters are found
1479
- const { error: warrning } = PaymentValidator.paymentStatusBulk().validate(
1719
+ const {
1720
+ error: warrning,
1721
+ } = PaymentPlatformApplicationValidator.paymentStatusBulk().validate(
1480
1722
  {
1481
1723
  body,
1482
1724
  },
@@ -1485,9 +1727,8 @@ class Payment {
1485
1727
  if (warrning) {
1486
1728
  Logger({
1487
1729
  level: "WARN",
1488
- message: "Parameter Validation warrnings for paymentStatusBulk",
1730
+ message: `Parameter Validation warrnings for platform > Payment > paymentStatusBulk \n ${warrning}`,
1489
1731
  });
1490
- Logger({ level: "WARN", message: warrning });
1491
1732
  }
1492
1733
 
1493
1734
  const query_params = {};
@@ -1497,36 +1738,51 @@ class Payment {
1497
1738
  "post",
1498
1739
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/payment-status-bulk/`,
1499
1740
  query_params,
1500
- body
1741
+ body,
1742
+ undefined,
1743
+ { headers }
1501
1744
  );
1502
1745
 
1746
+ let responseData = response;
1747
+ if (headers) {
1748
+ responseData = response[0];
1749
+ }
1750
+
1503
1751
  const {
1504
1752
  error: res_error,
1505
- } = PaymentModel.PaymentStatusBulkHandlerResponse().validate(response, {
1506
- abortEarly: false,
1507
- allowUnknown: false,
1508
- });
1753
+ } = PaymentPlatformModel.PaymentStatusBulkHandlerResponse().validate(
1754
+ responseData,
1755
+ { abortEarly: false, allowUnknown: false }
1756
+ );
1509
1757
 
1510
1758
  if (res_error) {
1511
1759
  Logger({
1512
1760
  level: "WARN",
1513
- message: "Response Validation Warnnings for paymentStatusBulk",
1761
+ message: `Response Validation Warnnings for platform > Payment > paymentStatusBulk \n ${res_error}`,
1514
1762
  });
1515
- Logger({ level: "WARN", message: res_error });
1516
1763
  }
1517
1764
 
1518
1765
  return response;
1519
1766
  }
1520
1767
 
1521
1768
  /**
1522
- * @param {Object} arg - Arg object.
1523
- * @param {string} [arg.paymentLinkId] -
1524
- * @returns {Promise<PollingPaymentLinkResponse>} - Success response
1769
+ * @param {PaymentPlatformApplicationValidator.PollingPaymentLinkParam} arg
1770
+ * - Arg object
1771
+ *
1772
+ * @param {import("../PlatformAPIClient").Options} - Options
1773
+ * @returns {Promise<PaymentPlatformModel.PollingPaymentLinkResponse>} -
1774
+ * Success response
1775
+ * @name pollingPaymentLink
1525
1776
  * @summary: Used for polling if payment successful or not
1526
- * @description: Use this API to poll if payment through payment was successful or not
1777
+ * @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/platform/payment/pollingPaymentLink/).
1527
1778
  */
1528
- async pollingPaymentLink({ paymentLinkId } = {}) {
1529
- const { error } = PaymentValidator.pollingPaymentLink().validate(
1779
+ async pollingPaymentLink(
1780
+ { paymentLinkId } = {},
1781
+ { headers } = { headers: false }
1782
+ ) {
1783
+ const {
1784
+ error,
1785
+ } = PaymentPlatformApplicationValidator.pollingPaymentLink().validate(
1530
1786
  {
1531
1787
  paymentLinkId,
1532
1788
  },
@@ -1537,7 +1793,9 @@ class Payment {
1537
1793
  }
1538
1794
 
1539
1795
  // Showing warrnings if extra unknown parameters are found
1540
- const { error: warrning } = PaymentValidator.pollingPaymentLink().validate(
1796
+ const {
1797
+ error: warrning,
1798
+ } = PaymentPlatformApplicationValidator.pollingPaymentLink().validate(
1541
1799
  {
1542
1800
  paymentLinkId,
1543
1801
  },
@@ -1546,9 +1804,8 @@ class Payment {
1546
1804
  if (warrning) {
1547
1805
  Logger({
1548
1806
  level: "WARN",
1549
- message: "Parameter Validation warrnings for pollingPaymentLink",
1807
+ message: `Parameter Validation warrnings for platform > Payment > pollingPaymentLink \n ${warrning}`,
1550
1808
  });
1551
- Logger({ level: "WARN", message: warrning });
1552
1809
  }
1553
1810
 
1554
1811
  const query_params = {};
@@ -1559,36 +1816,45 @@ class Payment {
1559
1816
  "get",
1560
1817
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/polling-payment-link/`,
1561
1818
  query_params,
1562
- undefined
1819
+ undefined,
1820
+ undefined,
1821
+ { headers }
1563
1822
  );
1564
1823
 
1824
+ let responseData = response;
1825
+ if (headers) {
1826
+ responseData = response[0];
1827
+ }
1828
+
1565
1829
  const {
1566
1830
  error: res_error,
1567
- } = PaymentModel.PollingPaymentLinkResponse().validate(response, {
1568
- abortEarly: false,
1569
- allowUnknown: false,
1570
- });
1831
+ } = PaymentPlatformModel.PollingPaymentLinkResponse().validate(
1832
+ responseData,
1833
+ { abortEarly: false, allowUnknown: false }
1834
+ );
1571
1835
 
1572
1836
  if (res_error) {
1573
1837
  Logger({
1574
1838
  level: "WARN",
1575
- message: "Response Validation Warnnings for pollingPaymentLink",
1839
+ message: `Response Validation Warnnings for platform > Payment > pollingPaymentLink \n ${res_error}`,
1576
1840
  });
1577
- Logger({ level: "WARN", message: res_error });
1578
1841
  }
1579
1842
 
1580
1843
  return response;
1581
1844
  }
1582
1845
 
1583
1846
  /**
1584
- * @param {Object} arg - Arg object.
1585
- * @param {RepaymentDetailsSerialiserPayAll} arg.body
1586
- * @returns {Promise<RepaymentResponse>} - Success response
1847
+ * @param {PaymentPlatformApplicationValidator.RepaymentDetailsParam} arg - Arg object
1848
+ * @param {import("../PlatformAPIClient").Options} - Options
1849
+ * @returns {Promise<PaymentPlatformModel.RepaymentResponse>} - Success response
1850
+ * @name repaymentDetails
1587
1851
  * @summary: API to register repayment details
1588
- * @description: Use this API to register any repayment record in the db and notify the aggrgator
1852
+ * @description: Use this API to register any repayment record in the db and notify the aggrgator - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/repaymentDetails/).
1589
1853
  */
1590
- async repaymentDetails({ body } = {}) {
1591
- const { error } = PaymentValidator.repaymentDetails().validate(
1854
+ async repaymentDetails({ body } = {}, { headers } = { headers: false }) {
1855
+ const {
1856
+ error,
1857
+ } = PaymentPlatformApplicationValidator.repaymentDetails().validate(
1592
1858
  {
1593
1859
  body,
1594
1860
  },
@@ -1599,7 +1865,9 @@ class Payment {
1599
1865
  }
1600
1866
 
1601
1867
  // Showing warrnings if extra unknown parameters are found
1602
- const { error: warrning } = PaymentValidator.repaymentDetails().validate(
1868
+ const {
1869
+ error: warrning,
1870
+ } = PaymentPlatformApplicationValidator.repaymentDetails().validate(
1603
1871
  {
1604
1872
  body,
1605
1873
  },
@@ -1608,9 +1876,8 @@ class Payment {
1608
1876
  if (warrning) {
1609
1877
  Logger({
1610
1878
  level: "WARN",
1611
- message: "Parameter Validation warrnings for repaymentDetails",
1879
+ message: `Parameter Validation warrnings for platform > Payment > repaymentDetails \n ${warrning}`,
1612
1880
  });
1613
- Logger({ level: "WARN", message: warrning });
1614
1881
  }
1615
1882
 
1616
1883
  const query_params = {};
@@ -1620,12 +1887,19 @@ class Payment {
1620
1887
  "post",
1621
1888
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/repayment-details`,
1622
1889
  query_params,
1623
- body
1890
+ body,
1891
+ undefined,
1892
+ { headers }
1624
1893
  );
1625
1894
 
1895
+ let responseData = response;
1896
+ if (headers) {
1897
+ responseData = response[0];
1898
+ }
1899
+
1626
1900
  const {
1627
1901
  error: res_error,
1628
- } = PaymentModel.RepaymentResponse().validate(response, {
1902
+ } = PaymentPlatformModel.RepaymentResponse().validate(responseData, {
1629
1903
  abortEarly: false,
1630
1904
  allowUnknown: false,
1631
1905
  });
@@ -1633,23 +1907,28 @@ class Payment {
1633
1907
  if (res_error) {
1634
1908
  Logger({
1635
1909
  level: "WARN",
1636
- message: "Response Validation Warnnings for repaymentDetails",
1910
+ message: `Response Validation Warnnings for platform > Payment > repaymentDetails \n ${res_error}`,
1637
1911
  });
1638
- Logger({ level: "WARN", message: res_error });
1639
1912
  }
1640
1913
 
1641
1914
  return response;
1642
1915
  }
1643
1916
 
1644
1917
  /**
1645
- * @param {Object} arg - Arg object.
1646
- * @param {ResendOrCancelPaymentRequest} arg.body
1647
- * @returns {Promise<ResendOrCancelPaymentResponse>} - Success response
1918
+ * @param {PaymentPlatformApplicationValidator.ResendOrCancelPaymentParam} arg
1919
+ * - Arg object
1920
+ *
1921
+ * @param {import("../PlatformAPIClient").Options} - Options
1922
+ * @returns {Promise<PaymentPlatformModel.ResendOrCancelPaymentResponse>} -
1923
+ * Success response
1924
+ * @name resendOrCancelPayment
1648
1925
  * @summary: API to resend and cancel a payment link which was already generated.
1649
- * @description: Use this API to perform resend or cancel a payment link based on request payload.
1926
+ * @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/platform/payment/resendOrCancelPayment/).
1650
1927
  */
1651
- async resendOrCancelPayment({ body } = {}) {
1652
- const { error } = PaymentValidator.resendOrCancelPayment().validate(
1928
+ async resendOrCancelPayment({ body } = {}, { headers } = { headers: false }) {
1929
+ const {
1930
+ error,
1931
+ } = PaymentPlatformApplicationValidator.resendOrCancelPayment().validate(
1653
1932
  {
1654
1933
  body,
1655
1934
  },
@@ -1662,7 +1941,7 @@ class Payment {
1662
1941
  // Showing warrnings if extra unknown parameters are found
1663
1942
  const {
1664
1943
  error: warrning,
1665
- } = PaymentValidator.resendOrCancelPayment().validate(
1944
+ } = PaymentPlatformApplicationValidator.resendOrCancelPayment().validate(
1666
1945
  {
1667
1946
  body,
1668
1947
  },
@@ -1671,9 +1950,8 @@ class Payment {
1671
1950
  if (warrning) {
1672
1951
  Logger({
1673
1952
  level: "WARN",
1674
- message: "Parameter Validation warrnings for resendOrCancelPayment",
1953
+ message: `Parameter Validation warrnings for platform > Payment > resendOrCancelPayment \n ${warrning}`,
1675
1954
  });
1676
- Logger({ level: "WARN", message: warrning });
1677
1955
  }
1678
1956
 
1679
1957
  const query_params = {};
@@ -1683,36 +1961,48 @@ class Payment {
1683
1961
  "post",
1684
1962
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/cancel`,
1685
1963
  query_params,
1686
- body
1964
+ body,
1965
+ undefined,
1966
+ { headers }
1687
1967
  );
1688
1968
 
1969
+ let responseData = response;
1970
+ if (headers) {
1971
+ responseData = response[0];
1972
+ }
1973
+
1689
1974
  const {
1690
1975
  error: res_error,
1691
- } = PaymentModel.ResendOrCancelPaymentResponse().validate(response, {
1692
- abortEarly: false,
1693
- allowUnknown: false,
1694
- });
1976
+ } = PaymentPlatformModel.ResendOrCancelPaymentResponse().validate(
1977
+ responseData,
1978
+ { abortEarly: false, allowUnknown: false }
1979
+ );
1695
1980
 
1696
1981
  if (res_error) {
1697
1982
  Logger({
1698
1983
  level: "WARN",
1699
- message: "Response Validation Warnnings for resendOrCancelPayment",
1984
+ message: `Response Validation Warnnings for platform > Payment > resendOrCancelPayment \n ${res_error}`,
1700
1985
  });
1701
- Logger({ level: "WARN", message: res_error });
1702
1986
  }
1703
1987
 
1704
1988
  return response;
1705
1989
  }
1706
1990
 
1707
1991
  /**
1708
- * @param {Object} arg - Arg object.
1709
- * @param {CancelOrResendPaymentLinkRequest} arg.body
1710
- * @returns {Promise<ResendPaymentLinkResponse>} - Success response
1992
+ * @param {PaymentPlatformApplicationValidator.ResendPaymentLinkParam} arg
1993
+ * - Arg object
1994
+ *
1995
+ * @param {import("../PlatformAPIClient").Options} - Options
1996
+ * @returns {Promise<PaymentPlatformModel.ResendPaymentLinkResponse>} -
1997
+ * Success response
1998
+ * @name resendPaymentLink
1711
1999
  * @summary: Resend payment link
1712
- * @description: Use this API to resend a payment link for the customer
2000
+ * @description: Use this API to resend a payment link for the customer - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/resendPaymentLink/).
1713
2001
  */
1714
- async resendPaymentLink({ body } = {}) {
1715
- const { error } = PaymentValidator.resendPaymentLink().validate(
2002
+ async resendPaymentLink({ body } = {}, { headers } = { headers: false }) {
2003
+ const {
2004
+ error,
2005
+ } = PaymentPlatformApplicationValidator.resendPaymentLink().validate(
1716
2006
  {
1717
2007
  body,
1718
2008
  },
@@ -1723,7 +2013,9 @@ class Payment {
1723
2013
  }
1724
2014
 
1725
2015
  // Showing warrnings if extra unknown parameters are found
1726
- const { error: warrning } = PaymentValidator.resendPaymentLink().validate(
2016
+ const {
2017
+ error: warrning,
2018
+ } = PaymentPlatformApplicationValidator.resendPaymentLink().validate(
1727
2019
  {
1728
2020
  body,
1729
2021
  },
@@ -1732,9 +2024,8 @@ class Payment {
1732
2024
  if (warrning) {
1733
2025
  Logger({
1734
2026
  level: "WARN",
1735
- message: "Parameter Validation warrnings for resendPaymentLink",
2027
+ message: `Parameter Validation warrnings for platform > Payment > resendPaymentLink \n ${warrning}`,
1736
2028
  });
1737
- Logger({ level: "WARN", message: warrning });
1738
2029
  }
1739
2030
 
1740
2031
  const query_params = {};
@@ -1744,36 +2035,48 @@ class Payment {
1744
2035
  "post",
1745
2036
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/resend-payment-link/`,
1746
2037
  query_params,
1747
- body
2038
+ body,
2039
+ undefined,
2040
+ { headers }
1748
2041
  );
1749
2042
 
2043
+ let responseData = response;
2044
+ if (headers) {
2045
+ responseData = response[0];
2046
+ }
2047
+
1750
2048
  const {
1751
2049
  error: res_error,
1752
- } = PaymentModel.ResendPaymentLinkResponse().validate(response, {
1753
- abortEarly: false,
1754
- allowUnknown: false,
1755
- });
2050
+ } = PaymentPlatformModel.ResendPaymentLinkResponse().validate(
2051
+ responseData,
2052
+ { abortEarly: false, allowUnknown: false }
2053
+ );
1756
2054
 
1757
2055
  if (res_error) {
1758
2056
  Logger({
1759
2057
  level: "WARN",
1760
- message: "Response Validation Warnnings for resendPaymentLink",
2058
+ message: `Response Validation Warnnings for platform > Payment > resendPaymentLink \n ${res_error}`,
1761
2059
  });
1762
- Logger({ level: "WARN", message: res_error });
1763
2060
  }
1764
2061
 
1765
2062
  return response;
1766
2063
  }
1767
2064
 
1768
2065
  /**
1769
- * @param {Object} arg - Arg object.
1770
- * @param {string} arg.aggregator - Aggregator_slug
1771
- * @returns {Promise<RevokeOAuthToken>} - Success response
2066
+ * @param {PaymentPlatformApplicationValidator.RevokeOauthTokenParam} arg - Arg object
2067
+ * @param {import("../PlatformAPIClient").Options} - Options
2068
+ * @returns {Promise<PaymentPlatformModel.RevokeOAuthToken>} - Success response
2069
+ * @name revokeOauthToken
1772
2070
  * @summary: API to Revoke oauth for razorpay partnership
1773
- * @description: Use this API to Revoke oauth for razorpay partnership
2071
+ * @description: Use this API to Revoke oauth for razorpay partnership - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/revokeOauthToken/).
1774
2072
  */
1775
- async revokeOauthToken({ aggregator } = {}) {
1776
- const { error } = PaymentValidator.revokeOauthToken().validate(
2073
+ async revokeOauthToken(
2074
+ { aggregator } = {},
2075
+ { headers } = { headers: false }
2076
+ ) {
2077
+ const {
2078
+ error,
2079
+ } = PaymentPlatformApplicationValidator.revokeOauthToken().validate(
1777
2080
  {
1778
2081
  aggregator,
1779
2082
  },
@@ -1784,7 +2087,9 @@ class Payment {
1784
2087
  }
1785
2088
 
1786
2089
  // Showing warrnings if extra unknown parameters are found
1787
- const { error: warrning } = PaymentValidator.revokeOauthToken().validate(
2090
+ const {
2091
+ error: warrning,
2092
+ } = PaymentPlatformApplicationValidator.revokeOauthToken().validate(
1788
2093
  {
1789
2094
  aggregator,
1790
2095
  },
@@ -1793,9 +2098,8 @@ class Payment {
1793
2098
  if (warrning) {
1794
2099
  Logger({
1795
2100
  level: "WARN",
1796
- message: "Parameter Validation warrnings for revokeOauthToken",
2101
+ message: `Parameter Validation warrnings for platform > Payment > revokeOauthToken \n ${warrning}`,
1797
2102
  });
1798
- Logger({ level: "WARN", message: warrning });
1799
2103
  }
1800
2104
 
1801
2105
  const query_params = {};
@@ -1805,12 +2109,19 @@ class Payment {
1805
2109
  "post",
1806
2110
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/revoke/${aggregator}/`,
1807
2111
  query_params,
1808
- undefined
2112
+ undefined,
2113
+ undefined,
2114
+ { headers }
1809
2115
  );
1810
2116
 
2117
+ let responseData = response;
2118
+ if (headers) {
2119
+ responseData = response[0];
2120
+ }
2121
+
1811
2122
  const {
1812
2123
  error: res_error,
1813
- } = PaymentModel.RevokeOAuthToken().validate(response, {
2124
+ } = PaymentPlatformModel.RevokeOAuthToken().validate(responseData, {
1814
2125
  abortEarly: false,
1815
2126
  allowUnknown: false,
1816
2127
  });
@@ -1818,23 +2129,31 @@ class Payment {
1818
2129
  if (res_error) {
1819
2130
  Logger({
1820
2131
  level: "WARN",
1821
- message: "Response Validation Warnnings for revokeOauthToken",
2132
+ message: `Response Validation Warnnings for platform > Payment > revokeOauthToken \n ${res_error}`,
1822
2133
  });
1823
- Logger({ level: "WARN", message: res_error });
1824
2134
  }
1825
2135
 
1826
2136
  return response;
1827
2137
  }
1828
2138
 
1829
2139
  /**
1830
- * @param {Object} arg - Arg object.
1831
- * @param {PaymentGatewayConfigRequest} arg.body
1832
- * @returns {Promise<PaymentGatewayToBeReviewed>} - Success response
2140
+ * @param {PaymentPlatformApplicationValidator.SaveBrandPaymentGatewayConfigParam} arg
2141
+ * - Arg object
2142
+ *
2143
+ * @param {import("../PlatformAPIClient").Options} - Options
2144
+ * @returns {Promise<PaymentPlatformModel.PaymentGatewayToBeReviewed>} -
2145
+ * Success response
2146
+ * @name saveBrandPaymentGatewayConfig
1833
2147
  * @summary: Save Config Secret For Brand Payment Gateway
1834
- * @description: Save Config Secret For Brand Payment Gateway
2148
+ * @description: Save Config Secret For Brand Payment Gateway - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/saveBrandPaymentGatewayConfig/).
1835
2149
  */
1836
- async saveBrandPaymentGatewayConfig({ body } = {}) {
1837
- const { error } = PaymentValidator.saveBrandPaymentGatewayConfig().validate(
2150
+ async saveBrandPaymentGatewayConfig(
2151
+ { body } = {},
2152
+ { headers } = { headers: false }
2153
+ ) {
2154
+ const {
2155
+ error,
2156
+ } = PaymentPlatformApplicationValidator.saveBrandPaymentGatewayConfig().validate(
1838
2157
  {
1839
2158
  body,
1840
2159
  },
@@ -1847,7 +2166,7 @@ class Payment {
1847
2166
  // Showing warrnings if extra unknown parameters are found
1848
2167
  const {
1849
2168
  error: warrning,
1850
- } = PaymentValidator.saveBrandPaymentGatewayConfig().validate(
2169
+ } = PaymentPlatformApplicationValidator.saveBrandPaymentGatewayConfig().validate(
1851
2170
  {
1852
2171
  body,
1853
2172
  },
@@ -1856,10 +2175,8 @@ class Payment {
1856
2175
  if (warrning) {
1857
2176
  Logger({
1858
2177
  level: "WARN",
1859
- message:
1860
- "Parameter Validation warrnings for saveBrandPaymentGatewayConfig",
2178
+ message: `Parameter Validation warrnings for platform > Payment > saveBrandPaymentGatewayConfig \n ${warrning}`,
1861
2179
  });
1862
- Logger({ level: "WARN", message: warrning });
1863
2180
  }
1864
2181
 
1865
2182
  const query_params = {};
@@ -1869,37 +2186,47 @@ class Payment {
1869
2186
  "post",
1870
2187
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/aggregator/request`,
1871
2188
  query_params,
1872
- body
2189
+ body,
2190
+ undefined,
2191
+ { headers }
1873
2192
  );
1874
2193
 
2194
+ let responseData = response;
2195
+ if (headers) {
2196
+ responseData = response[0];
2197
+ }
2198
+
1875
2199
  const {
1876
2200
  error: res_error,
1877
- } = PaymentModel.PaymentGatewayToBeReviewed().validate(response, {
1878
- abortEarly: false,
1879
- allowUnknown: false,
1880
- });
2201
+ } = PaymentPlatformModel.PaymentGatewayToBeReviewed().validate(
2202
+ responseData,
2203
+ { abortEarly: false, allowUnknown: false }
2204
+ );
1881
2205
 
1882
2206
  if (res_error) {
1883
2207
  Logger({
1884
2208
  level: "WARN",
1885
- message:
1886
- "Response Validation Warnnings for saveBrandPaymentGatewayConfig",
2209
+ message: `Response Validation Warnnings for platform > Payment > saveBrandPaymentGatewayConfig \n ${res_error}`,
1887
2210
  });
1888
- Logger({ level: "WARN", message: res_error });
1889
2211
  }
1890
2212
 
1891
2213
  return response;
1892
2214
  }
1893
2215
 
1894
2216
  /**
1895
- * @param {Object} arg - Arg object.
1896
- * @param {SetCODForUserRequest} arg.body
1897
- * @returns {Promise<SetCODOptionResponse>} - Success response
2217
+ * @param {PaymentPlatformApplicationValidator.SetUserCODlimitRoutesParam} arg
2218
+ * - Arg object
2219
+ *
2220
+ * @param {import("../PlatformAPIClient").Options} - Options
2221
+ * @returns {Promise<PaymentPlatformModel.SetCODOptionResponse>} - Success response
2222
+ * @name setUserCODlimitRoutes
1898
2223
  * @summary: Set COD option for user for payment
1899
- * @description: Use this API to set cod option as true or false for the payment
2224
+ * @description: Use this API to set cod option as true or false for the payment - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/setUserCODlimitRoutes/).
1900
2225
  */
1901
- async setUserCODlimitRoutes({ body } = {}) {
1902
- const { error } = PaymentValidator.setUserCODlimitRoutes().validate(
2226
+ async setUserCODlimitRoutes({ body } = {}, { headers } = { headers: false }) {
2227
+ const {
2228
+ error,
2229
+ } = PaymentPlatformApplicationValidator.setUserCODlimitRoutes().validate(
1903
2230
  {
1904
2231
  body,
1905
2232
  },
@@ -1912,7 +2239,7 @@ class Payment {
1912
2239
  // Showing warrnings if extra unknown parameters are found
1913
2240
  const {
1914
2241
  error: warrning,
1915
- } = PaymentValidator.setUserCODlimitRoutes().validate(
2242
+ } = PaymentPlatformApplicationValidator.setUserCODlimitRoutes().validate(
1916
2243
  {
1917
2244
  body,
1918
2245
  },
@@ -1921,9 +2248,8 @@ class Payment {
1921
2248
  if (warrning) {
1922
2249
  Logger({
1923
2250
  level: "WARN",
1924
- message: "Parameter Validation warrnings for setUserCODlimitRoutes",
2251
+ message: `Parameter Validation warrnings for platform > Payment > setUserCODlimitRoutes \n ${warrning}`,
1925
2252
  });
1926
- Logger({ level: "WARN", message: warrning });
1927
2253
  }
1928
2254
 
1929
2255
  const query_params = {};
@@ -1933,12 +2259,19 @@ class Payment {
1933
2259
  "put",
1934
2260
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/user-cod`,
1935
2261
  query_params,
1936
- body
2262
+ body,
2263
+ undefined,
2264
+ { headers }
1937
2265
  );
1938
2266
 
2267
+ let responseData = response;
2268
+ if (headers) {
2269
+ responseData = response[0];
2270
+ }
2271
+
1939
2272
  const {
1940
2273
  error: res_error,
1941
- } = PaymentModel.SetCODOptionResponse().validate(response, {
2274
+ } = PaymentPlatformModel.SetCODOptionResponse().validate(responseData, {
1942
2275
  abortEarly: false,
1943
2276
  allowUnknown: false,
1944
2277
  });
@@ -1946,23 +2279,25 @@ class Payment {
1946
2279
  if (res_error) {
1947
2280
  Logger({
1948
2281
  level: "WARN",
1949
- message: "Response Validation Warnnings for setUserCODlimitRoutes",
2282
+ message: `Response Validation Warnnings for platform > Payment > setUserCODlimitRoutes \n ${res_error}`,
1950
2283
  });
1951
- Logger({ level: "WARN", message: res_error });
1952
2284
  }
1953
2285
 
1954
2286
  return response;
1955
2287
  }
1956
2288
 
1957
2289
  /**
1958
- * @param {Object} arg - Arg object.
1959
- * @param {EdcAddRequest} arg.body
1960
- * @returns {Promise<EdcDeviceAddResponse>} - Success response
2290
+ * @param {PaymentPlatformApplicationValidator.UpdateEdcDeviceParam} arg - Arg object
2291
+ * @param {import("../PlatformAPIClient").Options} - Options
2292
+ * @returns {Promise<PaymentPlatformModel.EdcDeviceAddResponse>} - Success response
2293
+ * @name updateEdcDevice
1961
2294
  * @summary: map new edc device to the terminal
1962
- * @description: Use this API to map new edc device to the terminal
2295
+ * @description: Use this API to map new edc device to the terminal - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/updateEdcDevice/).
1963
2296
  */
1964
- async updateEdcDevice({ body } = {}) {
1965
- const { error } = PaymentValidator.updateEdcDevice().validate(
2297
+ async updateEdcDevice({ body } = {}, { headers } = { headers: false }) {
2298
+ const {
2299
+ error,
2300
+ } = PaymentPlatformApplicationValidator.updateEdcDevice().validate(
1966
2301
  {
1967
2302
  body,
1968
2303
  },
@@ -1973,7 +2308,9 @@ class Payment {
1973
2308
  }
1974
2309
 
1975
2310
  // Showing warrnings if extra unknown parameters are found
1976
- const { error: warrning } = PaymentValidator.updateEdcDevice().validate(
2311
+ const {
2312
+ error: warrning,
2313
+ } = PaymentPlatformApplicationValidator.updateEdcDevice().validate(
1977
2314
  {
1978
2315
  body,
1979
2316
  },
@@ -1982,9 +2319,8 @@ class Payment {
1982
2319
  if (warrning) {
1983
2320
  Logger({
1984
2321
  level: "WARN",
1985
- message: "Parameter Validation warrnings for updateEdcDevice",
2322
+ message: `Parameter Validation warrnings for platform > Payment > updateEdcDevice \n ${warrning}`,
1986
2323
  });
1987
- Logger({ level: "WARN", message: warrning });
1988
2324
  }
1989
2325
 
1990
2326
  const query_params = {};
@@ -1994,12 +2330,19 @@ class Payment {
1994
2330
  "post",
1995
2331
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/edc-device`,
1996
2332
  query_params,
1997
- body
2333
+ body,
2334
+ undefined,
2335
+ { headers }
1998
2336
  );
1999
2337
 
2338
+ let responseData = response;
2339
+ if (headers) {
2340
+ responseData = response[0];
2341
+ }
2342
+
2000
2343
  const {
2001
2344
  error: res_error,
2002
- } = PaymentModel.EdcDeviceAddResponse().validate(response, {
2345
+ } = PaymentPlatformModel.EdcDeviceAddResponse().validate(responseData, {
2003
2346
  abortEarly: false,
2004
2347
  allowUnknown: false,
2005
2348
  });
@@ -2007,23 +2350,31 @@ class Payment {
2007
2350
  if (res_error) {
2008
2351
  Logger({
2009
2352
  level: "WARN",
2010
- message: "Response Validation Warnnings for updateEdcDevice",
2353
+ message: `Response Validation Warnnings for platform > Payment > updateEdcDevice \n ${res_error}`,
2011
2354
  });
2012
- Logger({ level: "WARN", message: res_error });
2013
2355
  }
2014
2356
 
2015
2357
  return response;
2016
2358
  }
2017
2359
 
2018
2360
  /**
2019
- * @param {Object} arg - Arg object.
2020
- * @param {ValidateCustomerRequest} arg.body
2021
- * @returns {Promise<ValidateCustomerResponse>} - Success response
2361
+ * @param {PaymentPlatformApplicationValidator.VerifyCustomerForPaymentParam} arg
2362
+ * - Arg object
2363
+ *
2364
+ * @param {import("../PlatformAPIClient").Options} - Options
2365
+ * @returns {Promise<PaymentPlatformModel.ValidateCustomerResponse>} -
2366
+ * Success response
2367
+ * @name verifyCustomerForPayment
2022
2368
  * @summary: Validate customer for payment
2023
- * @description: Use this API to check if the customer is eligible to use credit-line facilities such as Simpl Pay Later and Rupifi.
2369
+ * @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/platform/payment/verifyCustomerForPayment/).
2024
2370
  */
2025
- async verifyCustomerForPayment({ body } = {}) {
2026
- const { error } = PaymentValidator.verifyCustomerForPayment().validate(
2371
+ async verifyCustomerForPayment(
2372
+ { body } = {},
2373
+ { headers } = { headers: false }
2374
+ ) {
2375
+ const {
2376
+ error,
2377
+ } = PaymentPlatformApplicationValidator.verifyCustomerForPayment().validate(
2027
2378
  {
2028
2379
  body,
2029
2380
  },
@@ -2036,7 +2387,7 @@ class Payment {
2036
2387
  // Showing warrnings if extra unknown parameters are found
2037
2388
  const {
2038
2389
  error: warrning,
2039
- } = PaymentValidator.verifyCustomerForPayment().validate(
2390
+ } = PaymentPlatformApplicationValidator.verifyCustomerForPayment().validate(
2040
2391
  {
2041
2392
  body,
2042
2393
  },
@@ -2045,9 +2396,8 @@ class Payment {
2045
2396
  if (warrning) {
2046
2397
  Logger({
2047
2398
  level: "WARN",
2048
- message: "Parameter Validation warrnings for verifyCustomerForPayment",
2399
+ message: `Parameter Validation warrnings for platform > Payment > verifyCustomerForPayment \n ${warrning}`,
2049
2400
  });
2050
- Logger({ level: "WARN", message: warrning });
2051
2401
  }
2052
2402
 
2053
2403
  const query_params = {};
@@ -2057,12 +2407,19 @@ class Payment {
2057
2407
  "post",
2058
2408
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/customer/validation`,
2059
2409
  query_params,
2060
- body
2410
+ body,
2411
+ undefined,
2412
+ { headers }
2061
2413
  );
2062
2414
 
2415
+ let responseData = response;
2416
+ if (headers) {
2417
+ responseData = response[0];
2418
+ }
2419
+
2063
2420
  const {
2064
2421
  error: res_error,
2065
- } = PaymentModel.ValidateCustomerResponse().validate(response, {
2422
+ } = PaymentPlatformModel.ValidateCustomerResponse().validate(responseData, {
2066
2423
  abortEarly: false,
2067
2424
  allowUnknown: false,
2068
2425
  });
@@ -2070,9 +2427,8 @@ class Payment {
2070
2427
  if (res_error) {
2071
2428
  Logger({
2072
2429
  level: "WARN",
2073
- message: "Response Validation Warnnings for verifyCustomerForPayment",
2430
+ message: `Response Validation Warnnings for platform > Payment > verifyCustomerForPayment \n ${res_error}`,
2074
2431
  });
2075
- Logger({ level: "WARN", message: res_error });
2076
2432
  }
2077
2433
 
2078
2434
  return response;