(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient', 'models/CustomerAccountResponse', 'models/CustomerAccountsResponse', 'models/ErrorResponseVo', 'models/RenewCustomerAccountRequest'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('../models/CustomerAccountResponse'), require('../models/CustomerAccountsResponse'), require('../models/ErrorResponseVo'), require('../models/RenewCustomerAccountRequest'));
} else {
// Browser globals (root is window)
if (!root.OrbipayPaymentsapiClient) {
root.OrbipayPaymentsapiClient = {};
}
root.OrbipayPaymentsapiClient.CustomerAccountApi = factory(root.OrbipayPaymentsapiClient.ApiClient, root.OrbipayPaymentsapiClient.CustomerAccountResponse, root.OrbipayPaymentsapiClient.CustomerAccountsResponse, root.OrbipayPaymentsapiClient.ErrorResponseVo, root.OrbipayPaymentsapiClient.RenewCustomerAccountRequest);
}
}(this, function(ApiClient, CustomerAccountResponse, CustomerAccountsResponse, ErrorResponseVo, RenewCustomerAccountRequest) {
'use strict';
/**
* CustomerAccount service.
* @module api/CustomerAccountApi
*/
/**
* <h3 style="color:red"> This class subject to change without prior notice, Please dont use this class directly. </h3>
* Constructs a new CustomerAccountApi.
* @alias module:api/CustomerAccountApi
* @class
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
* default to {@link module:ApiClient#instance} if unspecified.
*/
var exports = function(apiClient) {
this.apiClient = apiClient || ApiClient.instance;
/**
* Callback function to receive the result of the getCustomerAccount operation.
* @callback module:api/CustomerAccountApi~getCustomerAccountCallback
* @param {String} error Error message, if any.
* @param {module:models/CustomerAccountResponse} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Get Customer Account
* The Get Customer Account API is used to retrieve the details of a customer account based on the id.
* @param {String} channel The channel through which the API is invoked.
* @param {String} client_key The unique identifier assigned by EBPP to the client.
* @param {module:models/String} product The product identifier corresponding to the API.
* @param {String} timestamp The timestamp for the moment when the API request is created.
* @param {String} idempotent_request_key The unique token that clients can generate and maintain in order to identify an API request.
* @param {module:models/String} requestor_type Type of the requestor of the API.
* @param {String} id_customer_account The unique identifier assigned by EBPP to the Customer Account.
* @param {String} id_customer The unique identifier assigned by EBPP to the customer.
* @param {Object} opts Optional parameters
* @param {String} opts.requestor The identifier for the requestor of the API. If the requestor_type is <b>system</b>, requestor is optional.
* @param {String} opts.x_opay_headers Intended for the future use.
* @param {module:api/CustomerAccountApi~getCustomerAccountCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:models/CustomerAccountResponse}
*/
this.getCustomerAccount = function(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, id_customer_account, id_customer, opts, callback) {
opts = opts || {};
var postBody = null;
var pathParams = {
'ID_CUSTOMER_ACCOUNT': id_customer_account,
'ID_CUSTOMER': id_customer
};
var queryParams = {
};
var headerParams = {
'channel': channel,
'client_key': client_key,
'product': product,
'timestamp': timestamp,
'idempotent_request_key': idempotent_request_key,
'requestor_type': requestor_type,
'requestor': opts['requestor'],
'X-OPAY-Headers': opts['x_opay_headers']
};
var formParams = {
};
var authNames = [];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = CustomerAccountResponse;
return this.apiClient.callApi(
'/customers/{ID_CUSTOMER}/customeraccounts/{ID_CUSTOMER_ACCOUNT}', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
};
/**
* Callback function to receive the result of the renewCustomerAccount operation.
* @callback module:api/CustomerAccountApi~renewCustomerAccountCallback
* @param {String} error Error message, if any.
* @param {module:models/CustomerAccountResponse} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Renew Customer Account
* 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.
* @param {String} channel The channel through which the API is invoked.
* @param {String} client_key The unique identifier assigned by EBPP to the client.
* @param {module:models/String} product The product identifier corresponding to the API.
* @param {String} timestamp The timestamp for the moment when the API request is created.
* @param {String} idempotent_request_key The unique token that clients can generate and maintain in order to identify an API request.
* @param {module:models/String} requestor_type Type of the requestor of the API.
* @param {String} id_customer_account The unique identifier assigned by EBPP to the Customer Account.
* @param {String} id_customer The unique identifier assigned by EBPP to the customer.
* @param {module:models/RenewCustomerAccountRequest} renew_customer_account_request JSON containing all the attributes of the Customer account to be renewed.
* @param {Object} opts Optional parameters
* @param {String} opts.requestor The identifier for the requestor of the API. If the requestor_type is <b>system</b>, requestor is optional.
* @param {String} opts.x_opay_headers Intended for the future use.
* @param {module:api/CustomerAccountApi~renewCustomerAccountCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:models/CustomerAccountResponse}
*/
this.renewCustomerAccount = function(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, id_customer_account, id_customer, renew_customer_account_request, opts, callback) {
opts = opts || {};
var postBody = renew_customer_account_request;
var pathParams = {
'ID_CUSTOMER_ACCOUNT': id_customer_account,
'ID_CUSTOMER': id_customer
};
var queryParams = {
};
var headerParams = {
'channel': channel,
'client_key': client_key,
'product': product,
'timestamp': timestamp,
'idempotent_request_key': idempotent_request_key,
'requestor_type': requestor_type,
'requestor': opts['requestor'],
'X-OPAY-Headers': opts['x_opay_headers']
};
var formParams = {
};
var authNames = [];
var contentTypes = ['application/json'];
var accepts = ['application/json'];
var returnType = CustomerAccountResponse;
return this.apiClient.callApi(
'/customers/{ID_CUSTOMER}/customeraccounts/{ID_CUSTOMER_ACCOUNT}/renew', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
};
/**
* Callback function to receive the result of the retrieveCustomerAccounts operation.
* @callback module:api/CustomerAccountApi~retrieveCustomerAccountsCallback
* @param {String} error Error message, if any.
* @param {module:models/CustomerAccountsResponse} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Retrieve Customer Accounts
* 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.
* @param {String} channel The channel through which the API is invoked.
* @param {String} client_key The unique identifier assigned by EBPP to the client.
* @param {module:models/String} product The product identifier corresponding to the API.
* @param {String} timestamp The timestamp for the moment when the API request is created.
* @param {String} idempotent_request_key The unique token that clients can generate and maintain in order to identify an API request.
* @param {module:models/String} requestor_type Type of the requestor of the API.
* @param {String} id_customer The unique identifier assigned by EBPP to the customer.
* @param {Object} opts Optional parameters
* @param {String} opts.requestor The identifier for the requestor of the API. If the requestor_type is <b>system</b>, requestor is optional.
* @param {String} opts.x_opay_headers Intended for the future use.
* @param {String} opts.page_size The maximum number of objects returned in the query.
* @param {String} opts.account_number The Account Number to get details of.
* @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....
* @param {module:api/CustomerAccountApi~retrieveCustomerAccountsCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:models/CustomerAccountsResponse}
*/
this.retrieveCustomerAccounts = function(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, id_customer, opts, callback) {
opts = opts || {};
var postBody = null;
var pathParams = {
'ID_CUSTOMER': id_customer
};
var queryParams = {
'page_size': opts['page_size']
};
var headerParams = {
'channel': channel,
'client_key': client_key,
'product': product,
'timestamp': timestamp,
'idempotent_request_key': idempotent_request_key,
'requestor_type': requestor_type,
'requestor': opts['requestor'],
'X-OPAY-Headers': opts['x_opay_headers']
};
var formParams = {
'account_number': opts['account_number'],
'status': this.apiClient.buildCollectionParam(opts['status'], 'multi')
};
var authNames = [];
var contentTypes = ['application/x-www-form-urlencoded'];
var accepts = ['application/json'];
var returnType = CustomerAccountsResponse;
return this.apiClient.callApi(
'/customers/{ID_CUSTOMER}/customeraccounts/lists', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
};
/**
* Callback function to receive the result of the retrieveCustomerAccountsPage operation.
* @callback module:api/CustomerAccountApi~retrieveCustomerAccountsPageCallback
* @param {String} error Error message, if any.
* @param {module:models/CustomerAccountsResponse} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Retrieve Customer Accounts Pagination
* This API is used to paginate through the list of customer Accounts returned in the Retrieve Customer Accounts API.
* @param {String} channel The channel through which the API is invoked.
* @param {String} client_key The unique identifier assigned by EBPP to the client.
* @param {module:models/String} product The product identifier corresponding to the API.
* @param {String} timestamp The timestamp for the moment when the API request is created.
* @param {String} idempotent_request_key The unique token that clients can generate and maintain in order to identify an API request.
* @param {module:models/String} requestor_type Type of the requestor of the API.
* @param {String} id_customer The unique identifier assigned by EBPP to the customer.
* @param {String} query_id query id of the Retrieve/Search Accounts lookup.
* @param {Object} opts Optional parameters
* @param {String} opts.requestor The identifier for the requestor of the API. If the requestor_type is <b>system</b>, requestor is optional.
* @param {String} opts.x_opay_headers Intended for the future use.
* @param {String} opts.page_size The maximum number of objects returned in the query.
* @param {String} opts.from_index To fetch the next set of objects that start after this object
* @param {String} opts.to_index To fetch the previous set of objects that end at this object
* @param {module:api/CustomerAccountApi~retrieveCustomerAccountsPageCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:models/CustomerAccountsResponse}
*/
this.retrieveCustomerAccountsPage = function(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, id_customer, query_id, opts, callback) {
opts = opts || {};
var postBody = null;
var pathParams = {
'ID_CUSTOMER': id_customer
};
var queryParams = {
'page_size': opts['page_size'],
'query_id': query_id,
'from_index': opts['from_index'],
'to_index': opts['to_index']
};
var headerParams = {
'channel': channel,
'client_key': client_key,
'product': product,
'timestamp': timestamp,
'idempotent_request_key': idempotent_request_key,
'requestor_type': requestor_type,
'requestor': opts['requestor'],
'X-OPAY-Headers': opts['x_opay_headers']
};
var formParams = {
};
var authNames = [];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = CustomerAccountsResponse;
return this.apiClient.callApi(
'/customers/{ID_CUSTOMER}/customeraccounts/lists', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
};
};
return exports;
}));