@gofynd/fdk-client-javascript 1.1.6 → 1.3.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 (348) hide show
  1. package/README.md +52 -3
  2. package/index.js +0 -3
  3. package/package.json +1 -2
  4. package/sdk/application/ApplicationAPIClient.d.ts +15 -1
  5. package/sdk/application/ApplicationAPIClient.js +12 -3
  6. package/sdk/application/ApplicationClient.d.ts +36 -6
  7. package/sdk/application/ApplicationClient.js +30 -43
  8. package/sdk/application/ApplicationConfig.d.ts +92 -12
  9. package/sdk/application/ApplicationConfig.js +48 -14
  10. package/sdk/application/Cart/CartApplicationClient.d.ts +200 -357
  11. package/sdk/application/Cart/CartApplicationClient.js +711 -483
  12. package/sdk/application/Cart/CartApplicationModel.d.ts +2054 -96
  13. package/sdk/application/Cart/CartApplicationModel.js +1224 -93
  14. package/sdk/application/Cart/CartApplicationValidator.d.ts +508 -30
  15. package/sdk/application/Cart/CartApplicationValidator.js +270 -15
  16. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +274 -422
  17. package/sdk/application/Catalog/CatalogApplicationClient.js +865 -630
  18. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +2320 -117
  19. package/sdk/application/Catalog/CatalogApplicationModel.js +1566 -172
  20. package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +798 -31
  21. package/sdk/application/Catalog/CatalogApplicationValidator.js +318 -3
  22. package/sdk/application/Common/CommonApplicationClient.d.ts +16 -21
  23. package/sdk/application/Common/CommonApplicationClient.js +52 -33
  24. package/sdk/application/Common/CommonApplicationModel.d.ts +368 -19
  25. package/sdk/application/Common/CommonApplicationModel.js +192 -40
  26. package/sdk/application/Common/CommonApplicationValidator.d.ts +42 -4
  27. package/sdk/application/Common/CommonApplicationValidator.js +21 -3
  28. package/sdk/application/Communication/CommunicationApplicationClient.d.ts +31 -18
  29. package/sdk/application/Communication/CommunicationApplicationClient.js +86 -47
  30. package/sdk/application/Communication/CommunicationApplicationModel.d.ts +157 -14
  31. package/sdk/application/Communication/CommunicationApplicationModel.js +104 -23
  32. package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +27 -4
  33. package/sdk/application/Communication/CommunicationApplicationValidator.js +21 -5
  34. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +149 -118
  35. package/sdk/application/Configuration/ConfigurationApplicationClient.js +457 -260
  36. package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +2235 -110
  37. package/sdk/application/Configuration/ConfigurationApplicationModel.js +1113 -193
  38. package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +160 -8
  39. package/sdk/application/Configuration/ConfigurationApplicationValidator.js +88 -4
  40. package/sdk/application/Content/ContentApplicationClient.d.ts +149 -139
  41. package/sdk/application/Content/ContentApplicationClient.js +489 -278
  42. package/sdk/application/Content/ContentApplicationModel.d.ts +1010 -105
  43. package/sdk/application/Content/ContentApplicationModel.js +737 -396
  44. package/sdk/application/Content/ContentApplicationValidator.d.ts +214 -12
  45. package/sdk/application/Content/ContentApplicationValidator.js +113 -3
  46. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +23 -29
  47. package/sdk/application/FileStorage/FileStorageApplicationClient.js +74 -47
  48. package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +148 -20
  49. package/sdk/application/FileStorage/FileStorageApplicationModel.js +100 -87
  50. package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +55 -5
  51. package/sdk/application/FileStorage/FileStorageApplicationValidator.js +33 -6
  52. package/sdk/application/Lead/LeadApplicationClient.d.ts +57 -53
  53. package/sdk/application/Lead/LeadApplicationClient.js +188 -103
  54. package/sdk/application/Lead/LeadApplicationModel.d.ts +686 -54
  55. package/sdk/application/Lead/LeadApplicationModel.js +330 -244
  56. package/sdk/application/Lead/LeadApplicationValidator.d.ts +91 -9
  57. package/sdk/application/Lead/LeadApplicationValidator.js +51 -6
  58. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +40 -33
  59. package/sdk/application/Logistic/LogisticApplicationClient.js +131 -73
  60. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +399 -28
  61. package/sdk/application/Logistic/LogisticApplicationModel.js +293 -24
  62. package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +48 -6
  63. package/sdk/application/Logistic/LogisticApplicationValidator.js +34 -6
  64. package/sdk/application/Order/OrderApplicationClient.d.ts +93 -133
  65. package/sdk/application/Order/OrderApplicationClient.js +329 -217
  66. package/sdk/application/Order/OrderApplicationModel.d.ts +1101 -66
  67. package/sdk/application/Order/OrderApplicationModel.js +776 -57
  68. package/sdk/application/Order/OrderApplicationValidator.d.ts +249 -14
  69. package/sdk/application/Order/OrderApplicationValidator.js +114 -5
  70. package/sdk/application/Payment/PaymentApplicationClient.d.ts +400 -366
  71. package/sdk/application/Payment/PaymentApplicationClient.js +1176 -703
  72. package/sdk/application/Payment/PaymentApplicationModel.d.ts +3125 -99
  73. package/sdk/application/Payment/PaymentApplicationModel.js +1158 -62
  74. package/sdk/application/Payment/PaymentApplicationValidator.d.ts +494 -41
  75. package/sdk/application/Payment/PaymentApplicationValidator.js +297 -25
  76. package/sdk/application/PosCart/PosCartApplicationClient.d.ts +205 -350
  77. package/sdk/application/PosCart/PosCartApplicationClient.js +720 -491
  78. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +1823 -89
  79. package/sdk/application/PosCart/PosCartApplicationModel.js +1117 -85
  80. package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +480 -29
  81. package/sdk/application/PosCart/PosCartApplicationValidator.js +262 -15
  82. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +58 -47
  83. package/sdk/application/Rewards/RewardsApplicationClient.js +187 -102
  84. package/sdk/application/Rewards/RewardsApplicationModel.d.ts +343 -22
  85. package/sdk/application/Rewards/RewardsApplicationModel.js +230 -15
  86. package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +70 -7
  87. package/sdk/application/Rewards/RewardsApplicationValidator.js +45 -6
  88. package/sdk/application/Share/ShareApplicationClient.d.ts +52 -50
  89. package/sdk/application/Share/ShareApplicationClient.js +185 -97
  90. package/sdk/application/Share/ShareApplicationModel.d.ts +198 -15
  91. package/sdk/application/Share/ShareApplicationModel.js +131 -31
  92. package/sdk/application/Share/ShareApplicationValidator.d.ts +86 -8
  93. package/sdk/application/Share/ShareApplicationValidator.js +48 -4
  94. package/sdk/application/Theme/ThemeApplicationClient.d.ts +30 -27
  95. package/sdk/application/Theme/ThemeApplicationClient.js +102 -56
  96. package/sdk/application/Theme/ThemeApplicationModel.d.ts +1291 -48
  97. package/sdk/application/Theme/ThemeApplicationModel.js +895 -134
  98. package/sdk/application/Theme/ThemeApplicationValidator.d.ts +49 -5
  99. package/sdk/application/Theme/ThemeApplicationValidator.js +26 -3
  100. package/sdk/application/User/UserApplicationClient.d.ts +260 -305
  101. package/sdk/application/User/UserApplicationClient.js +910 -522
  102. package/sdk/application/User/UserApplicationModel.d.ts +992 -101
  103. package/sdk/application/User/UserApplicationModel.js +699 -248
  104. package/sdk/application/User/UserApplicationValidator.d.ts +457 -33
  105. package/sdk/application/User/UserApplicationValidator.js +265 -31
  106. package/sdk/common/AxiosHelper.js +7 -2
  107. package/sdk/common/FDKError.d.ts +3 -0
  108. package/sdk/common/FDKError.js +8 -0
  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/common/utils.d.ts +3 -0
  113. package/sdk/common/utils.js +29 -0
  114. package/sdk/partner/PartnerAPIClient.d.ts +16 -1
  115. package/sdk/partner/PartnerAPIClient.js +12 -2
  116. package/sdk/partner/PartnerClient.d.ts +22 -3
  117. package/sdk/partner/PartnerClient.js +20 -0
  118. package/sdk/partner/PartnerConfig.d.ts +40 -14
  119. package/sdk/partner/PartnerConfig.js +31 -6
  120. package/sdk/partner/Theme/ThemePartnerClient.d.ts +299 -0
  121. package/sdk/partner/Theme/ThemePartnerClient.js +768 -0
  122. package/sdk/partner/Theme/ThemePartnerModel.d.ts +1706 -0
  123. package/sdk/partner/Theme/ThemePartnerModel.js +1409 -0
  124. package/sdk/partner/Theme/ThemePartnerValidator.d.ts +22 -0
  125. package/sdk/partner/Theme/ThemePartnerValidator.js +157 -0
  126. package/sdk/partner/index.d.ts +3 -1
  127. package/sdk/partner/index.js +3 -1
  128. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +30 -25
  129. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +104 -53
  130. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +190 -17
  131. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +132 -15
  132. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +52 -5
  133. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +30 -4
  134. package/sdk/platform/Billing/BillingPlatformClient.d.ts +133 -97
  135. package/sdk/platform/Billing/BillingPlatformClient.js +561 -191
  136. package/sdk/platform/Billing/BillingPlatformModel.d.ts +1071 -68
  137. package/sdk/platform/Billing/BillingPlatformModel.js +762 -151
  138. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +175 -12
  139. package/sdk/platform/Billing/BillingPlatformValidator.js +118 -8
  140. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +454 -635
  141. package/sdk/platform/Cart/CartPlatformApplicationClient.js +1646 -957
  142. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +827 -57
  143. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +492 -34
  144. package/sdk/platform/Cart/CartPlatformModel.d.ts +3839 -175
  145. package/sdk/platform/Cart/CartPlatformModel.js +2423 -217
  146. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +528 -638
  147. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1600 -984
  148. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +1081 -49
  149. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +482 -23
  150. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +652 -826
  151. package/sdk/platform/Catalog/CatalogPlatformClient.js +1979 -1264
  152. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +6869 -326
  153. package/sdk/platform/Catalog/CatalogPlatformModel.js +4215 -351
  154. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +1361 -71
  155. package/sdk/platform/Catalog/CatalogPlatformValidator.js +624 -30
  156. package/sdk/platform/Common/CommonPlatformClient.d.ts +16 -21
  157. package/sdk/platform/Common/CommonPlatformClient.js +50 -33
  158. package/sdk/platform/Common/CommonPlatformModel.d.ts +423 -19
  159. package/sdk/platform/Common/CommonPlatformModel.js +214 -40
  160. package/sdk/platform/Common/CommonPlatformValidator.d.ts +37 -4
  161. package/sdk/platform/Common/CommonPlatformValidator.js +20 -3
  162. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +731 -303
  163. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +3095 -785
  164. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +699 -41
  165. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +463 -27
  166. package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +19 -5
  167. package/sdk/platform/Communication/CommunicationPlatformClient.js +59 -19
  168. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +1708 -102
  169. package/sdk/platform/Communication/CommunicationPlatformModel.js +1360 -235
  170. package/sdk/platform/Communication/CommunicationPlatformValidator.d.ts +16 -3
  171. package/sdk/platform/Communication/CommunicationPlatformValidator.js +11 -3
  172. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +127 -111
  173. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +435 -225
  174. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +882 -43
  175. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +666 -78
  176. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +184 -13
  177. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +105 -10
  178. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +327 -240
  179. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +922 -438
  180. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +297 -22
  181. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +191 -17
  182. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +184 -178
  183. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +555 -311
  184. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +4337 -188
  185. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +2178 -248
  186. package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +332 -19
  187. package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +153 -10
  188. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +605 -578
  189. package/sdk/platform/Content/ContentPlatformApplicationClient.js +1996 -987
  190. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +872 -62
  191. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +487 -35
  192. package/sdk/platform/Content/ContentPlatformModel.d.ts +1472 -108
  193. package/sdk/platform/Content/ContentPlatformModel.js +1085 -204
  194. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +85 -82
  195. package/sdk/platform/Discount/DiscountPlatformClient.js +333 -175
  196. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +281 -15
  197. package/sdk/platform/Discount/DiscountPlatformModel.js +189 -10
  198. package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +185 -13
  199. package/sdk/platform/Discount/DiscountPlatformValidator.js +88 -8
  200. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +109 -52
  201. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +570 -105
  202. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +141 -6
  203. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +118 -7
  204. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +43 -63
  205. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +153 -135
  206. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +426 -20
  207. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +379 -40
  208. package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +106 -8
  209. package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +60 -8
  210. package/sdk/platform/Finance/FinancePlatformClient.d.ts +260 -129
  211. package/sdk/platform/Finance/FinancePlatformClient.js +1182 -194
  212. package/sdk/platform/Finance/FinancePlatformModel.d.ts +1267 -50
  213. package/sdk/platform/Finance/FinancePlatformModel.js +1252 -38
  214. package/sdk/platform/Finance/FinancePlatformValidator.d.ts +233 -15
  215. package/sdk/platform/Finance/FinancePlatformValidator.js +229 -16
  216. package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +111 -97
  217. package/sdk/platform/Inventory/InventoryPlatformClient.js +330 -199
  218. package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +1354 -61
  219. package/sdk/platform/Inventory/InventoryPlatformModel.js +916 -83
  220. package/sdk/platform/Inventory/InventoryPlatformValidator.d.ts +168 -12
  221. package/sdk/platform/Inventory/InventoryPlatformValidator.js +82 -6
  222. package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +100 -106
  223. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +372 -186
  224. package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +180 -14
  225. package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +94 -9
  226. package/sdk/platform/Lead/LeadPlatformClient.d.ts +89 -104
  227. package/sdk/platform/Lead/LeadPlatformClient.js +305 -180
  228. package/sdk/platform/Lead/LeadPlatformModel.d.ts +1045 -54
  229. package/sdk/platform/Lead/LeadPlatformModel.js +504 -142
  230. package/sdk/platform/Lead/LeadPlatformValidator.d.ts +173 -12
  231. package/sdk/platform/Lead/LeadPlatformValidator.js +92 -15
  232. package/sdk/platform/OAuthClient.js +6 -2
  233. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +20 -14
  234. package/sdk/platform/Order/OrderPlatformApplicationClient.js +58 -29
  235. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +26 -4
  236. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +16 -3
  237. package/sdk/platform/Order/OrderPlatformClient.d.ts +437 -556
  238. package/sdk/platform/Order/OrderPlatformClient.js +1500 -760
  239. package/sdk/platform/Order/OrderPlatformModel.d.ts +5225 -247
  240. package/sdk/platform/Order/OrderPlatformModel.js +3473 -260
  241. package/sdk/platform/Order/OrderPlatformValidator.d.ts +859 -37
  242. package/sdk/platform/Order/OrderPlatformValidator.js +435 -23
  243. package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +16 -42
  244. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +52 -155
  245. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +37 -6
  246. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +19 -17
  247. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +78 -45
  248. package/sdk/platform/Partner/PartnerPlatformModel.js +43 -369
  249. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +418 -288
  250. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +1509 -505
  251. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +438 -30
  252. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +312 -19
  253. package/sdk/platform/Payment/PaymentPlatformClient.d.ts +83 -73
  254. package/sdk/platform/Payment/PaymentPlatformClient.js +259 -154
  255. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +3200 -93
  256. package/sdk/platform/Payment/PaymentPlatformModel.js +1334 -36
  257. package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +111 -11
  258. package/sdk/platform/Payment/PaymentPlatformValidator.js +68 -7
  259. package/sdk/platform/PlatformAPIClient.d.ts +16 -1
  260. package/sdk/platform/PlatformAPIClient.js +9 -1
  261. package/sdk/platform/PlatformApplicationClient.d.ts +22 -1798
  262. package/sdk/platform/PlatformApplicationClient.js +17 -1899
  263. package/sdk/platform/PlatformClient.d.ts +31 -12581
  264. package/sdk/platform/PlatformClient.js +30 -15089
  265. package/sdk/platform/PlatformConfig.d.ts +37 -11
  266. package/sdk/platform/PlatformConfig.js +32 -6
  267. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +96 -92
  268. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +344 -177
  269. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +149 -12
  270. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +82 -8
  271. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +360 -23
  272. package/sdk/platform/Rewards/RewardsPlatformModel.js +238 -22
  273. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +159 -92
  274. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +473 -208
  275. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +138 -13
  276. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +100 -14
  277. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +166 -178
  278. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +518 -329
  279. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +1408 -96
  280. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +1034 -71
  281. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +280 -18
  282. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +134 -11
  283. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +41 -66
  284. package/sdk/platform/Share/SharePlatformApplicationClient.js +149 -116
  285. package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +87 -7
  286. package/sdk/platform/Share/SharePlatformApplicationValidator.js +42 -5
  287. package/sdk/platform/Share/SharePlatformModel.d.ts +250 -16
  288. package/sdk/platform/Share/SharePlatformModel.js +167 -19
  289. package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +229 -193
  290. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +976 -352
  291. package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +345 -24
  292. package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +206 -14
  293. package/sdk/platform/Theme/ThemePlatformClient.d.ts +37 -0
  294. package/sdk/platform/Theme/ThemePlatformClient.js +235 -0
  295. package/sdk/platform/Theme/ThemePlatformModel.d.ts +1527 -48
  296. package/sdk/platform/Theme/ThemePlatformModel.js +1099 -118
  297. package/sdk/platform/Theme/ThemePlatformValidator.d.ts +32 -0
  298. package/sdk/platform/Theme/ThemePlatformValidator.js +38 -0
  299. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +138 -152
  300. package/sdk/platform/User/UserPlatformApplicationClient.js +470 -244
  301. package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +242 -18
  302. package/sdk/platform/User/UserPlatformApplicationValidator.js +129 -12
  303. package/sdk/platform/User/UserPlatformModel.d.ts +653 -101
  304. package/sdk/platform/User/UserPlatformModel.js +467 -424
  305. package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +153 -49
  306. package/sdk/platform/Webhook/WebhookPlatformClient.js +896 -88
  307. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +632 -16
  308. package/sdk/platform/Webhook/WebhookPlatformModel.js +502 -54
  309. package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +170 -7
  310. package/sdk/platform/Webhook/WebhookPlatformValidator.js +157 -7
  311. package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +16 -21
  312. package/sdk/public/Configuration/ConfigurationPublicClient.js +48 -33
  313. package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +370 -19
  314. package/sdk/public/Configuration/ConfigurationPublicModel.js +191 -40
  315. package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +42 -4
  316. package/sdk/public/Configuration/ConfigurationPublicValidator.js +21 -3
  317. package/sdk/public/Inventory/InventoryPublicClient.d.ts +54 -48
  318. package/sdk/public/Inventory/InventoryPublicClient.js +161 -98
  319. package/sdk/public/Inventory/InventoryPublicModel.d.ts +392 -21
  320. package/sdk/public/Inventory/InventoryPublicModel.js +267 -27
  321. package/sdk/public/Inventory/InventoryPublicValidator.d.ts +90 -8
  322. package/sdk/public/Inventory/InventoryPublicValidator.js +44 -4
  323. package/sdk/public/Partner/PartnerPublicClient.d.ts +22 -0
  324. package/sdk/public/Partner/PartnerPublicClient.js +110 -0
  325. package/sdk/public/Partner/PartnerPublicModel.d.ts +240 -0
  326. package/sdk/public/Partner/PartnerPublicModel.js +280 -0
  327. package/sdk/public/Partner/PartnerPublicValidator.d.ts +18 -0
  328. package/sdk/public/Partner/PartnerPublicValidator.js +19 -0
  329. package/sdk/public/PublicAPIClient.d.ts +14 -1
  330. package/sdk/public/PublicAPIClient.js +7 -1
  331. package/sdk/public/PublicClient.d.ts +21 -3
  332. package/sdk/public/PublicClient.js +20 -0
  333. package/sdk/public/PublicConfig.d.ts +27 -6
  334. package/sdk/public/PublicConfig.js +17 -1
  335. package/sdk/public/Webhook/WebhookPublicClient.d.ts +16 -11
  336. package/sdk/public/Webhook/WebhookPublicClient.js +48 -27
  337. package/sdk/public/Webhook/WebhookPublicModel.d.ts +52 -16
  338. package/sdk/public/Webhook/WebhookPublicModel.js +33 -113
  339. package/sdk/public/Webhook/WebhookPublicValidator.d.ts +18 -3
  340. package/sdk/public/Webhook/WebhookPublicValidator.js +14 -4
  341. package/sdk/public/index.d.ts +1 -0
  342. package/sdk/public/index.js +2 -0
  343. package/sdk/application/ApplicationModels.d.ts +0 -3
  344. package/sdk/application/ApplicationModels.js +0 -20
  345. package/sdk/platform/Partner/PartnerPlatformClient.d.ts +0 -145
  346. package/sdk/platform/Partner/PartnerPlatformClient.js +0 -799
  347. package/sdk/platform/Partner/PartnerPlatformValidator.d.ts +0 -14
  348. package/sdk/platform/Partner/PartnerPlatformValidator.js +0 -87
