class SezzleClient::CustomerApi
Attributes
Public Class Methods
# File lib/sezzle_client/api/customer_api.rb, line 16 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Delete customer @param customer_uuid Customer
UUID @param [Hash] opts the optional parameters @return [nil]
# File lib/sezzle_client/api/customer_api.rb, line 23 def delete_v2_token(customer_uuid, opts = {}) delete_v2_token_with_http_info(customer_uuid, opts) nil end
Delete customer @param customer_uuid Customer
UUID @param [Hash] opts the optional parameters @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
# File lib/sezzle_client/api/customer_api.rb, line 32 def delete_v2_token_with_http_info(customer_uuid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CustomerApi.delete_v2_token ...' end # verify the required parameter 'customer_uuid' is set if @api_client.config.client_side_validation && customer_uuid.nil? fail ArgumentError, "Missing the required parameter 'customer_uuid' when calling CustomerApi.delete_v2_token" end # resource path local_var_path = '/customer/{customer_uuid}'.sub('{' + 'customer_uuid' + '}', customer_uuid.to_s) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] return_type = opts[:return_type] auth_names = opts[:auth_names] || ['Bearer'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type) if @api_client.config.debugging @api_client.config.logger.debug "API called: CustomerApi#delete_v2_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get customer @param customer_uuid Customer
UUID @param [Hash] opts the optional parameters @return [InlineResponse2003]
# File lib/sezzle_client/api/customer_api.rb, line 77 def get_v2_customer(customer_uuid, opts = {}) data, _status_code, _headers = get_v2_customer_with_http_info(customer_uuid, opts) data end
Get list of customers @param [Hash] opts the optional parameters @return [Array<InlineResponse2002>]
# File lib/sezzle_client/api/customer_api.rb, line 130 def get_v2_customer_list(opts = {}) data, _status_code, _headers = get_v2_customer_list_with_http_info(opts) data end
Get list of customers @param [Hash] opts the optional parameters @return [Array<(Array<InlineResponse2002>, Integer, Hash)>] Array<InlineResponse2002> data, response status code and response headers
# File lib/sezzle_client/api/customer_api.rb, line 138 def get_v2_customer_list_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CustomerApi.get_v2_customer_list ...' end # resource path local_var_path = '/customer' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] return_type = opts[:return_type] || 'Array<InlineResponse2002>' auth_names = opts[:auth_names] || ['Bearer'] 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 => return_type) if @api_client.config.debugging @api_client.config.logger.debug "API called: CustomerApi#get_v2_customer_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get customer @param customer_uuid Customer
UUID @param [Hash] opts the optional parameters @return [Array<(InlineResponse2003
, Integer, Hash)>] InlineResponse2003
data, response status code and response headers
# File lib/sezzle_client/api/customer_api.rb, line 86 def get_v2_customer_with_http_info(customer_uuid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CustomerApi.get_v2_customer ...' end # verify the required parameter 'customer_uuid' is set if @api_client.config.client_side_validation && customer_uuid.nil? fail ArgumentError, "Missing the required parameter 'customer_uuid' when calling CustomerApi.get_v2_customer" end # resource path local_var_path = '/customer/{customer_uuid}'.sub('{' + 'customer_uuid' + '}', customer_uuid.to_s) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] return_type = opts[:return_type] || 'InlineResponse2003' auth_names = opts[:auth_names] || ['Bearer'] 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 => return_type) if @api_client.config.debugging @api_client.config.logger.debug "API called: CustomerApi#get_v2_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Create order by customer @param customer_uuid Customer
UUID @param [Hash] opts the optional parameters @option opts [Body2] :body Order
request @option opts [String] :sezzle_request_id Unique client-generated ID to enforce idempotency @return [InlineResponse2005]
# File lib/sezzle_client/api/customer_api.rb, line 181 def post_v2_customer_order(customer_uuid, opts = {}) data, _status_code, _headers = post_v2_customer_order_with_http_info(customer_uuid, opts) data end
Create order by customer @param customer_uuid Customer
UUID @param [Hash] opts the optional parameters @option opts [Body2] :body Order
request @option opts [String] :sezzle_request_id Unique client-generated ID to enforce idempotency @return [Array<(InlineResponse2005
, Integer, Hash)>] InlineResponse2005
data, response status code and response headers
# File lib/sezzle_client/api/customer_api.rb, line 192 def post_v2_customer_order_with_http_info(customer_uuid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CustomerApi.post_v2_customer_order ...' end # verify the required parameter 'customer_uuid' is set if @api_client.config.client_side_validation && customer_uuid.nil? fail ArgumentError, "Missing the required parameter 'customer_uuid' when calling CustomerApi.post_v2_customer_order" end # resource path local_var_path = '/customer/{customer_uuid}/order'.sub('{' + 'customer_uuid' + '}', customer_uuid.to_s) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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[:'Sezzle-Request-Id'] = opts[:'sezzle_request_id'] if !opts[:'sezzle_request_id'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body']) return_type = opts[:return_type] || 'InlineResponse2005' auth_names = opts[:auth_names] || ['Bearer'] 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 => return_type) if @api_client.config.debugging @api_client.config.logger.debug "API called: CustomerApi#post_v2_customer_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Preapprove amount by customer @param customer_uuid Customer
UUID @param [Hash] opts the optional parameters @option opts [Price] :body Preapproval request @return [InlineResponse2004]
# File lib/sezzle_client/api/customer_api.rb, line 241 def preapprove_v2_token(customer_uuid, opts = {}) data, _status_code, _headers = preapprove_v2_token_with_http_info(customer_uuid, opts) data end
Preapprove amount by customer @param customer_uuid Customer
UUID @param [Hash] opts the optional parameters @option opts [Price] :body Preapproval request @return [Array<(InlineResponse2004
, Integer, Hash)>] InlineResponse2004
data, response status code and response headers
# File lib/sezzle_client/api/customer_api.rb, line 251 def preapprove_v2_token_with_http_info(customer_uuid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CustomerApi.preapprove_v2_token ...' end # verify the required parameter 'customer_uuid' is set if @api_client.config.client_side_validation && customer_uuid.nil? fail ArgumentError, "Missing the required parameter 'customer_uuid' when calling CustomerApi.preapprove_v2_token" end # resource path local_var_path = '/customer/{customer_uuid}/preapprove'.sub('{' + 'customer_uuid' + '}', customer_uuid.to_s) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[: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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body']) return_type = opts[:return_type] || 'InlineResponse2004' auth_names = opts[:auth_names] || ['Bearer'] 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 => return_type) if @api_client.config.debugging @api_client.config.logger.debug "API called: CustomerApi#preapprove_v2_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end