Class: OrbipayPaymentsapiClient::OrbipayPaymentsapiClientApis::CustomerApi

Inherits:
Object
  • Object
show all
Defined in:
lib/orbipay_paymentsapi_client/api/customer_api.rb

Overview

.

############################################################################################
## This class subject to change without prior notice, Please dont use this class directly.##
############################################################################################

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ CustomerApi

Returns a new instance of CustomerApi.



15
16
17
# File 'lib/orbipay_paymentsapi_client/api/customer_api.rb', line 15

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



13
14
15
# File 'lib/orbipay_paymentsapi_client/api/customer_api.rb', line 13

def api_client
  @api_client
end

Instance Method Details

#create_customer(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, create_customer_request, opts = {}) ⇒ [CustomerResponse, headers]

Create Customer The Create Customer API is used to register a customer with a biller in EBPP. It is also mandatory to create a customer account for the customer. So, at least one customer account should be provided in order to register a customer. There is no limit on the number of accounts that can be associated with the customer. Either first_name or last_name is required to create a customer.

Parameters:

  • channel

    The channel through which the API is invoked.

  • client_key

    The unique identifier assigned by EBPP to the client.

  • product

    The product identifier corresponding to the API.

  • timestamp

    The timestamp for the moment when the API request is created.

  • idempotent_request_key

    The unique token that clients can generate and maintain in order to identify an API request.

  • requestor_type

    Type of the requestor of the API.

  • create_customer_request

    The JSON that contains all the attributes of customer to be created.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :requestor (String)

    The identifier for the requestor of the API. If the requestor_type is <b>system</b>, requestor is optional.

  • :x_opay_headers (String)

    Intended for the future use.

  • :trace_id (String)

    The unique reference that can be used for tracing and debugging an API call.

Returns:

  • ([CustomerResponse, headers])


32
33
34
35
# File 'lib/orbipay_paymentsapi_client/api/customer_api.rb', line 32

def create_customer(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, create_customer_request, opts = {})
  data, _status_code, _headers = create_customer_with_http_info(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, create_customer_request, opts)
  [data, _status_code, _headers]
end

#create_customer_with_http_info(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, create_customer_request, opts = {}) ⇒ Array<(CustomerResponse, Fixnum, Hash)>

Create Customer The Create Customer API is used to register a customer with a biller in EBPP. It is also mandatory to create a customer account for the customer. So, at least one customer account should be provided in order to register a customer. There is no limit on the number of accounts that can be associated with the customer. Either first_name or last_name is required to create a customer.

Parameters:

  • channel

    The channel through which the API is invoked.

  • client_key

    The unique identifier assigned by EBPP to the client.

  • product

    The product identifier corresponding to the API.

  • timestamp

    The timestamp for the moment when the API request is created.

  • idempotent_request_key

    The unique token that clients can generate and maintain in order to identify an API request.

  • requestor_type

    Type of the requestor of the API.

  • create_customer_request

    The JSON that contains all the attributes of customer to be created.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :requestor (String)

    The identifier for the requestor of the API. If the requestor_type is &lt;b&gt;system&lt;/b&gt;, requestor is optional.

  • :x_opay_headers (String)

    Intended for the future use.

  • :trace_id (String)

    The unique reference that can be used for tracing and debugging an API call.

Returns:

  • (Array<(CustomerResponse, Fixnum, Hash)>)

    CustomerResponse data, response status code and response headers



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/orbipay_paymentsapi_client/api/customer_api.rb', line 51

