1. 1 :
  2. 2 : (function(root, factory) {
  3. 3 : if (typeof define === 'function' && define.amd) {
  4. 4 : // AMD. Register as an anonymous module.
  5. 5 : define(['ApiClient', 'models/AddFundingAccountRequest', 'models/DeleteFundingAccountRequest', 'models/DeleteResponse', 'models/ErrorResponseVo', 'models/FundingAccountResponse', 'models/FundingAccountsResponse', 'models/ReplaceFundingAccountRequest', 'models/UpdateFundingAccountRequest'], factory);
  6. 6 : } else if (typeof module === 'object' && module.exports) {
  7. 7 : // CommonJS-like environments that support module.exports, like Node.
  8. 8 : module.exports = factory(require('../ApiClient'), require('../models/AddFundingAccountRequest'), require('../models/DeleteFundingAccountRequest'), require('../models/DeleteResponse'), require('../models/ErrorResponseVo'), require('../models/FundingAccountResponse'), require('../models/FundingAccountsResponse'), require('../models/ReplaceFundingAccountRequest'), require('../models/UpdateFundingAccountRequest'));
  9. 9 : } else {
  10. 10 : // Browser globals (root is window)
  11. 11 : if (!root.OrbipayPaymentsapiClient) {
  12. 12 : root.OrbipayPaymentsapiClient = {};
  13. 13 : }
  14. 14 : root.OrbipayPaymentsapiClient.FundingAccountApi = factory(root.OrbipayPaymentsapiClient.ApiClient, root.OrbipayPaymentsapiClient.AddFundingAccountRequest, root.OrbipayPaymentsapiClient.DeleteFundingAccountRequest, root.OrbipayPaymentsapiClient.DeleteResponse, root.OrbipayPaymentsapiClient.ErrorResponseVo, root.OrbipayPaymentsapiClient.FundingAccountResponse, root.OrbipayPaymentsapiClient.FundingAccountsResponse, root.OrbipayPaymentsapiClient.ReplaceFundingAccountRequest, root.OrbipayPaymentsapiClient.UpdateFundingAccountRequest);
  15. 15 : }
  16. 16 : }(this, function(ApiClient, AddFundingAccountRequest, DeleteFundingAccountRequest, DeleteResponse, ErrorResponseVo, FundingAccountResponse, FundingAccountsResponse, ReplaceFundingAccountRequest, UpdateFundingAccountRequest) {
  17. 17 : 'use strict';
  18. 18 :
  19. 19 : /**
  20. 20 : * FundingAccount service.
  21. 21 : * @module api/FundingAccountApi
  22. 22 : */
  23. 23 :
  24. 24 : /**
  25. 25 : * <h3 style="color:red"> This class subject to change without prior notice, Please dont use this class directly. </h3>
  26. 26 :
  27. 27 : * Constructs a new FundingAccountApi.
  28. 28 : * @alias module:api/FundingAccountApi
  29. 29 : * @class
  30. 30 : * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
  31. 31 : * default to {@link module:ApiClient#instance} if unspecified.
  32. 32 : */
  33. 33 : var exports = function(apiClient) {
  34. 34 : this.apiClient = apiClient || ApiClient.instance;
  35. 35 :
  36. 36 :
  37. 37 : /**
  38. 38 : * Callback function to receive the result of the addFundingAccount operation.
  39. 39 : * @callback module:api/FundingAccountApi~addFundingAccountCallback
  40. 40 : * @param {String} error Error message, if any.
  41. 41 : * @param {module:models/FundingAccountResponse} data The data returned by the service call.
  42. 42 : * @param {String} response The complete HTTP response.
  43. 43 : */
  44. 44 :
  45. 45 : /**
  46. 46 : * Add Funding Account
  47. 47 : * This API is used to add a funding account for the customer. The funding account is available for servicing all the customer accounts the customer holds. An exhaustive set of account types are supported as funding accounts as indicated in the field account_subtype. ABA routing number and account sub-type are mandatory for bank accounts. Expiry date, address fields and Card CVV are required for card accounts.
  48. 48 : * @param {String} channel The channel through which the API is invoked.
  49. 49 : * @param {String} client_key The unique identifier assigned by EBPP to the client.
  50. 50 : * @param {module:models/String} product The product identifier corresponding to the API.
  51. 51 : * @param {String} timestamp The timestamp for the moment when the API request is created.
  52. 52 : * @param {String} idempotent_request_key The unique token that clients can generate and maintain in order to identify an API request.
  53. 53 : * @param {module:models/String} requestor_type Type of the requestor of the API.
  54. 54 : * @param {String} id_customer The unique identifier assigned by EBPP to the customer.
  55. 55 : * @param {module:models/AddFundingAccountRequest} add_funding_account_request JSON containing all the attributes of the Funding account to be added to customer.
  56. 56 : * @param {Object} opts Optional parameters
  57. 57 : * @param {String} opts.requestor The identifier for the requestor of the API.
  58. 58 : * @param {String} opts.x_opay_headers Intended for the future use.
  59. 59 : * @param {String} opts.trace_id The unique reference that can be used for tracing and debugging an API call.
  60. 60 : * @param {module:api/FundingAccountApi~addFundingAccountCallback} callback The callback function, accepting three arguments: error, data, response
  61. 61 : * data is of type: {@link module:models/FundingAccountResponse}
  62. 62 : */
  63. 63 : this.addFundingAccount = function(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, id_customer, add_funding_account_request, opts, callback) {
  64. 64 : opts = opts || {};
  65. 65 : var postBody = add_funding_account_request;
  66. 66 :
  67. 67 : var pathParams = {
  68. 68 : 'ID_CUSTOMER': id_customer
  69. 69 : };
  70. 70 : var queryParams = {
  71. 71 : };
  72. 72 : var headerParams = {
  73. 73 : 'channel': channel,
  74. 74 : 'client_key': client_key,
  75. 75 : 'product': product,
  76. 76 : 'timestamp': timestamp,
  77. 77 : 'idempotent_request_key': idempotent_request_key,
  78. 78 : 'requestor_type': requestor_type,
  79. 79 : 'requestor': opts['requestor'],
  80. 80 : 'X-OPAY-Headers': opts['x_opay_headers'],
  81. 81 : 'trace_id': opts['trace_id']
  82. 82 : };
  83. 83 : var formParams = {
  84. 84 : };
  85. 85 :
  86. 86 : var authNames = [];
  87. 87 : var contentTypes = ['application/json'];
  88. 88 : var accepts = ['application/json'];
  89. 89 : var returnType = FundingAccountResponse;
  90. 90 :
  91. 91 : return this.apiClient.callApi(
  92. 92 : '/customers/{ID_CUSTOMER}/fundingaccounts', 'POST',
  93. 93 : pathParams, queryParams, headerParams, formParams, postBody,
  94. 94 : authNames, contentTypes, accepts, returnType, callback
  95. 95 : );
  96. 96 : };
  97. 97 :
  98. 98 : /**
  99. 99 : * Callback function to receive the result of the deleteFundingAccount operation.
  100. 100 : * @callback module:api/FundingAccountApi~deleteFundingAccountCallback
  101. 101 : * @param {String} error Error message, if any.
  102. 102 : * @param {module:models/DeleteResponse} data The data returned by the service call.
  103. 103 : * @param {String} response The complete HTTP response.
  104. 104 : */
  105. 105 :
  106. 106 : /**
  107. 107 : * Delete Funding Account
  108. 108 : * The Delete Funding Account API is used to delete the funding account of a customer. All pending payments made with that account are cancelled upon deletion of the funding account.
  109. 109 : * @param {String} channel The channel through which the API is invoked.
  110. 110 : * @param {String} client_key The unique identifier assigned by EBPP to the client.
  111. 111 : * @param {module:models/String} product The product identifier corresponding to the API.
  112. 112 : * @param {String} timestamp The timestamp for the moment when the API request is created.
  113. 113 : * @param {String} idempotent_request_key The unique token that clients can generate and maintain in order to identify an API request.
  114. 114 : * @param {module:models/String} requestor_type Type of the requestor of the API.
  115. 115 : * @param {String} id_funding_account The unique identifier assigned by EBPP to the Funding Account.
  116. 116 : * @param {String} id_customer The unique identifier assigned by EBPP to the customer.
  117. 117 : * @param {module:models/DeleteFundingAccountRequest} delete_funding_account_request Details of account to be deleted.
  118. 118 : * @param {Object} opts Optional parameters
  119. 119 : * @param {String} opts.requestor The identifier for the requestor of the API.
  120. 120 : * @param {String} opts.x_opay_headers Intended for the future use.
  121. 121 : * @param {String} opts.trace_id The unique reference that can be used for tracing and debugging an API call.
  122. 122 : * @param {module:api/FundingAccountApi~deleteFundingAccountCallback} callback The callback function, accepting three arguments: error, data, response
  123. 123 : * data is of type: {@link module:models/DeleteResponse}
  124. 124 : */
  125. 125 : this.deleteFundingAccount = function(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, id_funding_account, id_customer, delete_funding_account_request, opts, callback) {
  126. 126 : opts = opts || {};
  127. 127 : var postBody = delete_funding_account_request;
  128. 128 :
  129. 129 : var pathParams = {
  130. 130 : 'ID_FUNDING_ACCOUNT': id_funding_account,
  131. 131 : 'ID_CUSTOMER': id_customer
  132. 132 : };
  133. 133 : var queryParams = {
  134. 134 : };
  135. 135 : var headerParams = {
  136. 136 : 'channel': channel,
  137. 137 : 'client_key': client_key,
  138. 138 : 'product': product,
  139. 139 : 'timestamp': timestamp,
  140. 140 : 'idempotent_request_key': idempotent_request_key,
  141. 141 : 'requestor_type': requestor_type,
  142. 142 : 'requestor': opts['requestor'],
  143. 143 : 'X-OPAY-Headers': opts['x_opay_headers'],
  144. 144 : 'trace_id': opts['trace_id']
  145. 145 : };
  146. 146 : var formParams = {
  147. 147 : };
  148. 148 :
  149. 149 : var authNames = [];
  150. 150 : var contentTypes = ['application/json'];
  151. 151 : var accepts = ['application/json'];
  152. 152 : var returnType = DeleteResponse;
  153. 153 :
  154. 154 : return this.apiClient.callApi(
  155. 155 : '/customers/{ID_CUSTOMER}/fundingaccounts/{ID_FUNDING_ACCOUNT}', 'DELETE',
  156. 156 : pathParams, queryParams, headerParams, formParams, postBody,
  157. 157 : authNames, contentTypes, accepts, returnType, callback
  158. 158 : );
  159. 159 : };
  160. 160 :
  161. 161 : /**
  162. 162 : * Callback function to receive the result of the getFundingAccount operation.
  163. 163 : * @callback module:api/FundingAccountApi~getFundingAccountCallback
  164. 164 : * @param {String} error Error message, if any.
  165. 165 : * @param {module:models/FundingAccountResponse} data The data returned by the service call.
  166. 166 : * @param {String} response The complete HTTP response.
  167. 167 : */
  168. 168 :
  169. 169 : /**
  170. 170 : * Get Funding Account
  171. 171 : * The Get Funding Account API is used to retrieve the details of the funding account based on the id.
  172. 172 : * @param {String} channel The channel through which the API is invoked.
  173. 173 : * @param {String} client_key The unique identifier assigned by EBPP to the client.
  174. 174 : * @param {module:models/String} product The product identifier corresponding to the API.
  175. 175 : * @param {String} timestamp The timestamp for the moment when the API request is created.
  176. 176 : * @param {String} idempotent_request_key The unique token that clients can generate and maintain in order to identify an API request.
  177. 177 : * @param {module:models/String} requestor_type Type of the requestor of the API.
  178. 178 : * @param {String} id_funding_account The unique identifier assigned by EBPP to the Funding Account.
  179. 179 : * @param {String} id_customer The unique identifier assigned by EBPP to the customer.
  180. 180 : * @param {Object} opts Optional parameters
  181. 181 : * @param {String} opts.requestor The identifier for the requestor of the API.
  182. 182 : * @param {String} opts.x_opay_headers Intended for the future use.
  183. 183 : * @param {String} opts.trace_id The unique reference that can be used for tracing and debugging an API call.
  184. 184 : * @param {module:api/FundingAccountApi~getFundingAccountCallback} callback The callback function, accepting three arguments: error, data, response
  185. 185 : * data is of type: {@link module:models/FundingAccountResponse}
  186. 186 : */
  187. 187 : this.getFundingAccount = function(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, id_funding_account, id_customer, opts, callback) {
  188. 188 : opts = opts || {};
  189. 189 : var postBody = null;
  190. 190 :
  191. 191 : var pathParams = {
  192. 192 : 'ID_FUNDING_ACCOUNT': id_funding_account,
  193. 193 : 'ID_CUSTOMER': id_customer
  194. 194 : };
  195. 195 : var queryParams = {
  196. 196 : };
  197. 197 : var headerParams = {
  198. 198 : 'channel': channel,
  199. 199 : 'client_key': client_key,
  200. 200 : 'product': product,
  201. 201 : 'timestamp': timestamp,
  202. 202 : 'idempotent_request_key': idempotent_request_key,
  203. 203 : 'requestor_type': requestor_type,
  204. 204 : 'requestor': opts['requestor'],
  205. 205 : 'X-OPAY-Headers': opts['x_opay_headers'],
  206. 206 : 'trace_id': opts['trace_id']
  207. 207 : };
  208. 208 : var formParams = {
  209. 209 : };
  210. 210 :
  211. 211 : var authNames = [];
  212. 212 : var contentTypes = [];
  213. 213 : var accepts = ['application/json'];
  214. 214 : var returnType = FundingAccountResponse;
  215. 215 :
  216. 216 : return this.apiClient.callApi(
  217. 217 : '/customers/{ID_CUSTOMER}/fundingaccounts/{ID_FUNDING_ACCOUNT}', 'GET',
  218. 218 : pathParams, queryParams, headerParams, formParams, postBody,
  219. 219 : authNames, contentTypes, accepts, returnType, callback
  220. 220 : );
  221. 221 : };
  222. 222 :
  223. 223 : /**
  224. 224 : * Callback function to receive the result of the replaceFundingAccount operation.
  225. 225 : * @callback module:api/FundingAccountApi~replaceFundingAccountCallback
  226. 226 : * @param {String} error Error message, if any.
  227. 227 : * @param {module:models/FundingAccountResponse} data The data returned by the service call.
  228. 228 : * @param {String} response The complete HTTP response.
  229. 229 : */
  230. 230 :
  231. 231 : /**
  232. 232 : * Replace Funding Account
  233. 233 : * The API is used to replace the funding account details. The type of the funding account cannot be replaced. In other words, a card account cannot be replaced to a bank account and vice versa. CVV is mandatory to make any change to a card account.Replacing a funding account updates the account information on all pending payments made using that account but does not change the details on payments that have been completed.
  234. 234 : * @param {String} channel The channel through which the API is invoked.
  235. 235 : * @param {String} client_key The unique identifier assigned by EBPP to the client.
  236. 236 : * @param {module:models/String} product The product identifier corresponding to the API.
  237. 237 : * @param {String} timestamp The timestamp for the moment when the API request is created.
  238. 238 : * @param {String} idempotent_request_key The unique token that clients can generate and maintain in order to identify an API request.
  239. 239 : * @param {module:models/String} requestor_type Type of the requestor of the API.
  240. 240 : * @param {String} id_funding_account The unique identifier assigned by EBPP to the Funding Account.
  241. 241 : * @param {String} id_customer The unique identifier assigned by EBPP to the customer.
  242. 242 : * @param {module:models/ReplaceFundingAccountRequest} replace_funding_account_request JSON containing all the attributes of the Funding account to be replaced.
  243. 243 : * @param {Object} opts Optional parameters
  244. 244 : * @param {String} opts.requestor The identifier for the requestor of the API.
  245. 245 : * @param {String} opts.x_opay_headers Intended for the future use.
  246. 246 : * @param {String} opts.trace_id The unique reference that can be used for tracing and debugging an API call.
  247. 247 : * @param {module:api/FundingAccountApi~replaceFundingAccountCallback} callback The callback function, accepting three arguments: error, data, response
  248. 248 : * data is of type: {@link module:models/FundingAccountResponse}
  249. 249 : */
  250. 250 : this.replaceFundingAccount = function(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, id_funding_account, id_customer, replace_funding_account_request, opts, callback) {
  251. 251 : opts = opts || {};
  252. 252 : var postBody = replace_funding_account_request;
  253. 253 :
  254. 254 : var pathParams = {
  255. 255 : 'ID_FUNDING_ACCOUNT': id_funding_account,
  256. 256 : 'ID_CUSTOMER': id_customer
  257. 257 : };
  258. 258 : var queryParams = {
  259. 259 : };
  260. 260 : var headerParams = {
  261. 261 : 'channel': channel,
  262. 262 : 'client_key': client_key,
  263. 263 : 'product': product,
  264. 264 : 'timestamp': timestamp,
  265. 265 : 'idempotent_request_key': idempotent_request_key,
  266. 266 : 'requestor_type': requestor_type,
  267. 267 : 'requestor': opts['requestor'],
  268. 268 : 'X-OPAY-Headers': opts['x_opay_headers'],
  269. 269 : 'trace_id': opts['trace_id']
  270. 270 : };
  271. 271 : var formParams = {
  272. 272 : };
  273. 273 :
  274. 274 : var authNames = [];
  275. 275 : var contentTypes = ['application/json'];
  276. 276 : var accepts = ['application/json'];
  277. 277 : var returnType = FundingAccountResponse;
  278. 278 :
  279. 279 : return this.apiClient.callApi(
  280. 280 : '/customers/{ID_CUSTOMER}/fundingaccounts/{ID_FUNDING_ACCOUNT}/replacement', 'POST',
  281. 281 : pathParams, queryParams, headerParams, formParams, postBody,
  282. 282 : authNames, contentTypes, accepts, returnType, callback
  283. 283 : );
  284. 284 : };
  285. 285 :
  286. 286 : /**
  287. 287 : * Callback function to receive the result of the retrieveFundingAccounts operation.
  288. 288 : * @callback module:api/FundingAccountApi~retrieveFundingAccountsCallback
  289. 289 : * @param {String} error Error message, if any.
  290. 290 : * @param {module:models/FundingAccountsResponse} data The data returned by the service call.
  291. 291 : * @param {String} response The complete HTTP response.
  292. 292 : */
  293. 293 :
  294. 294 : /**
  295. 295 : * Retrieve Funding Accounts
  296. 296 : * This API is used to retrieve all the funding accounts associated with a customer. Accounts can be filtered using the account number, the ABA routing number (for bank accounts), the account status, account type, account sub-type and others mentioned below. The results are sorted based on their last_modified_time in descending order. The API responds with the first page of the list of funding accounts matching the criteria.
  297. 297 : * @param {String} channel The channel through which the API is invoked.
  298. 298 : * @param {String} client_key The unique identifier assigned by EBPP to the client.
  299. 299 : * @param {module:models/String} product The product identifier corresponding to the API.
  300. 300 : * @param {String} timestamp The timestamp for the moment when the API request is created.
  301. 301 : * @param {String} idempotent_request_key The unique token that clients can generate and maintain in order to identify an API request.
  302. 302 : * @param {module:models/String} requestor_type Type of the requestor of the API.
  303. 303 : * @param {String} id_customer The unique identifier assigned by EBPP to the customer.
  304. 304 : * @param {Object} opts Optional parameters
  305. 305 : * @param {String} opts.requestor The identifier for the requestor of the API.
  306. 306 : * @param {String} opts.x_opay_headers Intended for the future use.
  307. 307 : * @param {String} opts.trace_id The unique reference that can be used for tracing and debugging an API call.
  308. 308 : * @param {String} opts.page_size The maximum number of objects returned in the query.
  309. 309 : * @param {String} opts.account_number The Account Number to get details of.
  310. 310 : * @param {Array.<module:models/String>} opts.status The status of the funding account in EBPP. This can take multiple values in the format key&#x3D;value1&amp;key&#x3D;value2....
  311. 311 : * @param {String} opts.aba_routing_number The ABA/Routing number for the bank account.
  312. 312 : * @param {Array.<module:models/String>} opts.account_type The type of the funding account. This can take multiple values in the format key&#x3D;value1&amp;key&#x3D;value2....
  313. 313 : * @param {module:models/String} opts.account_subtype The sub type of the funding account. This is derived by EBPP in the case of card funding accounts.
  314. 314 : * @param {module:api/FundingAccountApi~retrieveFundingAccountsCallback} callback The callback function, accepting three arguments: error, data, response
  315. 315 : * data is of type: {@link module:models/FundingAccountsResponse}
  316. 316 : */
  317. 317 : this.retrieveFundingAccounts = function(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, id_customer, opts, callback) {
  318. 318 : opts = opts || {};
  319. 319 : var postBody = null;
  320. 320 :
  321. 321 : var pathParams = {
  322. 322 : 'ID_CUSTOMER': id_customer
  323. 323 : };
  324. 324 : var queryParams = {
  325. 325 : 'page_size': opts['page_size']
  326. 326 : };
  327. 327 : var headerParams = {
  328. 328 : 'channel': channel,
  329. 329 : 'client_key': client_key,
  330. 330 : 'product': product,
  331. 331 : 'timestamp': timestamp,
  332. 332 : 'idempotent_request_key': idempotent_request_key,
  333. 333 : 'requestor_type': requestor_type,
  334. 334 : 'requestor': opts['requestor'],
  335. 335 : 'X-OPAY-Headers': opts['x_opay_headers'],
  336. 336 : 'trace_id': opts['trace_id']
  337. 337 : };
  338. 338 : var formParams = {
  339. 339 : 'account_number': opts['account_number'],
  340. 340 : 'status': this.apiClient.buildCollectionParam(opts['status'], 'multi'),
  341. 341 : 'aba_routing_number': opts['aba_routing_number'],
  342. 342 : 'account_type': this.apiClient.buildCollectionParam(opts['account_type'], 'multi'),
  343. 343 : 'account_subtype': opts['account_subtype']
  344. 344 : };
  345. 345 :
  346. 346 : var authNames = [];
  347. 347 : var contentTypes = ['application/x-www-form-urlencoded'];
  348. 348 : var accepts = ['application/json'];
  349. 349 : var returnType = FundingAccountsResponse;
  350. 350 :
  351. 351 : return this.apiClient.callApi(
  352. 352 : '/customers/{ID_CUSTOMER}/fundingaccounts/lists', 'POST',
  353. 353 : pathParams, queryParams, headerParams, formParams, postBody,
  354. 354 : authNames, contentTypes, accepts, returnType, callback
  355. 355 : );
  356. 356 : };
  357. 357 :
  358. 358 : /**
  359. 359 : * Callback function to receive the result of the retrieveFundingAccountsPage operation.
  360. 360 : * @callback module:api/FundingAccountApi~retrieveFundingAccountsPageCallback
  361. 361 : * @param {String} error Error message, if any.
  362. 362 : * @param {module:models/FundingAccountsResponse} data The data returned by the service call.
  363. 363 : * @param {String} response The complete HTTP response.
  364. 364 : */
  365. 365 :
  366. 366 : /**
  367. 367 : * Retrieve Funding Accounts Pagination
  368. 368 : * This API is used to paginate through the list of funding accounts returned in the Retrieve Funding Accounts API.
  369. 369 : * @param {String} channel The channel through which the API is invoked.
  370. 370 : * @param {String} client_key The unique identifier assigned by EBPP to the client.
  371. 371 : * @param {module:models/String} product The product identifier corresponding to the API.
  372. 372 : * @param {String} timestamp The timestamp for the moment when the API request is created.
  373. 373 : * @param {String} idempotent_request_key The unique token that clients can generate and maintain in order to identify an API request.
  374. 374 : * @param {module:models/String} requestor_type Type of the requestor of the API.
  375. 375 : * @param {String} id_customer The unique identifier assigned by EBPP to the customer.
  376. 376 : * @param {String} query_id query id of the Retrieve/Search Accounts lookup.
  377. 377 : * @param {Object} opts Optional parameters
  378. 378 : * @param {String} opts.requestor The identifier for the requestor of the API.
  379. 379 : * @param {String} opts.x_opay_headers Intended for the future use.
  380. 380 : * @param {String} opts.trace_id The unique reference that can be used for tracing and debugging an API call.
  381. 381 : * @param {String} opts.page_size The maximum number of objects returned in the query.
  382. 382 : * @param {String} opts.from_index To fetch the next set of objects that start after this object
  383. 383 : * @param {String} opts.to_index To fetch the previous set of objects that end at this object
  384. 384 : * @param {module:api/FundingAccountApi~retrieveFundingAccountsPageCallback} callback The callback function, accepting three arguments: error, data, response
  385. 385 : * data is of type: {@link module:models/FundingAccountsResponse}
  386. 386 : */
  387. 387 : this.retrieveFundingAccountsPage = function(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, id_customer, query_id, opts, callback) {
  388. 388 : opts = opts || {};
  389. 389 : var postBody = null;
  390. 390 :
  391. 391 : var pathParams = {
  392. 392 : 'ID_CUSTOMER': id_customer
  393. 393 : };
  394. 394 : var queryParams = {
  395. 395 : 'page_size': opts['page_size'],
  396. 396 : 'query_id': query_id,
  397. 397 : 'from_index': opts['from_index'],
  398. 398 : 'to_index': opts['to_index']
  399. 399 : };
  400. 400 : var headerParams = {
  401. 401 : 'channel': channel,
  402. 402 : 'client_key': client_key,
  403. 403 : 'product': product,
  404. 404 : 'timestamp': timestamp,
  405. 405 : 'idempotent_request_key': idempotent_request_key,
  406. 406 : 'requestor_type': requestor_type,
  407. 407 : 'requestor': opts['requestor'],
  408. 408 : 'X-OPAY-Headers': opts['x_opay_headers'],
  409. 409 : 'trace_id': opts['trace_id']
  410. 410 : };
  411. 411 : var formParams = {
  412. 412 : };
  413. 413 :
  414. 414 : var authNames = [];
  415. 415 : var contentTypes = [];
  416. 416 : var accepts = ['application/json'];
  417. 417 : var returnType = FundingAccountsResponse;
  418. 418 :
  419. 419 : return this.apiClient.callApi(
  420. 420 : '/customers/{ID_CUSTOMER}/fundingaccounts/lists', 'GET',
  421. 421 : pathParams, queryParams, headerParams, formParams, postBody,
  422. 422 : authNames, contentTypes, accepts, returnType, callback
  423. 423 : );
  424. 424 : };
  425. 425 :
  426. 426 : /**
  427. 427 : * Callback function to receive the result of the updateFundingAccount operation.
  428. 428 : * @callback module:api/FundingAccountApi~updateFundingAccountCallback
  429. 429 : * @param {String} error Error message, if any.
  430. 430 : * @param {module:models/FundingAccountResponse} data The data returned by the service call.
  431. 431 : * @param {String} response The complete HTTP response.
  432. 432 : */
  433. 433 :
  434. 434 : /**
  435. 435 : * Update Funding Account
  436. 436 : * The API is used to edit the funding account details. The type of the funding account cannot be changed. In other words, a card account cannot be changed to a bank account and vice versa. The sub-type of a bank account can be changed. For e.g., a saving account can be updated to a money market account. However, the sub-type cannot be updated for a card account. CVV is mandatory to make any change to a card account. The Id of the funding account gets updated to a new value if the account number is updated. Editing a funding account updates the account information on all pending payments made using that account but does not change the details on payments that have been completed. &lt;br&gt;&lt;br&gt; Below are the possible funding account state transformation. | from_status | to_status | allowed requestor_type | | ------------ | ------------ | ------------ | | active | deleted| &lt;ul&gt; &lt;li&gt;external_user&lt;/li&gt; &lt;li&gt; client_agent&lt;/li&gt; &lt;li&gt; system&lt;/li&gt; &lt;li&gt; customer&lt;/li&gt;&lt;/ul&gt; | | active | frozen | &lt;ul&gt; &lt;li&gt;external_user &lt;/li&gt; &lt;li&gt; client_agent &lt;/li&gt; &lt;li&gt; system&lt;/li&gt;&lt;/ul&gt; | | active | inactive | &lt;ul&gt; &lt;li&gt;external_user &lt;/li&gt; &lt;li&gt; client_agent &lt;/li&gt; &lt;li&gt; system&lt;/li&gt;&lt;/ul&gt; | | active | unverified | &lt;ul&gt; &lt;li&gt;system&lt;/li&gt;&lt;/ul&gt; | | frozen | active | &lt;ul&gt; &lt;li&gt;external_user &lt;/li&gt; &lt;li&gt; client_agent&lt;/li&gt;&lt;/ul&gt; | | inactive | active | &lt;ul&gt; &lt;li&gt;external_user &lt;/li&gt; &lt;li&gt; client_agent &lt;/li&gt; &lt;li&gt; system&lt;/li&gt;&lt;/ul&gt; |
  437. 437 : * @param {String} channel The channel through which the API is invoked.
  438. 438 : * @param {String} client_key The unique identifier assigned by EBPP to the client.
  439. 439 : * @param {module:models/String} product The product identifier corresponding to the API.
  440. 440 : * @param {String} timestamp The timestamp for the moment when the API request is created.
  441. 441 : * @param {String} idempotent_request_key The unique token that clients can generate and maintain in order to identify an API request.
  442. 442 : * @param {module:models/String} requestor_type Type of the requestor of the API.
  443. 443 : * @param {String} id_funding_account The unique identifier assigned by EBPP to the Funding Account.
  444. 444 : * @param {String} id_customer The unique identifier assigned by EBPP to the customer.
  445. 445 : * @param {module:models/UpdateFundingAccountRequest} update_funding_account_request JSON containing all the attributes of the Funding account to be updated.
  446. 446 : * @param {Object} opts Optional parameters
  447. 447 : * @param {String} opts.requestor The identifier for the requestor of the API.
  448. 448 : * @param {String} opts.x_opay_headers Intended for the future use.
  449. 449 : * @param {String} opts.trace_id The unique reference that can be used for tracing and debugging an API call.
  450. 450 : * @param {module:api/FundingAccountApi~updateFundingAccountCallback} callback The callback function, accepting three arguments: error, data, response
  451. 451 : * data is of type: {@link module:models/FundingAccountResponse}
  452. 452 : */
  453. 453 : this.updateFundingAccount = function(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, id_funding_account, id_customer, update_funding_account_request, opts, callback) {
  454. 454 : opts = opts || {};
  455. 455 : var postBody = update_funding_account_request;
  456. 456 :
  457. 457 : var pathParams = {
  458. 458 : 'ID_FUNDING_ACCOUNT': id_funding_account,
  459. 459 : 'ID_CUSTOMER': id_customer
  460. 460 : };
  461. 461 : var queryParams = {
  462. 462 : };
  463. 463 : var headerParams = {
  464. 464 : 'channel': channel,
  465. 465 : 'client_key': client_key,
  466. 466 : 'product': product,
  467. 467 : 'timestamp': timestamp,
  468. 468 : 'idempotent_request_key': idempotent_request_key,
  469. 469 : 'requestor_type': requestor_type,
  470. 470 : 'requestor': opts['requestor'],
  471. 471 : 'X-OPAY-Headers': opts['x_opay_headers'],
  472. 472 : 'trace_id': opts['trace_id']
  473. 473 : };
  474. 474 : var formParams = {
  475. 475 : };
  476. 476 :
  477. 477 : var authNames = [];
  478. 478 : var contentTypes = ['application/json'];
  479. 479 : var accepts = ['application/json'];
  480. 480 : var returnType = FundingAccountResponse;
  481. 481 :
  482. 482 : return this.apiClient.callApi(
  483. 483 : '/customers/{ID_CUSTOMER}/fundingaccounts/{ID_FUNDING_ACCOUNT}', 'PUT',
  484. 484 : pathParams, queryParams, headerParams, formParams, postBody,
  485. 485 : authNames, contentTypes, accepts, returnType, callback
  486. 486 : );
  487. 487 : };
  488. 488 : };
  489. 489 :
  490. 490 : return exports;
  491. 491 : }));