Class: OrbipayPaymentsapiClient::OrbipayPaymentsapiClientHandlers::RetrieveCustomersHandler
- Inherits:
-
Base
- Object
- Base
- OrbipayPaymentsapiClient::OrbipayPaymentsapiClientHandlers::RetrieveCustomersHandler
- Defined in:
- lib/orbipay_paymentsapi_client/handlers/retrieve_customers_handler.rb
Overview
.
############################################################################################
## This class subject to change without prior notice, Please dont use this class directly.##
############################################################################################
Instance Attribute Summary
Attributes inherited from Base
#api_end_point, #http_status_code, #invocation_context, #live_mode
Instance Method Summary collapse
- #process(customers) ⇒ Object
- #wrap_response_body(customers_response) ⇒ Object
- #wrap_response_headers(headers) ⇒ Object
Methods inherited from Base
attribute_map, #for_client, #initialize, #requested_by, #set_api_end_point, #set_values, swagger_types, #vide_channel, #with_context
Constructor Details
This class inherits a constructor from OrbipayPaymentsapiClient::Base
Instance Method Details
#process(customers) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/orbipay_paymentsapi_client/handlers/retrieve_customers_handler.rb', line 13 def process(customers) configuration = Configuration::Configuration.new if customers.invocation_context.secret != nil configuration.set_values(secret: customers.invocation_context.secret) end if customers.invocation_context.api_key != nil configuration.set_values(client_api_key: customers.invocation_context.api_key) end if customers.invocation_context.auth_scheme != nil configuration.set_values(algorithm: customers.invocation_context.auth_scheme) end configuration.set_values(api_end_point: customers.api_end_point) if customers.invocation_context.idempotent_request_key != nil configuration.logger.info "Idempotent Request Key: #{ customers.invocation_context.idempotent_request_key}" end api_client = ApiClient::ApiClient.new(configuration) api_instance = OrbipayPaymentsapiClientApis::CustomerApi.new(api_client) channel = customers.invocation_context.channel client_key = customers.invocation_context.client_key product = customers.invocation_context.product if customers.invocation_context. != nil = customers.invocation_context. else = CommonUtil::CommonUtil.time_stamp end idempotent_request_key = customers.invocation_context.idempotent_request_key requestor_type = customers.invocation_context.requestor_type requestor = customers.invocation_context.requestor x_opay_headers = customers.invocation_context.x_opay_headers page_size = customers.page_size customer_reference = customers.customer_reference ssn = customers.ssn email = customers.email account_number = customers.account_number opts = { requestor: requestor, x_opay_headers: x_opay_headers, page_size: page_size, customer_reference: customer_reference, ssn: ssn, email: email, account_number: account_number, } data, http_status_code, headers = api_instance.retrieve_customers(channel, client_key, product, , idempotent_request_key, requestor_type, opts) response = wrap_response_body(data) if response == nil response = Customers.new end response.set_values(invocation_context: wrap_response_headers(headers)) response.set_values(http_status_code: http_status_code) response end |
#wrap_response_body(customers_response) ⇒ Object
68 69 70 71 |
# File 'lib/orbipay_paymentsapi_client/handlers/retrieve_customers_handler.rb', line 68 def wrap_response_body(customers_response) customers_json_object = CommonUtil::CommonUtil.object_to_http_body(customers_response) CommonUtil::CommonUtil.deserialize(customers_json_object,"Customers") end |
#wrap_response_headers(headers) ⇒ Object
73 74 75 76 |
# File 'lib/orbipay_paymentsapi_client/handlers/retrieve_customers_handler.rb', line 73 def wrap_response_headers(headers) headers_json_object = CommonUtil::CommonUtil.object_to_http_body(headers) CommonUtil::CommonUtil.deserialize(headers_json_object,"InvocationContext") end |