def create_customer_with_http_info(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, create_customer_request, opts = {})

  # resource path
  local_var_path = '/customers'
  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params['channel'] = channel
  header_params['client_key'] = client_key
  header_params['product'] = product
  header_params['timestamp'] = timestamp
  header_params['idempotent_request_key'] = idempotent_request_key
  header_params['requestor_type'] = requestor_type
  header_params['requestor'] = opts[:'requestor'] if !opts[:'requestor'].nil?
  header_params['X-OPAY-Headers'] = opts[:'x_opay_headers'] if !opts[:'x_opay_headers'].nil?
  header_params['trace_id'] = opts[:'trace_id'] if !opts[:'trace_id'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(create_customer_request)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CustomerResponse')
  return data, status_code, headers
end

#get_customer(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, id_customer, opts = {}) ⇒ [CustomerResponse, headers]

Get Customer The Get Customer API is used to retrieve the details of the customer based on the id.

Parameters:

  • channel

    The channel through which the API is invoked.

  • client_key

    The unique identifier assigned by EBPP to the client.

  • product

    The product identifier corresponding to the API.

  • timestamp

    The timestamp for the moment when the API request is created.

  • idempotent_request_key

    The unique token that clients can generate and maintain in order to identify an API request.

  • requestor_type

    Type of the requestor of the API.

  • id_customer

    The unique identifier assigned by EBPP to the customer.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :requestor (String)

    The identifier for the requestor of the API. If the requestor_type is &lt;b&gt;system&lt;/b&gt;, requestor is optional.

  • :x_opay_headers (String)

    Intended for the future use.

  • :trace_id (String)

    The unique reference that can be used for tracing and debugging an API call.

Returns:

  • ([CustomerResponse, headers])


103
104
105
106
# File 'lib/orbipay_paymentsapi_client/api/customer_api.rb', line 103

def get_customer(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, id_customer, opts = {})
  data, _status_code, _headers = get_customer_with_http_info(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, id_customer, opts)
  [data, _status_code, _headers]
end

#get_customer_with_http_info(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, id_customer, opts = {}) ⇒ Array<(CustomerResponse, Fixnum, Hash)>

Get Customer The Get Customer API is used to retrieve the details of the customer based on the id.

Parameters:

  • channel

    The channel through which the API is invoked.

  • client_key

    The unique identifier assigned by EBPP to the client.

  • product

    The product identifier corresponding to the API.

  • timestamp

    The timestamp for the moment when the API request is created.

  • idempotent_request_key

    The unique token that clients can generate and maintain in order to identify an API request.

  • requestor_type

    Type of the requestor of the API.

  • id_customer

    The unique identifier assigned by EBPP to the customer.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :requestor (String)

    The identifier for the requestor of the API. If the requestor_type is &lt;b&gt;system&lt;/b&gt;, requestor is optional.

  • :x_opay_headers (String)

    Intended for the future use.

  • :trace_id (String)

    The unique reference that can be used for tracing and debugging an API call.

Returns:

  • (Array<(CustomerResponse, Fixnum, Hash)>)

    CustomerResponse data, response status code and response headers



122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/orbipay_paymentsapi_client/api/customer_api.rb', line 122

def get_customer_with_http_info(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, id_customer, opts = {})

  # resource path
  local_var_path = '/customers/{ID_CUSTOMER}'
  if  !id_customer.nil? && id_customer.to_s.strip != ""
  		local_var_path = local_var_path.sub('{' + 'ID_CUSTOMER' + '}', id_customer.to_s)
	  else
	fail ArgumentError, "Missing the required parameter 'id_customer' when calling CustomerApi.get_customer"
  end
  
  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params['channel'] = channel
  header_params['client_key'] = client_key
  header_params['product'] = product
  header_params['timestamp'] = timestamp
  header_params['idempotent_request_key'] = idempotent_request_key
  header_params['requestor_type'] = requestor_type
  header_params['requestor'] = opts[:'requestor'] if !opts[:'requestor'].nil?
  header_params['X-OPAY-Headers'] = opts[:'x_opay_headers'] if !opts[:'x_opay_headers'].nil?
  header_params['trace_id'] = opts[:'trace_id'] if !opts[:'trace_id'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CustomerResponse')
  return data, status_code, headers
end

#retrieve_customers(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, opts = {}) ⇒ [CustomersResponse, headers]

Retrieve Customers This API is used to retrieve/lookup customers from EBPP. Customers can be retrieved matching criteria that includes the customer_reference, the ssn, the email or the customer account number. A unique customer can be retrieved by using search criteria as per the customer uniqueness parameters opted by the client/biller. If the requestor_type is customer, the Retrieve Customers API will return an error if it cannot retrieve a unique customer.

Parameters:

  • channel

    The channel through which the API is invoked.

  • client_key

    The unique identifier assigned by EBPP to the client.

  • product

    The product identifier corresponding to the API.

  • timestamp

    The timestamp for the moment when the API request is created.

  • idempotent_request_key

    The unique token that clients can generate and maintain in order to identify an API request.

  • requestor_type

    Type of the requestor of the API.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :requestor (String)

    The identifier for the requestor of the API. If the requestor_type is &lt;b&gt;system&lt;/b&gt;, requestor is optional.

  • :x_opay_headers (String)

    Intended for the future use.

  • :trace_id (String)

    The unique reference that can be used for tracing and debugging an API call.

  • :page_size (String)

    The maximum number of objects returned in the query.

  • :customer_reference (String)

    Unique ID assigned by the biller/client system for a given customer.

  • :ssn (String)

    The SSN of the customer if the account holder is an individual or the tax ID, if the customer is a business.

  • :email (String)

    This field contains the customer’s email address within EBPP.

  • :account_number (String)

    Customer Account Number of the customer to get details of.

Returns:

  • ([CustomersResponse, headers])


182
183
184
185
# File 'lib/orbipay_paymentsapi_client/api/customer_api.rb', line 182

def retrieve_customers(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, opts = {})
  data, _status_code, _headers = retrieve_customers_with_http_info(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, opts)
  [data, _status_code, _headers]
end

#retrieve_customers_page(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, query_id, opts = {}) ⇒ [CustomersResponse, headers]

Retrieve Customers Pagination This API is used to paginate through the list of customers returned in the Retrieve Customers API.

Parameters:

  • channel

    The channel through which the API is invoked.

  • client_key

    The unique identifier assigned by EBPP to the client.

  • product

    The product identifier corresponding to the API.

  • timestamp

    The timestamp for the moment when the API request is created.

  • idempotent_request_key

    The unique token that clients can generate and maintain in order to identify an API request.

  • requestor_type

    Type of the requestor of the API.

  • query_id

    query id of the Retrieve/Search Customers lookup.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :requestor (String)

    The identifier for the requestor of the API. If the requestor_type is &lt;b&gt;system&lt;/b&gt;, requestor is optional.

  • :x_opay_headers (String)

    Intended for the future use.

  • :trace_id (String)

    The unique reference that can be used for tracing and debugging an API call.

  • :page_size (String)

    The maximum number of objects returned in the query.

  • :from_index (String)

    To fetch the next set of objects that start after this object

  • :to_index (String)

    To fetch the previous set of objects that end at this object

Returns:

  • ([CustomersResponse, headers])


267
268
269
270
# File 'lib/orbipay_paymentsapi_client/api/customer_api.rb', line 267

def retrieve_customers_page(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, query_id, opts = {})
  data, _status_code, _headers = retrieve_customers_page_with_http_info(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, query_id, opts)
  [data, _status_code, _headers]
end

#retrieve_customers_page_with_http_info(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, query_id, opts = {}) ⇒ Array<(CustomersResponse, Fixnum, Hash)>

Retrieve Customers Pagination This API is used to paginate through the list of customers returned in the Retrieve Customers API.

Parameters:

  • channel

    The channel through which the API is invoked.

  • client_key

    The unique identifier assigned by EBPP to the client.

  • product

    The product identifier corresponding to the API.

  • timestamp

    The timestamp for the moment when the API request is created.

  • idempotent_request_key

    The unique token that clients can generate and maintain in order to identify an API request.

  • requestor_type

    Type of the requestor of the API.

  • query_id

    query id of the Retrieve/Search Customers lookup.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :requestor (String)

    The identifier for the requestor of the API. If the requestor_type is &lt;b&gt;system&lt;/b&gt;, requestor is optional.

  • :x_opay_headers (String)

    Intended for the future use.

  • :trace_id (String)

    The unique reference that can be used for tracing and debugging an API call.

  • :page_size (String)

    The maximum number of objects returned in the query.

  • :from_index (String)

    To fetch the next set of objects that start after this object

  • :to_index (String)

    To fetch the previous set of objects that end at this object

Returns:

  • (Array<(CustomersResponse, Fixnum, Hash)>)

    CustomersResponse data, response status code and response headers



289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
# File 'lib/orbipay_paymentsapi_client/api/customer_api.rb', line 289

def retrieve_customers_page_with_http_info(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, query_id, opts = {})

  # resource path
  local_var_path = '/customers/lists'
  # query parameters
  query_params = {}
  if  !query_id.nil? && query_id.to_s.strip != "" 
      query_params[:'query_id'] = query_id
  end
  if !opts[:'page_size'].nil? && opts[:'page_size'].to_s.strip != "" 
      query_params[:'page_size'] = opts[:'page_size']
  end
  if !opts[:'from_index'].nil? && opts[:'from_index'].to_s.strip != "" 
      query_params[:'from_index'] = opts[:'from_index']
  end
  if !opts[:'to_index'].nil? && opts[:'to_index'].to_s.strip != "" 
      query_params[:'to_index'] = opts[:'to_index']
  end

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params['channel'] = channel
  header_params['client_key'] = client_key
  header_params['product'] = product
  header_params['timestamp'] = timestamp
  header_params['idempotent_request_key'] = idempotent_request_key
  header_params['requestor_type'] = requestor_type
  header_params['requestor'] = opts[:'requestor'] if !opts[:'requestor'].nil?
  header_params['X-OPAY-Headers'] = opts[:'x_opay_headers'] if !opts[:'x_opay_headers'].nil?
  header_params['trace_id'] = opts[:'trace_id'] if !opts[:'trace_id'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CustomersResponse')
  return data, status_code, headers
end

#retrieve_customers_with_http_info(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, opts = {}) ⇒ Array<(CustomersResponse, Fixnum, Hash)>

Retrieve Customers This API is used to retrieve/lookup customers from EBPP. Customers can be retrieved matching criteria that includes the customer_reference, the ssn, the email or the customer account number. A unique customer can be retrieved by using search criteria as per the customer uniqueness parameters opted by the client/biller. If the requestor_type is customer, the Retrieve Customers API will return an error if it cannot retrieve a unique customer.

Parameters:

  • channel

    The channel through which the API is invoked.

  • client_key

    The unique identifier assigned by EBPP to the client.

  • product

    The product identifier corresponding to the API.

  • timestamp

    The timestamp for the moment when the API request is created.

  • idempotent_request_key

    The unique token that clients can generate and maintain in order to identify an API request.

  • requestor_type

    Type of the requestor of the API.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :requestor (String)

    The identifier for the requestor of the API. If the requestor_type is &lt;b&gt;system&lt;/b&gt;, requestor is optional.

  • :x_opay_headers (String)

    Intended for the future use.

  • :trace_id (String)

    The unique reference that can be used for tracing and debugging an API call.

  • :page_size (String)

    The maximum number of objects returned in the query.

  • :customer_reference (String)

    Unique ID assigned by the biller/client system for a given customer.

  • :ssn (String)

    The SSN of the customer if the account holder is an individual or the tax ID, if the customer is a business.

  • :email (String)

    This field contains the customer’s email address within EBPP.

  • :account_number (String)

    Customer Account Number of the customer to get details of.

Returns:

  • (Array<(CustomersResponse, Fixnum, Hash)>)

    CustomersResponse data, response status code and response headers



205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
# File 'lib/orbipay_paymentsapi_client/api/customer_api.rb', line 205

def retrieve_customers_with_http_info(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, opts = {})

  # resource path
  local_var_path = '/customers/lists'
  # query parameters
  query_params = {}
  if !opts[:'page_size'].nil? && opts[:'page_size'].to_s.strip != "" 
      query_params[:'page_size'] = opts[:'page_size']
  end

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
  header_params['channel'] = channel
  header_params['client_key'] = client_key
  header_params['product'] = product
  header_params['timestamp'] = timestamp
  header_params['idempotent_request_key'] = idempotent_request_key
  header_params['requestor_type'] = requestor_type
  header_params['requestor'] = opts[:'requestor'] if !opts[:'requestor'].nil?
  header_params['X-OPAY-Headers'] = opts[:'x_opay_headers'] if !opts[:'x_opay_headers'].nil?
  header_params['trace_id'] = opts[:'trace_id'] if !opts[:'trace_id'].nil?

  # form parameters
  form_params = {}
  form_params['customer_reference'] = opts[:'customer_reference'] if !opts[:'customer_reference'].nil?
  form_params['ssn'] = opts[:'ssn'] if !opts[:'ssn'].nil?
  form_params['email'] = opts[:'email'] if !opts[:'email'].nil?
  form_params['account_number'] = opts[:'account_number'] if !opts[:'account_number'].nil?

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CustomersResponse')
  return data, status_code, headers
end

#update_customer(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, id_customer, update_customer_request, opts = {}) ⇒ [CustomerResponse, headers]

Update Customer The Update Customer API is used to edit the customer''s personal details, accounts or the customer''s status. Only the information being updated needs to be sent in the request, along with the id of the customer being updated. A customer can also be associated with new customer accounts using the API.
Along with Customer details , Customer and Customer Account statuses also can be updated using the Update Customer API. Below are the possible customer state transformations. | from_status | to_status | allowed requestor_type | | ———— | ———— | ———— | | active | suspended| <ul> <li>external_user</li> <li> client_agent</li> <li> system</li></ul> | | active | revoked | <ul> <li>external_user</li> <li> client_agent</li> <li> system</li></ul> </ul> | | suspended | active | <ul> <li>external_user</li> <li> client_agent</li> <li> system</li></ul> </ul> | | suspended | revoked | <ul> <li>external_user</li> <li> client_agent</li> <li> system</li></ul> </ul> | | revoked | active | <ul> <li>external_user</li> <li> client_agent</li></ul> </ul> | Below are the possible customer account state transformation. | from_status | to_status | allowed requestor_type | | ———— | ———— | ———— | | active | inactive| <ul> <li>external_user</li> <li> client_agent</li> <li> system</li></ul> | | inactive | active | <ul> <li>external_user</li> <li> client_agent</li> <li> system</li></ul> </ul> |

Parameters:

  • channel

    The channel through which the API is invoked.

  • client_key

    The unique identifier assigned by EBPP to the client.

  • product

    The product identifier corresponding to the API.

  • timestamp

    The timestamp for the moment when the API request is created.

  • idempotent_request_key

    The unique token that clients can generate and maintain in order to identify an API request.

  • requestor_type

    Type of the requestor of the API.

  • id_customer

    The unique identifier assigned by EBPP to the customer.

  • update_customer_request

    JSON containing all the attributes of the customer to be updated.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :requestor (String)

    The identifier for the requestor of the API. If the requestor_type is &lt;b&gt;system&lt;/b&gt;, requestor is optional.

  • :x_opay_headers (String)

    Intended for the future use.

  • :trace_id (String)

    The unique reference that can be used for tracing and debugging an API call.

Returns:

  • ([CustomerResponse, headers])


352
353
354
355
# File 'lib/orbipay_paymentsapi_client/api/customer_api.rb', line 352

def update_customer(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, id_customer, update_customer_request, opts = {})
  data, _status_code, _headers = update_customer_with_http_info(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, id_customer, update_customer_request, opts)
  [data, _status_code, _headers]
end

#update_customer_with_http_info(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, id_customer, update_customer_request, opts = {}) ⇒ Array<(CustomerResponse, Fixnum, Hash)>

Update Customer The Update Customer API is used to edit the customer&#39;&#39;s personal details, accounts or the customer&#39;&#39;s status. Only the information being updated needs to be sent in the request, along with the id of the customer being updated. A customer can also be associated with new customer accounts using the API. &lt;br&gt;&lt;br&gt; Along with Customer details , Customer and Customer Account statuses also can be updated using the Update Customer API. Below are the possible customer state transformations. | from_status | to_status | allowed requestor_type | | ———— | ———— | ———— | | active | suspended| &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 | revoked | &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; &lt;/ul&gt; | | suspended | 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; &lt;/ul&gt; | | suspended | revoked | &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; &lt;/ul&gt; | | revoked | active | &lt;ul&gt; &lt;li&gt;external_user&lt;/li&gt; &lt;li&gt; client_agent&lt;/li&gt;&lt;/ul&gt; &lt;/ul&gt; | Below are the possible customer account state transformation. | from_status | to_status | allowed requestor_type | | ———— | ———— | ———— | | 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; | | 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; &lt;/ul&gt; |

Parameters:

  • channel

    The channel through which the API is invoked.

  • client_key

    The unique identifier assigned by EBPP to the client.

  • product

    The product identifier corresponding to the API.

  • timestamp

    The timestamp for the moment when the API request is created.

  • idempotent_request_key

    The unique token that clients can generate and maintain in order to identify an API request.

  • requestor_type

    Type of the requestor of the API.

  • id_customer

    The unique identifier assigned by EBPP to the customer.

  • update_customer_request

    JSON containing all the attributes of the customer to be updated.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :requestor (String)

    The identifier for the requestor of the API. If the requestor_type is &lt;b&gt;system&lt;/b&gt;, requestor is optional.

  • :x_opay_headers (String)

    Intended for the future use.

  • :trace_id (String)

    The unique reference that can be used for tracing and debugging an API call.

Returns:

  • (Array<(CustomerResponse, Fixnum, Hash)>)

    CustomerResponse data, response status code and response headers



372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
# File 'lib/orbipay_paymentsapi_client/api/customer_api.rb', line 372

def update_customer_with_http_info(channel, client_key, product, timestamp, idempotent_request_key, requestor_type, id_customer, update_customer_request, opts = {})

  # resource path
  local_var_path = '/customers/{ID_CUSTOMER}'
  if  !id_customer.nil? && id_customer.to_s.strip != ""
  		local_var_path = local_var_path.sub('{' + 'ID_CUSTOMER' + '}', id_customer.to_s)
	  else
	fail ArgumentError, "Missing the required parameter 'id_customer' when calling CustomerApi.update_customer"
  end
  
  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params['channel'] = channel
  header_params['client_key'] = client_key
  header_params['product'] = product
  header_params['timestamp'] = timestamp
  header_params['idempotent_request_key'] = idempotent_request_key
  header_params['requestor_type'] = requestor_type
  header_params['requestor'] = opts[:'requestor'] if !opts[:'requestor'].nil?
  header_params['X-OPAY-Headers'] = opts[:'x_opay_headers'] if !opts[:'x_opay_headers'].nil?
  header_params['trace_id'] = opts[:'trace_id'] if !opts[:'trace_id'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(update_customer_request)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'CustomerResponse')
  return data, status_code, headers
end