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/DeleteRecordedPaymentRequest', 'models/ErrorResponseVo', 'models/GetRecordedPaymentResponse', 'models/RecordPaymentRequest', 'models/RecordedPaymentResponse', 'models/RecordedPaymentsResponse'], 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/DeleteRecordedPaymentRequest'), require('../models/ErrorResponseVo'), require('../models/GetRecordedPaymentResponse'), require('../models/RecordPaymentRequest'), require('../models/RecordedPaymentResponse'), require('../models/RecordedPaymentsResponse'));
  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.RecordedPaymentApi = factory(root.OrbipayPaymentsapiClient.ApiClient, root.OrbipayPaymentsapiClient.DeleteRecordedPaymentRequest, root.OrbipayPaymentsapiClient.ErrorResponseVo, root.OrbipayPaymentsapiClient.GetRecordedPaymentResponse, root.OrbipayPaymentsapiClient.RecordPaymentRequest, root.OrbipayPaymentsapiClient.RecordedPaymentResponse, root.OrbipayPaymentsapiClient.RecordedPaymentsResponse);
  15. 15 : }
  16. 16 : }(this, function(ApiClient, DeleteRecordedPaymentRequest, ErrorResponseVo, GetRecordedPaymentResponse, RecordPaymentRequest, RecordedPaymentResponse, RecordedPaymentsResponse) {
  17. 17 : 'use strict';
  18. 18 :
  19. 19 : /**
  20. 20 : * RecordedPayment service.
  21. 21 : * @module api/RecordedPaymentApi
  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 RecordedPaymentApi.
  28. 28 : * @alias module:api/RecordedPaymentApi
  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 deleteRecordPayment operation.
  39. 39 : * @callback module:api/RecordedPaymentApi~deleteRecordPaymentCallback
  40. 40 : * @param {String} error Error message, if any.
  41. 41 : * @param data This operation does not return a value.
  42. 42 : * @param {String} response The complete HTTP response.
  43. 43 : */
  44. 44 :
  45. 45 : /**
  46. 46 : * Delete Recorded Payment
  47. 47 : * The API is used to delete the recorded payment. It returns 204 http status code with empty body in successful case
  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_payment The unique identifier assigned by EBPP to the payment.
  55. 55 : * @param {module:models/DeleteRecordedPaymentRequest} delete_recorded_payment_request Details of payment to be deleted/cancelled
  56. 56 : * @param {Object} opts Optional parameters
  57. 57 : * @param {String} opts.requestor The identifier for the requestor of the API. If the requestor_type is &lt;b&gt;system&lt;/b&gt;, requestor is optional.
  58. 58 : * @param {String} opts.x_opay_headers Intended for the future use.
  59. 59 : * @param {module:api/RecordedPaymentApi~deleteRecordPaymentCallback} callback The callback function, accepting three arguments: error, data, response
  60. 60 : */
  61. 61 : this.deleteRecordPayment = function(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, id_payment, delete_recorded_payment_request, opts, callback) {
  62. 62 : opts = opts || {};
  63. 63 : var postBody = delete_recorded_payment_request;
  64. 64 :
  65. 65 : var pathParams = {
  66. 66 : 'ID_PAYMENT': id_payment
  67. 67 : };
  68. 68 : var queryParams = {
  69. 69 : };
  70. 70 : var headerParams = {
  71. 71 : 'channel': channel,
  72. 72 : 'client_key': client_key,
  73. 73 : 'product': product,
  74. 74 : 'timestamp': timestamp,
  75. 75 : 'idempotent_request_key': idempotent_request_key,
  76. 76 : 'requestor_type': requestor_type,
  77. 77 : 'requestor': opts['requestor'],
  78. 78 : 'X-OPAY-Headers': opts['x_opay_headers']
  79. 79 : };
  80. 80 : var formParams = {
  81. 81 : };
  82. 82 :
  83. 83 : var authNames = [];
  84. 84 : var contentTypes = ['application/json'];
  85. 85 : var accepts = ['application/json'];
  86. 86 : var returnType = null;
  87. 87 :
  88. 88 : return this.apiClient.callApi(
  89. 89 : '/recordedpayments/{ID_PAYMENT}', 'DELETE',
  90. 90 : pathParams, queryParams, headerParams, formParams, postBody,
  91. 91 : authNames, contentTypes, accepts, returnType, callback
  92. 92 : );
  93. 93 : };
  94. 94 :
  95. 95 : /**
  96. 96 : * Callback function to receive the result of the getRecordPayment operation.
  97. 97 : * @callback module:api/RecordedPaymentApi~getRecordPaymentCallback
  98. 98 : * @param {String} error Error message, if any.
  99. 99 : * @param {module:models/GetRecordedPaymentResponse} data The data returned by the service call.
  100. 100 : * @param {String} response The complete HTTP response.
  101. 101 : */
  102. 102 :
  103. 103 : /**
  104. 104 : * Get Recorded Payment
  105. 105 : * The API is used to retrieve the details of a payment by id.
  106. 106 : * @param {String} channel The channel through which the API is invoked.
  107. 107 : * @param {String} client_key The unique identifier assigned by EBPP to the client.
  108. 108 : * @param {module:models/String} product The product identifier corresponding to the API.
  109. 109 : * @param {String} timestamp The timestamp for the moment when the API request is created.
  110. 110 : * @param {String} idempotent_request_key The unique token that clients can generate and maintain in order to identify an API request.
  111. 111 : * @param {module:models/String} requestor_type Type of the requestor of the API.
  112. 112 : * @param {String} id_payment The unique identifier assigned by EBPP to the payment.
  113. 113 : * @param {Object} opts Optional parameters
  114. 114 : * @param {String} opts.requestor The identifier for the requestor of the API. If the requestor_type is &lt;b&gt;system&lt;/b&gt;, requestor is optional.
  115. 115 : * @param {String} opts.x_opay_headers Intended for the future use.
  116. 116 : * @param {module:api/RecordedPaymentApi~getRecordPaymentCallback} callback The callback function, accepting three arguments: error, data, response
  117. 117 : * data is of type: {@link module:models/GetRecordedPaymentResponse}
  118. 118 : */
  119. 119 : this.getRecordPayment = function(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, id_payment, opts, callback) {
  120. 120 : opts = opts || {};
  121. 121 : var postBody = null;
  122. 122 :
  123. 123 : var pathParams = {
  124. 124 : 'ID_PAYMENT': id_payment
  125. 125 : };
  126. 126 : var queryParams = {
  127. 127 : };
  128. 128 : var headerParams = {
  129. 129 : 'channel': channel,
  130. 130 : 'client_key': client_key,
  131. 131 : 'product': product,
  132. 132 : 'timestamp': timestamp,
  133. 133 : 'idempotent_request_key': idempotent_request_key,
  134. 134 : 'requestor_type': requestor_type,
  135. 135 : 'requestor': opts['requestor'],
  136. 136 : 'X-OPAY-Headers': opts['x_opay_headers']
  137. 137 : };
  138. 138 : var formParams = {
  139. 139 : };
  140. 140 :
  141. 141 : var authNames = [];
  142. 142 : var contentTypes = [];
  143. 143 : var accepts = ['application/json'];
  144. 144 : var returnType = GetRecordedPaymentResponse;
  145. 145 :
  146. 146 : return this.apiClient.callApi(
  147. 147 : '/recordedpayments/{ID_PAYMENT}', 'GET',
  148. 148 : pathParams, queryParams, headerParams, formParams, postBody,
  149. 149 : authNames, contentTypes, accepts, returnType, callback
  150. 150 : );
  151. 151 : };
  152. 152 :
  153. 153 : /**
  154. 154 : * Callback function to receive the result of the recordPayment operation.
  155. 155 : * @callback module:api/RecordedPaymentApi~recordPaymentCallback
  156. 156 : * @param {String} error Error message, if any.
  157. 157 : * @param {module:models/RecordedPaymentResponse} data The data returned by the service call.
  158. 158 : * @param {String} response The complete HTTP response.
  159. 159 : */
  160. 160 :
  161. 161 : /**
  162. 162 : * Record Payment
  163. 163 : * The API is used to record payments in EBPP those are made and fulfilled outside EBPP.
  164. 164 : * @param {String} channel The channel through which the API is invoked.
  165. 165 : * @param {String} client_key The unique identifier assigned by EBPP to the client.
  166. 166 : * @param {module:models/String} product The product identifier corresponding to the API.
  167. 167 : * @param {String} timestamp The timestamp for the moment when the API request is created.
  168. 168 : * @param {String} idempotent_request_key The unique token that clients can generate and maintain in order to identify an API request.
  169. 169 : * @param {module:models/String} requestor_type Type of the requestor of the API.
  170. 170 : * @param {module:models/RecordPaymentRequest} record_payment_request JSON containing all the fields required to record a payment.
  171. 171 : * @param {Object} opts Optional parameters
  172. 172 : * @param {String} opts.requestor The identifier for the requestor of the API. If the requestor_type is &lt;b&gt;system&lt;/b&gt;, requestor is optional.
  173. 173 : * @param {String} opts.x_opay_headers Intended for the future use.
  174. 174 : * @param {module:api/RecordedPaymentApi~recordPaymentCallback} callback The callback function, accepting three arguments: error, data, response
  175. 175 : * data is of type: {@link module:models/RecordedPaymentResponse}
  176. 176 : */
  177. 177 : this.recordPayment = function(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, record_payment_request, opts, callback) {
  178. 178 : opts = opts || {};
  179. 179 : var postBody = record_payment_request;
  180. 180 :
  181. 181 : var pathParams = {
  182. 182 : };
  183. 183 : var queryParams = {
  184. 184 : };
  185. 185 : var headerParams = {
  186. 186 : 'channel': channel,
  187. 187 : 'client_key': client_key,
  188. 188 : 'product': product,
  189. 189 : 'timestamp': timestamp,
  190. 190 : 'idempotent_request_key': idempotent_request_key,
  191. 191 : 'requestor_type': requestor_type,
  192. 192 : 'requestor': opts['requestor'],
  193. 193 : 'X-OPAY-Headers': opts['x_opay_headers']
  194. 194 : };
  195. 195 : var formParams = {
  196. 196 : };
  197. 197 :
  198. 198 : var authNames = [];
  199. 199 : var contentTypes = ['application/json'];
  200. 200 : var accepts = ['application/json'];
  201. 201 : var returnType = RecordedPaymentResponse;
  202. 202 :
  203. 203 : return this.apiClient.callApi(
  204. 204 : '/recordedpayments', 'POST',
  205. 205 : pathParams, queryParams, headerParams, formParams, postBody,
  206. 206 : authNames, contentTypes, accepts, returnType, callback
  207. 207 : );
  208. 208 : };
  209. 209 :
  210. 210 : /**
  211. 211 : * Callback function to receive the result of the retrieveRecordPayments operation.
  212. 212 : * @callback module:api/RecordedPaymentApi~retrieveRecordPaymentsCallback
  213. 213 : * @param {String} error Error message, if any.
  214. 214 : * @param {module:models/RecordedPaymentsResponse} data The data returned by the service call.
  215. 215 : * @param {String} response The complete HTTP response.
  216. 216 : */
  217. 217 :
  218. 218 : /**
  219. 219 : * Retrieve Recorded Payments
  220. 220 : * The API is used to retrieve the payments made by a customer. Payments can be filtered using the confirmation number, customer account, status, by date range and others mentioned below. If no dates are provided for retrieval, payments in the last six months and all the payments scheduled for a future date are returned. In case a payment has failed due to ACH returns, then the payment return date and the return code will be available in the response.
  221. 221 : * @param {String} channel The channel through which the API is invoked.
  222. 222 : * @param {String} client_key The unique identifier assigned by EBPP to the client.
  223. 223 : * @param {module:models/String} product The product identifier corresponding to the API.
  224. 224 : * @param {String} timestamp The timestamp for the moment when the API request is created.
  225. 225 : * @param {String} idempotent_request_key The unique token that clients can generate and maintain in order to identify an API request.
  226. 226 : * @param {module:models/String} requestor_type Type of the requestor of the API.
  227. 227 : * @param {String} id_customer The unique identifier assigned by EBPP to the customer.
  228. 228 : * @param {Object} opts Optional parameters
  229. 229 : * @param {String} opts.requestor The identifier for the requestor of the API. If the requestor_type is &lt;b&gt;system&lt;/b&gt;, requestor is optional.
  230. 230 : * @param {String} opts.x_opay_headers Intended for the future use.
  231. 231 : * @param {String} opts.id_customer_account The unique identifier assigned by EBPP to the customer account
  232. 232 : * @param {String} opts.confirmation_number The confirmation number or reference provided to the customer for the successful payment.
  233. 233 : * @param {Array.<module:models/String>} opts.payment_method The non fulfillment method for the payment. This can take multiple values in the format key&#x3D;value1&amp;key&#x3D;value2....
  234. 234 : * @param {Array.<module:models/String>} opts.status The status of the payment. This can take multiple values in the format key&#x3D;value1&amp;key&#x3D;value2....
  235. 235 : * @param {String} opts.from_date The date from which payments, matching the criteria specified, need to be retrieved.
  236. 236 : * @param {String} opts.to_date The date upto which payments, matching the criteria specified, need to be retrieved.
  237. 237 : * @param {String} opts.page_size The maximum number of objects returned in the query.
  238. 238 : * @param {String} opts.query_id query id of the Retrieve/Search Payments lookup.
  239. 239 : * @param {String} opts.from_index To fetch the next set of objects that start after this object
  240. 240 : * @param {String} opts.to_index To fetch the previous set of objects that end at this object
  241. 241 : * @param {module:api/RecordedPaymentApi~retrieveRecordPaymentsCallback} callback The callback function, accepting three arguments: error, data, response
  242. 242 : * data is of type: {@link module:models/RecordedPaymentsResponse}
  243. 243 : */
  244. 244 : this.retrieveRecordPayments = function(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, id_customer, opts, callback) {
  245. 245 : opts = opts || {};
  246. 246 : var postBody = null;
  247. 247 :
  248. 248 : var pathParams = {
  249. 249 : };
  250. 250 : var queryParams = {
  251. 251 : 'id_customer': id_customer,
  252. 252 : 'id_customer_account': opts['id_customer_account'],
  253. 253 : 'confirmation_number': opts['confirmation_number'],
  254. 254 : 'payment_method': opts['payment_method'],
  255. 255 : 'status': opts['status'],
  256. 256 : 'from_date': opts['from_date'],
  257. 257 : 'to_date': opts['to_date'],
  258. 258 : 'page_size': opts['page_size'],
  259. 259 : 'query_id': opts['query_id'],
  260. 260 : 'from_index': opts['from_index'],
  261. 261 : 'to_index': opts['to_index']
  262. 262 : };
  263. 263 : var headerParams = {
  264. 264 : 'channel': channel,
  265. 265 : 'client_key': client_key,
  266. 266 : 'product': product,
  267. 267 : 'timestamp': timestamp,
  268. 268 : 'idempotent_request_key': idempotent_request_key,
  269. 269 : 'requestor_type': requestor_type,
  270. 270 : 'requestor': opts['requestor'],
  271. 271 : 'X-OPAY-Headers': opts['x_opay_headers']
  272. 272 : };
  273. 273 : var formParams = {
  274. 274 : };
  275. 275 :
  276. 276 : var authNames = [];
  277. 277 : var contentTypes = [];
  278. 278 : var accepts = ['application/json'];
  279. 279 : var returnType = RecordedPaymentsResponse;
  280. 280 :
  281. 281 : return this.apiClient.callApi(
  282. 282 : '/recordedpayments', 'GET',
  283. 283 : pathParams, queryParams, headerParams, formParams, postBody,
  284. 284 : authNames, contentTypes, accepts, returnType, callback
  285. 285 : );
  286. 286 : };
  287. 287 : };
  288. 288 :
  289. 289 : return exports;
  290. 290 : }));