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
data/docs/Webhook.md
ADDED
data/docs/WebhooksApi.md
ADDED
@@ -0,0 +1,157 @@
|
|
1
|
+
# SezzleClient::WebhooksApi
|
2
|
+
|
3
|
+
All URIs are relative to *//sandbox.gateway.sezzle.com/v2/*
|
4
|
+
|
5
|
+
Method | HTTP request | Description
|
6
|
+
------------- | ------------- | -------------
|
7
|
+
[**delete_v2_webhooks**](WebhooksApi.md#delete_v2_webhooks) | **DELETE** /webhooks/{webhooks_uuid} | Delete webhooks
|
8
|
+
[**get_v2_webhooks**](WebhooksApi.md#get_v2_webhooks) | **GET** /webhooks | List webhooks
|
9
|
+
[**post_v2_webhooks**](WebhooksApi.md#post_v2_webhooks) | **POST** /webhooks | Create webhooks
|
10
|
+
|
11
|
+
# **delete_v2_webhooks**
|
12
|
+
> delete_v2_webhooks(webhooks_uuid)
|
13
|
+
|
14
|
+
Delete webhooks
|
15
|
+
|
16
|
+
### Example
|
17
|
+
```ruby
|
18
|
+
# load the gem
|
19
|
+
require 'sezzle_client'
|
20
|
+
# setup authorization
|
21
|
+
SezzleClient.configure do |config|
|
22
|
+
# Configure API key authorization: Bearer
|
23
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
24
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
25
|
+
#config.api_key_prefix['Authorization'] = 'Bearer'
|
26
|
+
end
|
27
|
+
|
28
|
+
api_instance = SezzleClient::WebhooksApi.new
|
29
|
+
webhooks_uuid = 'webhooks_uuid_example' # String | Webhooks UUID
|
30
|
+
|
31
|
+
|
32
|
+
begin
|
33
|
+
#Delete webhooks
|
34
|
+
api_instance.delete_v2_webhooks(webhooks_uuid)
|
35
|
+
rescue SezzleClient::ApiError => e
|
36
|
+
puts "Exception when calling WebhooksApi->delete_v2_webhooks: #{e}"
|
37
|
+
end
|
38
|
+
```
|
39
|
+
|
40
|
+
### Parameters
|
41
|
+
|
42
|
+
Name | Type | Description | Notes
|
43
|
+
------------- | ------------- | ------------- | -------------
|
44
|
+
**webhooks_uuid** | **String**| Webhooks UUID |
|
45
|
+
|
46
|
+
### Return type
|
47
|
+
|
48
|
+
nil (empty response body)
|
49
|
+
|
50
|
+
### Authorization
|
51
|
+
|
52
|
+
[Bearer](../README.md#Bearer)
|
53
|
+
|
54
|
+
### HTTP request headers
|
55
|
+
|
56
|
+
- **Content-Type**: Not defined
|
57
|
+
- **Accept**: application/json
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
# **get_v2_webhooks**
|
62
|
+
> Array<null> get_v2_webhooks
|
63
|
+
|
64
|
+
List webhooks
|
65
|
+
|
66
|
+
### Example
|
67
|
+
```ruby
|
68
|
+
# load the gem
|
69
|
+
require 'sezzle_client'
|
70
|
+
# setup authorization
|
71
|
+
SezzleClient.configure do |config|
|
72
|
+
# Configure API key authorization: Bearer
|
73
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
74
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
75
|
+
#config.api_key_prefix['Authorization'] = 'Bearer'
|
76
|
+
end
|
77
|
+
|
78
|
+
api_instance = SezzleClient::WebhooksApi.new
|
79
|
+
|
80
|
+
begin
|
81
|
+
#List webhooks
|
82
|
+
result = api_instance.get_v2_webhooks
|
83
|
+
p result
|
84
|
+
rescue SezzleClient::ApiError => e
|
85
|
+
puts "Exception when calling WebhooksApi->get_v2_webhooks: #{e}"
|
86
|
+
end
|
87
|
+
```
|
88
|
+
|
89
|
+
### Parameters
|
90
|
+
This endpoint does not need any parameter.
|
91
|
+
|
92
|
+
### Return type
|
93
|
+
|
94
|
+
**Array<null>**
|
95
|
+
|
96
|
+
### Authorization
|
97
|
+
|
98
|
+
[Bearer](../README.md#Bearer)
|
99
|
+
|
100
|
+
### HTTP request headers
|
101
|
+
|
102
|
+
- **Content-Type**: Not defined
|
103
|
+
- **Accept**: application/json
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
# **post_v2_webhooks**
|
108
|
+
> InlineResponse2008 post_v2_webhooks(body)
|
109
|
+
|
110
|
+
Create webhooks
|
111
|
+
|
112
|
+
### Example
|
113
|
+
```ruby
|
114
|
+
# load the gem
|
115
|
+
require 'sezzle_client'
|
116
|
+
# setup authorization
|
117
|
+
SezzleClient.configure do |config|
|
118
|
+
# Configure API key authorization: Bearer
|
119
|
+
config.api_key['Authorization'] = 'YOUR API KEY'
|
120
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
121
|
+
#config.api_key_prefix['Authorization'] = 'Bearer'
|
122
|
+
end
|
123
|
+
|
124
|
+
api_instance = SezzleClient::WebhooksApi.new
|
125
|
+
body = SezzleClient::Webhook.new # Webhook | Webhooks request
|
126
|
+
|
127
|
+
|
128
|
+
begin
|
129
|
+
#Create webhooks
|
130
|
+
result = api_instance.post_v2_webhooks(body)
|
131
|
+
p result
|
132
|
+
rescue SezzleClient::ApiError => e
|
133
|
+
puts "Exception when calling WebhooksApi->post_v2_webhooks: #{e}"
|
134
|
+
end
|
135
|
+
```
|
136
|
+
|
137
|
+
### Parameters
|
138
|
+
|
139
|
+
Name | Type | Description | Notes
|
140
|
+
------------- | ------------- | ------------- | -------------
|
141
|
+
**body** | [**Webhook**](Webhook.md)| Webhooks request |
|
142
|
+
|
143
|
+
### Return type
|
144
|
+
|
145
|
+
[**InlineResponse2008**](InlineResponse2008.md)
|
146
|
+
|
147
|
+
### Authorization
|
148
|
+
|
149
|
+
[Bearer](../README.md#Bearer)
|
150
|
+
|
151
|
+
### HTTP request headers
|
152
|
+
|
153
|
+
- **Content-Type**: application/json
|
154
|
+
- **Accept**: application/json
|
155
|
+
|
156
|
+
|
157
|
+
|
data/git_push.sh
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
#
|
3
|
+
# Generated by: https://github.com/swagger-api/swagger-codegen.git
|
4
|
+
#
|
5
|
+
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
6
|
+
#
|
7
|
+
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
|
8
|
+
|
9
|
+
git_user_id=$1
|
10
|
+
git_repo_id=$2
|
11
|
+
release_note=$3
|
12
|
+
|
13
|
+
if [ "$git_user_id" = "" ]; then
|
14
|
+
git_user_id="GIT_USER_ID"
|
15
|
+
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
16
|
+
fi
|
17
|
+
|
18
|
+
if [ "$git_repo_id" = "" ]; then
|
19
|
+
git_repo_id="GIT_REPO_ID"
|
20
|
+
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
21
|
+
fi
|
22
|
+
|
23
|
+
if [ "$release_note" = "" ]; then
|
24
|
+
release_note="Minor update"
|
25
|
+
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
26
|
+
fi
|
27
|
+
|
28
|
+
# Initialize the local directory as a Git repository
|
29
|
+
git init
|
30
|
+
|
31
|
+
# Adds the files in the local repository and stages them for commit.
|
32
|
+
git add .
|
33
|
+
|
34
|
+
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
35
|
+
git commit -m "$release_note"
|
36
|
+
|
37
|
+
# Sets the new remote
|
38
|
+
git_remote=`git remote`
|
39
|
+
if [ "$git_remote" = "" ]; then # git remote not defined
|
40
|
+
|
41
|
+
if [ "$GIT_TOKEN" = "" ]; then
|
42
|
+
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
43
|
+
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
|
44
|
+
else
|
45
|
+
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
|
46
|
+
fi
|
47
|
+
|
48
|
+
fi
|
49
|
+
|
50
|
+
git pull origin master
|
51
|
+
|
52
|
+
# Pushes (Forces) the changes in the local repository up to the remote repository
|
53
|
+
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
|
54
|
+
git push origin master 2>&1 | grep -v 'To https'
|
55
|
+
|
@@ -0,0 +1,90 @@
|
|
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
|
+
# Common files
|
13
|
+
require 'sezzle_client/api_client'
|
14
|
+
require 'sezzle_client/api_error'
|
15
|
+
require 'sezzle_client/version'
|
16
|
+
require 'sezzle_client/configuration'
|
17
|
+
|
18
|
+
# Models
|
19
|
+
require 'sezzle_client/models/address'
|
20
|
+
require 'sezzle_client/models/all_of_session_customer'
|
21
|
+
require 'sezzle_client/models/all_of_session_order'
|
22
|
+
require 'sezzle_client/models/authorization'
|
23
|
+
require 'sezzle_client/models/body'
|
24
|
+
require 'sezzle_client/models/body_1'
|
25
|
+
require 'sezzle_client/models/body_2'
|
26
|
+
require 'sezzle_client/models/body_3'
|
27
|
+
require 'sezzle_client/models/body_4'
|
28
|
+
require 'sezzle_client/models/capture'
|
29
|
+
require 'sezzle_client/models/customer'
|
30
|
+
require 'sezzle_client/models/discount'
|
31
|
+
require 'sezzle_client/models/error'
|
32
|
+
require 'sezzle_client/models/error_inner'
|
33
|
+
require 'sezzle_client/models/inline_response_200'
|
34
|
+
require 'sezzle_client/models/inline_response_200_1'
|
35
|
+
require 'sezzle_client/models/inline_response_200_2'
|
36
|
+
require 'sezzle_client/models/inline_response_200_3'
|
37
|
+
require 'sezzle_client/models/inline_response_200_4'
|
38
|
+
require 'sezzle_client/models/inline_response_200_5'
|
39
|
+
require 'sezzle_client/models/inline_response_200_6'
|
40
|
+
require 'sezzle_client/models/inline_response_200_7'
|
41
|
+
require 'sezzle_client/models/inline_response_200_8'
|
42
|
+
require 'sezzle_client/models/inline_response_200_9'
|
43
|
+
require 'sezzle_client/models/inline_response_200_order'
|
44
|
+
require 'sezzle_client/models/inline_response_201'
|
45
|
+
require 'sezzle_client/models/inline_response_201_1'
|
46
|
+
require 'sezzle_client/models/inline_response_201_1_order'
|
47
|
+
require 'sezzle_client/models/inline_response_201_1_tokenize'
|
48
|
+
require 'sezzle_client/models/installment_plan'
|
49
|
+
require 'sezzle_client/models/intent'
|
50
|
+
require 'sezzle_client/models/line_item'
|
51
|
+
require 'sezzle_client/models/link'
|
52
|
+
require 'sezzle_client/models/notification'
|
53
|
+
require 'sezzle_client/models/order'
|
54
|
+
require 'sezzle_client/models/order_authorization'
|
55
|
+
require 'sezzle_client/models/payout'
|
56
|
+
require 'sezzle_client/models/payout_inner'
|
57
|
+
require 'sezzle_client/models/price'
|
58
|
+
require 'sezzle_client/models/refund'
|
59
|
+
require 'sezzle_client/models/session'
|
60
|
+
require 'sezzle_client/models/session_cancel_url'
|
61
|
+
require 'sezzle_client/models/session_status'
|
62
|
+
require 'sezzle_client/models/token'
|
63
|
+
require 'sezzle_client/models/webhook'
|
64
|
+
|
65
|
+
# APIs
|
66
|
+
require 'sezzle_client/api/bearer_authentication_api'
|
67
|
+
require 'sezzle_client/api/customer_api'
|
68
|
+
require 'sezzle_client/api/order_api'
|
69
|
+
require 'sezzle_client/api/reports_api'
|
70
|
+
require 'sezzle_client/api/session_api'
|
71
|
+
require 'sezzle_client/api/token_api'
|
72
|
+
require 'sezzle_client/api/webhooks_api'
|
73
|
+
|
74
|
+
module SezzleClient
|
75
|
+
class << self
|
76
|
+
# Customize default settings for the SDK using block.
|
77
|
+
# SezzleClient.configure do |config|
|
78
|
+
# config.username = "xxx"
|
79
|
+
# config.password = "xxx"
|
80
|
+
# end
|
81
|
+
# If no block given, return the default Configuration object.
|
82
|
+
def configure
|
83
|
+
if block_given?
|
84
|
+
yield(Configuration.default)
|
85
|
+
else
|
86
|
+
Configuration.default
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
@@ -0,0 +1,76 @@
|
|
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 BearerAuthenticationApi
|
14
|
+
attr_accessor :api_client
|
15
|
+
|
16
|
+
def initialize(api_client = ApiClient.default)
|
17
|
+
@api_client = api_client
|
18
|
+
end
|
19
|
+
# Get bearer authentication token
|
20
|
+
# @param body Authentication request
|
21
|
+
# @param [Hash] opts the optional parameters
|
22
|
+
# @return [InlineResponse201]
|
23
|
+
def post_v1_authentication(body, opts = {})
|
24
|
+
data, _status_code, _headers = post_v1_authentication_with_http_info(body, opts)
|
25
|
+
data
|
26
|
+
end
|
27
|
+
|
28
|
+
# Get bearer authentication token
|
29
|
+
# @param body Authentication request
|
30
|
+
# @param [Hash] opts the optional parameters
|
31
|
+
# @return [Array<(InlineResponse201, Integer, Hash)>] InlineResponse201 data, response status code and response headers
|
32
|
+
def post_v1_authentication_with_http_info(body, opts = {})
|
33
|
+
if @api_client.config.debugging
|
34
|
+
@api_client.config.logger.debug 'Calling API: BearerAuthenticationApi.post_v1_authentication ...'
|
35
|
+
end
|
36
|
+
# verify the required parameter 'body' is set
|
37
|
+
if @api_client.config.client_side_validation && body.nil?
|
38
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling BearerAuthenticationApi.post_v1_authentication"
|
39
|
+
end
|
40
|
+
# resource path
|
41
|
+
local_var_path = '/authentication'
|
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
|
+
# HTTP header 'Content-Type'
|
51
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
52
|
+
|
53
|
+
# form parameters
|
54
|
+
form_params = opts[:form_params] || {}
|
55
|
+
|
56
|
+
# http body (model)
|
57
|
+
post_body = opts[:body] || @api_client.object_to_http_body(body)
|
58
|
+
|
59
|
+
return_type = opts[:return_type] || 'InlineResponse201'
|
60
|
+
|
61
|
+
auth_names = opts[:auth_names] || []
|
62
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
63
|
+
:header_params => header_params,
|
64
|
+
:query_params => query_params,
|
65
|
+
:form_params => form_params,
|
66
|
+
:body => post_body,
|
67
|
+
:auth_names => auth_names,
|
68
|
+
:return_type => return_type)
|
69
|
+
|
70
|
+
if @api_client.config.debugging
|
71
|
+
@api_client.config.logger.debug "API called: BearerAuthenticationApi#post_v1_authentication\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
72
|
+
end
|
73
|
+
return data, status_code, headers
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
@@ -0,0 +1,295 @@
|
|
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 CustomerApi
|
14
|
+
attr_accessor :api_client
|
15
|
+
|
16
|
+
def initialize(api_client = ApiClient.default)
|
17
|
+
@api_client = api_client
|
18
|
+
end
|
19
|
+
# Delete customer
|
20
|
+
# @param customer_uuid Customer UUID
|
21
|
+
# @param [Hash] opts the optional parameters
|
22
|
+
# @return [nil]
|
23
|
+
def delete_v2_token(customer_uuid, opts = {})
|
24
|
+
delete_v2_token_with_http_info(customer_uuid, opts)
|
25
|
+
nil
|
26
|
+
end
|
27
|
+
|
28
|
+
# Delete customer
|
29
|
+
# @param customer_uuid Customer UUID
|
30
|
+
# @param [Hash] opts the optional parameters
|
31
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
32
|
+
def delete_v2_token_with_http_info(customer_uuid, opts = {})
|
33
|
+
if @api_client.config.debugging
|
34
|
+
@api_client.config.logger.debug 'Calling API: CustomerApi.delete_v2_token ...'
|
35
|
+
end
|
36
|
+
# verify the required parameter 'customer_uuid' is set
|
37
|
+
if @api_client.config.client_side_validation && customer_uuid.nil?
|
38
|
+
fail ArgumentError, "Missing the required parameter 'customer_uuid' when calling CustomerApi.delete_v2_token"
|
39
|
+
end
|
40
|
+
# resource path
|
41
|
+
local_var_path = '/customer/{customer_uuid}'.sub('{' + 'customer_uuid' + '}', customer_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]
|
58
|
+
|
59
|
+
auth_names = opts[:auth_names] || ['Bearer']
|
60
|
+
data, status_code, headers = @api_client.call_api(:DELETE, 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: CustomerApi#delete_v2_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
70
|
+
end
|
71
|
+
return data, status_code, headers
|
72
|
+
end
|
73
|
+
# Get customer
|
74
|
+
# @param customer_uuid Customer UUID
|
75
|
+
# @param [Hash] opts the optional parameters
|
76
|
+
# @return [InlineResponse2003]
|
77
|
+
def get_v2_customer(customer_uuid, opts = {})
|
78
|
+
data, _status_code, _headers = get_v2_customer_with_http_info(customer_uuid, opts)
|
79
|
+
data
|
80
|
+
end
|
81
|
+
|
82
|
+
# Get customer
|
83
|
+
# @param customer_uuid Customer UUID
|
84
|
+
# @param [Hash] opts the optional parameters
|
85
|
+
# @return [Array<(InlineResponse2003, Integer, Hash)>] InlineResponse2003 data, response status code and response headers
|
86
|
+
def get_v2_customer_with_http_info(customer_uuid, opts = {})
|
87
|
+
if @api_client.config.debugging
|
88
|
+
@api_client.config.logger.debug 'Calling API: CustomerApi.get_v2_customer ...'
|
89
|
+
end
|
90
|
+
# verify the required parameter 'customer_uuid' is set
|
91
|
+
if @api_client.config.client_side_validation && customer_uuid.nil?
|
92
|
+
fail ArgumentError, "Missing the required parameter 'customer_uuid' when calling CustomerApi.get_v2_customer"
|
93
|
+
end
|
94
|
+
# resource path
|
95
|
+
local_var_path = '/customer/{customer_uuid}'.sub('{' + 'customer_uuid' + '}', customer_uuid.to_s)
|
96
|
+
|
97
|
+
# query parameters
|
98
|
+
query_params = opts[:query_params] || {}
|
99
|
+
|
100
|
+
# header parameters
|
101
|
+
header_params = opts[:header_params] || {}
|
102
|
+
# HTTP header 'Accept' (if needed)
|
103
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
104
|
+
|
105
|
+
# form parameters
|
106
|
+
form_params = opts[:form_params] || {}
|
107
|
+
|
108
|
+
# http body (model)
|
109
|
+
post_body = opts[:body]
|
110
|
+
|
111
|
+
return_type = opts[:return_type] || 'InlineResponse2003'
|
112
|
+
|
113
|
+
auth_names = opts[:auth_names] || ['Bearer']
|
114
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
115
|
+
:header_params => header_params,
|
116
|
+
:query_params => query_params,
|
117
|
+
:form_params => form_params,
|
118
|
+
:body => post_body,
|
119
|
+
:auth_names => auth_names,
|
120
|
+
:return_type => return_type)
|
121
|
+
|
122
|
+
if @api_client.config.debugging
|
123
|
+
@api_client.config.logger.debug "API called: CustomerApi#get_v2_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
124
|
+
end
|
125
|
+
return data, status_code, headers
|
126
|
+
end
|
127
|
+
# Get list of customers
|
128
|
+
# @param [Hash] opts the optional parameters
|
129
|
+
# @return [Array<InlineResponse2002>]
|
130
|
+
def get_v2_customer_list(opts = {})
|
131
|
+
data, _status_code, _headers = get_v2_customer_list_with_http_info(opts)
|
132
|
+
data
|
133
|
+
end
|
134
|
+
|
135
|
+
# Get list of customers
|
136
|
+
# @param [Hash] opts the optional parameters
|
137
|
+
# @return [Array<(Array<InlineResponse2002>, Integer, Hash)>] Array<InlineResponse2002> data, response status code and response headers
|
138
|
+
def get_v2_customer_list_with_http_info(opts = {})
|
139
|
+
if @api_client.config.debugging
|
140
|
+
@api_client.config.logger.debug 'Calling API: CustomerApi.get_v2_customer_list ...'
|
141
|
+
end
|
142
|
+
# resource path
|
143
|
+
local_var_path = '/customer'
|
144
|
+
|
145
|
+
# query parameters
|
146
|
+
query_params = opts[:query_params] || {}
|
147
|
+
|
148
|
+
# header parameters
|
149
|
+
header_params = opts[:header_params] || {}
|
150
|
+
# HTTP header 'Accept' (if needed)
|
151
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
152
|
+
|
153
|
+
# form parameters
|
154
|
+
form_params = opts[:form_params] || {}
|
155
|
+
|
156
|
+
# http body (model)
|
157
|
+
post_body = opts[:body]
|
158
|
+
|
159
|
+
return_type = opts[:return_type] || 'Array<InlineResponse2002>'
|
160
|
+
|
161
|
+
auth_names = opts[:auth_names] || ['Bearer']
|
162
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
163
|
+
:header_params => header_params,
|
164
|
+
:query_params => query_params,
|
165
|
+
:form_params => form_params,
|
166
|
+
:body => post_body,
|
167
|
+
:auth_names => auth_names,
|
168
|
+
:return_type => return_type)
|
169
|
+
|
170
|
+
if @api_client.config.debugging
|
171
|
+
@api_client.config.logger.debug "API called: CustomerApi#get_v2_customer_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
172
|
+
end
|
173
|
+
return data, status_code, headers
|
174
|
+
end
|
175
|
+
# Create order by customer
|
176
|
+
# @param customer_uuid Customer UUID
|
177
|
+
# @param [Hash] opts the optional parameters
|
178
|
+
# @option opts [Body2] :body Order request
|
179
|
+
# @option opts [String] :sezzle_request_id Unique client-generated ID to enforce idempotency
|
180
|
+
# @return [InlineResponse2005]
|
181
|
+
def post_v2_customer_order(customer_uuid, opts = {})
|
182
|
+
data, _status_code, _headers = post_v2_customer_order_with_http_info(customer_uuid, opts)
|
183
|
+
data
|
184
|
+
end
|
185
|
+
|
186
|
+
# Create order by customer
|
187
|
+
# @param customer_uuid Customer UUID
|
188
|
+
# @param [Hash] opts the optional parameters
|
189
|
+
# @option opts [Body2] :body Order request
|
190
|
+
# @option opts [String] :sezzle_request_id Unique client-generated ID to enforce idempotency
|
191
|
+
# @return [Array<(InlineResponse2005, Integer, Hash)>] InlineResponse2005 data, response status code and response headers
|
192
|
+
def post_v2_customer_order_with_http_info(customer_uuid, opts = {})
|
193
|
+
if @api_client.config.debugging
|
194
|
+
@api_client.config.logger.debug 'Calling API: CustomerApi.post_v2_customer_order ...'
|
195
|
+
end
|
196
|
+
# verify the required parameter 'customer_uuid' is set
|
197
|
+
if @api_client.config.client_side_validation && customer_uuid.nil?
|
198
|
+
fail ArgumentError, "Missing the required parameter 'customer_uuid' when calling CustomerApi.post_v2_customer_order"
|
199
|
+
end
|
200
|
+
# resource path
|
201
|
+
local_var_path = '/customer/{customer_uuid}/order'.sub('{' + 'customer_uuid' + '}', customer_uuid.to_s)
|
202
|
+
|
203
|
+
# query parameters
|
204
|
+
query_params = opts[:query_params] || {}
|
205
|
+
|
206
|
+
# header parameters
|
207
|
+
header_params = opts[:header_params] || {}
|
208
|
+
# HTTP header 'Accept' (if needed)
|
209
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
210
|
+
# HTTP header 'Content-Type'
|
211
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
212
|
+
header_params[:'Sezzle-Request-Id'] = opts[:'sezzle_request_id'] if !opts[:'sezzle_request_id'].nil?
|
213
|
+
|
214
|
+
# form parameters
|
215
|
+
form_params = opts[:form_params] || {}
|
216
|
+
|
217
|
+
# http body (model)
|
218
|
+
post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body'])
|
219
|
+
|
220
|
+
return_type = opts[:return_type] || 'InlineResponse2005'
|
221
|
+
|
222
|
+
auth_names = opts[:auth_names] || ['Bearer']
|
223
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
224
|
+
:header_params => header_params,
|
225
|
+
:query_params => query_params,
|
226
|
+
:form_params => form_params,
|
227
|
+
:body => post_body,
|
228
|
+
:auth_names => auth_names,
|
229
|
+
:return_type => return_type)
|
230
|
+
|
231
|
+
if @api_client.config.debugging
|
232
|
+
@api_client.config.logger.debug "API called: CustomerApi#post_v2_customer_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
233
|
+
end
|
234
|
+
return data, status_code, headers
|
235
|
+
end
|
236
|
+
# Preapprove amount by customer
|
237
|
+
# @param customer_uuid Customer UUID
|
238
|
+
# @param [Hash] opts the optional parameters
|
239
|
+
# @option opts [Price] :body Preapproval request
|
240
|
+
# @return [InlineResponse2004]
|
241
|
+
def preapprove_v2_token(customer_uuid, opts = {})
|
242
|
+
data, _status_code, _headers = preapprove_v2_token_with_http_info(customer_uuid, opts)
|
243
|
+
data
|
244
|
+
end
|
245
|
+
|
246
|
+
# Preapprove amount by customer
|
247
|
+
# @param customer_uuid Customer UUID
|
248
|
+
# @param [Hash] opts the optional parameters
|
249
|
+
# @option opts [Price] :body Preapproval request
|
250
|
+
# @return [Array<(InlineResponse2004, Integer, Hash)>] InlineResponse2004 data, response status code and response headers
|
251
|
+
def preapprove_v2_token_with_http_info(customer_uuid, opts = {})
|
252
|
+
if @api_client.config.debugging
|
253
|
+
@api_client.config.logger.debug 'Calling API: CustomerApi.preapprove_v2_token ...'
|
254
|
+
end
|
255
|
+
# verify the required parameter 'customer_uuid' is set
|
256
|
+
if @api_client.config.client_side_validation && customer_uuid.nil?
|
257
|
+
fail ArgumentError, "Missing the required parameter 'customer_uuid' when calling CustomerApi.preapprove_v2_token"
|
258
|
+
end
|
259
|
+
# resource path
|
260
|
+
local_var_path = '/customer/{customer_uuid}/preapprove'.sub('{' + 'customer_uuid' + '}', customer_uuid.to_s)
|
261
|
+
|
262
|
+
# query parameters
|
263
|
+
query_params = opts[:query_params] || {}
|
264
|
+
|
265
|
+
# header parameters
|
266
|
+
header_params = opts[:header_params] || {}
|
267
|
+
# HTTP header 'Accept' (if needed)
|
268
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
269
|
+
# HTTP header 'Content-Type'
|
270
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
271
|
+
|
272
|
+
# form parameters
|
273
|
+
form_params = opts[:form_params] || {}
|
274
|
+
|
275
|
+
# http body (model)
|
276
|
+
post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body'])
|
277
|
+
|
278
|
+
return_type = opts[:return_type] || 'InlineResponse2004'
|
279
|
+
|
280
|
+
auth_names = opts[:auth_names] || ['Bearer']
|
281
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
282
|
+
:header_params => header_params,
|
283
|
+
:query_params => query_params,
|
284
|
+
:form_params => form_params,
|
285
|
+
:body => post_body,
|
286
|
+
:auth_names => auth_names,
|
287
|
+
:return_type => return_type)
|
288
|
+
|
289
|
+
if @api_client.config.debugging
|
290
|
+
@api_client.config.logger.debug "API called: CustomerApi#preapprove_v2_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
291
|
+
end
|
292
|
+
return data, status_code, headers
|
293
|
+
end
|
294
|
+
end
|
295
|
+
end
|