@@ -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,21 @@ 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 {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
18
+ * @param {import("../PlatformAPIClient").Options} - Options
19
+ * @returns {Promise<PaymentPlatformModel.EdcDeviceUpdateResponse>} - Success response
20
+ * @name addEdcDevice
20
21
  * @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
22
+ * @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
23
  */
23
- async addEdcDevice({ terminalUniqueIdentifier, body } = {}) {
24
- const { error } = PaymentValidator.addEdcDevice().validate(
24
+ async addEdcDevice(
25
+ { terminalUniqueIdentifier, body, requestHeaders } = { requestHeaders: {} },
26
+ { responseHeaders } = { responseHeaders: false }
27
+ ) {
28
+ const {
29
+ error,
30
+ } = PaymentPlatformApplicationValidator.addEdcDevice().validate(
25
31
  {
26
32
  terminalUniqueIdentifier,
27
33
  body,
@@ -33,7 +39,9 @@ class Payment {
33
39
  }
34
40
 
35
41
  // Showing warrnings if extra unknown parameters are found
36
- const { error: warrning } = PaymentValidator.addEdcDevice().validate(
42
+ const {
43
+ error: warrning,
44
+ } = PaymentPlatformApplicationValidator.addEdcDevice().validate(
37
45
  {
38
46
  terminalUniqueIdentifier,
39
47
  body,
@@ -43,9 +51,8 @@ class Payment {
43
51
  if (warrning) {
44
52
  Logger({
45
53
  level: "WARN",
46
- message: "Parameter Validation warrnings for addEdcDevice",
54
+ message: `Parameter Validation warrnings for platform > Payment > addEdcDevice \n ${warrning}`,
47
55
  });
48
- Logger({ level: "WARN", message: warrning });
49
56
  }
50
57
 
51
58
  const query_params = {};
@@ -55,12 +62,19 @@ class Payment {
55
62
  "put",
56
63
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/edc-device/${terminalUniqueIdentifier}`,
57
64
  query_params,
58
- body
65
+ body,
66
+ requestHeaders,
67
+ { responseHeaders }
59
68
  );
60
69
 
70
+ let responseData = response;
71
+ if (responseHeaders) {
72
+ responseData = response[0];
73
+ }
74
+
61
75
  const {
62
76
  error: res_error,
63
- } = PaymentModel.EdcDeviceUpdateResponse().validate(response, {
77
+ } = PaymentPlatformModel.EdcDeviceUpdateResponse().validate(responseData, {
64
78
  abortEarly: false,
65
79
  allowUnknown: false,
66
80
  });
@@ -68,23 +82,31 @@ class Payment {
68
82
  if (res_error) {
69
83
  Logger({
70
84
  level: "WARN",
71
- message: "Response Validation Warnnings for addEdcDevice",
85
+ message: `Response Validation Warnnings for platform > Payment > addEdcDevice \n ${res_error}`,
72
86
  });
73
- Logger({ level: "WARN", message: res_error });
74
87
  }
75
88
 
76
89
  return response;
77
90
  }
78
91
 
79
92
  /**
80
- * @param {Object} arg - Arg object.
81
- * @param {AddBeneficiaryDetailsOTPRequest} arg.body
82
- * @returns {Promise<RefundAccountResponse>} - Success response
93
+ * @param {PaymentPlatformApplicationValidator.AddRefundBankAccountUsingOTPParam} arg
94
+ * - Arg object
95
+ *
96
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
97
+ * @param {import("../PlatformAPIClient").Options} - Options
98
+ * @returns {Promise<PaymentPlatformModel.RefundAccountResponse>} - Success response
99
+ * @name addRefundBankAccountUsingOTP
83
100
  * @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.
101
+ * @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
102
  */
86
- async addRefundBankAccountUsingOTP({ body } = {}) {
87
- const { error } = PaymentValidator.addRefundBankAccountUsingOTP().validate(
103
+ async addRefundBankAccountUsingOTP(
104
+ { body, requestHeaders } = { requestHeaders: {} },
105
+ { responseHeaders } = { responseHeaders: false }
106
+ ) {
107
+ const {
108
+ error,
109
+ } = PaymentPlatformApplicationValidator.addRefundBankAccountUsingOTP().validate(
88
110
  {
89
111
  body,
90
112
  },
@@ -97,7 +119,7 @@ class Payment {
97
119
  // Showing warrnings if extra unknown parameters are found
98
120
  const {
99
121
  error: warrning,
100
- } = PaymentValidator.addRefundBankAccountUsingOTP().validate(
122
+ } = PaymentPlatformApplicationValidator.addRefundBankAccountUsingOTP().validate(
101
123
  {
102
124
  body,
103
125
  },
@@ -106,10 +128,8 @@ class Payment {
106
128
  if (warrning) {
107
129
  Logger({
108
130
  level: "WARN",
109
- message:
110
- "Parameter Validation warrnings for addRefundBankAccountUsingOTP",
131
+ message: `Parameter Validation warrnings for platform > Payment > addRefundBankAccountUsingOTP \n ${warrning}`,
111
132
  });
112
- Logger({ level: "WARN", message: warrning });
113
133
  }
114
134
 
115
135
  const query_params = {};
@@ -119,12 +139,19 @@ class Payment {
119
139
  "post",
120
140
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/refund/account`,
121
141
  query_params,
122
- body
142
+ body,
143
+ requestHeaders,
144
+ { responseHeaders }
123
145
  );
124
146
 
147
+ let responseData = response;
148
+ if (responseHeaders) {
149
+ responseData = response[0];
150
+ }
151
+
125
152
  const {
126
153
  error: res_error,
127
- } = PaymentModel.RefundAccountResponse().validate(response, {
154
+ } = PaymentPlatformModel.RefundAccountResponse().validate(responseData, {
128
155
  abortEarly: false,
129
156
  allowUnknown: false,
130
157
  });
@@ -132,24 +159,32 @@ class Payment {
132
159
  if (res_error) {
133
160
  Logger({
134
161
  level: "WARN",
135
- message:
136
- "Response Validation Warnnings for addRefundBankAccountUsingOTP",
162
+ message: `Response Validation Warnnings for platform > Payment > addRefundBankAccountUsingOTP \n ${res_error}`,
137
163
  });
138
- Logger({ level: "WARN", message: res_error });
139
164
  }
140
165
 
141
166
  return response;
142
167
  }
143
168
 
144
169
  /**
145
- * @param {Object} arg - Arg object.
146
- * @param {CancelOrResendPaymentLinkRequest} arg.body
147
- * @returns {Promise<CancelPaymentLinkResponse>} - Success response
170
+ * @param {PaymentPlatformApplicationValidator.CancelPaymentLinkParam} arg
171
+ * - Arg object
172
+ *
173
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
174
+ * @param {import("../PlatformAPIClient").Options} - Options
175
+ * @returns {Promise<PaymentPlatformModel.CancelPaymentLinkResponse>} -
176
+ * Success response
177
+ * @name cancelPaymentLink
148
178
  * @summary: Cancel payment link
149
- * @description: Use this API to cancel a payment link for the customer
179
+ * @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
180
  */
151
- async cancelPaymentLink({ body } = {}) {
152
- const { error } = PaymentValidator.cancelPaymentLink().validate(
181
+ async cancelPaymentLink(
182
+ { body, requestHeaders } = { requestHeaders: {} },
183
+ { responseHeaders } = { responseHeaders: false }
184
+ ) {
185
+ const {
186
+ error,
187
+ } = PaymentPlatformApplicationValidator.cancelPaymentLink().validate(
153
188
  {
154
189
  body,
155
190
  },
@@ -160,7 +195,9 @@ class Payment {
160
195
  }
161
196
 
162
197
  // Showing warrnings if extra unknown parameters are found
163
- const { error: warrning } = PaymentValidator.cancelPaymentLink().validate(
198
+ const {
199
+ error: warrning,
200
+ } = PaymentPlatformApplicationValidator.cancelPaymentLink().validate(
164
201
  {
165
202
  body,
166
203
  },
@@ -169,9 +206,8 @@ class Payment {
169
206
  if (warrning) {
170
207
  Logger({
171
208
  level: "WARN",
172
- message: "Parameter Validation warrnings for cancelPaymentLink",
209
+ message: `Parameter Validation warrnings for platform > Payment > cancelPaymentLink \n ${warrning}`,
173
210
  });
174
- Logger({ level: "WARN", message: warrning });
175
211
  }
176
212
 
177
213
  const query_params = {};
@@ -181,36 +217,52 @@ class Payment {
181
217
  "post",
182
218
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/cancel-payment-link/`,
183
219
  query_params,
184
- body
220
+ body,
221
+ requestHeaders,
222
+ { responseHeaders }
185
223
  );
186
224
 
225
+ let responseData = response;
226
+ if (responseHeaders) {
227
+ responseData = response[0];
228
+ }
229
+
187
230
  const {
188
231
  error: res_error,
189
- } = PaymentModel.CancelPaymentLinkResponse().validate(response, {
190
- abortEarly: false,
191
- allowUnknown: false,
192
- });
232
+ } = PaymentPlatformModel.CancelPaymentLinkResponse().validate(
233
+ responseData,
234
+ { abortEarly: false, allowUnknown: false }
235
+ );
193
236
 
194
237
  if (res_error) {
195
238
  Logger({
196
239
  level: "WARN",
197
- message: "Response Validation Warnnings for cancelPaymentLink",
240
+ message: `Response Validation Warnnings for platform > Payment > cancelPaymentLink \n ${res_error}`,
198
241
  });
199
- Logger({ level: "WARN", message: res_error });
200
242
  }
201
243
 
202
244
  return response;
203
245
  }
204
246
 
205
247
  /**
206
- * @param {Object} arg - Arg object.
207
- * @param {PaymentStatusUpdateRequest} arg.body
208
- * @returns {Promise<PaymentStatusUpdateResponse>} - Success response
248
+ * @param {PaymentPlatformApplicationValidator.CheckAndUpdatePaymentStatusParam} arg
249
+ * - Arg object
250
+ *
251
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
252
+ * @param {import("../PlatformAPIClient").Options} - Options
253
+ * @returns {Promise<PaymentPlatformModel.PaymentStatusUpdateResponse>} -
254
+ * Success response
255
+ * @name checkAndUpdatePaymentStatus
209
256
  * @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.
257
+ * @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
258
  */
212
- async checkAndUpdatePaymentStatus({ body } = {}) {
213
- const { error } = PaymentValidator.checkAndUpdatePaymentStatus().validate(
259
+ async checkAndUpdatePaymentStatus(
260
+ { body, requestHeaders } = { requestHeaders: {} },
261
+ { responseHeaders } = { responseHeaders: false }
262
+ ) {
263
+ const {
264
+ error,
265
+ } = PaymentPlatformApplicationValidator.checkAndUpdatePaymentStatus().validate(
214
266
  {
215
267
  body,
216
268
  },
@@ -223,7 +275,7 @@ class Payment {
223
275
  // Showing warrnings if extra unknown parameters are found
224
276
  const {
225
277
  error: warrning,
226
- } = PaymentValidator.checkAndUpdatePaymentStatus().validate(
278
+ } = PaymentPlatformApplicationValidator.checkAndUpdatePaymentStatus().validate(
227
279
  {
228
280
  body,
229
281
  },
@@ -232,10 +284,8 @@ class Payment {
232
284
  if (warrning) {
233
285
  Logger({
234
286
  level: "WARN",
235
- message:
236
- "Parameter Validation warrnings for checkAndUpdatePaymentStatus",
287
+ message: `Parameter Validation warrnings for platform > Payment > checkAndUpdatePaymentStatus \n ${warrning}`,
237
288
  });
238
- Logger({ level: "WARN", message: warrning });
239
289
  }
240
290
 
241
291
  const query_params = {};
@@ -245,37 +295,50 @@ class Payment {
245
295
  "post",
246
296
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/confirm/polling`,
247
297
  query_params,
248
- body
298
+ body,
299
+ requestHeaders,
300
+ { responseHeaders }
249
301
  );
250
302
 
303
+ let responseData = response;
304
+ if (responseHeaders) {
305
+ responseData = response[0];
306
+ }
307
+
251
308
  const {
252
309
  error: res_error,
253
- } = PaymentModel.PaymentStatusUpdateResponse().validate(response, {
254
- abortEarly: false,
255
- allowUnknown: false,
256
- });
310
+ } = PaymentPlatformModel.PaymentStatusUpdateResponse().validate(
311
+ responseData,
312
+ { abortEarly: false, allowUnknown: false }
313
+ );
257
314
 
258
315
  if (res_error) {
259
316
  Logger({
260
317
  level: "WARN",
261
- message:
262
- "Response Validation Warnnings for checkAndUpdatePaymentStatus",
318
+ message: `Response Validation Warnnings for platform > Payment > checkAndUpdatePaymentStatus \n ${res_error}`,
263
319
  });
264
- Logger({ level: "WARN", message: res_error });
265
320
  }
266
321
 
267
322
  return response;
268
323
  }
269
324
 
270
325
  /**
271
- * @param {Object} arg - Arg object.
272
- * @param {PaymentConfirmationRequest} arg.body
273
- * @returns {Promise<PaymentConfirmationResponse>} - Success response
326
+ * @param {PaymentPlatformApplicationValidator.ConfirmPaymentParam} arg - Arg object
327
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
328
+ * @param {import("../PlatformAPIClient").Options} - Options
329
+ * @returns {Promise<PaymentPlatformModel.PaymentConfirmationResponse>} -
330
+ * Success response
331
+ * @name confirmPayment
274
332
  * @summary: Confirm payment after successful payment from payment gateway
275
- * @description: Use this API to confirm payment after payment gateway accepted payment.
333
+ * @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
334
  */
277
- async confirmPayment({ body } = {}) {
278
- const { error } = PaymentValidator.confirmPayment().validate(
335
+ async confirmPayment(
336
+ { body, requestHeaders } = { requestHeaders: {} },
337
+ { responseHeaders } = { responseHeaders: false }
338
+ ) {
339
+ const {
340
+ error,
341
+ } = PaymentPlatformApplicationValidator.confirmPayment().validate(
279
342
  {
280
343
  body,
281
344
  },
@@ -286,7 +349,9 @@ class Payment {
286
349
  }
287
350
 
288
351
  // Showing warrnings if extra unknown parameters are found
289
- const { error: warrning } = PaymentValidator.confirmPayment().validate(
352
+ const {
353
+ error: warrning,
354
+ } = PaymentPlatformApplicationValidator.confirmPayment().validate(
290
355
  {
291
356
  body,
292
357
  },
@@ -295,9 +360,8 @@ class Payment {
295
360
  if (warrning) {
296
361
  Logger({
297
362
  level: "WARN",
298
- message: "Parameter Validation warrnings for confirmPayment",
363
+ message: `Parameter Validation warrnings for platform > Payment > confirmPayment \n ${warrning}`,
299
364
  });
300
- Logger({ level: "WARN", message: warrning });
301
365
  }
302
366
 
303
367
  const query_params = {};
@@ -307,36 +371,52 @@ class Payment {
307
371
  "post",
308
372
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/confirm`,
309
373
  query_params,
310
- body
374
+ body,
375
+ requestHeaders,
376
+ { responseHeaders }
311
377
  );
312
378
 
379
+ let responseData = response;
380
+ if (responseHeaders) {
381
+ responseData = response[0];
382
+ }
383
+
313
384
  const {
314
385
  error: res_error,
315
- } = PaymentModel.PaymentConfirmationResponse().validate(response, {
316
- abortEarly: false,
317
- allowUnknown: false,
318
- });
386
+ } = PaymentPlatformModel.PaymentConfirmationResponse().validate(
387
+ responseData,
388
+ { abortEarly: false, allowUnknown: false }
389
+ );
319
390
 
320
391
  if (res_error) {
321
392
  Logger({
322
393
  level: "WARN",
323
- message: "Response Validation Warnnings for confirmPayment",
394
+ message: `Response Validation Warnnings for platform > Payment > confirmPayment \n ${res_error}`,
324
395
  });
325
- Logger({ level: "WARN", message: res_error });
326
396
  }
327
397
 
328
398
  return response;
329
399
  }
330
400
 
331
401
  /**
332
- * @param {Object} arg - Arg object.
333
- * @param {CreatePaymentLinkRequest} arg.body
334
- * @returns {Promise<CreatePaymentLinkResponse>} - Success response
402
+ * @param {PaymentPlatformApplicationValidator.CreatePaymentLinkParam} arg
403
+ * - Arg object
404
+ *
405
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
406
+ * @param {import("../PlatformAPIClient").Options} - Options
407
+ * @returns {Promise<PaymentPlatformModel.CreatePaymentLinkResponse>} -
408
+ * Success response
409
+ * @name createPaymentLink
335
410
  * @summary: Create payment link
336
- * @description: Use this API to create a payment link for the customer
411
+ * @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
412
  */
338
- async createPaymentLink({ body } = {}) {
339
- const { error } = PaymentValidator.createPaymentLink().validate(
413
+ async createPaymentLink(
414
+ { body, requestHeaders } = { requestHeaders: {} },
415
+ { responseHeaders } = { responseHeaders: false }
416
+ ) {
417
+ const {
418
+ error,
419
+ } = PaymentPlatformApplicationValidator.createPaymentLink().validate(
340
420
  {
341
421
  body,
342
422
  },
@@ -347,7 +427,9 @@ class Payment {
347
427
  }
348
428
 
349
429
  // Showing warrnings if extra unknown parameters are found
350
- const { error: warrning } = PaymentValidator.createPaymentLink().validate(
430
+ const {
431
+ error: warrning,
432
+ } = PaymentPlatformApplicationValidator.createPaymentLink().validate(
351
433
  {
352
434
  body,
353
435
  },
@@ -356,9 +438,8 @@ class Payment {
356
438
  if (warrning) {
357
439
  Logger({
358
440
  level: "WARN",
359
- message: "Parameter Validation warrnings for createPaymentLink",
441
+ message: `Parameter Validation warrnings for platform > Payment > createPaymentLink \n ${warrning}`,
360
442
  });
361
- Logger({ level: "WARN", message: warrning });
362
443
  }
363
444
 
364
445
  const query_params = {};
@@ -368,35 +449,53 @@ class Payment {
368
449
  "post",
369
450
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/create-payment-link/`,
370
451
  query_params,
371
- body
452
+ body,
453
+ requestHeaders,
454
+ { responseHeaders }
372
455
  );
373
456
 
457
+ let responseData = response;
458
+ if (responseHeaders) {
459
+ responseData = response[0];
460
+ }
461
+
374
462
  const {
375
463
  error: res_error,
376
- } = PaymentModel.CreatePaymentLinkResponse().validate(response, {
377
- abortEarly: false,
378
- allowUnknown: false,
379
- });
464
+ } = PaymentPlatformModel.CreatePaymentLinkResponse().validate(
465
+ responseData,
466
+ { abortEarly: false, allowUnknown: false }
467
+ );
380
468
 
381
469
  if (res_error) {
382
470
  Logger({
383
471
  level: "WARN",
384
- message: "Response Validation Warnnings for createPaymentLink",
472
+ message: `Response Validation Warnnings for platform > Payment > createPaymentLink \n ${res_error}`,
385
473
  });
386
- Logger({ level: "WARN", message: res_error });
387
474
  }
388
475
 
389
476
  return response;
390
477
  }
391
478
 
392
479
  /**
393
- * @param {Object} arg - Arg object.
394
- * @returns {Promise<EdcAggregatorAndModelListResponse>} - Success response
480
+ * @param {PaymentPlatformApplicationValidator.EdcAggregatorsAndModelListParam} arg
481
+ * - Arg object
482
+ *
483
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
484
+ * @param {import("../PlatformAPIClient").Options} - Options
485
+ * @returns {Promise<PaymentPlatformModel.EdcAggregatorAndModelListResponse>}
486
+ * - Success response
487
+ *
488
+ * @name edcAggregatorsAndModelList
395
489
  * @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.
490
+ * @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
491
  */
398
- async edcAggregatorsAndModelList({} = {}) {
399
- const { error } = PaymentValidator.edcAggregatorsAndModelList().validate(
492
+ async edcAggregatorsAndModelList(
493
+ { requestHeaders } = { requestHeaders: {} },
494
+ { responseHeaders } = { responseHeaders: false }
495
+ ) {
496
+ const {
497
+ error,
498
+ } = PaymentPlatformApplicationValidator.edcAggregatorsAndModelList().validate(
400
499
  {},
401
500
  { abortEarly: false, allowUnknown: true }
402
501
  );
@@ -407,17 +506,15 @@ class Payment {
407
506
  // Showing warrnings if extra unknown parameters are found
408
507
  const {
409
508
  error: warrning,
410
- } = PaymentValidator.edcAggregatorsAndModelList().validate(
509
+ } = PaymentPlatformApplicationValidator.edcAggregatorsAndModelList().validate(
411
510
  {},
412
511
  { abortEarly: false, allowUnknown: false }
413
512
  );
414
513
  if (warrning) {
415
514
  Logger({
416
515
  level: "WARN",
417
- message:
418
- "Parameter Validation warrnings for edcAggregatorsAndModelList",
516
+ message: `Parameter Validation warrnings for platform > Payment > edcAggregatorsAndModelList \n ${warrning}`,
419
517
  });
420
- Logger({ level: "WARN", message: warrning });
421
518
  }
422
519
 
423
520
  const query_params = {};
@@ -427,40 +524,51 @@ class Payment {
427
524
  "get",
428
525
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/edc-aggregator-list`,
429
526
  query_params,
430
- undefined
527
+ undefined,
528
+ requestHeaders,
529
+ { responseHeaders }
431
530
  );
432
531
 
532
+ let responseData = response;
533
+ if (responseHeaders) {
534
+ responseData = response[0];
535
+ }
536
+
433
537
  const {
434
538
  error: res_error,
435
- } = PaymentModel.EdcAggregatorAndModelListResponse().validate(response, {
436
- abortEarly: false,
437
- allowUnknown: false,
438
- });
539
+ } = PaymentPlatformModel.EdcAggregatorAndModelListResponse().validate(
540
+ responseData,
541
+ { abortEarly: false, allowUnknown: false }
542
+ );
439
543
 
440
544
  if (res_error) {
441
545
  Logger({
442
546
  level: "WARN",
443
- message: "Response Validation Warnnings for edcAggregatorsAndModelList",
547
+ message: `Response Validation Warnnings for platform > Payment > edcAggregatorsAndModelList \n ${res_error}`,
444
548
  });
445
- Logger({ level: "WARN", message: res_error });
446
549
  }
447
550
 
448
551
  return response;
449
552
  }
450
553
 
451
554
  /**
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
555
+ * @param {PaymentPlatformApplicationValidator.EdcDeviceListParam} arg - Arg object
556
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
557
+ * @param {import("../PlatformAPIClient").Options} - Options
558
+ * @returns {Promise<PaymentPlatformModel.EdcDeviceListResponse>} - Success response
559
+ * @name edcDeviceList
459
560
  * @summary: get all the device list of an app
460
- * @description: Use this API to get all devices linked to a particular app.
561
+ * @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
562
  */
462
- async edcDeviceList({ pageNo, pageSize, isActive, storeId, deviceTag } = {}) {
463
- const { error } = PaymentValidator.edcDeviceList().validate(
563
+ async edcDeviceList(
564
+ { pageNo, pageSize, isActive, storeId, deviceTag, requestHeaders } = {
565
+ requestHeaders: {},
566
+ },
567
+ { responseHeaders } = { responseHeaders: false }
568
+ ) {
569
+ const {
570
+ error,
571
+ } = PaymentPlatformApplicationValidator.edcDeviceList().validate(
464
572
  {
465
573
  pageNo,
466
574
  pageSize,
@@ -475,7 +583,9 @@ class Payment {
475
583
  }
476
584
 
477
585
  // Showing warrnings if extra unknown parameters are found
478
- const { error: warrning } = PaymentValidator.edcDeviceList().validate(
586
+ const {
587
+ error: warrning,
588
+ } = PaymentPlatformApplicationValidator.edcDeviceList().validate(
479
589
  {
480
590
  pageNo,
481
591
  pageSize,
@@ -488,9 +598,8 @@ class Payment {
488
598
  if (warrning) {
489
599
  Logger({
490
600
  level: "WARN",
491
- message: "Parameter Validation warrnings for edcDeviceList",
601
+ message: `Parameter Validation warrnings for platform > Payment > edcDeviceList \n ${warrning}`,
492
602
  });
493
- Logger({ level: "WARN", message: warrning });
494
603
  }
495
604
 
496
605
  const query_params = {};
@@ -505,12 +614,19 @@ class Payment {
505
614
  "get",
506
615
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/edc-device-list`,
507
616
  query_params,
508
- undefined
617
+ undefined,
618
+ requestHeaders,
619
+ { responseHeaders }
509
620
  );
510
621
 
622
+ let responseData = response;
623
+ if (responseHeaders) {
624
+ responseData = response[0];
625
+ }
626
+
511
627
  const {
512
628
  error: res_error,
513
- } = PaymentModel.EdcDeviceListResponse().validate(response, {
629
+ } = PaymentPlatformModel.EdcDeviceListResponse().validate(responseData, {
514
630
  abortEarly: false,
515
631
  allowUnknown: false,
516
632
  });
@@ -518,22 +634,29 @@ class Payment {
518
634
  if (res_error) {
519
635
  Logger({
520
636
  level: "WARN",
521
- message: "Response Validation Warnnings for edcDeviceList",
637
+ message: `Response Validation Warnnings for platform > Payment > edcDeviceList \n ${res_error}`,
522
638
  });
523
- Logger({ level: "WARN", message: res_error });
524
639
  }
525
640
 
526
641
  return response;
527
642
  }
528
643
 
529
644
  /**
530
- * @param {Object} arg - Arg object.
531
- * @returns {Promise<EdcDeviceStatsResponse>} - Success response
645
+ * @param {PaymentPlatformApplicationValidator.EdcDeviceStatsParam} arg - Arg object
646
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
647
+ * @param {import("../PlatformAPIClient").Options} - Options
648
+ * @returns {Promise<PaymentPlatformModel.EdcDeviceStatsResponse>} - Success response
649
+ * @name edcDeviceStats
532
650
  * @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.
651
+ * @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
652
  */
535
- async edcDeviceStats({} = {}) {
536
- const { error } = PaymentValidator.edcDeviceStats().validate(
653
+ async edcDeviceStats(
654
+ { requestHeaders } = { requestHeaders: {} },
655
+ { responseHeaders } = { responseHeaders: false }
656
+ ) {
657
+ const {
658
+ error,
659
+ } = PaymentPlatformApplicationValidator.edcDeviceStats().validate(
537
660
  {},
538
661
  { abortEarly: false, allowUnknown: true }
539
662
  );
@@ -542,16 +665,17 @@ class Payment {
542
665
  }
543
666
 
544
667
  // Showing warrnings if extra unknown parameters are found
545
- const { error: warrning } = PaymentValidator.edcDeviceStats().validate(
668
+ const {
669
+ error: warrning,
670
+ } = PaymentPlatformApplicationValidator.edcDeviceStats().validate(
546
671
  {},
547
672
  { abortEarly: false, allowUnknown: false }
548
673
  );
549
674
  if (warrning) {
550
675
  Logger({
551
676
  level: "WARN",
552
- message: "Parameter Validation warrnings for edcDeviceStats",
677
+ message: `Parameter Validation warrnings for platform > Payment > edcDeviceStats \n ${warrning}`,
553
678
  });
554
- Logger({ level: "WARN", message: warrning });
555
679
  }
556
680
 
557
681
  const query_params = {};
@@ -561,12 +685,19 @@ class Payment {
561
685
  "get",
562
686
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/edc-device-stats`,
563
687
  query_params,
564
- undefined
688
+ undefined,
689
+ requestHeaders,
690
+ { responseHeaders }
565
691
  );
566
692
 
693
+ let responseData = response;
694
+ if (responseHeaders) {
695
+ responseData = response[0];
696
+ }
697
+
567
698
  const {
568
699
  error: res_error,
569
- } = PaymentModel.EdcDeviceStatsResponse().validate(response, {
700
+ } = PaymentPlatformModel.EdcDeviceStatsResponse().validate(responseData, {
570
701
  abortEarly: false,
571
702
  allowUnknown: false,
572
703
  });
@@ -574,28 +705,31 @@ class Payment {
574
705
  if (res_error) {
575
706
  Logger({
576
707
  level: "WARN",
577
- message: "Response Validation Warnnings for edcDeviceStats",
708
+ message: `Response Validation Warnnings for platform > Payment > edcDeviceStats \n ${res_error}`,
578
709
  });
579
- Logger({ level: "WARN", message: res_error });
580
710
  }
581
711
 
582
712
  return response;
583
713
  }
584
714
 
585
715
  /**
586
- * @param {Object} arg - Arg object.
587
- * @param {string} arg.orderId -
588
- * @param {string} [arg.requestHash] -
589
- * @returns {Promise<RefundAccountResponse>} - Success response
716
+ * @param {PaymentPlatformApplicationValidator.GetBankAccountDetailsOpenAPIParam} arg
717
+ * - Arg object
718
+ *
719
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
720
+ * @param {import("../PlatformAPIClient").Options} - Options
721
+ * @returns {Promise<PaymentPlatformModel.RefundAccountResponse>} - Success response
722
+ * @name getBankAccountDetailsOpenAPI
590
723
  * @summary: Get bank details
591
- * @description: Use this API to get saved bank details for returned/cancelled order using order id.
724
+ * @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
725
  */
593
- async getBankAccountDetailsOpenAPI({
594
- orderId,
595
-
596
- requestHash,
597
- } = {}) {
598
- const { error } = PaymentValidator.getBankAccountDetailsOpenAPI().validate(
726
+ async getBankAccountDetailsOpenAPI(
727
+ { orderId, requestHash, requestHeaders } = { requestHeaders: {} },
728
+ { responseHeaders } = { responseHeaders: false }
729
+ ) {
730
+ const {
731
+ error,
732
+ } = PaymentPlatformApplicationValidator.getBankAccountDetailsOpenAPI().validate(
599
733
  {
600
734
  orderId,
601
735
 
@@ -610,7 +744,7 @@ class Payment {
610
744
  // Showing warrnings if extra unknown parameters are found
611
745
  const {
612
746
  error: warrning,
613
- } = PaymentValidator.getBankAccountDetailsOpenAPI().validate(
747
+ } = PaymentPlatformApplicationValidator.getBankAccountDetailsOpenAPI().validate(
614
748
  {
615
749
  orderId,
616
750
 
@@ -621,10 +755,8 @@ class Payment {
621
755
  if (warrning) {
622
756
  Logger({
623
757
  level: "WARN",
624
- message:
625
- "Parameter Validation warrnings for getBankAccountDetailsOpenAPI",
758
+ message: `Parameter Validation warrnings for platform > Payment > getBankAccountDetailsOpenAPI \n ${warrning}`,
626
759
  });
627
- Logger({ level: "WARN", message: warrning });
628
760
  }
629
761
 
630
762
  const query_params = {};
@@ -636,12 +768,19 @@ class Payment {
636
768
  "get",
637
769
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/refund/account`,
638
770
  query_params,
639
- undefined
771
+ undefined,
772
+ requestHeaders,
773
+ { responseHeaders }
640
774
  );
641
775
 
776
+ let responseData = response;
777
+ if (responseHeaders) {
778
+ responseData = response[0];
779
+ }
780
+
642
781
  const {
643
782
  error: res_error,
644
- } = PaymentModel.RefundAccountResponse().validate(response, {
783
+ } = PaymentPlatformModel.RefundAccountResponse().validate(responseData, {
645
784
  abortEarly: false,
646
785
  allowUnknown: false,
647
786
  });
@@ -649,23 +788,32 @@ class Payment {
649
788
  if (res_error) {
650
789
  Logger({
651
790
  level: "WARN",
652
- message:
653
- "Response Validation Warnnings for getBankAccountDetailsOpenAPI",
791
+ message: `Response Validation Warnnings for platform > Payment > getBankAccountDetailsOpenAPI \n ${res_error}`,
654
792
  });
655
- Logger({ level: "WARN", message: res_error });
656
793
  }
657
794
 
658
795
  return response;
659
796
  }
660
797
 
661
798
  /**
662
- * @param {Object} arg - Arg object.
663
- * @returns {Promise<PaymentGatewayConfigResponse>} - Success response
799
+ * @param {PaymentPlatformApplicationValidator.GetBrandPaymentGatewayConfigParam} arg
800
+ * - Arg object
801
+ *
802
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
803
+ * @param {import("../PlatformAPIClient").Options} - Options
804
+ * @returns {Promise<PaymentPlatformModel.PaymentGatewayConfigResponse>} -
805
+ * Success response
806
+ * @name getBrandPaymentGatewayConfig
664
807
  * @summary: Get All Brand Payment Gateway Config Secret
665
- * @description: Get All Brand Payment Gateway Config Secret
808
+ * @description: Get All Brand Payment Gateway Config Secret - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/getBrandPaymentGatewayConfig/).
666
809
  */
667
- async getBrandPaymentGatewayConfig({} = {}) {
668
- const { error } = PaymentValidator.getBrandPaymentGatewayConfig().validate(
810
+ async getBrandPaymentGatewayConfig(
811
+ { requestHeaders } = { requestHeaders: {} },
812
+ { responseHeaders } = { responseHeaders: false }
813
+ ) {
814
+ const {
815
+ error,
816
+ } = PaymentPlatformApplicationValidator.getBrandPaymentGatewayConfig().validate(
669
817
  {},
670
818
  { abortEarly: false, allowUnknown: true }
671
819
  );
@@ -676,17 +824,15 @@ class Payment {
676
824
  // Showing warrnings if extra unknown parameters are found
677
825
  const {
678
826
  error: warrning,
679
- } = PaymentValidator.getBrandPaymentGatewayConfig().validate(
827
+ } = PaymentPlatformApplicationValidator.getBrandPaymentGatewayConfig().validate(
680
828
  {},
681
829
  { abortEarly: false, allowUnknown: false }
682
830
  );
683
831
  if (warrning) {
684
832
  Logger({
685
833
  level: "WARN",
686
- message:
687
- "Parameter Validation warrnings for getBrandPaymentGatewayConfig",
834
+ message: `Parameter Validation warrnings for platform > Payment > getBrandPaymentGatewayConfig \n ${warrning}`,
688
835
  });
689
- Logger({ level: "WARN", message: warrning });
690
836
  }
691
837
 
692
838
  const query_params = {};
@@ -696,37 +842,50 @@ class Payment {
696
842
  "get",
697
843
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/aggregator/request`,
698
844
  query_params,
699
- undefined
845
+ undefined,
846
+ requestHeaders,
847
+ { responseHeaders }
700
848
  );
701
849
 
850
+ let responseData = response;
851
+ if (responseHeaders) {
852
+ responseData = response[0];
853
+ }
854
+
702
855
  const {
703
856
  error: res_error,
704
- } = PaymentModel.PaymentGatewayConfigResponse().validate(response, {
705
- abortEarly: false,
706
- allowUnknown: false,
707
- });
857
+ } = PaymentPlatformModel.PaymentGatewayConfigResponse().validate(
858
+ responseData,
859
+ { abortEarly: false, allowUnknown: false }
860
+ );
708
861
 
709
862
  if (res_error) {
710
863
  Logger({
711
864
  level: "WARN",
712
- message:
713
- "Response Validation Warnnings for getBrandPaymentGatewayConfig",
865
+ message: `Response Validation Warnnings for platform > Payment > getBrandPaymentGatewayConfig \n ${res_error}`,
714
866
  });
715
- Logger({ level: "WARN", message: res_error });
716
867
  }
717
868
 
718
869
  return response;
719
870
  }
720
871
 
721
872
  /**
722
- * @param {Object} arg - Arg object.
723
- * @param {string} arg.terminalUniqueIdentifier - Terminal unique identifier
724
- * @returns {Promise<EdcDeviceDetailsResponse>} - Success response
873
+ * @param {PaymentPlatformApplicationValidator.GetEdcDeviceParam} arg - Arg object
874
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
875
+ * @param {import("../PlatformAPIClient").Options} - Options
876
+ * @returns {Promise<PaymentPlatformModel.EdcDeviceDetailsResponse>} -
877
+ * Success response
878
+ * @name getEdcDevice
725
879
  * @summary: get details of a single edc device
726
- * @description: Use this API to get details of a single edc device
880
+ * @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
881
  */
728
- async getEdcDevice({ terminalUniqueIdentifier } = {}) {
729
- const { error } = PaymentValidator.getEdcDevice().validate(
882
+ async getEdcDevice(
883
+ { terminalUniqueIdentifier, requestHeaders } = { requestHeaders: {} },
884
+ { responseHeaders } = { responseHeaders: false }
885
+ ) {
886
+ const {
887
+ error,
888
+ } = PaymentPlatformApplicationValidator.getEdcDevice().validate(
730
889
  {
731
890
  terminalUniqueIdentifier,
732
891
  },
@@ -737,7 +896,9 @@ class Payment {
737
896
  }
738
897
 
739
898
  // Showing warrnings if extra unknown parameters are found
740
- const { error: warrning } = PaymentValidator.getEdcDevice().validate(
899
+ const {
900
+ error: warrning,
901
+ } = PaymentPlatformApplicationValidator.getEdcDevice().validate(
741
902
  {
742
903
  terminalUniqueIdentifier,
743
904
  },
@@ -746,9 +907,8 @@ class Payment {
746
907
  if (warrning) {
747
908
  Logger({
748
909
  level: "WARN",
749
- message: "Parameter Validation warrnings for getEdcDevice",
910
+ message: `Parameter Validation warrnings for platform > Payment > getEdcDevice \n ${warrning}`,
750
911
  });
751
- Logger({ level: "WARN", message: warrning });
752
912
  }
753
913
 
754
914
  const query_params = {};
@@ -758,12 +918,19 @@ class Payment {
758
918
  "get",
759
919
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/edc-device/${terminalUniqueIdentifier}`,
760
920
  query_params,
761
- undefined
921
+ undefined,
922
+ requestHeaders,
923
+ { responseHeaders }
762
924
  );
763
925
 
926
+ let responseData = response;
927
+ if (responseHeaders) {
928
+ responseData = response[0];
929
+ }
930
+
764
931
  const {
765
932
  error: res_error,
766
- } = PaymentModel.EdcDeviceDetailsResponse().validate(response, {
933
+ } = PaymentPlatformModel.EdcDeviceDetailsResponse().validate(responseData, {
767
934
  abortEarly: false,
768
935
  allowUnknown: false,
769
936
  });
@@ -771,22 +938,265 @@ class Payment {
771
938
  if (res_error) {
772
939
  Logger({
773
940
  level: "WARN",
774
- message: "Response Validation Warnnings for getEdcDevice",
941
+ message: `Response Validation Warnnings for platform > Payment > getEdcDevice \n ${res_error}`,
942
+ });
943
+ }
944
+
945
+ return response;
946
+ }
947
+
948
+ /**
949
+ * @param {PaymentPlatformApplicationValidator.GetMerchantAggregatorPaymentModeDetailsParam} arg
950
+ * - Arg object
951
+ *
952
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
953
+ * @param {import("../PlatformAPIClient").Options} - Options
954
+ * @returns {Promise<PaymentPlatformModel.MerchnatPaymentModeResponse>} -
955
+ * Success response
956
+ * @name getMerchantAggregatorPaymentModeDetails
957
+ * @summary: Get Aggregator, payment mode and sub payment mode.
958
+ * @description: Get Aggregator, payment mode and sub payment mode details. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/getMerchantAggregatorPaymentModeDetails/).
959
+ */
960
+ async getMerchantAggregatorPaymentModeDetails(
961
+ { aggregatorId, businessUnit, device, requestHeaders } = {
962
+ requestHeaders: {},
963
+ },
964
+ { responseHeaders } = { responseHeaders: false }
965
+ ) {
966
+ const {
967
+ error,
968
+ } = PaymentPlatformApplicationValidator.getMerchantAggregatorPaymentModeDetails().validate(
969
+ {
970
+ aggregatorId,
971
+ businessUnit,
972
+ device,
973
+ },
974
+ { abortEarly: false, allowUnknown: true }
975
+ );
976
+ if (error) {
977
+ return Promise.reject(new FDKClientValidationError(error));
978
+ }
979
+
980
+ // Showing warrnings if extra unknown parameters are found
981
+ const {
982
+ error: warrning,
983
+ } = PaymentPlatformApplicationValidator.getMerchantAggregatorPaymentModeDetails().validate(
984
+ {
985
+ aggregatorId,
986
+ businessUnit,
987
+ device,
988
+ },
989
+ { abortEarly: false, allowUnknown: false }
990
+ );
991
+ if (warrning) {
992
+ Logger({
993
+ level: "WARN",
994
+ message: `Parameter Validation warrnings for platform > Payment > getMerchantAggregatorPaymentModeDetails \n ${warrning}`,
995
+ });
996
+ }
997
+
998
+ const query_params = {};
999
+ query_params["business_unit"] = businessUnit;
1000
+ query_params["device"] = device;
1001
+
1002
+ const response = await PlatformAPIClient.execute(
1003
+ this.config,
1004
+ "get",
1005
+ `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/options/aggregators/${aggregatorId}`,
1006
+ query_params,
1007
+ undefined,
1008
+ requestHeaders,
1009
+ { responseHeaders }
1010
+ );
1011
+
1012
+ let responseData = response;
1013
+ if (responseHeaders) {
1014
+ responseData = response[0];
1015
+ }
1016
+
1017
+ const {
1018
+ error: res_error,
1019
+ } = PaymentPlatformModel.MerchnatPaymentModeResponse().validate(
1020
+ responseData,
1021
+ { abortEarly: false, allowUnknown: false }
1022
+ );
1023
+
1024
+ if (res_error) {
1025
+ Logger({
1026
+ level: "WARN",
1027
+ message: `Response Validation Warnnings for platform > Payment > getMerchantAggregatorPaymentModeDetails \n ${res_error}`,
1028
+ });
1029
+ }
1030
+
1031
+ return response;
1032
+ }
1033
+
1034
+ /**
1035
+ * @param {PaymentPlatformApplicationValidator.GetMerchantPaymentOptionParam} arg
1036
+ * - Arg object
1037
+ *
1038
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1039
+ * @param {import("../PlatformAPIClient").Options} - Options
1040
+ * @returns {Promise<PaymentPlatformModel.MerchnatPaymentModeResponse>} -
1041
+ * Success response
1042
+ * @name getMerchantPaymentOption
1043
+ * @summary: Get Payment modes and COD details.
1044
+ * @description: This api fetches all the available PGs for merchant and its offline payment mode details. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/getMerchantPaymentOption/).
1045
+ */
1046
+ async getMerchantPaymentOption(
1047
+ { requestHeaders } = { requestHeaders: {} },
1048
+ { responseHeaders } = { responseHeaders: false }
1049
+ ) {
1050
+ const {
1051
+ error,
1052
+ } = PaymentPlatformApplicationValidator.getMerchantPaymentOption().validate(
1053
+ {},
1054
+ { abortEarly: false, allowUnknown: true }
1055
+ );
1056
+ if (error) {
1057
+ return Promise.reject(new FDKClientValidationError(error));
1058
+ }
1059
+
1060
+ // Showing warrnings if extra unknown parameters are found
1061
+ const {
1062
+ error: warrning,
1063
+ } = PaymentPlatformApplicationValidator.getMerchantPaymentOption().validate(
1064
+ {},
1065
+ { abortEarly: false, allowUnknown: false }
1066
+ );
1067
+ if (warrning) {
1068
+ Logger({
1069
+ level: "WARN",
1070
+ message: `Parameter Validation warrnings for platform > Payment > getMerchantPaymentOption \n ${warrning}`,
1071
+ });
1072
+ }
1073
+
1074
+ const query_params = {};
1075
+
1076
+ const response = await PlatformAPIClient.execute(
1077
+ this.config,
1078
+ "get",
1079
+ `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/options/configuration`,
1080
+ query_params,
1081
+ undefined,
1082
+ requestHeaders,
1083
+ { responseHeaders }
1084
+ );
1085
+
1086
+ let responseData = response;
1087
+ if (responseHeaders) {
1088
+ responseData = response[0];
1089
+ }
1090
+
1091
+ const {
1092
+ error: res_error,
1093
+ } = PaymentPlatformModel.MerchnatPaymentModeResponse().validate(
1094
+ responseData,
1095
+ { abortEarly: false, allowUnknown: false }
1096
+ );
1097
+
1098
+ if (res_error) {
1099
+ Logger({
1100
+ level: "WARN",
1101
+ message: `Response Validation Warnnings for platform > Payment > getMerchantPaymentOption \n ${res_error}`,
1102
+ });
1103
+ }
1104
+
1105
+ return response;
1106
+ }
1107
+
1108
+ /**
1109
+ * @param {PaymentPlatformApplicationValidator.GetPGConfigAggregatorsParam} arg
1110
+ * - Arg object
1111
+ *
1112
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1113
+ * @param {import("../PlatformAPIClient").Options} - Options
1114
+ * @returns {Promise<PaymentPlatformModel.MerchnatPaymentModeResponse>} -
1115
+ * Success response
1116
+ * @name getPGConfigAggregators
1117
+ * @summary: Get Aggregators available to be added as PG.
1118
+ * @description: Get Aggregators available to be added as PG. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/getPGConfigAggregators/).
1119
+ */
1120
+ async getPGConfigAggregators(
1121
+ { requestHeaders } = { requestHeaders: {} },
1122
+ { responseHeaders } = { responseHeaders: false }
1123
+ ) {
1124
+ const {
1125
+ error,
1126
+ } = PaymentPlatformApplicationValidator.getPGConfigAggregators().validate(
1127
+ {},
1128
+ { abortEarly: false, allowUnknown: true }
1129
+ );
1130
+ if (error) {
1131
+ return Promise.reject(new FDKClientValidationError(error));
1132
+ }
1133
+
1134
+ // Showing warrnings if extra unknown parameters are found
1135
+ const {
1136
+ error: warrning,
1137
+ } = PaymentPlatformApplicationValidator.getPGConfigAggregators().validate(
1138
+ {},
1139
+ { abortEarly: false, allowUnknown: false }
1140
+ );
1141
+ if (warrning) {
1142
+ Logger({
1143
+ level: "WARN",
1144
+ message: `Parameter Validation warrnings for platform > Payment > getPGConfigAggregators \n ${warrning}`,
1145
+ });
1146
+ }
1147
+
1148
+ const query_params = {};
1149
+
1150
+ const response = await PlatformAPIClient.execute(
1151
+ this.config,
1152
+ "get",
1153
+ `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/options/configuration/aggregator`,
1154
+ query_params,
1155
+ undefined,
1156
+ requestHeaders,
1157
+ { responseHeaders }
1158
+ );
1159
+
1160
+ let responseData = response;
1161
+ if (responseHeaders) {
1162
+ responseData = response[0];
1163
+ }
1164
+
1165
+ const {
1166
+ error: res_error,
1167
+ } = PaymentPlatformModel.MerchnatPaymentModeResponse().validate(
1168
+ responseData,
1169
+ { abortEarly: false, allowUnknown: false }
1170
+ );
1171
+
1172
+ if (res_error) {
1173
+ Logger({
1174
+ level: "WARN",
1175
+ message: `Response Validation Warnnings for platform > Payment > getPGConfigAggregators \n ${res_error}`,
775
1176
  });
776
- Logger({ level: "WARN", message: res_error });
777
1177
  }
778
1178
 
779
1179
  return response;
780
1180
  }
781
1181
 
782
1182
  /**
783
- * @param {Object} arg - Arg object.
784
- * @returns {Promise<GetPaymentCodeResponse>} - Success response
1183
+ * @param {PaymentPlatformApplicationValidator.GetPaymentCodeOptionParam} arg
1184
+ * - Arg object
1185
+ *
1186
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1187
+ * @param {import("../PlatformAPIClient").Options} - Options
1188
+ * @returns {Promise<PaymentPlatformModel.GetPaymentCodeResponse>} - Success response
1189
+ * @name getPaymentCodeOption
785
1190
  * @summary: List Payment Options Method Codes
786
- * @description: Get all active List Payment Options Method Codes
1191
+ * @description: Get all active List Payment Options Method Codes - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/getPaymentCodeOption/).
787
1192
  */
788
- async getPaymentCodeOption({} = {}) {
789
- const { error } = PaymentValidator.getPaymentCodeOption().validate(
1193
+ async getPaymentCodeOption(
1194
+ { requestHeaders } = { requestHeaders: {} },
1195
+ { responseHeaders } = { responseHeaders: false }
1196
+ ) {
1197
+ const {
1198
+ error,
1199
+ } = PaymentPlatformApplicationValidator.getPaymentCodeOption().validate(
790
1200
  {},
791
1201
  { abortEarly: false, allowUnknown: true }
792
1202
  );
@@ -797,16 +1207,15 @@ class Payment {
797
1207
  // Showing warrnings if extra unknown parameters are found
798
1208
  const {
799
1209
  error: warrning,
800
- } = PaymentValidator.getPaymentCodeOption().validate(
1210
+ } = PaymentPlatformApplicationValidator.getPaymentCodeOption().validate(
801
1211
  {},
802
1212
  { abortEarly: false, allowUnknown: false }
803
1213
  );
804
1214
  if (warrning) {
805
1215
  Logger({
806
1216
  level: "WARN",
807
- message: "Parameter Validation warrnings for getPaymentCodeOption",
1217
+ message: `Parameter Validation warrnings for platform > Payment > getPaymentCodeOption \n ${warrning}`,
808
1218
  });
809
- Logger({ level: "WARN", message: warrning });
810
1219
  }
811
1220
 
812
1221
  const query_params = {};
@@ -816,12 +1225,19 @@ class Payment {
816
1225
  "get",
817
1226
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/codes`,
818
1227
  query_params,
819
- undefined
1228
+ undefined,
1229
+ requestHeaders,
1230
+ { responseHeaders }
820
1231
  );
821
1232
 
1233
+ let responseData = response;
1234
+ if (responseHeaders) {
1235
+ responseData = response[0];
1236
+ }
1237
+
822
1238
  const {
823
1239
  error: res_error,
824
- } = PaymentModel.GetPaymentCodeResponse().validate(response, {
1240
+ } = PaymentPlatformModel.GetPaymentCodeResponse().validate(responseData, {
825
1241
  abortEarly: false,
826
1242
  allowUnknown: false,
827
1243
  });
@@ -829,23 +1245,29 @@ class Payment {
829
1245
  if (res_error) {
830
1246
  Logger({
831
1247
  level: "WARN",
832
- message: "Response Validation Warnnings for getPaymentCodeOption",
1248
+ message: `Response Validation Warnnings for platform > Payment > getPaymentCodeOption \n ${res_error}`,
833
1249
  });
834
- Logger({ level: "WARN", message: res_error });
835
1250
  }
836
1251
 
837
1252
  return response;
838
1253
  }
839
1254
 
840
1255
  /**
841
- * @param {Object} arg - Arg object.
842
- * @param {string} [arg.paymentLinkId] -
843
- * @returns {Promise<GetPaymentLinkResponse>} - Success response
1256
+ * @param {PaymentPlatformApplicationValidator.GetPaymentLinkParam} arg - Arg object
1257
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1258
+ * @param {import("../PlatformAPIClient").Options} - Options
1259
+ * @returns {Promise<PaymentPlatformModel.GetPaymentLinkResponse>} - Success response
1260
+ * @name getPaymentLink
844
1261
  * @summary: Get payment link
845
- * @description: Use this API to get a payment link
1262
+ * @description: Use this API to get a payment link - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/getPaymentLink/).
846
1263
  */
847
- async getPaymentLink({ paymentLinkId } = {}) {
848
- const { error } = PaymentValidator.getPaymentLink().validate(
1264
+ async getPaymentLink(
1265
+ { paymentLinkId, requestHeaders } = { requestHeaders: {} },
1266
+ { responseHeaders } = { responseHeaders: false }
1267
+ ) {
1268
+ const {
1269
+ error,
1270
+ } = PaymentPlatformApplicationValidator.getPaymentLink().validate(
849
1271
  {
850
1272
  paymentLinkId,
851
1273
  },
@@ -856,7 +1278,9 @@ class Payment {
856
1278
  }
857
1279
 
858
1280
  // Showing warrnings if extra unknown parameters are found
859
- const { error: warrning } = PaymentValidator.getPaymentLink().validate(
1281
+ const {
1282
+ error: warrning,
1283
+ } = PaymentPlatformApplicationValidator.getPaymentLink().validate(
860
1284
  {
861
1285
  paymentLinkId,
862
1286
  },
@@ -865,9 +1289,8 @@ class Payment {
865
1289
  if (warrning) {
866
1290
  Logger({
867
1291
  level: "WARN",
868
- message: "Parameter Validation warrnings for getPaymentLink",
1292
+ message: `Parameter Validation warrnings for platform > Payment > getPaymentLink \n ${warrning}`,
869
1293
  });
870
- Logger({ level: "WARN", message: warrning });
871
1294
  }
872
1295
 
873
1296
  const query_params = {};
@@ -878,12 +1301,19 @@ class Payment {
878
1301
  "get",
879
1302
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/create-payment-link/`,
880
1303
  query_params,
881
- undefined
1304
+ undefined,
1305
+ requestHeaders,
1306
+ { responseHeaders }
882
1307
  );
883
1308
 
1309
+ let responseData = response;
1310
+ if (responseHeaders) {
1311
+ responseData = response[0];
1312
+ }
1313
+
884
1314
  const {
885
1315
  error: res_error,
886
- } = PaymentModel.GetPaymentLinkResponse().validate(response, {
1316
+ } = PaymentPlatformModel.GetPaymentLinkResponse().validate(responseData, {
887
1317
  abortEarly: false,
888
1318
  allowUnknown: false,
889
1319
  });
@@ -891,24 +1321,31 @@ class Payment {
891
1321
  if (res_error) {
892
1322
  Logger({
893
1323
  level: "WARN",
894
- message: "Response Validation Warnnings for getPaymentLink",
1324
+ message: `Response Validation Warnnings for platform > Payment > getPaymentLink \n ${res_error}`,
895
1325
  });
896
- Logger({ level: "WARN", message: res_error });
897
1326
  }
898
1327
 
899
1328
  return response;
900
1329
  }
901
1330
 
902
1331
  /**
903
- * @param {Object} arg - Arg object.
904
- * @param {boolean} arg.refresh -
905
- * @param {string} arg.requestType -
906
- * @returns {Promise<PaymentOptionsResponse>} - Success response
1332
+ * @param {PaymentPlatformApplicationValidator.GetPaymentModeRoutesParam} arg
1333
+ * - Arg object
1334
+ *
1335
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1336
+ * @param {import("../PlatformAPIClient").Options} - Options
1337
+ * @returns {Promise<PaymentPlatformModel.PaymentOptionsResponse>} - Success response
1338
+ * @name getPaymentModeRoutes
907
1339
  * @summary: Get All Valid Payment Options
908
- * @description: Use this API to get Get All Valid Payment Options for making payment
1340
+ * @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
1341
  */
910
- async getPaymentModeRoutes({ refresh, requestType } = {}) {
911
- const { error } = PaymentValidator.getPaymentModeRoutes().validate(
1342
+ async getPaymentModeRoutes(
1343
+ { refresh, requestType, requestHeaders } = { requestHeaders: {} },
1344
+ { responseHeaders } = { responseHeaders: false }
1345
+ ) {
1346
+ const {
1347
+ error,
1348
+ } = PaymentPlatformApplicationValidator.getPaymentModeRoutes().validate(
912
1349
  {
913
1350
  refresh,
914
1351
  requestType,
@@ -922,7 +1359,7 @@ class Payment {
922
1359
  // Showing warrnings if extra unknown parameters are found
923
1360
  const {
924
1361
  error: warrning,
925
- } = PaymentValidator.getPaymentModeRoutes().validate(
1362
+ } = PaymentPlatformApplicationValidator.getPaymentModeRoutes().validate(
926
1363
  {
927
1364
  refresh,
928
1365
  requestType,
@@ -932,9 +1369,8 @@ class Payment {
932
1369
  if (warrning) {
933
1370
  Logger({
934
1371
  level: "WARN",
935
- message: "Parameter Validation warrnings for getPaymentModeRoutes",
1372
+ message: `Parameter Validation warrnings for platform > Payment > getPaymentModeRoutes \n ${warrning}`,
936
1373
  });
937
- Logger({ level: "WARN", message: warrning });
938
1374
  }
939
1375
 
940
1376
  const query_params = {};
@@ -946,12 +1382,19 @@ class Payment {
946
1382
  "get",
947
1383
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/options`,
948
1384
  query_params,
949
- undefined
1385
+ undefined,
1386
+ requestHeaders,
1387
+ { responseHeaders }
950
1388
  );
951
1389
 
1390
+ let responseData = response;
1391
+ if (responseHeaders) {
1392
+ responseData = response[0];
1393
+ }
1394
+
952
1395
  const {
953
1396
  error: res_error,
954
- } = PaymentModel.PaymentOptionsResponse().validate(response, {
1397
+ } = PaymentPlatformModel.PaymentOptionsResponse().validate(responseData, {
955
1398
  abortEarly: false,
956
1399
  allowUnknown: false,
957
1400
  });
@@ -959,45 +1402,41 @@ class Payment {
959
1402
  if (res_error) {
960
1403
  Logger({
961
1404
  level: "WARN",
962
- message: "Response Validation Warnnings for getPaymentModeRoutes",
1405
+ message: `Response Validation Warnnings for platform > Payment > getPaymentModeRoutes \n ${res_error}`,
963
1406
  });
964
- Logger({ level: "WARN", message: res_error });
965
1407
  }
966
1408
 
967
1409
  return response;
968
1410
  }
969
1411
 
970
1412
  /**
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
1413
+ * @param {PaymentPlatformApplicationValidator.GetPosPaymentModeRoutesParam} arg
1414
+ * - Arg object
1415
+ *
1416
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1417
+ * @param {import("../PlatformAPIClient").Options} - Options
1418
+ * @returns {Promise<PaymentPlatformModel.PaymentOptionsResponse>} - Success response
1419
+ * @name getPosPaymentModeRoutes
987
1420
  * @summary: Get All Valid Payment Options
988
- * @description: Use this API to get Get All Valid Payment Options for making payment
1421
+ * @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
1422
  */
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(
1423
+ async getPosPaymentModeRoutes(
1424
+ {
1425
+ amount,
1426
+ cartId,
1427
+ pincode,
1428
+ checkoutMode,
1429
+ orderType,
1430
+ refresh,
1431
+ cardReference,
1432
+ userDetails,
1433
+ requestHeaders,
1434
+ } = { requestHeaders: {} },
1435
+ { responseHeaders } = { responseHeaders: false }
1436
+ ) {
1437
+ const {
1438
+ error,
1439
+ } = PaymentPlatformApplicationValidator.getPosPaymentModeRoutes().validate(
1001
1440
  {
1002
1441
  amount,
1003
1442
  cartId,
@@ -1017,7 +1456,7 @@ class Payment {
1017
1456
  // Showing warrnings if extra unknown parameters are found
1018
1457
  const {
1019
1458
  error: warrning,
1020
- } = PaymentValidator.getPosPaymentModeRoutes().validate(
1459
+ } = PaymentPlatformApplicationValidator.getPosPaymentModeRoutes().validate(
1021
1460
  {
1022
1461
  amount,
1023
1462
  cartId,
@@ -1033,9 +1472,8 @@ class Payment {
1033
1472
  if (warrning) {
1034
1473
  Logger({
1035
1474
  level: "WARN",
1036
- message: "Parameter Validation warrnings for getPosPaymentModeRoutes",
1475
+ message: `Parameter Validation warrnings for platform > Payment > getPosPaymentModeRoutes \n ${warrning}`,
1037
1476
  });
1038
- Logger({ level: "WARN", message: warrning });
1039
1477
  }
1040
1478
 
1041
1479
  const query_params = {};
@@ -1053,12 +1491,19 @@ class Payment {
1053
1491
  "get",
1054
1492
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/options/pos`,
1055
1493
  query_params,
1056
- undefined
1494
+ undefined,
1495
+ requestHeaders,
1496
+ { responseHeaders }
1057
1497
  );
1058
1498
 
1499
+ let responseData = response;
1500
+ if (responseHeaders) {
1501
+ responseData = response[0];
1502
+ }
1503
+
1059
1504
  const {
1060
1505
  error: res_error,
1061
- } = PaymentModel.PaymentOptionsResponse().validate(response, {
1506
+ } = PaymentPlatformModel.PaymentOptionsResponse().validate(responseData, {
1062
1507
  abortEarly: false,
1063
1508
  allowUnknown: false,
1064
1509
  });
@@ -1066,23 +1511,32 @@ class Payment {
1066
1511
  if (res_error) {
1067
1512
  Logger({
1068
1513
  level: "WARN",
1069
- message: "Response Validation Warnnings for getPosPaymentModeRoutes",
1514
+ message: `Response Validation Warnnings for platform > Payment > getPosPaymentModeRoutes \n ${res_error}`,
1070
1515
  });
1071
- Logger({ level: "WARN", message: res_error });
1072
1516
  }
1073
1517
 
1074
1518
  return response;
1075
1519
  }
1076
1520
 
1077
1521
  /**
1078
- * @param {Object} arg - Arg object.
1079
- * @param {string} arg.orderId -
1080
- * @returns {Promise<OrderBeneficiaryResponse>} - Success response
1522
+ * @param {PaymentPlatformApplicationValidator.GetUserBeneficiariesParam} arg
1523
+ * - Arg object
1524
+ *
1525
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1526
+ * @param {import("../PlatformAPIClient").Options} - Options
1527
+ * @returns {Promise<PaymentPlatformModel.OrderBeneficiaryResponse>} -
1528
+ * Success response
1529
+ * @name getUserBeneficiaries
1081
1530
  * @summary: List User Beneficiary
1082
- * @description: Get all active beneficiary details added by the user for refund
1531
+ * @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
1532
  */
1084
- async getUserBeneficiaries({ orderId } = {}) {
1085
- const { error } = PaymentValidator.getUserBeneficiaries().validate(
1533
+ async getUserBeneficiaries(
1534
+ { orderId, requestHeaders } = { requestHeaders: {} },
1535
+ { responseHeaders } = { responseHeaders: false }
1536
+ ) {
1537
+ const {
1538
+ error,
1539
+ } = PaymentPlatformApplicationValidator.getUserBeneficiaries().validate(
1086
1540
  { orderId },
1087
1541
  { abortEarly: false, allowUnknown: true }
1088
1542
  );
@@ -1093,16 +1547,15 @@ class Payment {
1093
1547
  // Showing warrnings if extra unknown parameters are found
1094
1548
  const {
1095
1549
  error: warrning,
1096
- } = PaymentValidator.getUserBeneficiaries().validate(
1550
+ } = PaymentPlatformApplicationValidator.getUserBeneficiaries().validate(
1097
1551
  { orderId },
1098
1552
  { abortEarly: false, allowUnknown: false }
1099
1553
  );
1100
1554
  if (warrning) {
1101
1555
  Logger({
1102
1556
  level: "WARN",
1103
- message: "Parameter Validation warrnings for getUserBeneficiaries",
1557
+ message: `Parameter Validation warrnings for platform > Payment > getUserBeneficiaries \n ${warrning}`,
1104
1558
  });
1105
- Logger({ level: "WARN", message: warrning });
1106
1559
  }
1107
1560
 
1108
1561
  const query_params = {};
@@ -1113,12 +1566,19 @@ class Payment {
1113
1566
  "get",
1114
1567
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/refund/accounts/user`,
1115
1568
  query_params,
1116
- undefined
1569
+ undefined,
1570
+ requestHeaders,
1571
+ { responseHeaders }
1117
1572
  );
1118
1573
 
1574
+ let responseData = response;
1575
+ if (responseHeaders) {
1576
+ responseData = response[0];
1577
+ }
1578
+
1119
1579
  const {
1120
1580
  error: res_error,
1121
- } = PaymentModel.OrderBeneficiaryResponse().validate(response, {
1581
+ } = PaymentPlatformModel.OrderBeneficiaryResponse().validate(responseData, {
1122
1582
  abortEarly: false,
1123
1583
  allowUnknown: false,
1124
1584
  });
@@ -1126,24 +1586,31 @@ class Payment {
1126
1586
  if (res_error) {
1127
1587
  Logger({
1128
1588
  level: "WARN",
1129
- message: "Response Validation Warnnings for getUserBeneficiaries",
1589
+ message: `Response Validation Warnnings for platform > Payment > getUserBeneficiaries \n ${res_error}`,
1130
1590
  });
1131
- Logger({ level: "WARN", message: res_error });
1132
1591
  }
1133
1592
 
1134
1593
  return response;
1135
1594
  }
1136
1595
 
1137
1596
  /**
1138
- * @param {Object} arg - Arg object.
1139
- * @param {string} arg.merchantUserId -
1140
- * @param {string} arg.mobileNo -
1141
- * @returns {Promise<GetUserCODLimitResponse>} - Success response
1597
+ * @param {PaymentPlatformApplicationValidator.GetUserCODlimitRoutesParam} arg
1598
+ * - Arg object
1599
+ *
1600
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1601
+ * @param {import("../PlatformAPIClient").Options} - Options
1602
+ * @returns {Promise<PaymentPlatformModel.GetUserCODLimitResponse>} - Success response
1603
+ * @name getUserCODlimitRoutes
1142
1604
  * @summary: Get COD limit for user
1143
- * @description: Use this API to get user cod limit and reamining limit for the payment
1605
+ * @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
1606
  */
1145
- async getUserCODlimitRoutes({ merchantUserId, mobileNo } = {}) {
1146
- const { error } = PaymentValidator.getUserCODlimitRoutes().validate(
1607
+ async getUserCODlimitRoutes(
1608
+ { merchantUserId, mobileNo, requestHeaders } = { requestHeaders: {} },
1609
+ { responseHeaders } = { responseHeaders: false }
1610
+ ) {
1611
+ const {
1612
+ error,
1613
+ } = PaymentPlatformApplicationValidator.getUserCODlimitRoutes().validate(
1147
1614
  {
1148
1615
  merchantUserId,
1149
1616
  mobileNo,
@@ -1157,7 +1624,7 @@ class Payment {
1157
1624
  // Showing warrnings if extra unknown parameters are found
1158
1625
  const {
1159
1626
  error: warrning,
1160
- } = PaymentValidator.getUserCODlimitRoutes().validate(
1627
+ } = PaymentPlatformApplicationValidator.getUserCODlimitRoutes().validate(
1161
1628
  {
1162
1629
  merchantUserId,
1163
1630
  mobileNo,
@@ -1167,9 +1634,8 @@ class Payment {
1167
1634
  if (warrning) {
1168
1635
  Logger({
1169
1636
  level: "WARN",
1170
- message: "Parameter Validation warrnings for getUserCODlimitRoutes",
1637
+ message: `Parameter Validation warrnings for platform > Payment > getUserCODlimitRoutes \n ${warrning}`,
1171
1638
  });
1172
- Logger({ level: "WARN", message: warrning });
1173
1639
  }
1174
1640
 
1175
1641
  const query_params = {};
@@ -1181,12 +1647,19 @@ class Payment {
1181
1647
  "get",
1182
1648
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/user-cod`,
1183
1649
  query_params,
1184
- undefined
1650
+ undefined,
1651
+ requestHeaders,
1652
+ { responseHeaders }
1185
1653
  );
1186
1654
 
1655
+ let responseData = response;
1656
+ if (responseHeaders) {
1657
+ responseData = response[0];
1658
+ }
1659
+
1187
1660
  const {
1188
1661
  error: res_error,
1189
- } = PaymentModel.GetUserCODLimitResponse().validate(response, {
1662
+ } = PaymentPlatformModel.GetUserCODLimitResponse().validate(responseData, {
1190
1663
  abortEarly: false,
1191
1664
  allowUnknown: false,
1192
1665
  });
@@ -1194,23 +1667,32 @@ class Payment {
1194
1667
  if (res_error) {
1195
1668
  Logger({
1196
1669
  level: "WARN",
1197
- message: "Response Validation Warnnings for getUserCODlimitRoutes",
1670
+ message: `Response Validation Warnnings for platform > Payment > getUserCODlimitRoutes \n ${res_error}`,
1198
1671
  });
1199
- Logger({ level: "WARN", message: res_error });
1200
1672
  }
1201
1673
 
1202
1674
  return response;
1203
1675
  }
1204
1676
 
1205
1677
  /**
1206
- * @param {Object} arg - Arg object.
1207
- * @param {string} arg.orderId -
1208
- * @returns {Promise<OrderBeneficiaryResponse>} - Success response
1678
+ * @param {PaymentPlatformApplicationValidator.GetUserOrderBeneficiariesParam} arg
1679
+ * - Arg object
1680
+ *
1681
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1682
+ * @param {import("../PlatformAPIClient").Options} - Options
1683
+ * @returns {Promise<PaymentPlatformModel.OrderBeneficiaryResponse>} -
1684
+ * Success response
1685
+ * @name getUserOrderBeneficiaries
1209
1686
  * @summary: List Order Beneficiary
1210
- * @description: Get all active beneficiary details added by the user for refund
1687
+ * @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
1688
  */
1212
- async getUserOrderBeneficiaries({ orderId } = {}) {
1213
- const { error } = PaymentValidator.getUserOrderBeneficiaries().validate(
1689
+ async getUserOrderBeneficiaries(
1690
+ { orderId, requestHeaders } = { requestHeaders: {} },
1691
+ { responseHeaders } = { responseHeaders: false }
1692
+ ) {
1693
+ const {
1694
+ error,
1695
+ } = PaymentPlatformApplicationValidator.getUserOrderBeneficiaries().validate(
1214
1696
  { orderId },
1215
1697
  { abortEarly: false, allowUnknown: true }
1216
1698
  );
@@ -1221,16 +1703,15 @@ class Payment {
1221
1703
  // Showing warrnings if extra unknown parameters are found
1222
1704
  const {
1223
1705
  error: warrning,
1224
- } = PaymentValidator.getUserOrderBeneficiaries().validate(
1706
+ } = PaymentPlatformApplicationValidator.getUserOrderBeneficiaries().validate(
1225
1707
  { orderId },
1226
1708
  { abortEarly: false, allowUnknown: false }
1227
1709
  );
1228
1710
  if (warrning) {
1229
1711
  Logger({
1230
1712
  level: "WARN",
1231
- message: "Parameter Validation warrnings for getUserOrderBeneficiaries",
1713
+ message: `Parameter Validation warrnings for platform > Payment > getUserOrderBeneficiaries \n ${warrning}`,
1232
1714
  });
1233
- Logger({ level: "WARN", message: warrning });
1234
1715
  }
1235
1716
 
1236
1717
  const query_params = {};
@@ -1241,12 +1722,19 @@ class Payment {
1241
1722
  "get",
1242
1723
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/refund/accounts/order`,
1243
1724
  query_params,
1244
- undefined
1725
+ undefined,
1726
+ requestHeaders,
1727
+ { responseHeaders }
1245
1728
  );
1246
1729
 
1730
+ let responseData = response;
1731
+ if (responseHeaders) {
1732
+ responseData = response[0];
1733
+ }
1734
+
1247
1735
  const {
1248
1736
  error: res_error,
1249
- } = PaymentModel.OrderBeneficiaryResponse().validate(response, {
1737
+ } = PaymentPlatformModel.OrderBeneficiaryResponse().validate(responseData, {
1250
1738
  abortEarly: false,
1251
1739
  allowUnknown: false,
1252
1740
  });
@@ -1254,23 +1742,32 @@ class Payment {
1254
1742
  if (res_error) {
1255
1743
  Logger({
1256
1744
  level: "WARN",
1257
- message: "Response Validation Warnnings for getUserOrderBeneficiaries",
1745
+ message: `Response Validation Warnnings for platform > Payment > getUserOrderBeneficiaries \n ${res_error}`,
1258
1746
  });
1259
- Logger({ level: "WARN", message: res_error });
1260
1747
  }
1261
1748
 
1262
1749
  return response;
1263
1750
  }
1264
1751
 
1265
1752
  /**
1266
- * @param {Object} arg - Arg object.
1267
- * @param {PaymentInitializationRequest} arg.body
1268
- * @returns {Promise<PaymentInitializationResponse>} - Success response
1753
+ * @param {PaymentPlatformApplicationValidator.InitialisePaymentParam} arg
1754
+ * - Arg object
1755
+ *
1756
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1757
+ * @param {import("../PlatformAPIClient").Options} - Options
1758
+ * @returns {Promise<PaymentPlatformModel.PaymentInitializationResponse>} -
1759
+ * Success response
1760
+ * @name initialisePayment
1269
1761
  * @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.
1762
+ * @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
1763
  */
1272
- async initialisePayment({ body } = {}) {
1273
- const { error } = PaymentValidator.initialisePayment().validate(
1764
+ async initialisePayment(
1765
+ { body, requestHeaders } = { requestHeaders: {} },
1766
+ { responseHeaders } = { responseHeaders: false }
1767
+ ) {
1768
+ const {
1769
+ error,
1770
+ } = PaymentPlatformApplicationValidator.initialisePayment().validate(
1274
1771
  {
1275
1772
  body,
1276
1773
  },
@@ -1281,7 +1778,9 @@ class Payment {
1281
1778
  }
1282
1779
 
1283
1780
  // Showing warrnings if extra unknown parameters are found
1284
- const { error: warrning } = PaymentValidator.initialisePayment().validate(
1781
+ const {
1782
+ error: warrning,
1783
+ } = PaymentPlatformApplicationValidator.initialisePayment().validate(
1285
1784
  {
1286
1785
  body,
1287
1786
  },
@@ -1290,9 +1789,8 @@ class Payment {
1290
1789
  if (warrning) {
1291
1790
  Logger({
1292
1791
  level: "WARN",
1293
- message: "Parameter Validation warrnings for initialisePayment",
1792
+ message: `Parameter Validation warrnings for platform > Payment > initialisePayment \n ${warrning}`,
1294
1793
  });
1295
- Logger({ level: "WARN", message: warrning });
1296
1794
  }
1297
1795
 
1298
1796
  const query_params = {};
@@ -1302,36 +1800,52 @@ class Payment {
1302
1800
  "post",
1303
1801
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/request`,
1304
1802
  query_params,
1305
- body
1803
+ body,
1804
+ requestHeaders,
1805
+ { responseHeaders }
1306
1806
  );
1307
1807
 
1808
+ let responseData = response;
1809
+ if (responseHeaders) {
1810
+ responseData = response[0];
1811
+ }
1812
+
1308
1813
  const {
1309
1814
  error: res_error,
1310
- } = PaymentModel.PaymentInitializationResponse().validate(response, {
1311
- abortEarly: false,
1312
- allowUnknown: false,
1313
- });
1815
+ } = PaymentPlatformModel.PaymentInitializationResponse().validate(
1816
+ responseData,
1817
+ { abortEarly: false, allowUnknown: false }
1818
+ );
1314
1819
 
1315
1820
  if (res_error) {
1316
1821
  Logger({
1317
1822
  level: "WARN",
1318
- message: "Response Validation Warnnings for initialisePayment",
1823
+ message: `Response Validation Warnnings for platform > Payment > initialisePayment \n ${res_error}`,
1319
1824
  });
1320
- Logger({ level: "WARN", message: res_error });
1321
1825
  }
1322
1826
 
1323
1827
  return response;
1324
1828
  }
1325
1829
 
1326
1830
  /**
1327
- * @param {Object} arg - Arg object.
1328
- * @param {MerchantOnBoardingRequest} arg.body
1329
- * @returns {Promise<MerchantOnBoardingResponse>} - Success response
1831
+ * @param {PaymentPlatformApplicationValidator.MerchantOnBoardingParam} arg
1832
+ * - Arg object
1833
+ *
1834
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1835
+ * @param {import("../PlatformAPIClient").Options} - Options
1836
+ * @returns {Promise<PaymentPlatformModel.MerchantOnBoardingResponse>} -
1837
+ * Success response
1838
+ * @name merchantOnBoarding
1330
1839
  * @summary: API to push Ajiodhan merchant data to Gringotts system
1331
- * @description: Use this API to push Ajiodhan merchant data to Gringotts system
1840
+ * @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
1841
  */
1333
- async merchantOnBoarding({ body } = {}) {
1334
- const { error } = PaymentValidator.merchantOnBoarding().validate(
1842
+ async merchantOnBoarding(
1843
+ { body, requestHeaders } = { requestHeaders: {} },
1844
+ { responseHeaders } = { responseHeaders: false }
1845
+ ) {
1846
+ const {
1847
+ error,
1848
+ } = PaymentPlatformApplicationValidator.merchantOnBoarding().validate(
1335
1849
  {
1336
1850
  body,
1337
1851
  },
@@ -1342,8 +1856,10 @@ class Payment {
1342
1856
  }
1343
1857
 
1344
1858
  // Showing warrnings if extra unknown parameters are found
1345
- const { error: warrning } = PaymentValidator.merchantOnBoarding().validate(
1346
- {
1859
+ const {
1860
+ error: warrning,
1861
+ } = PaymentPlatformApplicationValidator.merchantOnBoarding().validate(
1862
+ {
1347
1863
  body,
1348
1864
  },
1349
1865
  { abortEarly: false, allowUnknown: false }
@@ -1351,9 +1867,8 @@ class Payment {
1351
1867
  if (warrning) {
1352
1868
  Logger({
1353
1869
  level: "WARN",
1354
- message: "Parameter Validation warrnings for merchantOnBoarding",
1870
+ message: `Parameter Validation warrnings for platform > Payment > merchantOnBoarding \n ${warrning}`,
1355
1871
  });
1356
- Logger({ level: "WARN", message: warrning });
1357
1872
  }
1358
1873
 
1359
1874
  const query_params = {};
@@ -1363,42 +1878,51 @@ class Payment {
1363
1878
  "post",
1364
1879
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/merchant-onboarding`,
1365
1880
  query_params,
1366
- body
1881
+ body,
1882
+ requestHeaders,
1883
+ { responseHeaders }
1367
1884
  );
1368
1885
 
1886
+ let responseData = response;
1887
+ if (responseHeaders) {
1888
+ responseData = response[0];
1889
+ }
1890
+
1369
1891
  const {
1370
1892
  error: res_error,
1371
- } = PaymentModel.MerchantOnBoardingResponse().validate(response, {
1372
- abortEarly: false,
1373
- allowUnknown: false,
1374
- });
1893
+ } = PaymentPlatformModel.MerchantOnBoardingResponse().validate(
1894
+ responseData,
1895
+ { abortEarly: false, allowUnknown: false }
1896
+ );
1375
1897
 
1376
1898
  if (res_error) {
1377
1899
  Logger({
1378
1900
  level: "WARN",
1379
- message: "Response Validation Warnnings for merchantOnBoarding",
1901
+ message: `Response Validation Warnnings for platform > Payment > merchantOnBoarding \n ${res_error}`,
1380
1902
  });
1381
- Logger({ level: "WARN", message: res_error });
1382
1903
  }
1383
1904
 
1384
1905
  return response;
1385
1906
  }
1386
1907
 
1387
1908
  /**
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
1909
+ * @param {PaymentPlatformApplicationValidator.OauthGetUrlParam} arg - Arg object
1910
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1911
+ * @param {import("../PlatformAPIClient").Options} - Options
1912
+ * @returns {Promise<PaymentPlatformModel.GetOauthUrlResponse>} - Success response
1913
+ * @name oauthGetUrl
1393
1914
  * @summary: API to Get the url to call for oauth
1394
- * @description: Use this API to Get the url to call for oauth.
1915
+ * @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
1916
  */
1396
- async oauthGetUrl({
1397
- aggregator,
1398
- successRedirectUrl,
1399
- failureRedirectUrl,
1400
- } = {}) {
1401
- const { error } = PaymentValidator.oauthGetUrl().validate(
1917
+ async oauthGetUrl(
1918
+ { aggregator, successRedirectUrl, failureRedirectUrl, requestHeaders } = {
1919
+ requestHeaders: {},
1920
+ },
1921
+ { responseHeaders } = { responseHeaders: false }
1922
+ ) {
1923
+ const {
1924
+ error,
1925
+ } = PaymentPlatformApplicationValidator.oauthGetUrl().validate(
1402
1926
  {
1403
1927
  aggregator,
1404
1928
  successRedirectUrl,
@@ -1411,7 +1935,9 @@ class Payment {
1411
1935
  }
1412
1936
 
1413
1937
  // Showing warrnings if extra unknown parameters are found
1414
- const { error: warrning } = PaymentValidator.oauthGetUrl().validate(
1938
+ const {
1939
+ error: warrning,
1940
+ } = PaymentPlatformApplicationValidator.oauthGetUrl().validate(
1415
1941
  {
1416
1942
  aggregator,
1417
1943
  successRedirectUrl,
@@ -1422,9 +1948,8 @@ class Payment {
1422
1948
  if (warrning) {
1423
1949
  Logger({
1424
1950
  level: "WARN",
1425
- message: "Parameter Validation warrnings for oauthGetUrl",
1951
+ message: `Parameter Validation warrnings for platform > Payment > oauthGetUrl \n ${warrning}`,
1426
1952
  });
1427
- Logger({ level: "WARN", message: warrning });
1428
1953
  }
1429
1954
 
1430
1955
  const query_params = {};
@@ -1436,12 +1961,19 @@ class Payment {
1436
1961
  "get",
1437
1962
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/onboard/${aggregator}/`,
1438
1963
  query_params,
1439
- undefined
1964
+ undefined,
1965
+ requestHeaders,
1966
+ { responseHeaders }
1440
1967
  );
1441
1968
 
1969
+ let responseData = response;
1970
+ if (responseHeaders) {
1971
+ responseData = response[0];
1972
+ }
1973
+
1442
1974
  const {
1443
1975
  error: res_error,
1444
- } = PaymentModel.GetOauthUrlResponse().validate(response, {
1976
+ } = PaymentPlatformModel.GetOauthUrlResponse().validate(responseData, {
1445
1977
  abortEarly: false,
1446
1978
  allowUnknown: false,
1447
1979
  });
@@ -1449,23 +1981,191 @@ class Payment {
1449
1981
  if (res_error) {
1450
1982
  Logger({
1451
1983
  level: "WARN",
1452
- message: "Response Validation Warnnings for oauthGetUrl",
1984
+ message: `Response Validation Warnnings for platform > Payment > oauthGetUrl \n ${res_error}`,
1985
+ });
1986
+ }
1987
+
1988
+ return response;
1989
+ }
1990
+
1991
+ /**
1992
+ * @param {PaymentPlatformApplicationValidator.PatchMerchantAggregatorPaymentModeDetailsParam} arg
1993
+ * - Arg object
1994
+ *
1995
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
1996
+ * @param {import("../PlatformAPIClient").Options} - Options
1997
+ * @returns {Promise<PaymentPlatformModel.MerchnatPaymentModeResponse>} -
1998
+ * Success response
1999
+ * @name patchMerchantAggregatorPaymentModeDetails
2000
+ * @summary: Update Aggregator, payment mode and sub payment mode.
2001
+ * @description: Update Aggregator, payment mode and sub payment mode details. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/patchMerchantAggregatorPaymentModeDetails/).
2002
+ */
2003
+ async patchMerchantAggregatorPaymentModeDetails(
2004
+ { aggregatorId, body, requestHeaders } = { requestHeaders: {} },
2005
+ { responseHeaders } = { responseHeaders: false }
2006
+ ) {
2007
+ const {
2008
+ error,
2009
+ } = PaymentPlatformApplicationValidator.patchMerchantAggregatorPaymentModeDetails().validate(
2010
+ {
2011
+ aggregatorId,
2012
+ body,
2013
+ },
2014
+ { abortEarly: false, allowUnknown: true }
2015
+ );
2016
+ if (error) {
2017
+ return Promise.reject(new FDKClientValidationError(error));
2018
+ }
2019
+
2020
+ // Showing warrnings if extra unknown parameters are found
2021
+ const {
2022
+ error: warrning,
2023
+ } = PaymentPlatformApplicationValidator.patchMerchantAggregatorPaymentModeDetails().validate(
2024
+ {
2025
+ aggregatorId,
2026
+ body,
2027
+ },
2028
+ { abortEarly: false, allowUnknown: false }
2029
+ );
2030
+ if (warrning) {
2031
+ Logger({
2032
+ level: "WARN",
2033
+ message: `Parameter Validation warrnings for platform > Payment > patchMerchantAggregatorPaymentModeDetails \n ${warrning}`,
2034
+ });
2035
+ }
2036
+
2037
+ const query_params = {};
2038
+
2039
+ const response = await PlatformAPIClient.execute(
2040
+ this.config,
2041
+ "patch",
2042
+ `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/options/aggregators/${aggregatorId}`,
2043
+ query_params,
2044
+ body,
2045
+ requestHeaders,
2046
+ { responseHeaders }
2047
+ );
2048
+
2049
+ let responseData = response;
2050
+ if (responseHeaders) {
2051
+ responseData = response[0];
2052
+ }
2053
+
2054
+ const {
2055
+ error: res_error,
2056
+ } = PaymentPlatformModel.MerchnatPaymentModeResponse().validate(
2057
+ responseData,
2058
+ { abortEarly: false, allowUnknown: false }
2059
+ );
2060
+
2061
+ if (res_error) {
2062
+ Logger({
2063
+ level: "WARN",
2064
+ message: `Response Validation Warnnings for platform > Payment > patchMerchantAggregatorPaymentModeDetails \n ${res_error}`,
2065
+ });
2066
+ }
2067
+
2068
+ return response;
2069
+ }
2070
+
2071
+ /**
2072
+ * @param {PaymentPlatformApplicationValidator.PatchMerchantPaymentOptionParam} arg
2073
+ * - Arg object
2074
+ *
2075
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2076
+ * @param {import("../PlatformAPIClient").Options} - Options
2077
+ * @returns {Promise<PaymentPlatformModel.MerchnatPaymentModeResponse>} -
2078
+ * Success response
2079
+ * @name patchMerchantPaymentOption
2080
+ * @summary: Update Payment modes and COD details.
2081
+ * @description: To updated online payment as active/inactive or offline payment configuration like cod charges, anonymous cod allowed flags. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/patchMerchantPaymentOption/).
2082
+ */
2083
+ async patchMerchantPaymentOption(
2084
+ { body, requestHeaders } = { requestHeaders: {} },
2085
+ { responseHeaders } = { responseHeaders: false }
2086
+ ) {
2087
+ const {
2088
+ error,
2089
+ } = PaymentPlatformApplicationValidator.patchMerchantPaymentOption().validate(
2090
+ {
2091
+ body,
2092
+ },
2093
+ { abortEarly: false, allowUnknown: true }
2094
+ );
2095
+ if (error) {
2096
+ return Promise.reject(new FDKClientValidationError(error));
2097
+ }
2098
+
2099
+ // Showing warrnings if extra unknown parameters are found
2100
+ const {
2101
+ error: warrning,
2102
+ } = PaymentPlatformApplicationValidator.patchMerchantPaymentOption().validate(
2103
+ {
2104
+ body,
2105
+ },
2106
+ { abortEarly: false, allowUnknown: false }
2107
+ );
2108
+ if (warrning) {
2109
+ Logger({
2110
+ level: "WARN",
2111
+ message: `Parameter Validation warrnings for platform > Payment > patchMerchantPaymentOption \n ${warrning}`,
2112
+ });
2113
+ }
2114
+
2115
+ const query_params = {};
2116
+
2117
+ const response = await PlatformAPIClient.execute(
2118
+ this.config,
2119
+ "patch",
2120
+ `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/options/configuration`,
2121
+ query_params,
2122
+ body,
2123
+ requestHeaders,
2124
+ { responseHeaders }
2125
+ );
2126
+
2127
+ let responseData = response;
2128
+ if (responseHeaders) {
2129
+ responseData = response[0];
2130
+ }
2131
+
2132
+ const {
2133
+ error: res_error,
2134
+ } = PaymentPlatformModel.MerchnatPaymentModeResponse().validate(
2135
+ responseData,
2136
+ { abortEarly: false, allowUnknown: false }
2137
+ );
2138
+
2139
+ if (res_error) {
2140
+ Logger({
2141
+ level: "WARN",
2142
+ message: `Response Validation Warnnings for platform > Payment > patchMerchantPaymentOption \n ${res_error}`,
1453
2143
  });
1454
- Logger({ level: "WARN", message: res_error });
1455
2144
  }
1456
2145
 
1457
2146
  return response;
1458
2147
  }
1459
2148
 
1460
2149
  /**
1461
- * @param {Object} arg - Arg object.
1462
- * @param {PaymentStatusBulkHandlerRequest} arg.body
1463
- * @returns {Promise<PaymentStatusBulkHandlerResponse>} - Success response
2150
+ * @param {PaymentPlatformApplicationValidator.PaymentStatusBulkParam} arg
2151
+ * - Arg object
2152
+ *
2153
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2154
+ * @param {import("../PlatformAPIClient").Options} - Options
2155
+ * @returns {Promise<PaymentPlatformModel.PaymentStatusBulkHandlerResponse>}
2156
+ * - Success response
2157
+ *
2158
+ * @name paymentStatusBulk
1464
2159
  * @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
2160
+ * @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
2161
  */
1467
- async paymentStatusBulk({ body } = {}) {
1468
- const { error } = PaymentValidator.paymentStatusBulk().validate(
2162
+ async paymentStatusBulk(
2163
+ { body, requestHeaders } = { requestHeaders: {} },
2164
+ { responseHeaders } = { responseHeaders: false }
2165
+ ) {
2166
+ const {
2167
+ error,
2168
+ } = PaymentPlatformApplicationValidator.paymentStatusBulk().validate(
1469
2169
  {
1470
2170
  body,
1471
2171
  },
@@ -1476,7 +2176,9 @@ class Payment {
1476
2176
  }
1477
2177
 
1478
2178
  // Showing warrnings if extra unknown parameters are found
1479
- const { error: warrning } = PaymentValidator.paymentStatusBulk().validate(
2179
+ const {
2180
+ error: warrning,
2181
+ } = PaymentPlatformApplicationValidator.paymentStatusBulk().validate(
1480
2182
  {
1481
2183
  body,
1482
2184
  },
@@ -1485,9 +2187,8 @@ class Payment {
1485
2187
  if (warrning) {
1486
2188
  Logger({
1487
2189
  level: "WARN",
1488
- message: "Parameter Validation warrnings for paymentStatusBulk",
2190
+ message: `Parameter Validation warrnings for platform > Payment > paymentStatusBulk \n ${warrning}`,
1489
2191
  });
1490
- Logger({ level: "WARN", message: warrning });
1491
2192
  }
1492
2193
 
1493
2194
  const query_params = {};
@@ -1497,36 +2198,52 @@ class Payment {
1497
2198
  "post",
1498
2199
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/payment-status-bulk/`,
1499
2200
  query_params,
1500
- body
2201
+ body,
2202
+ requestHeaders,
2203
+ { responseHeaders }
1501
2204
  );
1502
2205
 
2206
+ let responseData = response;
2207
+ if (responseHeaders) {
2208
+ responseData = response[0];
2209
+ }
2210
+
1503
2211
  const {
1504
2212
  error: res_error,
1505
- } = PaymentModel.PaymentStatusBulkHandlerResponse().validate(response, {
1506
- abortEarly: false,
1507
- allowUnknown: false,
1508
- });
2213
+ } = PaymentPlatformModel.PaymentStatusBulkHandlerResponse().validate(
2214
+ responseData,
2215
+ { abortEarly: false, allowUnknown: false }
2216
+ );
1509
2217
 
1510
2218
  if (res_error) {
1511
2219
  Logger({
1512
2220
  level: "WARN",
1513
- message: "Response Validation Warnnings for paymentStatusBulk",
2221
+ message: `Response Validation Warnnings for platform > Payment > paymentStatusBulk \n ${res_error}`,
1514
2222
  });
1515
- Logger({ level: "WARN", message: res_error });
1516
2223
  }
1517
2224
 
1518
2225
  return response;
1519
2226
  }
1520
2227
 
1521
2228
  /**
1522
- * @param {Object} arg - Arg object.
1523
- * @param {string} [arg.paymentLinkId] -
1524
- * @returns {Promise<PollingPaymentLinkResponse>} - Success response
2229
+ * @param {PaymentPlatformApplicationValidator.PollingPaymentLinkParam} arg
2230
+ * - Arg object
2231
+ *
2232
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2233
+ * @param {import("../PlatformAPIClient").Options} - Options
2234
+ * @returns {Promise<PaymentPlatformModel.PollingPaymentLinkResponse>} -
2235
+ * Success response
2236
+ * @name pollingPaymentLink
1525
2237
  * @summary: Used for polling if payment successful or not
1526
- * @description: Use this API to poll if payment through payment was successful or not
2238
+ * @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
2239
  */
1528
- async pollingPaymentLink({ paymentLinkId } = {}) {
1529
- const { error } = PaymentValidator.pollingPaymentLink().validate(
2240
+ async pollingPaymentLink(
2241
+ { paymentLinkId, requestHeaders } = { requestHeaders: {} },
2242
+ { responseHeaders } = { responseHeaders: false }
2243
+ ) {
2244
+ const {
2245
+ error,
2246
+ } = PaymentPlatformApplicationValidator.pollingPaymentLink().validate(
1530
2247
  {
1531
2248
  paymentLinkId,
1532
2249
  },
@@ -1537,7 +2254,9 @@ class Payment {
1537
2254
  }
1538
2255
 
1539
2256
  // Showing warrnings if extra unknown parameters are found
1540
- const { error: warrning } = PaymentValidator.pollingPaymentLink().validate(
2257
+ const {
2258
+ error: warrning,
2259
+ } = PaymentPlatformApplicationValidator.pollingPaymentLink().validate(
1541
2260
  {
1542
2261
  paymentLinkId,
1543
2262
  },
@@ -1546,9 +2265,8 @@ class Payment {
1546
2265
  if (warrning) {
1547
2266
  Logger({
1548
2267
  level: "WARN",
1549
- message: "Parameter Validation warrnings for pollingPaymentLink",
2268
+ message: `Parameter Validation warrnings for platform > Payment > pollingPaymentLink \n ${warrning}`,
1550
2269
  });
1551
- Logger({ level: "WARN", message: warrning });
1552
2270
  }
1553
2271
 
1554
2272
  const query_params = {};
@@ -1559,36 +2277,49 @@ class Payment {
1559
2277
  "get",
1560
2278
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/polling-payment-link/`,
1561
2279
  query_params,
1562
- undefined
2280
+ undefined,
2281
+ requestHeaders,
2282
+ { responseHeaders }
1563
2283
  );
1564
2284
 
2285
+ let responseData = response;
2286
+ if (responseHeaders) {
2287
+ responseData = response[0];
2288
+ }
2289
+
1565
2290
  const {
1566
2291
  error: res_error,
1567
- } = PaymentModel.PollingPaymentLinkResponse().validate(response, {
1568
- abortEarly: false,
1569
- allowUnknown: false,
1570
- });
2292
+ } = PaymentPlatformModel.PollingPaymentLinkResponse().validate(
2293
+ responseData,
2294
+ { abortEarly: false, allowUnknown: false }
2295
+ );
1571
2296
 
1572
2297
  if (res_error) {
1573
2298
  Logger({
1574
2299
  level: "WARN",
1575
- message: "Response Validation Warnnings for pollingPaymentLink",
2300
+ message: `Response Validation Warnnings for platform > Payment > pollingPaymentLink \n ${res_error}`,
1576
2301
  });
1577
- Logger({ level: "WARN", message: res_error });
1578
2302
  }
1579
2303
 
1580
2304
  return response;
1581
2305
  }
1582
2306
 
1583
2307
  /**
1584
- * @param {Object} arg - Arg object.
1585
- * @param {RepaymentDetailsSerialiserPayAll} arg.body
1586
- * @returns {Promise<RepaymentResponse>} - Success response
2308
+ * @param {PaymentPlatformApplicationValidator.RepaymentDetailsParam} arg - Arg object
2309
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2310
+ * @param {import("../PlatformAPIClient").Options} - Options
2311
+ * @returns {Promise<PaymentPlatformModel.RepaymentResponse>} - Success response
2312
+ * @name repaymentDetails
1587
2313
  * @summary: API to register repayment details
1588
- * @description: Use this API to register any repayment record in the db and notify the aggrgator
2314
+ * @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
2315
  */
1590
- async repaymentDetails({ body } = {}) {
1591
- const { error } = PaymentValidator.repaymentDetails().validate(
2316
+ async repaymentDetails(
2317
+ { body, requestHeaders } = { requestHeaders: {} },
2318
+ { responseHeaders } = { responseHeaders: false }
2319
+ ) {
2320
+ const {
2321
+ error,
2322
+ } = PaymentPlatformApplicationValidator.repaymentDetails().validate(
1592
2323
  {
1593
2324
  body,
1594
2325
  },
@@ -1599,7 +2330,9 @@ class Payment {
1599
2330
  }
1600
2331
 
1601
2332
  // Showing warrnings if extra unknown parameters are found
1602
- const { error: warrning } = PaymentValidator.repaymentDetails().validate(
2333
+ const {
2334
+ error: warrning,
2335
+ } = PaymentPlatformApplicationValidator.repaymentDetails().validate(
1603
2336
  {
1604
2337
  body,
1605
2338
  },
@@ -1608,9 +2341,8 @@ class Payment {
1608
2341
  if (warrning) {
1609
2342
  Logger({
1610
2343
  level: "WARN",
1611
- message: "Parameter Validation warrnings for repaymentDetails",
2344
+ message: `Parameter Validation warrnings for platform > Payment > repaymentDetails \n ${warrning}`,
1612
2345
  });
1613
- Logger({ level: "WARN", message: warrning });
1614
2346
  }
1615
2347
 
1616
2348
  const query_params = {};
@@ -1620,12 +2352,19 @@ class Payment {
1620
2352
  "post",
1621
2353
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/repayment-details`,
1622
2354
  query_params,
1623
- body
2355
+ body,
2356
+ requestHeaders,
2357
+ { responseHeaders }
1624
2358
  );
1625
2359
 
2360
+ let responseData = response;
2361
+ if (responseHeaders) {
2362
+ responseData = response[0];
2363
+ }
2364
+
1626
2365
  const {
1627
2366
  error: res_error,
1628
- } = PaymentModel.RepaymentResponse().validate(response, {
2367
+ } = PaymentPlatformModel.RepaymentResponse().validate(responseData, {
1629
2368
  abortEarly: false,
1630
2369
  allowUnknown: false,
1631
2370
  });
@@ -1633,23 +2372,32 @@ class Payment {
1633
2372
  if (res_error) {
1634
2373
  Logger({
1635
2374
  level: "WARN",
1636
- message: "Response Validation Warnnings for repaymentDetails",
2375
+ message: `Response Validation Warnnings for platform > Payment > repaymentDetails \n ${res_error}`,
1637
2376
  });
1638
- Logger({ level: "WARN", message: res_error });
1639
2377
  }
1640
2378
 
1641
2379
  return response;
1642
2380
  }
1643
2381
 
1644
2382
  /**
1645
- * @param {Object} arg - Arg object.
1646
- * @param {ResendOrCancelPaymentRequest} arg.body
1647
- * @returns {Promise<ResendOrCancelPaymentResponse>} - Success response
2383
+ * @param {PaymentPlatformApplicationValidator.ResendOrCancelPaymentParam} arg
2384
+ * - Arg object
2385
+ *
2386
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2387
+ * @param {import("../PlatformAPIClient").Options} - Options
2388
+ * @returns {Promise<PaymentPlatformModel.ResendOrCancelPaymentResponse>} -
2389
+ * Success response
2390
+ * @name resendOrCancelPayment
1648
2391
  * @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.
2392
+ * @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
2393
  */
1651
- async resendOrCancelPayment({ body } = {}) {
1652
- const { error } = PaymentValidator.resendOrCancelPayment().validate(
2394
+ async resendOrCancelPayment(
2395
+ { body, requestHeaders } = { requestHeaders: {} },
2396
+ { responseHeaders } = { responseHeaders: false }
2397
+ ) {
2398
+ const {
2399
+ error,
2400
+ } = PaymentPlatformApplicationValidator.resendOrCancelPayment().validate(
1653
2401
  {
1654
2402
  body,
1655
2403
  },
@@ -1662,7 +2410,7 @@ class Payment {
1662
2410
  // Showing warrnings if extra unknown parameters are found
1663
2411
  const {
1664
2412
  error: warrning,
1665
- } = PaymentValidator.resendOrCancelPayment().validate(
2413
+ } = PaymentPlatformApplicationValidator.resendOrCancelPayment().validate(
1666
2414
  {
1667
2415
  body,
1668
2416
  },
@@ -1671,9 +2419,8 @@ class Payment {
1671
2419
  if (warrning) {
1672
2420
  Logger({
1673
2421
  level: "WARN",
1674
- message: "Parameter Validation warrnings for resendOrCancelPayment",
2422
+ message: `Parameter Validation warrnings for platform > Payment > resendOrCancelPayment \n ${warrning}`,
1675
2423
  });
1676
- Logger({ level: "WARN", message: warrning });
1677
2424
  }
1678
2425
 
1679
2426
  const query_params = {};
@@ -1683,36 +2430,52 @@ class Payment {
1683
2430
  "post",
1684
2431
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/cancel`,
1685
2432
  query_params,
1686
- body
2433
+ body,
2434
+ requestHeaders,
2435
+ { responseHeaders }
1687
2436
  );
1688
2437
 
2438
+ let responseData = response;
2439
+ if (responseHeaders) {
2440
+ responseData = response[0];
2441
+ }
2442
+
1689
2443
  const {
1690
2444
  error: res_error,
1691
- } = PaymentModel.ResendOrCancelPaymentResponse().validate(response, {
1692
- abortEarly: false,
1693
- allowUnknown: false,
1694
- });
2445
+ } = PaymentPlatformModel.ResendOrCancelPaymentResponse().validate(
2446
+ responseData,
2447
+ { abortEarly: false, allowUnknown: false }
2448
+ );
1695
2449
 
1696
2450
  if (res_error) {
1697
2451
  Logger({
1698
2452
  level: "WARN",
1699
- message: "Response Validation Warnnings for resendOrCancelPayment",
2453
+ message: `Response Validation Warnnings for platform > Payment > resendOrCancelPayment \n ${res_error}`,
1700
2454
  });
1701
- Logger({ level: "WARN", message: res_error });
1702
2455
  }
1703
2456
 
1704
2457
  return response;
1705
2458
  }
1706
2459
 
1707
2460
  /**
1708
- * @param {Object} arg - Arg object.
1709
- * @param {CancelOrResendPaymentLinkRequest} arg.body
1710
- * @returns {Promise<ResendPaymentLinkResponse>} - Success response
2461
+ * @param {PaymentPlatformApplicationValidator.ResendPaymentLinkParam} arg
2462
+ * - Arg object
2463
+ *
2464
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2465
+ * @param {import("../PlatformAPIClient").Options} - Options
2466
+ * @returns {Promise<PaymentPlatformModel.ResendPaymentLinkResponse>} -
2467
+ * Success response
2468
+ * @name resendPaymentLink
1711
2469
  * @summary: Resend payment link
1712
- * @description: Use this API to resend a payment link for the customer
2470
+ * @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
2471
  */
1714
- async resendPaymentLink({ body } = {}) {
1715
- const { error } = PaymentValidator.resendPaymentLink().validate(
2472
+ async resendPaymentLink(
2473
+ { body, requestHeaders } = { requestHeaders: {} },
2474
+ { responseHeaders } = { responseHeaders: false }
2475
+ ) {
2476
+ const {
2477
+ error,
2478
+ } = PaymentPlatformApplicationValidator.resendPaymentLink().validate(
1716
2479
  {
1717
2480
  body,
1718
2481
  },
@@ -1723,7 +2486,9 @@ class Payment {
1723
2486
  }
1724
2487
 
1725
2488
  // Showing warrnings if extra unknown parameters are found
1726
- const { error: warrning } = PaymentValidator.resendPaymentLink().validate(
2489
+ const {
2490
+ error: warrning,
2491
+ } = PaymentPlatformApplicationValidator.resendPaymentLink().validate(
1727
2492
  {
1728
2493
  body,
1729
2494
  },
@@ -1732,9 +2497,8 @@ class Payment {
1732
2497
  if (warrning) {
1733
2498
  Logger({
1734
2499
  level: "WARN",
1735
- message: "Parameter Validation warrnings for resendPaymentLink",
2500
+ message: `Parameter Validation warrnings for platform > Payment > resendPaymentLink \n ${warrning}`,
1736
2501
  });
1737
- Logger({ level: "WARN", message: warrning });
1738
2502
  }
1739
2503
 
1740
2504
  const query_params = {};
@@ -1744,36 +2508,49 @@ class Payment {
1744
2508
  "post",
1745
2509
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/resend-payment-link/`,
1746
2510
  query_params,
1747
- body
2511
+ body,
2512
+ requestHeaders,
2513
+ { responseHeaders }
1748
2514
  );
1749
2515
 
2516
+ let responseData = response;
2517
+ if (responseHeaders) {
2518
+ responseData = response[0];
2519
+ }
2520
+
1750
2521
  const {
1751
2522
  error: res_error,
1752
- } = PaymentModel.ResendPaymentLinkResponse().validate(response, {
1753
- abortEarly: false,
1754
- allowUnknown: false,
1755
- });
2523
+ } = PaymentPlatformModel.ResendPaymentLinkResponse().validate(
2524
+ responseData,
2525
+ { abortEarly: false, allowUnknown: false }
2526
+ );
1756
2527
 
1757
2528
  if (res_error) {
1758
2529
  Logger({
1759
2530
  level: "WARN",
1760
- message: "Response Validation Warnnings for resendPaymentLink",
2531
+ message: `Response Validation Warnnings for platform > Payment > resendPaymentLink \n ${res_error}`,
1761
2532
  });
1762
- Logger({ level: "WARN", message: res_error });
1763
2533
  }
1764
2534
 
1765
2535
  return response;
1766
2536
  }
1767
2537
 
1768
2538
  /**
1769
- * @param {Object} arg - Arg object.
1770
- * @param {string} arg.aggregator - Aggregator_slug
1771
- * @returns {Promise<RevokeOAuthToken>} - Success response
2539
+ * @param {PaymentPlatformApplicationValidator.RevokeOauthTokenParam} arg - Arg object
2540
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2541
+ * @param {import("../PlatformAPIClient").Options} - Options
2542
+ * @returns {Promise<PaymentPlatformModel.RevokeOAuthToken>} - Success response
2543
+ * @name revokeOauthToken
1772
2544
  * @summary: API to Revoke oauth for razorpay partnership
1773
- * @description: Use this API to Revoke oauth for razorpay partnership
2545
+ * @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
2546
  */
1775
- async revokeOauthToken({ aggregator } = {}) {
1776
- const { error } = PaymentValidator.revokeOauthToken().validate(
2547
+ async revokeOauthToken(
2548
+ { aggregator, requestHeaders } = { requestHeaders: {} },
2549
+ { responseHeaders } = { responseHeaders: false }
2550
+ ) {
2551
+ const {
2552
+ error,
2553
+ } = PaymentPlatformApplicationValidator.revokeOauthToken().validate(
1777
2554
  {
1778
2555
  aggregator,
1779
2556
  },
@@ -1784,7 +2561,9 @@ class Payment {
1784
2561
  }
1785
2562
 
1786
2563
  // Showing warrnings if extra unknown parameters are found
1787
- const { error: warrning } = PaymentValidator.revokeOauthToken().validate(
2564
+ const {
2565
+ error: warrning,
2566
+ } = PaymentPlatformApplicationValidator.revokeOauthToken().validate(
1788
2567
  {
1789
2568
  aggregator,
1790
2569
  },
@@ -1793,9 +2572,8 @@ class Payment {
1793
2572
  if (warrning) {
1794
2573
  Logger({
1795
2574
  level: "WARN",
1796
- message: "Parameter Validation warrnings for revokeOauthToken",
2575
+ message: `Parameter Validation warrnings for platform > Payment > revokeOauthToken \n ${warrning}`,
1797
2576
  });
1798
- Logger({ level: "WARN", message: warrning });
1799
2577
  }
1800
2578
 
1801
2579
  const query_params = {};
@@ -1805,12 +2583,19 @@ class Payment {
1805
2583
  "post",
1806
2584
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/revoke/${aggregator}/`,
1807
2585
  query_params,
1808
- undefined
2586
+ undefined,
2587
+ requestHeaders,
2588
+ { responseHeaders }
1809
2589
  );
1810
2590
 
2591
+ let responseData = response;
2592
+ if (responseHeaders) {
2593
+ responseData = response[0];
2594
+ }
2595
+
1811
2596
  const {
1812
2597
  error: res_error,
1813
- } = PaymentModel.RevokeOAuthToken().validate(response, {
2598
+ } = PaymentPlatformModel.RevokeOAuthToken().validate(responseData, {
1814
2599
  abortEarly: false,
1815
2600
  allowUnknown: false,
1816
2601
  });
@@ -1818,23 +2603,32 @@ class Payment {
1818
2603
  if (res_error) {
1819
2604
  Logger({
1820
2605
  level: "WARN",
1821
- message: "Response Validation Warnnings for revokeOauthToken",
2606
+ message: `Response Validation Warnnings for platform > Payment > revokeOauthToken \n ${res_error}`,
1822
2607
  });
1823
- Logger({ level: "WARN", message: res_error });
1824
2608
  }
1825
2609
 
1826
2610
  return response;
1827
2611
  }
1828
2612
 
1829
2613
  /**
1830
- * @param {Object} arg - Arg object.
1831
- * @param {PaymentGatewayConfigRequest} arg.body
1832
- * @returns {Promise<PaymentGatewayToBeReviewed>} - Success response
2614
+ * @param {PaymentPlatformApplicationValidator.SaveBrandPaymentGatewayConfigParam} arg
2615
+ * - Arg object
2616
+ *
2617
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2618
+ * @param {import("../PlatformAPIClient").Options} - Options
2619
+ * @returns {Promise<PaymentPlatformModel.PaymentGatewayToBeReviewed>} -
2620
+ * Success response
2621
+ * @name saveBrandPaymentGatewayConfig
1833
2622
  * @summary: Save Config Secret For Brand Payment Gateway
1834
- * @description: Save Config Secret For Brand Payment Gateway
2623
+ * @description: Save Config Secret For Brand Payment Gateway - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/saveBrandPaymentGatewayConfig/).
1835
2624
  */
1836
- async saveBrandPaymentGatewayConfig({ body } = {}) {
1837
- const { error } = PaymentValidator.saveBrandPaymentGatewayConfig().validate(
2625
+ async saveBrandPaymentGatewayConfig(
2626
+ { body, requestHeaders } = { requestHeaders: {} },
2627
+ { responseHeaders } = { responseHeaders: false }
2628
+ ) {
2629
+ const {
2630
+ error,
2631
+ } = PaymentPlatformApplicationValidator.saveBrandPaymentGatewayConfig().validate(
1838
2632
  {
1839
2633
  body,
1840
2634
  },
@@ -1847,7 +2641,7 @@ class Payment {
1847
2641
  // Showing warrnings if extra unknown parameters are found
1848
2642
  const {
1849
2643
  error: warrning,
1850
- } = PaymentValidator.saveBrandPaymentGatewayConfig().validate(
2644
+ } = PaymentPlatformApplicationValidator.saveBrandPaymentGatewayConfig().validate(
1851
2645
  {
1852
2646
  body,
1853
2647
  },
@@ -1856,10 +2650,8 @@ class Payment {
1856
2650
  if (warrning) {
1857
2651
  Logger({
1858
2652
  level: "WARN",
1859
- message:
1860
- "Parameter Validation warrnings for saveBrandPaymentGatewayConfig",
2653
+ message: `Parameter Validation warrnings for platform > Payment > saveBrandPaymentGatewayConfig \n ${warrning}`,
1861
2654
  });
1862
- Logger({ level: "WARN", message: warrning });
1863
2655
  }
1864
2656
 
1865
2657
  const query_params = {};
@@ -1869,37 +2661,51 @@ class Payment {
1869
2661
  "post",
1870
2662
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/aggregator/request`,
1871
2663
  query_params,
1872
- body
2664
+ body,
2665
+ requestHeaders,
2666
+ { responseHeaders }
1873
2667
  );
1874
2668
 
2669
+ let responseData = response;
2670
+ if (responseHeaders) {
2671
+ responseData = response[0];
2672
+ }
2673
+
1875
2674
  const {
1876
2675
  error: res_error,
1877
- } = PaymentModel.PaymentGatewayToBeReviewed().validate(response, {
1878
- abortEarly: false,
1879
- allowUnknown: false,
1880
- });
2676
+ } = PaymentPlatformModel.PaymentGatewayToBeReviewed().validate(
2677
+ responseData,
2678
+ { abortEarly: false, allowUnknown: false }
2679
+ );
1881
2680
 
1882
2681
  if (res_error) {
1883
2682
  Logger({
1884
2683
  level: "WARN",
1885
- message:
1886
- "Response Validation Warnnings for saveBrandPaymentGatewayConfig",
2684
+ message: `Response Validation Warnnings for platform > Payment > saveBrandPaymentGatewayConfig \n ${res_error}`,
1887
2685
  });
1888
- Logger({ level: "WARN", message: res_error });
1889
2686
  }
1890
2687
 
1891
2688
  return response;
1892
2689
  }
1893
2690
 
1894
2691
  /**
1895
- * @param {Object} arg - Arg object.
1896
- * @param {SetCODForUserRequest} arg.body
1897
- * @returns {Promise<SetCODOptionResponse>} - Success response
2692
+ * @param {PaymentPlatformApplicationValidator.SetUserCODlimitRoutesParam} arg
2693
+ * - Arg object
2694
+ *
2695
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2696
+ * @param {import("../PlatformAPIClient").Options} - Options
2697
+ * @returns {Promise<PaymentPlatformModel.SetCODOptionResponse>} - Success response
2698
+ * @name setUserCODlimitRoutes
1898
2699
  * @summary: Set COD option for user for payment
1899
- * @description: Use this API to set cod option as true or false for the payment
2700
+ * @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
2701
  */
1901
- async setUserCODlimitRoutes({ body } = {}) {
1902
- const { error } = PaymentValidator.setUserCODlimitRoutes().validate(
2702
+ async setUserCODlimitRoutes(
2703
+ { body, requestHeaders } = { requestHeaders: {} },
2704
+ { responseHeaders } = { responseHeaders: false }
2705
+ ) {
2706
+ const {
2707
+ error,
2708
+ } = PaymentPlatformApplicationValidator.setUserCODlimitRoutes().validate(
1903
2709
  {
1904
2710
  body,
1905
2711
  },
@@ -1912,7 +2718,7 @@ class Payment {
1912
2718
  // Showing warrnings if extra unknown parameters are found
1913
2719
  const {
1914
2720
  error: warrning,
1915
- } = PaymentValidator.setUserCODlimitRoutes().validate(
2721
+ } = PaymentPlatformApplicationValidator.setUserCODlimitRoutes().validate(
1916
2722
  {
1917
2723
  body,
1918
2724
  },
@@ -1921,9 +2727,8 @@ class Payment {
1921
2727
  if (warrning) {
1922
2728
  Logger({
1923
2729
  level: "WARN",
1924
- message: "Parameter Validation warrnings for setUserCODlimitRoutes",
2730
+ message: `Parameter Validation warrnings for platform > Payment > setUserCODlimitRoutes \n ${warrning}`,
1925
2731
  });
1926
- Logger({ level: "WARN", message: warrning });
1927
2732
  }
1928
2733
 
1929
2734
  const query_params = {};
@@ -1933,12 +2738,19 @@ class Payment {
1933
2738
  "put",
1934
2739
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/user-cod`,
1935
2740
  query_params,
1936
- body
2741
+ body,
2742
+ requestHeaders,
2743
+ { responseHeaders }
1937
2744
  );
1938
2745
 
2746
+ let responseData = response;
2747
+ if (responseHeaders) {
2748
+ responseData = response[0];
2749
+ }
2750
+
1939
2751
  const {
1940
2752
  error: res_error,
1941
- } = PaymentModel.SetCODOptionResponse().validate(response, {
2753
+ } = PaymentPlatformModel.SetCODOptionResponse().validate(responseData, {
1942
2754
  abortEarly: false,
1943
2755
  allowUnknown: false,
1944
2756
  });
@@ -1946,23 +2758,29 @@ class Payment {
1946
2758
  if (res_error) {
1947
2759
  Logger({
1948
2760
  level: "WARN",
1949
- message: "Response Validation Warnnings for setUserCODlimitRoutes",
2761
+ message: `Response Validation Warnnings for platform > Payment > setUserCODlimitRoutes \n ${res_error}`,
1950
2762
  });
1951
- Logger({ level: "WARN", message: res_error });
1952
2763
  }
1953
2764
 
1954
2765
  return response;
1955
2766
  }
1956
2767
 
1957
2768
  /**
1958
- * @param {Object} arg - Arg object.
1959
- * @param {EdcAddRequest} arg.body
1960
- * @returns {Promise<EdcDeviceAddResponse>} - Success response
2769
+ * @param {PaymentPlatformApplicationValidator.UpdateEdcDeviceParam} arg - Arg object
2770
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2771
+ * @param {import("../PlatformAPIClient").Options} - Options
2772
+ * @returns {Promise<PaymentPlatformModel.EdcDeviceAddResponse>} - Success response
2773
+ * @name updateEdcDevice
1961
2774
  * @summary: map new edc device to the terminal
1962
- * @description: Use this API to map new edc device to the terminal
2775
+ * @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
2776
  */
1964
- async updateEdcDevice({ body } = {}) {
1965
- const { error } = PaymentValidator.updateEdcDevice().validate(
2777
+ async updateEdcDevice(
2778
+ { body, requestHeaders } = { requestHeaders: {} },
2779
+ { responseHeaders } = { responseHeaders: false }
2780
+ ) {
2781
+ const {
2782
+ error,
2783
+ } = PaymentPlatformApplicationValidator.updateEdcDevice().validate(
1966
2784
  {
1967
2785
  body,
1968
2786
  },
@@ -1973,7 +2791,9 @@ class Payment {
1973
2791
  }
1974
2792
 
1975
2793
  // Showing warrnings if extra unknown parameters are found
1976
- const { error: warrning } = PaymentValidator.updateEdcDevice().validate(
2794
+ const {
2795
+ error: warrning,
2796
+ } = PaymentPlatformApplicationValidator.updateEdcDevice().validate(
1977
2797
  {
1978
2798
  body,
1979
2799
  },
@@ -1982,9 +2802,8 @@ class Payment {
1982
2802
  if (warrning) {
1983
2803
  Logger({
1984
2804
  level: "WARN",
1985
- message: "Parameter Validation warrnings for updateEdcDevice",
2805
+ message: `Parameter Validation warrnings for platform > Payment > updateEdcDevice \n ${warrning}`,
1986
2806
  });
1987
- Logger({ level: "WARN", message: warrning });
1988
2807
  }
1989
2808
 
1990
2809
  const query_params = {};
@@ -1994,12 +2813,19 @@ class Payment {
1994
2813
  "post",
1995
2814
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/edc-device`,
1996
2815
  query_params,
1997
- body
2816
+ body,
2817
+ requestHeaders,
2818
+ { responseHeaders }
1998
2819
  );
1999
2820
 
2821
+ let responseData = response;
2822
+ if (responseHeaders) {
2823
+ responseData = response[0];
2824
+ }
2825
+
2000
2826
  const {
2001
2827
  error: res_error,
2002
- } = PaymentModel.EdcDeviceAddResponse().validate(response, {
2828
+ } = PaymentPlatformModel.EdcDeviceAddResponse().validate(responseData, {
2003
2829
  abortEarly: false,
2004
2830
  allowUnknown: false,
2005
2831
  });
@@ -2007,23 +2833,196 @@ class Payment {
2007
2833
  if (res_error) {
2008
2834
  Logger({
2009
2835
  level: "WARN",
2010
- message: "Response Validation Warnnings for updateEdcDevice",
2836
+ message: `Response Validation Warnnings for platform > Payment > updateEdcDevice \n ${res_error}`,
2837
+ });
2838
+ }
2839
+
2840
+ return response;
2841
+ }
2842
+
2843
+ /**
2844
+ * @param {PaymentPlatformApplicationValidator.UpdatePaymentSessionParam} arg
2845
+ * - Arg object
2846
+ *
2847
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2848
+ * @param {import("../PlatformAPIClient").Options} - Options
2849
+ * @returns {Promise<PaymentPlatformModel.PaymentSessionResponseSerializer>}
2850
+ * - Success response
2851
+ *
2852
+ * @name updatePaymentSession
2853
+ * @summary: API to update status of a payment.
2854
+ * @description: A payment_session is initiated against a global identifier (gid) which is identifies the entity payment is initiated against. e.g. order_id, cart_id. This endpoint is to update the status of the said payment_session. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/updatePaymentSession/).
2855
+ */
2856
+ async updatePaymentSession(
2857
+ { gid, body, requestHeaders } = { requestHeaders: {} },
2858
+ { responseHeaders } = { responseHeaders: false }
2859
+ ) {
2860
+ const {
2861
+ error,
2862
+ } = PaymentPlatformApplicationValidator.updatePaymentSession().validate(
2863
+ {
2864
+ gid,
2865
+ body,
2866
+ },
2867
+ { abortEarly: false, allowUnknown: true }
2868
+ );
2869
+ if (error) {
2870
+ return Promise.reject(new FDKClientValidationError(error));
2871
+ }
2872
+
2873
+ // Showing warrnings if extra unknown parameters are found
2874
+ const {
2875
+ error: warrning,
2876
+ } = PaymentPlatformApplicationValidator.updatePaymentSession().validate(
2877
+ {
2878
+ gid,
2879
+ body,
2880
+ },
2881
+ { abortEarly: false, allowUnknown: false }
2882
+ );
2883
+ if (warrning) {
2884
+ Logger({
2885
+ level: "WARN",
2886
+ message: `Parameter Validation warrnings for platform > Payment > updatePaymentSession \n ${warrning}`,
2887
+ });
2888
+ }
2889
+
2890
+ const query_params = {};
2891
+
2892
+ const response = await PlatformAPIClient.execute(
2893
+ this.config,
2894
+ "put",
2895
+ `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/session/${gid}`,
2896
+ query_params,
2897
+ body,
2898
+ requestHeaders,
2899
+ { responseHeaders }
2900
+ );
2901
+
2902
+ let responseData = response;
2903
+ if (responseHeaders) {
2904
+ responseData = response[0];
2905
+ }
2906
+
2907
+ const {
2908
+ error: res_error,
2909
+ } = PaymentPlatformModel.PaymentSessionResponseSerializer().validate(
2910
+ responseData,
2911
+ { abortEarly: false, allowUnknown: false }
2912
+ );
2913
+
2914
+ if (res_error) {
2915
+ Logger({
2916
+ level: "WARN",
2917
+ message: `Response Validation Warnnings for platform > Payment > updatePaymentSession \n ${res_error}`,
2918
+ });
2919
+ }
2920
+
2921
+ return response;
2922
+ }
2923
+
2924
+ /**
2925
+ * @param {PaymentPlatformApplicationValidator.UpdateRefundSessionParam} arg
2926
+ * - Arg object
2927
+ *
2928
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2929
+ * @param {import("../PlatformAPIClient").Options} - Options
2930
+ * @returns {Promise<PaymentPlatformModel.RefundSessionResponseSerializer>}
2931
+ * - Success response
2932
+ *
2933
+ * @name updateRefundSession
2934
+ * @summary: API to update the status of a refund
2935
+ * @description: A refund_session is initiated against a refund request, and this endpoint is to update the status against the refund request_id. A gid is unique indentifier of the entity against which payment was received e.g. an order. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/payment/updateRefundSession/).
2936
+ */
2937
+ async updateRefundSession(
2938
+ { gid, requestId, body, requestHeaders } = { requestHeaders: {} },
2939
+ { responseHeaders } = { responseHeaders: false }
2940
+ ) {
2941
+ const {
2942
+ error,
2943
+ } = PaymentPlatformApplicationValidator.updateRefundSession().validate(
2944
+ {
2945
+ gid,
2946
+ requestId,
2947
+ body,
2948
+ },
2949
+ { abortEarly: false, allowUnknown: true }
2950
+ );
2951
+ if (error) {
2952
+ return Promise.reject(new FDKClientValidationError(error));
2953
+ }
2954
+
2955
+ // Showing warrnings if extra unknown parameters are found
2956
+ const {
2957
+ error: warrning,
2958
+ } = PaymentPlatformApplicationValidator.updateRefundSession().validate(
2959
+ {
2960
+ gid,
2961
+ requestId,
2962
+ body,
2963
+ },
2964
+ { abortEarly: false, allowUnknown: false }
2965
+ );
2966
+ if (warrning) {
2967
+ Logger({
2968
+ level: "WARN",
2969
+ message: `Parameter Validation warrnings for platform > Payment > updateRefundSession \n ${warrning}`,
2970
+ });
2971
+ }
2972
+
2973
+ const query_params = {};
2974
+
2975
+ const response = await PlatformAPIClient.execute(
2976
+ this.config,
2977
+ "put",
2978
+ `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/${gid}/refund/session/${requestId}`,
2979
+ query_params,
2980
+ body,
2981
+ requestHeaders,
2982
+ { responseHeaders }
2983
+ );
2984
+
2985
+ let responseData = response;
2986
+ if (responseHeaders) {
2987
+ responseData = response[0];
2988
+ }
2989
+
2990
+ const {
2991
+ error: res_error,
2992
+ } = PaymentPlatformModel.RefundSessionResponseSerializer().validate(
2993
+ responseData,
2994
+ { abortEarly: false, allowUnknown: false }
2995
+ );
2996
+
2997
+ if (res_error) {
2998
+ Logger({
2999
+ level: "WARN",
3000
+ message: `Response Validation Warnnings for platform > Payment > updateRefundSession \n ${res_error}`,
2011
3001
  });
2012
- Logger({ level: "WARN", message: res_error });
2013
3002
  }
2014
3003
 
2015
3004
  return response;
2016
3005
  }
2017
3006
 
2018
3007
  /**
2019
- * @param {Object} arg - Arg object.
2020
- * @param {ValidateCustomerRequest} arg.body
2021
- * @returns {Promise<ValidateCustomerResponse>} - Success response
3008
+ * @param {PaymentPlatformApplicationValidator.VerifyCustomerForPaymentParam} arg
3009
+ * - Arg object
3010
+ *
3011
+ * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
3012
+ * @param {import("../PlatformAPIClient").Options} - Options
3013
+ * @returns {Promise<PaymentPlatformModel.ValidateCustomerResponse>} -
3014
+ * Success response
3015
+ * @name verifyCustomerForPayment
2022
3016
  * @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.
3017
+ * @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
3018
  */
2025
- async verifyCustomerForPayment({ body } = {}) {
2026
- const { error } = PaymentValidator.verifyCustomerForPayment().validate(
3019
+ async verifyCustomerForPayment(
3020
+ { body, requestHeaders } = { requestHeaders: {} },
3021
+ { responseHeaders } = { responseHeaders: false }
3022
+ ) {
3023
+ const {
3024
+ error,
3025
+ } = PaymentPlatformApplicationValidator.verifyCustomerForPayment().validate(
2027
3026
  {
2028
3027
  body,
2029
3028
  },
@@ -2036,7 +3035,7 @@ class Payment {
2036
3035
  // Showing warrnings if extra unknown parameters are found
2037
3036
  const {
2038
3037
  error: warrning,
2039
- } = PaymentValidator.verifyCustomerForPayment().validate(
3038
+ } = PaymentPlatformApplicationValidator.verifyCustomerForPayment().validate(
2040
3039
  {
2041
3040
  body,
2042
3041
  },
@@ -2045,9 +3044,8 @@ class Payment {
2045
3044
  if (warrning) {
2046
3045
  Logger({
2047
3046
  level: "WARN",
2048
- message: "Parameter Validation warrnings for verifyCustomerForPayment",
3047
+ message: `Parameter Validation warrnings for platform > Payment > verifyCustomerForPayment \n ${warrning}`,
2049
3048
  });
2050
- Logger({ level: "WARN", message: warrning });
2051
3049
  }
2052
3050
 
2053
3051
  const query_params = {};
@@ -2057,12 +3055,19 @@ class Payment {
2057
3055
  "post",
2058
3056
  `/service/platform/payment/v1.0/company/${this.config.companyId}/application/${this.applicationId}/payment/customer/validation`,
2059
3057
  query_params,
2060
- body
3058
+ body,
3059
+ requestHeaders,
3060
+ { responseHeaders }
2061
3061
  );
2062
3062
 
3063
+ let responseData = response;
3064
+ if (responseHeaders) {
3065
+ responseData = response[0];
3066
+ }
3067
+
2063
3068
  const {
2064
3069
  error: res_error,
2065
- } = PaymentModel.ValidateCustomerResponse().validate(response, {
3070
+ } = PaymentPlatformModel.ValidateCustomerResponse().validate(responseData, {
2066
3071
  abortEarly: false,
2067
3072
  allowUnknown: false,
2068
3073
  });
@@ -2070,9 +3075,8 @@ class Payment {
2070
3075
  if (res_error) {
2071
3076
  Logger({
2072
3077
  level: "WARN",
2073
- message: "Response Validation Warnnings for verifyCustomerForPayment",
3078
+ message: `Response Validation Warnnings for platform > Payment > verifyCustomerForPayment \n ${res_error}`,
2074
3079
  });
2075
- Logger({ level: "WARN", message: res_error });
2076
3080
  }
2077
3081
 
2078
3082
  return response;