- 1 :
- 2 :
(function(root, factory) {
- 3 :
if (typeof define === 'function' && define.amd) {
- 4 :
// AMD. Register as an anonymous module.
- 5 :
define(['ApiClient', 'models/CustomerAccountResponse', 'models/CustomerAccountsResponse', 'models/ErrorResponseVo', 'models/RenewCustomerAccountRequest'], factory);
- 6 :
} else if (typeof module === 'object' && module.exports) {
- 7 :
// CommonJS-like environments that support module.exports, like Node.
- 8 :
module.exports = factory(require('../ApiClient'), require('../models/CustomerAccountResponse'), require('../models/CustomerAccountsResponse'), require('../models/ErrorResponseVo'), require('../models/RenewCustomerAccountRequest'));
- 9 :
} else {
- 10 :
// Browser globals (root is window)
- 11 :
if (!root.OrbipayPaymentsapiClient) {
- 12 :
root.OrbipayPaymentsapiClient = {};
- 13 :
}
- 14 :
root.OrbipayPaymentsapiClient.CustomerAccountApi = factory(root.OrbipayPaymentsapiClient.ApiClient, root.OrbipayPaymentsapiClient.CustomerAccountResponse, root.OrbipayPaymentsapiClient.CustomerAccountsResponse, root.OrbipayPaymentsapiClient.ErrorResponseVo, root.OrbipayPaymentsapiClient.RenewCustomerAccountRequest);
- 15 :
}
- 16 :
}(this, function(ApiClient, CustomerAccountResponse, CustomerAccountsResponse, ErrorResponseVo, RenewCustomerAccountRequest) {
- 17 :
'use strict';
- 18 :
- 19 :
/**
- 20 :
* CustomerAccount service.
- 21 :
* @module api/CustomerAccountApi
- 22 :
*/
- 23 :
- 24 :
/**
- 25 :
* <h3 style="color:red"> This class subject to change without prior notice, Please dont use this class directly. </h3>
- 26 :
- 27 :
* Constructs a new CustomerAccountApi.
- 28 :
* @alias module:api/CustomerAccountApi
- 29 :
* @class
- 30 :
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
- 31 :
* default to {@link module:ApiClient#instance} if unspecified.
- 32 :
*/
- 33 :
var exports = function(apiClient) {
- 34 :
this.apiClient = apiClient || ApiClient.instance;
- 35 :
- 36 :
- 37 :
/**
- 38 :
* Callback function to receive the result of the getCustomerAccount operation.
- 39 :
* @callback module:api/CustomerAccountApi~getCustomerAccountCallback
- 40 :
* @param {String} error Error message, if any.
- 41 :
* @param {module:models/CustomerAccountResponse} data The data returned by the service call.
- 42 :
* @param {String} response The complete HTTP response.
- 43 :
*/
- 44 :
- 45 :
/**
- 46 :
* Get Customer Account
- 47 :
* The Get Customer Account API is used to retrieve the details of a customer account based on the id.
- 48 :
* @param {String} channel The channel through which the API is invoked.
- 49 :
* @param {String} client_key The unique identifier assigned by EBPP to the client.
- 50 :
* @param {module:models/String} product The product identifier corresponding to the API.
- 51 :
* @param {String} timestamp The timestamp for the moment when the API request is created.
- 52 :
* @param {String} idempotent_request_key The unique token that clients can generate and maintain in order to identify an API request.
- 53 :
* @param {module:models/String} requestor_type Type of the requestor of the API.
- 54 :
* @param {String} id_customer_account The unique identifier assigned by EBPP to the Customer Account.
- 55 :
* @param {String} id_customer The unique identifier assigned by EBPP to the customer.
- 56 :
* @param {Object} opts Optional parameters
- 57 :
* @param {String} opts.requestor The identifier for the requestor of the API. If the requestor_type is <b>system</b>, requestor is optional.
- 58 :
* @param {String} opts.x_opay_headers Intended for the future use.
- 59 :
* @param {module:api/CustomerAccountApi~getCustomerAccountCallback} callback The callback function, accepting three arguments: error, data, response
- 60 :
* data is of type: {@link module:models/CustomerAccountResponse}
- 61 :
*/
- 62 :
this.getCustomerAccount = function(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, id_customer_account, id_customer, opts, callback) {
- 63 :
opts = opts || {};
- 64 :
var postBody = null;
- 65 :
- 66 :
var pathParams = {
- 67 :
'ID_CUSTOMER_ACCOUNT': id_customer_account,
- 68 :
'ID_CUSTOMER': id_customer
- 69 :
};
- 70 :
var queryParams = {
- 71 :
};
- 72 :
var headerParams = {
- 73 :
'channel': channel,
- 74 :
'client_key': client_key,
- 75 :
'product': product,
- 76 :
'timestamp': timestamp,
- 77 :
'idempotent_request_key': idempotent_request_key,
- 78 :
'requestor_type': requestor_type,
- 79 :
'requestor': opts['requestor'],
- 80 :
'X-OPAY-Headers': opts['x_opay_headers']
- 81 :
};
- 82 :
var formParams = {
- 83 :
};
- 84 :
- 85 :
var authNames = [];
- 86 :
var contentTypes = [];
- 87 :
var accepts = ['application/json'];
- 88 :
var returnType = CustomerAccountResponse;
- 89 :
- 90 :
return this.apiClient.callApi(
- 91 :
'/customers/{ID_CUSTOMER}/customeraccounts/{ID_CUSTOMER_ACCOUNT}', 'GET',
- 92 :
pathParams, queryParams, headerParams, formParams, postBody,
- 93 :
authNames, contentTypes, accepts, returnType, callback
- 94 :
);
- 95 :
};
- 96 :
- 97 :
/**
- 98 :
* Callback function to receive the result of the renewCustomerAccount operation.
- 99 :
* @callback module:api/CustomerAccountApi~renewCustomerAccountCallback
- 100 :
* @param {String} error Error message, if any.
- 101 :
* @param {module:models/CustomerAccountResponse} data The data returned by the service call.
- 102 :
* @param {String} response The complete HTTP response.
- 103 :
*/
- 104 :
- 105 :
/**
- 106 :
* Renew Customer Account
- 107 :
* This API is used to renew a customer account. The API migrates all the pending payments and active payment setups from the original customer account to the new one.
- 108 :
* @param {String} channel The channel through which the API is invoked.
- 109 :
* @param {String} client_key The unique identifier assigned by EBPP to the client.
- 110 :
* @param {module:models/String} product The product identifier corresponding to the API.
- 111 :
* @param {String} timestamp The timestamp for the moment when the API request is created.
- 112 :
* @param {String} idempotent_request_key The unique token that clients can generate and maintain in order to identify an API request.
- 113 :
* @param {module:models/String} requestor_type Type of the requestor of the API.
- 114 :
* @param {String} id_customer_account The unique identifier assigned by EBPP to the Customer Account.
- 115 :
* @param {String} id_customer The unique identifier assigned by EBPP to the customer.
- 116 :
* @param {module:models/RenewCustomerAccountRequest} renew_customer_account_request JSON containing all the attributes of the Customer account to be renewed.
- 117 :
* @param {Object} opts Optional parameters
- 118 :
* @param {String} opts.requestor The identifier for the requestor of the API. If the requestor_type is <b>system</b>, requestor is optional.
- 119 :
* @param {String} opts.x_opay_headers Intended for the future use.
- 120 :
* @param {module:api/CustomerAccountApi~renewCustomerAccountCallback} callback The callback function, accepting three arguments: error, data, response
- 121 :
* data is of type: {@link module:models/CustomerAccountResponse}
- 122 :
*/
- 123 :
this.renewCustomerAccount = function(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, id_customer_account, id_customer, renew_customer_account_request, opts, callback) {
- 124 :
opts = opts || {};
- 125 :
var postBody = renew_customer_account_request;
- 126 :
- 127 :
var pathParams = {
- 128 :
'ID_CUSTOMER_ACCOUNT': id_customer_account,
- 129 :
'ID_CUSTOMER': id_customer
- 130 :
};
- 131 :
var queryParams = {
- 132 :
};
- 133 :
var headerParams = {
- 134 :
'channel': channel,
- 135 :
'client_key': client_key,
- 136 :
'product': product,
- 137 :
'timestamp': timestamp,
- 138 :
'idempotent_request_key': idempotent_request_key,
- 139 :
'requestor_type': requestor_type,
- 140 :
'requestor': opts['requestor'],
- 141 :
'X-OPAY-Headers': opts['x_opay_headers']
- 142 :
};
- 143 :
var formParams = {
- 144 :
};
- 145 :
- 146 :
var authNames = [];
- 147 :
var contentTypes = ['application/json'];
- 148 :
var accepts = ['application/json'];
- 149 :
var returnType = CustomerAccountResponse;
- 150 :
- 151 :
return this.apiClient.callApi(
- 152 :
'/customers/{ID_CUSTOMER}/customeraccounts/{ID_CUSTOMER_ACCOUNT}/renew', 'POST',
- 153 :
pathParams, queryParams, headerParams, formParams, postBody,
- 154 :
authNames, contentTypes, accepts, returnType, callback
- 155 :
);
- 156 :
};
- 157 :
- 158 :
/**
- 159 :
* Callback function to receive the result of the retrieveCustomerAccounts operation.
- 160 :
* @callback module:api/CustomerAccountApi~retrieveCustomerAccountsCallback
- 161 :
* @param {String} error Error message, if any.
- 162 :
* @param {module:models/CustomerAccountsResponse} data The data returned by the service call.
- 163 :
* @param {String} response The complete HTTP response.
- 164 :
*/
- 165 :
- 166 :
/**
- 167 :
* Retrieve Customer Accounts
- 168 :
* The API is used to retrieve all the customer accounts associated with a customer. The accounts can be filtered using the account number, status. The API responds with the first page of the list of customerAccounts matching the criteria.
- 169 :
* @param {String} channel The channel through which the API is invoked.
- 170 :
* @param {String} client_key The unique identifier assigned by EBPP to the client.
- 171 :
* @param {module:models/String} product The product identifier corresponding to the API.
- 172 :
* @param {String} timestamp The timestamp for the moment when the API request is created.
- 173 :
* @param {String} idempotent_request_key The unique token that clients can generate and maintain in order to identify an API request.
- 174 :
* @param {module:models/String} requestor_type Type of the requestor of the API.
- 175 :
* @param {String} id_customer The unique identifier assigned by EBPP to the customer.
- 176 :
* @param {Object} opts Optional parameters
- 177 :
* @param {String} opts.requestor The identifier for the requestor of the API. If the requestor_type is <b>system</b>, requestor is optional.
- 178 :
* @param {String} opts.x_opay_headers Intended for the future use.
- 179 :
* @param {String} opts.page_size The maximum number of objects returned in the query.
- 180 :
* @param {String} opts.account_number The Account Number to get details of.
- 181 :
* @param {Array.<module:models/String>} opts.status The status of the customer's account in EBPP. This can take multiple values in the format key=value1&key=value2....
- 182 :
* @param {module:api/CustomerAccountApi~retrieveCustomerAccountsCallback} callback The callback function, accepting three arguments: error, data, response
- 183 :
* data is of type: {@link module:models/CustomerAccountsResponse}
- 184 :
*/
- 185 :
this.retrieveCustomerAccounts = function(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, id_customer, opts, callback) {
- 186 :
opts = opts || {};
- 187 :
var postBody = null;
- 188 :
- 189 :
var pathParams = {
- 190 :
'ID_CUSTOMER': id_customer
- 191 :
};
- 192 :
var queryParams = {
- 193 :
'page_size': opts['page_size']
- 194 :
};
- 195 :
var headerParams = {
- 196 :
'channel': channel,
- 197 :
'client_key': client_key,
- 198 :
'product': product,
- 199 :
'timestamp': timestamp,
- 200 :
'idempotent_request_key': idempotent_request_key,
- 201 :
'requestor_type': requestor_type,
- 202 :
'requestor': opts['requestor'],
- 203 :
'X-OPAY-Headers': opts['x_opay_headers']
- 204 :
};
- 205 :
var formParams = {
- 206 :
'account_number': opts['account_number'],
- 207 :
'status': this.apiClient.buildCollectionParam(opts['status'], 'multi')
- 208 :
};
- 209 :
- 210 :
var authNames = [];
- 211 :
var contentTypes = ['application/x-www-form-urlencoded'];
- 212 :
var accepts = ['application/json'];
- 213 :
var returnType = CustomerAccountsResponse;
- 214 :
- 215 :
return this.apiClient.callApi(
- 216 :
'/customers/{ID_CUSTOMER}/customeraccounts/lists', 'POST',
- 217 :
pathParams, queryParams, headerParams, formParams, postBody,
- 218 :
authNames, contentTypes, accepts, returnType, callback
- 219 :
);
- 220 :
};
- 221 :
- 222 :
/**
- 223 :
* Callback function to receive the result of the retrieveCustomerAccountsPage operation.
- 224 :
* @callback module:api/CustomerAccountApi~retrieveCustomerAccountsPageCallback
- 225 :
* @param {String} error Error message, if any.
- 226 :
* @param {module:models/CustomerAccountsResponse} data The data returned by the service call.
- 227 :
* @param {String} response The complete HTTP response.
- 228 :
*/
- 229 :
- 230 :
/**
- 231 :
* Retrieve Customer Accounts Pagination
- 232 :
* This API is used to paginate through the list of customer Accounts returned in the Retrieve Customer Accounts API.
- 233 :
* @param {String} channel The channel through which the API is invoked.
- 234 :
* @param {String} client_key The unique identifier assigned by EBPP to the client.
- 235 :
* @param {module:models/String} product The product identifier corresponding to the API.
- 236 :
* @param {String} timestamp The timestamp for the moment when the API request is created.
- 237 :
* @param {String} idempotent_request_key The unique token that clients can generate and maintain in order to identify an API request.
- 238 :
* @param {module:models/String} requestor_type Type of the requestor of the API.
- 239 :
* @param {String} id_customer The unique identifier assigned by EBPP to the customer.
- 240 :
* @param {String} query_id query id of the Retrieve/Search Accounts lookup.
- 241 :
* @param {Object} opts Optional parameters
- 242 :
* @param {String} opts.requestor The identifier for the requestor of the API. If the requestor_type is <b>system</b>, requestor is optional.
- 243 :
* @param {String} opts.x_opay_headers Intended for the future use.
- 244 :
* @param {String} opts.page_size The maximum number of objects returned in the query.
- 245 :
* @param {String} opts.from_index To fetch the next set of objects that start after this object
- 246 :
* @param {String} opts.to_index To fetch the previous set of objects that end at this object
- 247 :
* @param {module:api/CustomerAccountApi~retrieveCustomerAccountsPageCallback} callback The callback function, accepting three arguments: error, data, response
- 248 :
* data is of type: {@link module:models/CustomerAccountsResponse}
- 249 :
*/
- 250 :
this.retrieveCustomerAccountsPage = function(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, id_customer, query_id, opts, callback) {
- 251 :
opts = opts || {};
- 252 :
var postBody = null;
- 253 :
- 254 :
var pathParams = {
- 255 :
'ID_CUSTOMER': id_customer
- 256 :
};
- 257 :
var queryParams = {
- 258 :
'page_size': opts['page_size'],
- 259 :
'query_id': query_id,
- 260 :
'from_index': opts['from_index'],
- 261 :
'to_index': opts['to_index']
- 262 :
};
- 263 :
var headerParams = {
- 264 :
'channel': channel,
- 265 :
'client_key': client_key,
- 266 :
'product': product,
- 267 :
'timestamp': timestamp,
- 268 :
'idempotent_request_key': idempotent_request_key,
- 269 :
'requestor_type': requestor_type,
- 270 :
'requestor': opts['requestor'],
- 271 :
'X-OPAY-Headers': opts['x_opay_headers']
- 272 :
};
- 273 :
var formParams = {
- 274 :
};
- 275 :
- 276 :
var authNames = [];
- 277 :
var contentTypes = [];
- 278 :
var accepts = ['application/json'];
- 279 :
var returnType = CustomerAccountsResponse;
- 280 :
- 281 :
return this.apiClient.callApi(
- 282 :
'/customers/{ID_CUSTOMER}/customeraccounts/lists', 'GET',
- 283 :
pathParams, queryParams, headerParams, formParams, postBody,
- 284 :
authNames, contentTypes, accepts, returnType, callback
- 285 :
);
- 286 :
};
- 287 :
};
- 288 :
- 289 :
return exports;
- 290 :
}));