sezzle_client 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +611 -0
- data/Rakefile +8 -0
- data/docs/Address.md +14 -0
- data/docs/AllOfSessionCustomer.md +13 -0
- data/docs/AllOfSessionOrder.md +18 -0
- data/docs/Authorization.md +14 -0
- data/docs/BearerAuthenticationApi.md +52 -0
- data/docs/Body.md +8 -0
- data/docs/Body1.md +7 -0
- data/docs/Body2.md +6 -0
- data/docs/Body3.md +8 -0
- data/docs/Body4.md +8 -0
- data/docs/Capture.md +8 -0
- data/docs/Customer.md +13 -0
- data/docs/CustomerApi.md +269 -0
- data/docs/Discount.md +8 -0
- data/docs/Error.md +6 -0
- data/docs/ErrorInner.md +10 -0
- data/docs/InlineResponse200.md +10 -0
- data/docs/InlineResponse2001.md +15 -0
- data/docs/InlineResponse2002.md +9 -0
- data/docs/InlineResponse2003.md +15 -0
- data/docs/InlineResponse2004.md +8 -0
- data/docs/InlineResponse2005.md +12 -0
- data/docs/InlineResponse2006.md +7 -0
- data/docs/InlineResponse2007.md +14 -0
- data/docs/InlineResponse2008.md +8 -0
- data/docs/InlineResponse2009.md +7 -0
- data/docs/InlineResponse200Order.md +10 -0
- data/docs/InlineResponse201.md +9 -0
- data/docs/InlineResponse2011.md +10 -0
- data/docs/InlineResponse2011Order.md +9 -0
- data/docs/InlineResponse2011Tokenize.md +10 -0
- data/docs/InstallmentPlan.md +6 -0
- data/docs/Intent.md +6 -0
- data/docs/LineItem.md +10 -0
- data/docs/Link.md +9 -0
- data/docs/Notification.md +9 -0
- data/docs/Order.md +15 -0
- data/docs/OrderApi.md +391 -0
- data/docs/OrderAuthorization.md +12 -0
- data/docs/Payout.md +6 -0
- data/docs/PayoutInner.md +12 -0
- data/docs/Price.md +8 -0
- data/docs/Refund.md +8 -0
- data/docs/ReportsApi.md +230 -0
- data/docs/Session.md +10 -0
- data/docs/SessionApi.md +113 -0
- data/docs/SessionCancelUrl.md +8 -0
- data/docs/SessionStatus.md +8 -0
- data/docs/Token.md +10 -0
- data/docs/TokenApi.md +110 -0
- data/docs/Webhook.md +8 -0
- data/docs/WebhooksApi.md +157 -0
- data/git_push.sh +55 -0
- data/lib/sezzle_client.rb +90 -0
- data/lib/sezzle_client/api/bearer_authentication_api.rb +76 -0
- data/lib/sezzle_client/api/customer_api.rb +295 -0
- data/lib/sezzle_client/api/order_api.rb +430 -0
- data/lib/sezzle_client/api/reports_api.rb +253 -0
- data/lib/sezzle_client/api/session_api.rb +132 -0
- data/lib/sezzle_client/api/token_api.rb +126 -0
- data/lib/sezzle_client/api/webhooks_api.rb +178 -0
- data/lib/sezzle_client/api_client.rb +388 -0
- data/lib/sezzle_client/api_error.rb +57 -0
- data/lib/sezzle_client/configuration.rb +205 -0
- data/lib/sezzle_client/models/address.rb +297 -0
- data/lib/sezzle_client/models/all_of_session_customer.rb +260 -0
- data/lib/sezzle_client/models/all_of_session_order.rb +314 -0
- data/lib/sezzle_client/models/authorization.rb +281 -0
- data/lib/sezzle_client/models/body.rb +215 -0
- data/lib/sezzle_client/models/body_1.rb +206 -0
- data/lib/sezzle_client/models/body_2.rb +197 -0
- data/lib/sezzle_client/models/body_3.rb +215 -0
- data/lib/sezzle_client/models/body_4.rb +215 -0
- data/lib/sezzle_client/models/capture.rb +215 -0
- data/lib/sezzle_client/models/customer.rb +260 -0
- data/lib/sezzle_client/models/discount.rb +225 -0
- data/lib/sezzle_client/models/error.rb +201 -0
- data/lib/sezzle_client/models/error_inner.rb +233 -0
- data/lib/sezzle_client/models/inline_response_200.rb +239 -0
- data/lib/sezzle_client/models/inline_response_200_1.rb +286 -0
- data/lib/sezzle_client/models/inline_response_200_2.rb +226 -0
- data/lib/sezzle_client/models/inline_response_200_3.rb +284 -0
- data/lib/sezzle_client/models/inline_response_200_4.rb +215 -0
- data/lib/sezzle_client/models/inline_response_200_5.rb +257 -0
- data/lib/sezzle_client/models/inline_response_200_6.rb +206 -0
- data/lib/sezzle_client/models/inline_response_200_7.rb +277 -0
- data/lib/sezzle_client/models/inline_response_200_8.rb +217 -0
- data/lib/sezzle_client/models/inline_response_200_9.rb +206 -0
- data/lib/sezzle_client/models/inline_response_200_order.rb +235 -0
- data/lib/sezzle_client/models/inline_response_201.rb +224 -0
- data/lib/sezzle_client/models/inline_response_201_1.rb +235 -0
- data/lib/sezzle_client/models/inline_response_201_1_order.rb +226 -0
- data/lib/sezzle_client/models/inline_response_201_1_tokenize.rb +235 -0
- data/lib/sezzle_client/models/installment_plan.rb +28 -0
- data/lib/sezzle_client/models/intent.rb +28 -0
- data/lib/sezzle_client/models/line_item.rb +253 -0
- data/lib/sezzle_client/models/link.rb +224 -0
- data/lib/sezzle_client/models/notification.rb +224 -0
- data/lib/sezzle_client/models/order.rb +284 -0
- data/lib/sezzle_client/models/order_authorization.rb +257 -0
- data/lib/sezzle_client/models/payout.rb +201 -0
- data/lib/sezzle_client/models/payout_inner.rb +251 -0
- data/lib/sezzle_client/models/price.rb +225 -0
- data/lib/sezzle_client/models/refund.rb +215 -0
- data/lib/sezzle_client/models/session.rb +243 -0
- data/lib/sezzle_client/models/session_cancel_url.rb +215 -0
- data/lib/sezzle_client/models/session_status.rb +217 -0
- data/lib/sezzle_client/models/token.rb +235 -0
- data/lib/sezzle_client/models/webhook.rb +222 -0
- data/lib/sezzle_client/version.rb +14 -0
- data/sezzle_client.gemspec +38 -0
- data/spec/.DS_Store +0 -0
- data/spec/api/bearer_authentication_api_spec.rb +45 -0
- data/spec/api/customer_api_spec.rb +91 -0
- data/spec/api/order_api_spec.rb +119 -0
- data/spec/api/reports_api_spec.rb +84 -0
- data/spec/api/session_api_spec.rb +57 -0
- data/spec/api/token_api_spec.rb +56 -0
- data/spec/api/webhooks_api_spec.rb +66 -0
- data/spec/api_client_spec.rb +225 -0
- data/spec/base_object_spec.rb +109 -0
- data/spec/configuration_spec.rb +41 -0
- data/spec/models/address_spec.rb +82 -0
- data/spec/models/all_of_session_customer_spec.rb +76 -0
- data/spec/models/all_of_session_order_spec.rb +106 -0
- data/spec/models/authorization_spec.rb +82 -0
- data/spec/models/body_1_spec.rb +40 -0
- data/spec/models/body_2_spec.rb +34 -0
- data/spec/models/body_3_spec.rb +46 -0
- data/spec/models/body_4_spec.rb +46 -0
- data/spec/models/body_spec.rb +46 -0
- data/spec/models/capture_spec.rb +46 -0
- data/spec/models/customer_spec.rb +76 -0
- data/spec/models/discount_spec.rb +46 -0
- data/spec/models/error_inner_spec.rb +58 -0
- data/spec/models/error_spec.rb +34 -0
- data/spec/models/inline_response_200_1_spec.rb +88 -0
- data/spec/models/inline_response_200_2_spec.rb +52 -0
- data/spec/models/inline_response_200_3_spec.rb +88 -0
- data/spec/models/inline_response_200_4_spec.rb +46 -0
- data/spec/models/inline_response_200_5_spec.rb +70 -0
- data/spec/models/inline_response_200_6_spec.rb +40 -0
- data/spec/models/inline_response_200_7_spec.rb +82 -0
- data/spec/models/inline_response_200_8_spec.rb +46 -0
- data/spec/models/inline_response_200_9_spec.rb +40 -0
- data/spec/models/inline_response_200_order_spec.rb +58 -0
- data/spec/models/inline_response_200_spec.rb +58 -0
- data/spec/models/inline_response_201_1_order_spec.rb +52 -0
- data/spec/models/inline_response_201_1_spec.rb +58 -0
- data/spec/models/inline_response_201_1_tokenize_spec.rb +58 -0
- data/spec/models/inline_response_201_spec.rb +52 -0
- data/spec/models/installment_plan_spec.rb +34 -0
- data/spec/models/intent_spec.rb +34 -0
- data/spec/models/line_item_spec.rb +58 -0
- data/spec/models/link_spec.rb +52 -0
- data/spec/models/notification_spec.rb +52 -0
- data/spec/models/order_authorization_spec.rb +70 -0
- data/spec/models/order_spec.rb +88 -0
- data/spec/models/payout_inner_spec.rb +70 -0
- data/spec/models/payout_spec.rb +34 -0
- data/spec/models/price_spec.rb +46 -0
- data/spec/models/refund_spec.rb +46 -0
- data/spec/models/session_cancel_url_spec.rb +46 -0
- data/spec/models/session_spec.rb +58 -0
- data/spec/models/session_status_spec.rb +46 -0
- data/spec/models/token_spec.rb +58 -0
- data/spec/models/webhook_spec.rb +46 -0
- data/spec/spec_helper.rb +110 -0
- metadata +331 -0
@@ -0,0 +1,430 @@
|
|
1
|
+
=begin
|
2
|
+
#Sezzle API
|
3
|
+
|
4
|
+
#The Sezzle API is intended for merchants interested in accepting Sezzle Pay as a payment option.
|
5
|
+
|
6
|
+
OpenAPI spec version: 2.0.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 3.0.25
|
10
|
+
=end
|
11
|
+
|
12
|
+
module SezzleClient
|
13
|
+
class OrderApi
|
14
|
+
attr_accessor :api_client
|
15
|
+
|
16
|
+
def initialize(api_client = ApiClient.default)
|
17
|
+
@api_client = api_client
|
18
|
+
end
|
19
|
+
# Get order details
|
20
|
+
# @param order_uuid Order UUID
|
21
|
+
# @param [Hash] opts the optional parameters
|
22
|
+
# @return [InlineResponse2001]
|
23
|
+
def get_v2_order(order_uuid, opts = {})
|
24
|
+
data, _status_code, _headers = get_v2_order_with_http_info(order_uuid, opts)
|
25
|
+
data
|
26
|
+
end
|
27
|
+
|
28
|
+
# Get order details
|
29
|
+
# @param order_uuid Order UUID
|
30
|
+
# @param [Hash] opts the optional parameters
|
31
|
+
# @return [Array<(InlineResponse2001, Integer, Hash)>] InlineResponse2001 data, response status code and response headers
|
32
|
+
def get_v2_order_with_http_info(order_uuid, opts = {})
|
33
|
+
if @api_client.config.debugging
|
34
|
+
@api_client.config.logger.debug 'Calling API: OrderApi.get_v2_order ...'
|
35
|
+
end
|
36
|
+
# verify the required parameter 'order_uuid' is set
|
37
|
+
if @api_client.config.client_side_validation && order_uuid.nil?
|
38
|
+
fail ArgumentError, "Missing the required parameter 'order_uuid' when calling OrderApi.get_v2_order"
|
39
|
+
end
|
40
|
+
# resource path
|
41
|
+
local_var_path = '/order/{order_uuid}'.sub('{' + 'order_uuid' + '}', order_uuid.to_s)
|
42
|
+
|
43
|
+
# query parameters
|
44
|
+
query_params = opts[:query_params] || {}
|
45
|
+
|
46
|
+
# header parameters
|
47
|
+
header_params = opts[:header_params] || {}
|
48
|
+
# HTTP header 'Accept' (if needed)
|
49
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
50
|
+
|
51
|
+
# form parameters
|
52
|
+
form_params = opts[:form_params] || {}
|
53
|
+
|
54
|
+
# http body (model)
|
55
|
+
post_body = opts[:body]
|
56
|
+
|
57
|
+
return_type = opts[:return_type] || 'InlineResponse2001'
|
58
|
+
|
59
|
+
auth_names = opts[:auth_names] || ['Bearer']
|
60
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
61
|
+
:header_params => header_params,
|
62
|
+
:query_params => query_params,
|
63
|
+
:form_params => form_params,
|
64
|
+
:body => post_body,
|
65
|
+
:auth_names => auth_names,
|
66
|
+
:return_type => return_type)
|
67
|
+
|
68
|
+
if @api_client.config.debugging
|
69
|
+
@api_client.config.logger.debug "API called: OrderApi#get_v2_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
70
|
+
end
|
71
|
+
return data, status_code, headers
|
72
|
+
end
|
73
|
+
# Update order
|
74
|
+
# @param body Session request
|
75
|
+
# @param order_uuid Order UUID
|
76
|
+
# @param [Hash] opts the optional parameters
|
77
|
+
# @return [nil]
|
78
|
+
def patch_v2_checkout(body, order_uuid, opts = {})
|
79
|
+
patch_v2_checkout_with_http_info(body, order_uuid, opts)
|
80
|
+
nil
|
81
|
+
end
|
82
|
+
|
83
|
+
# Update order
|
84
|
+
# @param body Session request
|
85
|
+
# @param order_uuid Order UUID
|
86
|
+
# @param [Hash] opts the optional parameters
|
87
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
88
|
+
def patch_v2_checkout_with_http_info(body, order_uuid, opts = {})
|
89
|
+
if @api_client.config.debugging
|
90
|
+
@api_client.config.logger.debug 'Calling API: OrderApi.patch_v2_checkout ...'
|
91
|
+
end
|
92
|
+
# verify the required parameter 'body' is set
|
93
|
+
if @api_client.config.client_side_validation && body.nil?
|
94
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling OrderApi.patch_v2_checkout"
|
95
|
+
end
|
96
|
+
# verify the required parameter 'order_uuid' is set
|
97
|
+
if @api_client.config.client_side_validation && order_uuid.nil?
|
98
|
+
fail ArgumentError, "Missing the required parameter 'order_uuid' when calling OrderApi.patch_v2_checkout"
|
99
|
+
end
|
100
|
+
# resource path
|
101
|
+
local_var_path = '/order/{order_uuid}'.sub('{' + 'order_uuid' + '}', order_uuid.to_s)
|
102
|
+
|
103
|
+
# query parameters
|
104
|
+
query_params = opts[:query_params] || {}
|
105
|
+
|
106
|
+
# header parameters
|
107
|
+
header_params = opts[:header_params] || {}
|
108
|
+
# HTTP header 'Accept' (if needed)
|
109
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
110
|
+
# HTTP header 'Content-Type'
|
111
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
112
|
+
|
113
|
+
# form parameters
|
114
|
+
form_params = opts[:form_params] || {}
|
115
|
+
|
116
|
+
# http body (model)
|
117
|
+
post_body = opts[:body] || @api_client.object_to_http_body(body)
|
118
|
+
|
119
|
+
return_type = opts[:return_type]
|
120
|
+
|
121
|
+
auth_names = opts[:auth_names] || ['Bearer']
|
122
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
|
123
|
+
:header_params => header_params,
|
124
|
+
:query_params => query_params,
|
125
|
+
:form_params => form_params,
|
126
|
+
:body => post_body,
|
127
|
+
:auth_names => auth_names,
|
128
|
+
:return_type => return_type)
|
129
|
+
|
130
|
+
if @api_client.config.debugging
|
131
|
+
@api_client.config.logger.debug "API called: OrderApi#patch_v2_checkout\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
132
|
+
end
|
133
|
+
return data, status_code, headers
|
134
|
+
end
|
135
|
+
# Capture amount by order
|
136
|
+
# @param order_uuid Order UUID
|
137
|
+
# @param [Hash] opts the optional parameters
|
138
|
+
# @option opts [Body3] :body Capture request
|
139
|
+
# @return [InlineResponse2006]
|
140
|
+
def post_v2_capture_by_order(order_uuid, opts = {})
|
141
|
+
data, _status_code, _headers = post_v2_capture_by_order_with_http_info(order_uuid, opts)
|
142
|
+
data
|
143
|
+
end
|
144
|
+
|
145
|
+
# Capture amount by order
|
146
|
+
# @param order_uuid Order UUID
|
147
|
+
# @param [Hash] opts the optional parameters
|
148
|
+
# @option opts [Body3] :body Capture request
|
149
|
+
# @return [Array<(InlineResponse2006, Integer, Hash)>] InlineResponse2006 data, response status code and response headers
|
150
|
+
def post_v2_capture_by_order_with_http_info(order_uuid, opts = {})
|
151
|
+
if @api_client.config.debugging
|
152
|
+
@api_client.config.logger.debug 'Calling API: OrderApi.post_v2_capture_by_order ...'
|
153
|
+
end
|
154
|
+
# verify the required parameter 'order_uuid' is set
|
155
|
+
if @api_client.config.client_side_validation && order_uuid.nil?
|
156
|
+
fail ArgumentError, "Missing the required parameter 'order_uuid' when calling OrderApi.post_v2_capture_by_order"
|
157
|
+
end
|
158
|
+
# resource path
|
159
|
+
local_var_path = '/order/{order_uuid}/capture'.sub('{' + 'order_uuid' + '}', order_uuid.to_s)
|
160
|
+
|
161
|
+
# query parameters
|
162
|
+
query_params = opts[:query_params] || {}
|
163
|
+
|
164
|
+
# header parameters
|
165
|
+
header_params = opts[:header_params] || {}
|
166
|
+
# HTTP header 'Accept' (if needed)
|
167
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
168
|
+
# HTTP header 'Content-Type'
|
169
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
170
|
+
|
171
|
+
# form parameters
|
172
|
+
form_params = opts[:form_params] || {}
|
173
|
+
|
174
|
+
# http body (model)
|
175
|
+
post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body'])
|
176
|
+
|
177
|
+
return_type = opts[:return_type] || 'InlineResponse2006'
|
178
|
+
|
179
|
+
auth_names = opts[:auth_names] || ['Bearer']
|
180
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
181
|
+
:header_params => header_params,
|
182
|
+
:query_params => query_params,
|
183
|
+
:form_params => form_params,
|
184
|
+
:body => post_body,
|
185
|
+
:auth_names => auth_names,
|
186
|
+
:return_type => return_type)
|
187
|
+
|
188
|
+
if @api_client.config.debugging
|
189
|
+
@api_client.config.logger.debug "API called: OrderApi#post_v2_capture_by_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
190
|
+
end
|
191
|
+
return data, status_code, headers
|
192
|
+
end
|
193
|
+
# Reauthorize amount by order
|
194
|
+
# ### DEVELOPER PREVIEW *This API is subject to change and limited to select merchants. Bug fixes and new features will be released based on feedback throughout the preview period.* - Requires customer object on Create Session with at minimum `{ tokenize: true }` - Response will be a new order and its `uuid` can be used on the Order API endpoints
|
195
|
+
# @param order_uuid Order UUID
|
196
|
+
# @param [Hash] opts the optional parameters
|
197
|
+
# @option opts [Price] :body Reauthorize request
|
198
|
+
# @return [InlineResponse2007]
|
199
|
+
def post_v2_reauthorize_by_order(order_uuid, opts = {})
|
200
|
+
data, _status_code, _headers = post_v2_reauthorize_by_order_with_http_info(order_uuid, opts)
|
201
|
+
data
|
202
|
+
end
|
203
|
+
|
204
|
+
# Reauthorize amount by order
|
205
|
+
# ### DEVELOPER PREVIEW *This API is subject to change and limited to select merchants. Bug fixes and new features will be released based on feedback throughout the preview period.* - Requires customer object on Create Session with at minimum `{ tokenize: true }` - Response will be a new order and its `uuid` can be used on the Order API endpoints
|
206
|
+
# @param order_uuid Order UUID
|
207
|
+
# @param [Hash] opts the optional parameters
|
208
|
+
# @option opts [Price] :body Reauthorize request
|
209
|
+
# @return [Array<(InlineResponse2007, Integer, Hash)>] InlineResponse2007 data, response status code and response headers
|
210
|
+
def post_v2_reauthorize_by_order_with_http_info(order_uuid, opts = {})
|
211
|
+
if @api_client.config.debugging
|
212
|
+
@api_client.config.logger.debug 'Calling API: OrderApi.post_v2_reauthorize_by_order ...'
|
213
|
+
end
|
214
|
+
# verify the required parameter 'order_uuid' is set
|
215
|
+
if @api_client.config.client_side_validation && order_uuid.nil?
|
216
|
+
fail ArgumentError, "Missing the required parameter 'order_uuid' when calling OrderApi.post_v2_reauthorize_by_order"
|
217
|
+
end
|
218
|
+
# resource path
|
219
|
+
local_var_path = '/order/{order_uuid}/reauthorize'.sub('{' + 'order_uuid' + '}', order_uuid.to_s)
|
220
|
+
|
221
|
+
# query parameters
|
222
|
+
query_params = opts[:query_params] || {}
|
223
|
+
|
224
|
+
# header parameters
|
225
|
+
header_params = opts[:header_params] || {}
|
226
|
+
# HTTP header 'Accept' (if needed)
|
227
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
228
|
+
# HTTP header 'Content-Type'
|
229
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
230
|
+
|
231
|
+
# form parameters
|
232
|
+
form_params = opts[:form_params] || {}
|
233
|
+
|
234
|
+
# http body (model)
|
235
|
+
post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body'])
|
236
|
+
|
237
|
+
return_type = opts[:return_type] || 'InlineResponse2007'
|
238
|
+
|
239
|
+
auth_names = opts[:auth_names] || ['Bearer']
|
240
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
241
|
+
:header_params => header_params,
|
242
|
+
:query_params => query_params,
|
243
|
+
:form_params => form_params,
|
244
|
+
:body => post_body,
|
245
|
+
:auth_names => auth_names,
|
246
|
+
:return_type => return_type)
|
247
|
+
|
248
|
+
if @api_client.config.debugging
|
249
|
+
@api_client.config.logger.debug "API called: OrderApi#post_v2_reauthorize_by_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
250
|
+
end
|
251
|
+
return data, status_code, headers
|
252
|
+
end
|
253
|
+
# Refund amount by order
|
254
|
+
# @param order_uuid Order UUID
|
255
|
+
# @param [Hash] opts the optional parameters
|
256
|
+
# @option opts [Price] :body Refund request
|
257
|
+
# @return [InlineResponse2006]
|
258
|
+
def post_v2_refund_by_order(order_uuid, opts = {})
|
259
|
+
data, _status_code, _headers = post_v2_refund_by_order_with_http_info(order_uuid, opts)
|
260
|
+
data
|
261
|
+
end
|
262
|
+
|
263
|
+
# Refund amount by order
|
264
|
+
# @param order_uuid Order UUID
|
265
|
+
# @param [Hash] opts the optional parameters
|
266
|
+
# @option opts [Price] :body Refund request
|
267
|
+
# @return [Array<(InlineResponse2006, Integer, Hash)>] InlineResponse2006 data, response status code and response headers
|
268
|
+
def post_v2_refund_by_order_with_http_info(order_uuid, opts = {})
|
269
|
+
if @api_client.config.debugging
|
270
|
+
@api_client.config.logger.debug 'Calling API: OrderApi.post_v2_refund_by_order ...'
|
271
|
+
end
|
272
|
+
# verify the required parameter 'order_uuid' is set
|
273
|
+
if @api_client.config.client_side_validation && order_uuid.nil?
|
274
|
+
fail ArgumentError, "Missing the required parameter 'order_uuid' when calling OrderApi.post_v2_refund_by_order"
|
275
|
+
end
|
276
|
+
# resource path
|
277
|
+
local_var_path = '/order/{order_uuid}/refund'.sub('{' + 'order_uuid' + '}', order_uuid.to_s)
|
278
|
+
|
279
|
+
# query parameters
|
280
|
+
query_params = opts[:query_params] || {}
|
281
|
+
|
282
|
+
# header parameters
|
283
|
+
header_params = opts[:header_params] || {}
|
284
|
+
# HTTP header 'Accept' (if needed)
|
285
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
286
|
+
# HTTP header 'Content-Type'
|
287
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
288
|
+
|
289
|
+
# form parameters
|
290
|
+
form_params = opts[:form_params] || {}
|
291
|
+
|
292
|
+
# http body (model)
|
293
|
+
post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body'])
|
294
|
+
|
295
|
+
return_type = opts[:return_type] || 'InlineResponse2006'
|
296
|
+
|
297
|
+
auth_names = opts[:auth_names] || ['Bearer']
|
298
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
299
|
+
:header_params => header_params,
|
300
|
+
:query_params => query_params,
|
301
|
+
:form_params => form_params,
|
302
|
+
:body => post_body,
|
303
|
+
:auth_names => auth_names,
|
304
|
+
:return_type => return_type)
|
305
|
+
|
306
|
+
if @api_client.config.debugging
|
307
|
+
@api_client.config.logger.debug "API called: OrderApi#post_v2_refund_by_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
308
|
+
end
|
309
|
+
return data, status_code, headers
|
310
|
+
end
|
311
|
+
# Release amount by order
|
312
|
+
# @param order_uuid Order UUID
|
313
|
+
# @param [Hash] opts the optional parameters
|
314
|
+
# @option opts [Price] :body Release request
|
315
|
+
# @return [InlineResponse2006]
|
316
|
+
def post_v2_release_by_order(order_uuid, opts = {})
|
317
|
+
data, _status_code, _headers = post_v2_release_by_order_with_http_info(order_uuid, opts)
|
318
|
+
data
|
319
|
+
end
|
320
|
+
|
321
|
+
# Release amount by order
|
322
|
+
# @param order_uuid Order UUID
|
323
|
+
# @param [Hash] opts the optional parameters
|
324
|
+
# @option opts [Price] :body Release request
|
325
|
+
# @return [Array<(InlineResponse2006, Integer, Hash)>] InlineResponse2006 data, response status code and response headers
|
326
|
+
def post_v2_release_by_order_with_http_info(order_uuid, opts = {})
|
327
|
+
if @api_client.config.debugging
|
328
|
+
@api_client.config.logger.debug 'Calling API: OrderApi.post_v2_release_by_order ...'
|
329
|
+
end
|
330
|
+
# verify the required parameter 'order_uuid' is set
|
331
|
+
if @api_client.config.client_side_validation && order_uuid.nil?
|
332
|
+
fail ArgumentError, "Missing the required parameter 'order_uuid' when calling OrderApi.post_v2_release_by_order"
|
333
|
+
end
|
334
|
+
# resource path
|
335
|
+
local_var_path = '/order/{order_uuid}/release'.sub('{' + 'order_uuid' + '}', order_uuid.to_s)
|
336
|
+
|
337
|
+
# query parameters
|
338
|
+
query_params = opts[:query_params] || {}
|
339
|
+
|
340
|
+
# header parameters
|
341
|
+
header_params = opts[:header_params] || {}
|
342
|
+
# HTTP header 'Accept' (if needed)
|
343
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
344
|
+
# HTTP header 'Content-Type'
|
345
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
346
|
+
|
347
|
+
# form parameters
|
348
|
+
form_params = opts[:form_params] || {}
|
349
|
+
|
350
|
+
# http body (model)
|
351
|
+
post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body'])
|
352
|
+
|
353
|
+
return_type = opts[:return_type] || 'InlineResponse2006'
|
354
|
+
|
355
|
+
auth_names = opts[:auth_names] || ['Bearer']
|
356
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
357
|
+
:header_params => header_params,
|
358
|
+
:query_params => query_params,
|
359
|
+
:form_params => form_params,
|
360
|
+
:body => post_body,
|
361
|
+
:auth_names => auth_names,
|
362
|
+
:return_type => return_type)
|
363
|
+
|
364
|
+
if @api_client.config.debugging
|
365
|
+
@api_client.config.logger.debug "API called: OrderApi#post_v2_release_by_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
366
|
+
end
|
367
|
+
return data, status_code, headers
|
368
|
+
end
|
369
|
+
# Upcharge amount by order
|
370
|
+
# ### DEVELOPER PREVIEW *This API is subject to change and limited to select merchants. Bug fixes and new features will be released based on feedback throughout the preview period.* - This endpoint is not live and will return a `501 Not Implemented`
|
371
|
+
# @param order_uuid Order UUID
|
372
|
+
# @param [Hash] opts the optional parameters
|
373
|
+
# @option opts [Body4] :body Upcharge request
|
374
|
+
# @return [InlineResponse2007]
|
375
|
+
def post_v2_upcharge_by_order(order_uuid, opts = {})
|
376
|
+
data, _status_code, _headers = post_v2_upcharge_by_order_with_http_info(order_uuid, opts)
|
377
|
+
data
|
378
|
+
end
|
379
|
+
|
380
|
+
# Upcharge amount by order
|
381
|
+
# ### DEVELOPER PREVIEW *This API is subject to change and limited to select merchants. Bug fixes and new features will be released based on feedback throughout the preview period.* - This endpoint is not live and will return a `501 Not Implemented`
|
382
|
+
# @param order_uuid Order UUID
|
383
|
+
# @param [Hash] opts the optional parameters
|
384
|
+
# @option opts [Body4] :body Upcharge request
|
385
|
+
# @return [Array<(InlineResponse2007, Integer, Hash)>] InlineResponse2007 data, response status code and response headers
|
386
|
+
def post_v2_upcharge_by_order_with_http_info(order_uuid, opts = {})
|
387
|
+
if @api_client.config.debugging
|
388
|
+
@api_client.config.logger.debug 'Calling API: OrderApi.post_v2_upcharge_by_order ...'
|
389
|
+
end
|
390
|
+
# verify the required parameter 'order_uuid' is set
|
391
|
+
if @api_client.config.client_side_validation && order_uuid.nil?
|
392
|
+
fail ArgumentError, "Missing the required parameter 'order_uuid' when calling OrderApi.post_v2_upcharge_by_order"
|
393
|
+
end
|
394
|
+
# resource path
|
395
|
+
local_var_path = '/order/{order_uuid}/upcharge'.sub('{' + 'order_uuid' + '}', order_uuid.to_s)
|
396
|
+
|
397
|
+
# query parameters
|
398
|
+
query_params = opts[:query_params] || {}
|
399
|
+
|
400
|
+
# header parameters
|
401
|
+
header_params = opts[:header_params] || {}
|
402
|
+
# HTTP header 'Accept' (if needed)
|
403
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
404
|
+
# HTTP header 'Content-Type'
|
405
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
406
|
+
|
407
|
+
# form parameters
|
408
|
+
form_params = opts[:form_params] || {}
|
409
|
+
|
410
|
+
# http body (model)
|
411
|
+
post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body'])
|
412
|
+
|
413
|
+
return_type = opts[:return_type] || 'InlineResponse2007'
|
414
|
+
|
415
|
+
auth_names = opts[:auth_names] || ['Bearer']
|
416
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
417
|
+
:header_params => header_params,
|
418
|
+
:query_params => query_params,
|
419
|
+
:form_params => form_params,
|
420
|
+
:body => post_body,
|
421
|
+
:auth_names => auth_names,
|
422
|
+
:return_type => return_type)
|
423
|
+
|
424
|
+
if @api_client.config.debugging
|
425
|
+
@api_client.config.logger.debug "API called: OrderApi#post_v2_upcharge_by_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
426
|
+
end
|
427
|
+
return data, status_code, headers
|
428
|
+
end
|
429
|
+
end
|
430
|
+
end
|
@@ -0,0 +1,253 @@
|
|
1
|
+
=begin
|
2
|
+
#Sezzle API
|
3
|
+
|
4
|
+
#The Sezzle API is intended for merchants interested in accepting Sezzle Pay as a payment option.
|
5
|
+
|
6
|
+
OpenAPI spec version: 2.0.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 3.0.25
|
10
|
+
=end
|
11
|
+
|
12
|
+
module SezzleClient
|
13
|
+
class ReportsApi
|
14
|
+
attr_accessor :api_client
|
15
|
+
|
16
|
+
def initialize(api_client = ApiClient.default)
|
17
|
+
@api_client = api_client
|
18
|
+
end
|
19
|
+
# Interest Account Activity
|
20
|
+
# @param start_date Start Date
|
21
|
+
# @param [Hash] opts the optional parameters
|
22
|
+
# @option opts [String] :end_date End Date
|
23
|
+
# @option opts [String] :offset Pagination Offset (Limit 20)
|
24
|
+
# @option opts [String] :currency_code ISO-4217 Currency Code
|
25
|
+
# @return [String]
|
26
|
+
def get_interest_account_activity(start_date, opts = {})
|
27
|
+
data, _status_code, _headers = get_interest_account_activity_with_http_info(start_date, opts)
|
28
|
+
data
|
29
|
+
end
|
30
|
+
|
31
|
+
# Interest Account Activity
|
32
|
+
# @param start_date Start Date
|
33
|
+
# @param [Hash] opts the optional parameters
|
34
|
+
# @option opts [String] :end_date End Date
|
35
|
+
# @option opts [String] :offset Pagination Offset (Limit 20)
|
36
|
+
# @option opts [String] :currency_code ISO-4217 Currency Code
|
37
|
+
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
38
|
+
def get_interest_account_activity_with_http_info(start_date, opts = {})
|
39
|
+
if @api_client.config.debugging
|
40
|
+
@api_client.config.logger.debug 'Calling API: ReportsApi.get_interest_account_activity ...'
|
41
|
+
end
|
42
|
+
# verify the required parameter 'start_date' is set
|
43
|
+
if @api_client.config.client_side_validation && start_date.nil?
|
44
|
+
fail ArgumentError, "Missing the required parameter 'start_date' when calling ReportsApi.get_interest_account_activity"
|
45
|
+
end
|
46
|
+
# resource path
|
47
|
+
local_var_path = '/interest/activity'
|
48
|
+
|
49
|
+
# query parameters
|
50
|
+
query_params = opts[:query_params] || {}
|
51
|
+
query_params[:'start-date'] = start_date
|
52
|
+
query_params[:'end-date'] = opts[:'end_date'] if !opts[:'end_date'].nil?
|
53
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
54
|
+
query_params[:'currency-code'] = opts[:'currency_code'] if !opts[:'currency_code'].nil?
|
55
|
+
|
56
|
+
# header parameters
|
57
|
+
header_params = opts[:header_params] || {}
|
58
|
+
# HTTP header 'Accept' (if needed)
|
59
|
+
header_params['Accept'] = @api_client.select_header_accept(['text/csv', 'application/json'])
|
60
|
+
|
61
|
+
# form parameters
|
62
|
+
form_params = opts[:form_params] || {}
|
63
|
+
|
64
|
+
# http body (model)
|
65
|
+
post_body = opts[:body]
|
66
|
+
|
67
|
+
return_type = opts[:return_type] || 'String'
|
68
|
+
|
69
|
+
auth_names = opts[:auth_names] || ['Bearer']
|
70
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
71
|
+
:header_params => header_params,
|
72
|
+
:query_params => query_params,
|
73
|
+
:form_params => form_params,
|
74
|
+
:body => post_body,
|
75
|
+
:auth_names => auth_names,
|
76
|
+
:return_type => return_type)
|
77
|
+
|
78
|
+
if @api_client.config.debugging
|
79
|
+
@api_client.config.logger.debug "API called: ReportsApi#get_interest_account_activity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
80
|
+
end
|
81
|
+
return data, status_code, headers
|
82
|
+
end
|
83
|
+
# Interest Account Balance
|
84
|
+
# @param [Hash] opts the optional parameters
|
85
|
+
# @option opts [String] :currency_code ISO-4217 Currency Code
|
86
|
+
# @return [InlineResponse2009]
|
87
|
+
def get_interest_account_balance(opts = {})
|
88
|
+
data, _status_code, _headers = get_interest_account_balance_with_http_info(opts)
|
89
|
+
data
|
90
|
+
end
|
91
|
+
|
92
|
+
# Interest Account Balance
|
93
|
+
# @param [Hash] opts the optional parameters
|
94
|
+
# @option opts [String] :currency_code ISO-4217 Currency Code
|
95
|
+
# @return [Array<(InlineResponse2009, Integer, Hash)>] InlineResponse2009 data, response status code and response headers
|
96
|
+
def get_interest_account_balance_with_http_info(opts = {})
|
97
|
+
if @api_client.config.debugging
|
98
|
+
@api_client.config.logger.debug 'Calling API: ReportsApi.get_interest_account_balance ...'
|
99
|
+
end
|
100
|
+
# resource path
|
101
|
+
local_var_path = '/interest/balance'
|
102
|
+
|
103
|
+
# query parameters
|
104
|
+
query_params = opts[:query_params] || {}
|
105
|
+
query_params[:'currency-code'] = opts[:'currency_code'] if !opts[:'currency_code'].nil?
|
106
|
+
|
107
|
+
# header parameters
|
108
|
+
header_params = opts[:header_params] || {}
|
109
|
+
# HTTP header 'Accept' (if needed)
|
110
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
111
|
+
|
112
|
+
# form parameters
|
113
|
+
form_params = opts[:form_params] || {}
|
114
|
+
|
115
|
+
# http body (model)
|
116
|
+
post_body = opts[:body]
|
117
|
+
|
118
|
+
return_type = opts[:return_type] || 'InlineResponse2009'
|
119
|
+
|
120
|
+
auth_names = opts[:auth_names] || ['Bearer']
|
121
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
122
|
+
:header_params => header_params,
|
123
|
+
:query_params => query_params,
|
124
|
+
:form_params => form_params,
|
125
|
+
:body => post_body,
|
126
|
+
:auth_names => auth_names,
|
127
|
+
:return_type => return_type)
|
128
|
+
|
129
|
+
if @api_client.config.debugging
|
130
|
+
@api_client.config.logger.debug "API called: ReportsApi#get_interest_account_balance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
131
|
+
end
|
132
|
+
return data, status_code, headers
|
133
|
+
end
|
134
|
+
# Settlement Details
|
135
|
+
# @param payout_uuid Payout UUID
|
136
|
+
# @param [Hash] opts the optional parameters
|
137
|
+
# @return [String]
|
138
|
+
def get_settlement_details(payout_uuid, opts = {})
|
139
|
+
data, _status_code, _headers = get_settlement_details_with_http_info(payout_uuid, opts)
|
140
|
+
data
|
141
|
+
end
|
142
|
+
|
143
|
+
# Settlement Details
|
144
|
+
# @param payout_uuid Payout UUID
|
145
|
+
# @param [Hash] opts the optional parameters
|
146
|
+
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
147
|
+
def get_settlement_details_with_http_info(payout_uuid, opts = {})
|
148
|
+
if @api_client.config.debugging
|
149
|
+
@api_client.config.logger.debug 'Calling API: ReportsApi.get_settlement_details ...'
|
150
|
+
end
|
151
|
+
# verify the required parameter 'payout_uuid' is set
|
152
|
+
if @api_client.config.client_side_validation && payout_uuid.nil?
|
153
|
+
fail ArgumentError, "Missing the required parameter 'payout_uuid' when calling ReportsApi.get_settlement_details"
|
154
|
+
end
|
155
|
+
# resource path
|
156
|
+
local_var_path = '/settlements/details/{payout_uuid}'.sub('{' + 'payout_uuid' + '}', payout_uuid.to_s)
|
157
|
+
|
158
|
+
# query parameters
|
159
|
+
query_params = opts[:query_params] || {}
|
160
|
+
|
161
|
+
# header parameters
|
162
|
+
header_params = opts[:header_params] || {}
|
163
|
+
# HTTP header 'Accept' (if needed)
|
164
|
+
header_params['Accept'] = @api_client.select_header_accept(['text/csv', 'application/json'])
|
165
|
+
|
166
|
+
# form parameters
|
167
|
+
form_params = opts[:form_params] || {}
|
168
|
+
|
169
|
+
# http body (model)
|
170
|
+
post_body = opts[:body]
|
171
|
+
|
172
|
+
return_type = opts[:return_type] || 'String'
|
173
|
+
|
174
|
+
auth_names = opts[:auth_names] || ['Bearer']
|
175
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
176
|
+
:header_params => header_params,
|
177
|
+
:query_params => query_params,
|
178
|
+
:form_params => form_params,
|
179
|
+
:body => post_body,
|
180
|
+
:auth_names => auth_names,
|
181
|
+
:return_type => return_type)
|
182
|
+
|
183
|
+
if @api_client.config.debugging
|
184
|
+
@api_client.config.logger.debug "API called: ReportsApi#get_settlement_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
185
|
+
end
|
186
|
+
return data, status_code, headers
|
187
|
+
end
|
188
|
+
# Settlement Summaries
|
189
|
+
# @param start_date Start Date
|
190
|
+
# @param [Hash] opts the optional parameters
|
191
|
+
# @option opts [String] :end_date End Date
|
192
|
+
# @option opts [String] :offset Pagination Offset (Limit 20)
|
193
|
+
# @option opts [String] :currency_code ISO-4217 Currency Code
|
194
|
+
# @return [Payout]
|
195
|
+
def get_settlement_summaries(start_date, opts = {})
|
196
|
+
data, _status_code, _headers = get_settlement_summaries_with_http_info(start_date, opts)
|
197
|
+
data
|
198
|
+
end
|
199
|
+
|
200
|
+
# Settlement Summaries
|
201
|
+
# @param start_date Start Date
|
202
|
+
# @param [Hash] opts the optional parameters
|
203
|
+
# @option opts [String] :end_date End Date
|
204
|
+
# @option opts [String] :offset Pagination Offset (Limit 20)
|
205
|
+
# @option opts [String] :currency_code ISO-4217 Currency Code
|
206
|
+
# @return [Array<(Payout, Integer, Hash)>] Payout data, response status code and response headers
|
207
|
+
def get_settlement_summaries_with_http_info(start_date, opts = {})
|
208
|
+
if @api_client.config.debugging
|
209
|
+
@api_client.config.logger.debug 'Calling API: ReportsApi.get_settlement_summaries ...'
|
210
|
+
end
|
211
|
+
# verify the required parameter 'start_date' is set
|
212
|
+
if @api_client.config.client_side_validation && start_date.nil?
|
213
|
+
fail ArgumentError, "Missing the required parameter 'start_date' when calling ReportsApi.get_settlement_summaries"
|
214
|
+
end
|
215
|
+
# resource path
|
216
|
+
local_var_path = '/settlements/summaries'
|
217
|
+
|
218
|
+
# query parameters
|
219
|
+
query_params = opts[:query_params] || {}
|
220
|
+
query_params[:'start-date'] = start_date
|
221
|
+
query_params[:'end-date'] = opts[:'end_date'] if !opts[:'end_date'].nil?
|
222
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
223
|
+
query_params[:'currency-code'] = opts[:'currency_code'] if !opts[:'currency_code'].nil?
|
224
|
+
|
225
|
+
# header parameters
|
226
|
+
header_params = opts[:header_params] || {}
|
227
|
+
# HTTP header 'Accept' (if needed)
|
228
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
229
|
+
|
230
|
+
# form parameters
|
231
|
+
form_params = opts[:form_params] || {}
|
232
|
+
|
233
|
+
# http body (model)
|
234
|
+
post_body = opts[:body]
|
235
|
+
|
236
|
+
return_type = opts[:return_type] || 'Payout'
|
237
|
+
|
238
|
+
auth_names = opts[:auth_names] || ['Bearer']
|
239
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
240
|
+
:header_params => header_params,
|
241
|
+
:query_params => query_params,
|
242
|
+
:form_params => form_params,
|
243
|
+
:body => post_body,
|
244
|
+
:auth_names => auth_names,
|
245
|
+
:return_type => return_type)
|
246
|
+
|
247
|
+
if @api_client.config.debugging
|
248
|
+
@api_client.config.logger.debug "API called: ReportsApi#get_settlement_summaries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
249
|
+
end
|
250
|
+
return data, status_code, headers
|
251
|
+
end
|
252
|
+
end
|
253
|
+
end
|