Class: ZipMoney::CheckoutsApi
- Inherits:
-
Object
- Object
- ZipMoney::CheckoutsApi
- Defined in:
- lib/zip_money/api/checkouts_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#checkouts_create(opts = {}) ⇒ Checkout
Create a checkout Creates a zipMoney checkout.
-
#checkouts_create_with_http_info(opts = {}) ⇒ Array<(Checkout, Fixnum, Hash)>
Create a checkout Creates a zipMoney checkout.
-
#checkouts_get(id, opts = {}) ⇒ Checkout
Retrieve a checkout Retrieves a previously created checkout by id.
-
#checkouts_get_with_http_info(id, opts = {}) ⇒ Array<(Checkout, Fixnum, Hash)>
Retrieve a checkout Retrieves a previously created checkout by id.
-
#initialize(api_client = ApiClient.default) ⇒ CheckoutsApi
constructor
A new instance of CheckoutsApi.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ CheckoutsApi
Returns a new instance of CheckoutsApi.
12 13 14 |
# File 'lib/zip_money/api/checkouts_api.rb', line 12 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
10 11 12 |
# File 'lib/zip_money/api/checkouts_api.rb', line 10 def api_client @api_client end |
Instance Method Details
#checkouts_create(opts = {}) ⇒ Checkout
Create a checkout Creates a zipMoney checkout. During the checkout process a customer can apply for credit decisioning in real-time. This means the checkout needs to represent a good picture of known customer details along with order information and the checkout entity represents this as a resource. For more information on how to checkout with zipMoney see the #model:Z2QcrzRGHACY8wM6G guide.
21 22 23 24 |
# File 'lib/zip_money/api/checkouts_api.rb', line 21 def checkouts_create(opts = {}) data, _status_code, _headers = checkouts_create_with_http_info(opts) return data end |
#checkouts_create_with_http_info(opts = {}) ⇒ Array<(Checkout, Fixnum, Hash)>
Create a checkout Creates a zipMoney checkout. During the checkout process a customer can apply for credit decisioning in real-time. This means the checkout needs to represent a good picture of known customer details along with order information and the checkout entity represents this as a resource. For more information on how to checkout with zipMoney see the #model:Z2QcrzRGHACY8wM6G guide.
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 |
# File 'lib/zip_money/api/checkouts_api.rb', line 31 def checkouts_create_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CheckoutsApi.checkouts_create ..." end # resource path local_var_path = "/checkouts".sub('{format}','json') # 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']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['Authorization'] 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 => 'Checkout') if @api_client.config.debugging @api_client.config.logger.debug "API called: CheckoutsApi#checkouts_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#checkouts_get(id, opts = {}) ⇒ Checkout
Retrieve a checkout Retrieves a previously created checkout by id.
72 73 74 75 |
# File 'lib/zip_money/api/checkouts_api.rb', line 72 def checkouts_get(id, opts = {}) data, _status_code, _headers = checkouts_get_with_http_info(id, opts) return data end |
#checkouts_get_with_http_info(id, opts = {}) ⇒ Array<(Checkout, Fixnum, Hash)>
Retrieve a checkout Retrieves a previously created checkout by id.
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/zip_money/api/checkouts_api.rb', line 82 def checkouts_get_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: CheckoutsApi.checkouts_get ..." end # verify the required parameter 'id' is set fail ArgumentError, "Missing the required parameter 'id' when calling CheckoutsApi.checkouts_get" if id.nil? # resource path local_var_path = "/checkouts/{id}".sub('{format}','json').sub('{' + 'id' + '}', id.to_s) # 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']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['Authorization'] 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 => 'Checkout') if @api_client.config.debugging @api_client.config.logger.debug "API called: CheckoutsApi#checkouts_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |