devdraft 1.0.0 → 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 +4 -4
- data/README.md +86 -1088
- data/devdraft_ai_sdk.gemspec +2 -2
- data/example.rb +94 -0
- data/git_push.sh +1 -1
- data/lib/devdraft/api_error.rb +1 -1
- data/lib/devdraft/configuration.rb +1 -1
- data/lib/devdraft/version.rb +2 -2
- metadata +3 -2
data/README.md
CHANGED
@@ -1,1120 +1,118 @@
|
|
1
|
-
#
|
1
|
+
# Devdraft Ruby SDK
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
A comprehensive payment processing and business management API that enables seamless integration of cryptocurrency and traditional payment methods.
|
6
|
-
|
7
|
-
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
8
|
-
|
9
|
-
- API version: 1.0.0
|
10
|
-
- Package version: 1.0.0
|
11
|
-
- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen
|
3
|
+
A Ruby client library for the Devdraft Payment & Business Management API.
|
12
4
|
|
13
5
|
## Installation
|
14
6
|
|
15
|
-
|
7
|
+
Add this line to your application's Gemfile:
|
16
8
|
|
17
|
-
|
18
|
-
|
19
|
-
```shell
|
20
|
-
gem build devdraft_ai_sdk.gemspec
|
9
|
+
```ruby
|
10
|
+
gem 'devdraft', '~> 1.0.1'
|
21
11
|
```
|
22
12
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
gem install ./devdraft_ai_sdk-1.0.0.gem
|
13
|
+
And then execute:
|
14
|
+
```bash
|
15
|
+
$ bundle install
|
27
16
|
```
|
28
|
-
(for development, run `gem install --dev ./devdraft_ai_sdk-1.0.0.gem` to install the development dependencies)
|
29
|
-
|
30
|
-
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
31
|
-
|
32
|
-
Finally add this to the Gemfile:
|
33
|
-
|
34
|
-
gem 'devdraft_ai_sdk', '~> 1.0.0'
|
35
17
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
gem 'devdraft_ai_sdk', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
|
41
|
-
|
42
|
-
### Include the Ruby code directly
|
43
|
-
|
44
|
-
Include the Ruby code directly using `-I` as follows:
|
45
|
-
|
46
|
-
```shell
|
47
|
-
ruby -Ilib script.rb
|
18
|
+
Or install it yourself as:
|
19
|
+
```bash
|
20
|
+
$ gem install devdraft
|
48
21
|
```
|
49
22
|
|
50
|
-
##
|
51
|
-
|
52
|
-
Please follow the [installation](#installation) procedure and then run the following code:
|
53
|
-
```ruby
|
54
|
-
# Load the gem
|
55
|
-
require 'devdraft_ai_sdk'
|
56
|
-
|
57
|
-
api_instance = DevDraftAI::APIHealthApi.new
|
58
|
-
|
59
|
-
begin
|
60
|
-
#Authenticated health check endpoint
|
61
|
-
result = api_instance.health_controller_check_v0
|
62
|
-
p result
|
63
|
-
rescue DevDraftAI::ApiError => e
|
64
|
-
puts "Exception when calling APIHealthApi->health_controller_check_v0: #{e}"
|
65
|
-
end
|
66
|
-
|
67
|
-
api_instance = DevDraftAI::APIHealthApi.new
|
68
|
-
|
69
|
-
begin
|
70
|
-
#Public health check endpoint
|
71
|
-
result = api_instance.health_controller_public_health_check_v0
|
72
|
-
p result
|
73
|
-
rescue DevDraftAI::ApiError => e
|
74
|
-
puts "Exception when calling APIHealthApi->health_controller_public_health_check_v0: #{e}"
|
75
|
-
end
|
76
|
-
# Setup authorization
|
77
|
-
DevDraftAI.configure do |config|
|
78
|
-
# Configure API key authorization: x-client-key
|
79
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
80
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
81
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
82
|
-
|
83
|
-
# Configure API key authorization: x-client-secret
|
84
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
85
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
86
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
87
|
-
end
|
88
|
-
|
89
|
-
api_instance = DevDraftAI::AppBalancesApi.new
|
90
|
-
|
91
|
-
begin
|
92
|
-
#Get all stablecoin balances for an app
|
93
|
-
result = api_instance.balance_controller_get_all_balances
|
94
|
-
p result
|
95
|
-
rescue DevDraftAI::ApiError => e
|
96
|
-
puts "Exception when calling AppBalancesApi->balance_controller_get_all_balances: #{e}"
|
97
|
-
end
|
98
|
-
# Setup authorization
|
99
|
-
DevDraftAI.configure do |config|
|
100
|
-
# Configure API key authorization: x-client-key
|
101
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
102
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
103
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
104
|
-
|
105
|
-
# Configure API key authorization: x-client-secret
|
106
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
107
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
108
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
109
|
-
end
|
110
|
-
|
111
|
-
api_instance = DevDraftAI::AppBalancesApi.new
|
112
|
-
|
113
|
-
begin
|
114
|
-
#Get EURC balance for an app
|
115
|
-
result = api_instance.balance_controller_get_eurc_balance
|
116
|
-
p result
|
117
|
-
rescue DevDraftAI::ApiError => e
|
118
|
-
puts "Exception when calling AppBalancesApi->balance_controller_get_eurc_balance: #{e}"
|
119
|
-
end
|
120
|
-
# Setup authorization
|
121
|
-
DevDraftAI.configure do |config|
|
122
|
-
# Configure API key authorization: x-client-key
|
123
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
124
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
125
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
126
|
-
|
127
|
-
# Configure API key authorization: x-client-secret
|
128
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
129
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
130
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
131
|
-
end
|
132
|
-
|
133
|
-
api_instance = DevDraftAI::AppBalancesApi.new
|
134
|
-
|
135
|
-
begin
|
136
|
-
#Get USDC balance for an app
|
137
|
-
result = api_instance.balance_controller_get_usdc_balance
|
138
|
-
p result
|
139
|
-
rescue DevDraftAI::ApiError => e
|
140
|
-
puts "Exception when calling AppBalancesApi->balance_controller_get_usdc_balance: #{e}"
|
141
|
-
end
|
142
|
-
# Setup authorization
|
143
|
-
DevDraftAI.configure do |config|
|
144
|
-
# Configure API key authorization: x-client-key
|
145
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
146
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
147
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
148
|
-
|
149
|
-
# Configure API key authorization: x-client-secret
|
150
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
151
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
152
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
153
|
-
end
|
154
|
-
|
155
|
-
api_instance = DevDraftAI::CustomersApi.new
|
156
|
-
body = DevDraftAI::CreateCustomerDto.new # CreateCustomerDto | Customer creation data
|
157
|
-
|
158
|
-
|
159
|
-
begin
|
160
|
-
#Create a new customer
|
161
|
-
api_instance.customer_controller_create(body)
|
162
|
-
rescue DevDraftAI::ApiError => e
|
163
|
-
puts "Exception when calling CustomersApi->customer_controller_create: #{e}"
|
164
|
-
end
|
165
|
-
# Setup authorization
|
166
|
-
DevDraftAI.configure do |config|
|
167
|
-
# Configure API key authorization: x-client-key
|
168
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
169
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
170
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
171
|
-
|
172
|
-
# Configure API key authorization: x-client-secret
|
173
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
174
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
175
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
176
|
-
end
|
177
|
-
|
178
|
-
api_instance = DevDraftAI::CustomersApi.new
|
179
|
-
opts = {
|
180
|
-
status: 'status_example', # String | Filter by customer status
|
181
|
-
name: 'name_example', # String | Filter by customer name
|
182
|
-
email: 'email_example', # String | Filter by customer email
|
183
|
-
take: DevDraftAI::BigDecimal.new, # BigDecimal | Number of records to take
|
184
|
-
skip: DevDraftAI::BigDecimal.new # BigDecimal | Number of records to skip
|
185
|
-
}
|
186
|
-
|
187
|
-
begin
|
188
|
-
#Get all customers with filters
|
189
|
-
api_instance.customer_controller_find_all(opts)
|
190
|
-
rescue DevDraftAI::ApiError => e
|
191
|
-
puts "Exception when calling CustomersApi->customer_controller_find_all: #{e}"
|
192
|
-
end
|
193
|
-
# Setup authorization
|
194
|
-
DevDraftAI.configure do |config|
|
195
|
-
# Configure API key authorization: x-client-key
|
196
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
197
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
198
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
199
|
-
|
200
|
-
# Configure API key authorization: x-client-secret
|
201
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
202
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
203
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
204
|
-
end
|
205
|
-
|
206
|
-
api_instance = DevDraftAI::CustomersApi.new
|
207
|
-
id = 'id_example' # String |
|
208
|
-
|
209
|
-
|
210
|
-
begin
|
211
|
-
#Get a customer by ID
|
212
|
-
api_instance.customer_controller_find_one(id)
|
213
|
-
rescue DevDraftAI::ApiError => e
|
214
|
-
puts "Exception when calling CustomersApi->customer_controller_find_one: #{e}"
|
215
|
-
end
|
216
|
-
# Setup authorization
|
217
|
-
DevDraftAI.configure do |config|
|
218
|
-
# Configure API key authorization: x-client-key
|
219
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
220
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
221
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
222
|
-
|
223
|
-
# Configure API key authorization: x-client-secret
|
224
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
225
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
226
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
227
|
-
end
|
228
|
-
|
229
|
-
api_instance = DevDraftAI::CustomersApi.new
|
230
|
-
body = DevDraftAI::UpdateCustomerDto.new # UpdateCustomerDto | Customer update data
|
231
|
-
id = 'id_example' # String |
|
232
|
-
|
233
|
-
|
234
|
-
begin
|
235
|
-
#Update a customer
|
236
|
-
api_instance.customer_controller_update(body, id)
|
237
|
-
rescue DevDraftAI::ApiError => e
|
238
|
-
puts "Exception when calling CustomersApi->customer_controller_update: #{e}"
|
239
|
-
end
|
240
|
-
# Setup authorization
|
241
|
-
DevDraftAI.configure do |config|
|
242
|
-
# Configure API key authorization: x-client-key
|
243
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
244
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
245
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
246
|
-
|
247
|
-
# Configure API key authorization: x-client-secret
|
248
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
249
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
250
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
251
|
-
end
|
252
|
-
|
253
|
-
api_instance = DevDraftAI::ExchangeRatesApi.new
|
254
|
-
|
255
|
-
begin
|
256
|
-
#Get EUR to USD exchange rate
|
257
|
-
result = api_instance.exchange_rate_controller_get_eurto_usd_rate
|
258
|
-
p result
|
259
|
-
rescue DevDraftAI::ApiError => e
|
260
|
-
puts "Exception when calling ExchangeRatesApi->exchange_rate_controller_get_eurto_usd_rate: #{e}"
|
261
|
-
end
|
262
|
-
# Setup authorization
|
263
|
-
DevDraftAI.configure do |config|
|
264
|
-
# Configure API key authorization: x-client-key
|
265
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
266
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
267
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
268
|
-
|
269
|
-
# Configure API key authorization: x-client-secret
|
270
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
271
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
272
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
273
|
-
end
|
23
|
+
## Usage
|
274
24
|
|
275
|
-
|
276
|
-
from = 'from_example' # String | Source currency code (e.g., usd)
|
277
|
-
to = 'to_example' # String | Target currency code (e.g., eur)
|
278
|
-
|
279
|
-
|
280
|
-
begin
|
281
|
-
#Get exchange rate between specified currencies
|
282
|
-
result = api_instance.exchange_rate_controller_get_exchange_rate(from, to)
|
283
|
-
p result
|
284
|
-
rescue DevDraftAI::ApiError => e
|
285
|
-
puts "Exception when calling ExchangeRatesApi->exchange_rate_controller_get_exchange_rate: #{e}"
|
286
|
-
end
|
287
|
-
# Setup authorization
|
288
|
-
DevDraftAI.configure do |config|
|
289
|
-
# Configure API key authorization: x-client-key
|
290
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
291
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
292
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
293
|
-
|
294
|
-
# Configure API key authorization: x-client-secret
|
295
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
296
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
297
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
298
|
-
end
|
299
|
-
|
300
|
-
api_instance = DevDraftAI::ExchangeRatesApi.new
|
301
|
-
|
302
|
-
begin
|
303
|
-
#Get USD to EUR exchange rate
|
304
|
-
result = api_instance.exchange_rate_controller_get_usdto_eur_rate
|
305
|
-
p result
|
306
|
-
rescue DevDraftAI::ApiError => e
|
307
|
-
puts "Exception when calling ExchangeRatesApi->exchange_rate_controller_get_usdto_eur_rate: #{e}"
|
308
|
-
end
|
309
|
-
# Setup authorization
|
310
|
-
DevDraftAI.configure do |config|
|
311
|
-
# Configure API key authorization: x-client-key
|
312
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
313
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
314
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
315
|
-
|
316
|
-
# Configure API key authorization: x-client-secret
|
317
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
318
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
319
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
320
|
-
end
|
321
|
-
|
322
|
-
api_instance = DevDraftAI::InvoicesApi.new
|
323
|
-
body = DevDraftAI::CreateInvoiceDto.new # CreateInvoiceDto |
|
324
|
-
|
325
|
-
|
326
|
-
begin
|
327
|
-
#Create a new invoice
|
328
|
-
api_instance.invoice_controller_create(body)
|
329
|
-
rescue DevDraftAI::ApiError => e
|
330
|
-
puts "Exception when calling InvoicesApi->invoice_controller_create: #{e}"
|
331
|
-
end
|
332
|
-
# Setup authorization
|
333
|
-
DevDraftAI.configure do |config|
|
334
|
-
# Configure API key authorization: x-client-key
|
335
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
336
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
337
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
338
|
-
|
339
|
-
# Configure API key authorization: x-client-secret
|
340
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
341
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
342
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
343
|
-
end
|
344
|
-
|
345
|
-
api_instance = DevDraftAI::InvoicesApi.new
|
346
|
-
opts = {
|
347
|
-
skip: DevDraftAI::BigDecimal.new, # BigDecimal | Number of records to skip
|
348
|
-
take: DevDraftAI::BigDecimal.new # BigDecimal | Number of records to take
|
349
|
-
}
|
350
|
-
|
351
|
-
begin
|
352
|
-
#Get all invoices
|
353
|
-
api_instance.invoice_controller_find_all(opts)
|
354
|
-
rescue DevDraftAI::ApiError => e
|
355
|
-
puts "Exception when calling InvoicesApi->invoice_controller_find_all: #{e}"
|
356
|
-
end
|
357
|
-
# Setup authorization
|
358
|
-
DevDraftAI.configure do |config|
|
359
|
-
# Configure API key authorization: x-client-key
|
360
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
361
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
362
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
363
|
-
|
364
|
-
# Configure API key authorization: x-client-secret
|
365
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
366
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
367
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
368
|
-
end
|
369
|
-
|
370
|
-
api_instance = DevDraftAI::InvoicesApi.new
|
371
|
-
id = 'id_example' # String | Invoice ID
|
372
|
-
|
373
|
-
|
374
|
-
begin
|
375
|
-
#Get an invoice by ID
|
376
|
-
api_instance.invoice_controller_find_one(id)
|
377
|
-
rescue DevDraftAI::ApiError => e
|
378
|
-
puts "Exception when calling InvoicesApi->invoice_controller_find_one: #{e}"
|
379
|
-
end
|
380
|
-
# Setup authorization
|
381
|
-
DevDraftAI.configure do |config|
|
382
|
-
# Configure API key authorization: x-client-key
|
383
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
384
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
385
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
386
|
-
|
387
|
-
# Configure API key authorization: x-client-secret
|
388
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
389
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
390
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
391
|
-
end
|
392
|
-
|
393
|
-
api_instance = DevDraftAI::InvoicesApi.new
|
394
|
-
body = DevDraftAI::CreateInvoiceDto.new # CreateInvoiceDto |
|
395
|
-
id = 'id_example' # String | Invoice ID
|
396
|
-
|
397
|
-
|
398
|
-
begin
|
399
|
-
#Update an invoice
|
400
|
-
api_instance.invoice_controller_update(body, id)
|
401
|
-
rescue DevDraftAI::ApiError => e
|
402
|
-
puts "Exception when calling InvoicesApi->invoice_controller_update: #{e}"
|
403
|
-
end
|
404
|
-
|
405
|
-
api_instance = DevDraftAI::LiquidationAddressesApi.new
|
406
|
-
body = DevDraftAI::CreateLiquidationAddressDto.new # CreateLiquidationAddressDto |
|
407
|
-
customer_id = 'customer_id_example' # String | Unique identifier for the customer
|
408
|
-
|
409
|
-
|
410
|
-
begin
|
411
|
-
#Create a new liquidation address for a customer
|
412
|
-
result = api_instance.liquidation_address_controller_create_liquidation_address(body, customer_id)
|
413
|
-
p result
|
414
|
-
rescue DevDraftAI::ApiError => e
|
415
|
-
puts "Exception when calling LiquidationAddressesApi->liquidation_address_controller_create_liquidation_address: #{e}"
|
416
|
-
end
|
417
|
-
|
418
|
-
api_instance = DevDraftAI::LiquidationAddressesApi.new
|
419
|
-
customer_id = 'customer_id_example' # String | Unique identifier for the customer
|
420
|
-
liquidation_address_id = 'liquidation_address_id_example' # String | Unique identifier for the liquidation address
|
421
|
-
|
422
|
-
|
423
|
-
begin
|
424
|
-
#Get a specific liquidation address
|
425
|
-
result = api_instance.liquidation_address_controller_get_liquidation_address(customer_id, liquidation_address_id)
|
426
|
-
p result
|
427
|
-
rescue DevDraftAI::ApiError => e
|
428
|
-
puts "Exception when calling LiquidationAddressesApi->liquidation_address_controller_get_liquidation_address: #{e}"
|
429
|
-
end
|
430
|
-
|
431
|
-
api_instance = DevDraftAI::LiquidationAddressesApi.new
|
432
|
-
customer_id = 'customer_id_example' # String | Unique identifier for the customer
|
433
|
-
|
434
|
-
|
435
|
-
begin
|
436
|
-
#Get all liquidation addresses for a customer
|
437
|
-
result = api_instance.liquidation_address_controller_get_liquidation_addresses(customer_id)
|
438
|
-
p result
|
439
|
-
rescue DevDraftAI::ApiError => e
|
440
|
-
puts "Exception when calling LiquidationAddressesApi->liquidation_address_controller_get_liquidation_addresses: #{e}"
|
441
|
-
end
|
442
|
-
# Setup authorization
|
443
|
-
DevDraftAI.configure do |config|
|
444
|
-
# Configure API key authorization: x-client-key
|
445
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
446
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
447
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
448
|
-
|
449
|
-
# Configure API key authorization: x-client-secret
|
450
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
451
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
452
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
453
|
-
end
|
454
|
-
|
455
|
-
api_instance = DevDraftAI::PaymentIntentsApi.new
|
456
|
-
body = DevDraftAI::CreateBankPaymentIntentDto.new # CreateBankPaymentIntentDto | Bank payment intent creation data
|
457
|
-
idempotency_key = 'idempotency_key_example' # String | Unique UUID v4 for idempotent requests. Prevents duplicate payments.
|
458
|
-
|
459
|
-
|
460
|
-
begin
|
461
|
-
#Create a bank payment intent
|
462
|
-
api_instance.payment_intent_controller_create_bank_payment_intent(body, idempotency_key)
|
463
|
-
rescue DevDraftAI::ApiError => e
|
464
|
-
puts "Exception when calling PaymentIntentsApi->payment_intent_controller_create_bank_payment_intent: #{e}"
|
465
|
-
end
|
466
|
-
# Setup authorization
|
467
|
-
DevDraftAI.configure do |config|
|
468
|
-
# Configure API key authorization: x-client-key
|
469
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
470
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
471
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
472
|
-
|
473
|
-
# Configure API key authorization: x-client-secret
|
474
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
475
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
476
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
477
|
-
end
|
478
|
-
|
479
|
-
api_instance = DevDraftAI::PaymentIntentsApi.new
|
480
|
-
body = DevDraftAI::CreateStablePaymentIntentDto.new # CreateStablePaymentIntentDto | Stable payment intent creation data
|
481
|
-
idempotency_key = 'idempotency_key_example' # String | Unique UUID v4 for idempotent requests. Prevents duplicate payments.
|
482
|
-
|
483
|
-
|
484
|
-
begin
|
485
|
-
#Create a stable payment intent
|
486
|
-
api_instance.payment_intent_controller_create_stable_payment_intent(body, idempotency_key)
|
487
|
-
rescue DevDraftAI::ApiError => e
|
488
|
-
puts "Exception when calling PaymentIntentsApi->payment_intent_controller_create_stable_payment_intent: #{e}"
|
489
|
-
end
|
490
|
-
# Setup authorization
|
491
|
-
DevDraftAI.configure do |config|
|
492
|
-
# Configure API key authorization: x-client-key
|
493
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
494
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
495
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
496
|
-
|
497
|
-
# Configure API key authorization: x-client-secret
|
498
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
499
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
500
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
501
|
-
end
|
502
|
-
|
503
|
-
api_instance = DevDraftAI::PaymentLinksApi.new
|
504
|
-
body = DevDraftAI::CreatePaymentLinkDto.new # CreatePaymentLinkDto | Payment link creation data
|
505
|
-
|
506
|
-
|
507
|
-
begin
|
508
|
-
#Create a new payment link
|
509
|
-
api_instance.payment_links_controller_create(body)
|
510
|
-
rescue DevDraftAI::ApiError => e
|
511
|
-
puts "Exception when calling PaymentLinksApi->payment_links_controller_create: #{e}"
|
512
|
-
end
|
513
|
-
# Setup authorization
|
514
|
-
DevDraftAI.configure do |config|
|
515
|
-
# Configure API key authorization: x-client-key
|
516
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
517
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
518
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
519
|
-
|
520
|
-
# Configure API key authorization: x-client-secret
|
521
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
522
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
523
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
524
|
-
end
|
525
|
-
|
526
|
-
api_instance = DevDraftAI::PaymentLinksApi.new
|
527
|
-
opts = {
|
528
|
-
skip: 'skip_example', # String | Number of records to skip (must be non-negative)
|
529
|
-
take: 'take_example' # String | Number of records to take (must be positive)
|
530
|
-
}
|
531
|
-
|
532
|
-
begin
|
533
|
-
#Get all payment links
|
534
|
-
api_instance.payment_links_controller_find_all(opts)
|
535
|
-
rescue DevDraftAI::ApiError => e
|
536
|
-
puts "Exception when calling PaymentLinksApi->payment_links_controller_find_all: #{e}"
|
537
|
-
end
|
538
|
-
# Setup authorization
|
539
|
-
DevDraftAI.configure do |config|
|
540
|
-
# Configure API key authorization: x-client-key
|
541
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
542
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
543
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
25
|
+
### Basic Setup
|
544
26
|
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
#
|
557
|
-
|
558
|
-
rescue DevDraftAI::ApiError => e
|
559
|
-
puts "Exception when calling PaymentLinksApi->payment_links_controller_find_one: #{e}"
|
560
|
-
end
|
561
|
-
# Setup authorization
|
562
|
-
DevDraftAI.configure do |config|
|
563
|
-
# Configure API key authorization: x-client-key
|
564
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
565
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
566
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
567
|
-
|
568
|
-
# Configure API key authorization: x-client-secret
|
569
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
570
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
571
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
572
|
-
end
|
573
|
-
|
574
|
-
api_instance = DevDraftAI::PaymentLinksApi.new
|
575
|
-
body = DevDraftAI::UpdatePaymentLinkDto.new # UpdatePaymentLinkDto |
|
576
|
-
id = 'id_example' # String | Payment Link ID
|
577
|
-
|
578
|
-
|
579
|
-
begin
|
580
|
-
#Update a payment link
|
581
|
-
api_instance.payment_links_controller_update(body, id)
|
582
|
-
rescue DevDraftAI::ApiError => e
|
583
|
-
puts "Exception when calling PaymentLinksApi->payment_links_controller_update: #{e}"
|
584
|
-
end
|
585
|
-
# Setup authorization
|
586
|
-
DevDraftAI.configure do |config|
|
587
|
-
# Configure API key authorization: x-client-key
|
588
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
589
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
590
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
591
|
-
|
592
|
-
# Configure API key authorization: x-client-secret
|
593
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
594
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
595
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
596
|
-
end
|
597
|
-
|
598
|
-
api_instance = DevDraftAI::ProductsApi.new
|
599
|
-
name = 'name_example' # String |
|
600
|
-
description = 'description_example' # String |
|
601
|
-
price = DevDraftAI::BigDecimal.new # BigDecimal |
|
602
|
-
currency = 'currency_example' # String |
|
603
|
-
type = 'type_example' # String |
|
604
|
-
weight = DevDraftAI::BigDecimal.new # BigDecimal |
|
605
|
-
unit = 'unit_example' # String |
|
606
|
-
quantity = DevDraftAI::BigDecimal.new # BigDecimal |
|
607
|
-
stock_count = DevDraftAI::BigDecimal.new # BigDecimal |
|
608
|
-
status = 'status_example' # String |
|
609
|
-
product_type = 'product_type_example' # String |
|
610
|
-
images = ['images_example'] # Array<String> |
|
611
|
-
|
612
|
-
|
613
|
-
begin
|
614
|
-
#Create a new product
|
615
|
-
api_instance.product_controller_create(name, description, price, currency, type, weight, unit, quantity, stock_count, status, product_type, images)
|
616
|
-
rescue DevDraftAI::ApiError => e
|
617
|
-
puts "Exception when calling ProductsApi->product_controller_create: #{e}"
|
618
|
-
end
|
619
|
-
# Setup authorization
|
620
|
-
DevDraftAI.configure do |config|
|
621
|
-
# Configure API key authorization: x-client-key
|
622
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
623
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
624
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
625
|
-
|
626
|
-
# Configure API key authorization: x-client-secret
|
627
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
628
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
629
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
630
|
-
end
|
631
|
-
|
632
|
-
api_instance = DevDraftAI::ProductsApi.new
|
633
|
-
opts = {
|
634
|
-
skip: DevDraftAI::BigDecimal.new, # BigDecimal | Number of records to skip
|
635
|
-
take: DevDraftAI::BigDecimal.new # BigDecimal | Number of records to take
|
636
|
-
}
|
637
|
-
|
638
|
-
begin
|
639
|
-
#Get all products
|
640
|
-
api_instance.product_controller_find_all(opts)
|
641
|
-
rescue DevDraftAI::ApiError => e
|
642
|
-
puts "Exception when calling ProductsApi->product_controller_find_all: #{e}"
|
643
|
-
end
|
644
|
-
# Setup authorization
|
645
|
-
DevDraftAI.configure do |config|
|
646
|
-
# Configure API key authorization: x-client-key
|
647
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
648
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
649
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
650
|
-
|
651
|
-
# Configure API key authorization: x-client-secret
|
652
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
653
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
654
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
655
|
-
end
|
656
|
-
|
657
|
-
api_instance = DevDraftAI::ProductsApi.new
|
658
|
-
id = 'id_example' # String | Product ID
|
659
|
-
|
660
|
-
|
661
|
-
begin
|
662
|
-
#Get a product by ID
|
663
|
-
api_instance.product_controller_find_one(id)
|
664
|
-
rescue DevDraftAI::ApiError => e
|
665
|
-
puts "Exception when calling ProductsApi->product_controller_find_one: #{e}"
|
666
|
-
end
|
667
|
-
# Setup authorization
|
668
|
-
DevDraftAI.configure do |config|
|
669
|
-
# Configure API key authorization: x-client-key
|
670
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
671
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
672
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
673
|
-
|
674
|
-
# Configure API key authorization: x-client-secret
|
675
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
676
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
677
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
678
|
-
end
|
679
|
-
|
680
|
-
api_instance = DevDraftAI::ProductsApi.new
|
681
|
-
id = 'id_example' # String | Product ID
|
682
|
-
|
683
|
-
|
684
|
-
begin
|
685
|
-
#Delete a product
|
686
|
-
api_instance.product_controller_remove(id)
|
687
|
-
rescue DevDraftAI::ApiError => e
|
688
|
-
puts "Exception when calling ProductsApi->product_controller_remove: #{e}"
|
689
|
-
end
|
690
|
-
# Setup authorization
|
691
|
-
DevDraftAI.configure do |config|
|
692
|
-
# Configure API key authorization: x-client-key
|
693
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
694
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
695
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
696
|
-
|
697
|
-
# Configure API key authorization: x-client-secret
|
698
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
699
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
700
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
701
|
-
end
|
702
|
-
|
703
|
-
api_instance = DevDraftAI::ProductsApi.new
|
704
|
-
name = 'name_example' # String |
|
705
|
-
description = 'description_example' # String |
|
706
|
-
price = DevDraftAI::BigDecimal.new # BigDecimal |
|
707
|
-
currency = 'currency_example' # String |
|
708
|
-
type = 'type_example' # String |
|
709
|
-
weight = DevDraftAI::BigDecimal.new # BigDecimal |
|
710
|
-
unit = 'unit_example' # String |
|
711
|
-
quantity = DevDraftAI::BigDecimal.new # BigDecimal |
|
712
|
-
stock_count = DevDraftAI::BigDecimal.new # BigDecimal |
|
713
|
-
status = 'status_example' # String |
|
714
|
-
product_type = 'product_type_example' # String |
|
715
|
-
images = ['images_example'] # Array<String> |
|
716
|
-
id = 'id_example' # String | Product ID
|
717
|
-
|
718
|
-
|
719
|
-
begin
|
720
|
-
#Update a product
|
721
|
-
api_instance.product_controller_update(name, description, price, currency, type, weight, unit, quantity, stock_count, status, product_type, images, id)
|
722
|
-
rescue DevDraftAI::ApiError => e
|
723
|
-
puts "Exception when calling ProductsApi->product_controller_update: #{e}"
|
724
|
-
end
|
725
|
-
# Setup authorization
|
726
|
-
DevDraftAI.configure do |config|
|
727
|
-
# Configure API key authorization: x-client-key
|
728
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
729
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
730
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
731
|
-
|
732
|
-
# Configure API key authorization: x-client-secret
|
733
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
734
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
735
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
736
|
-
end
|
737
|
-
|
738
|
-
api_instance = DevDraftAI::ProductsApi.new
|
739
|
-
id = 'id_example' # String | Product ID
|
740
|
-
|
741
|
-
|
742
|
-
begin
|
743
|
-
#Upload images for a product
|
744
|
-
api_instance.product_controller_upload_image(id)
|
745
|
-
rescue DevDraftAI::ApiError => e
|
746
|
-
puts "Exception when calling ProductsApi->product_controller_upload_image: #{e}"
|
747
|
-
end
|
748
|
-
# Setup authorization
|
749
|
-
DevDraftAI.configure do |config|
|
750
|
-
# Configure API key authorization: x-client-key
|
751
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
752
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
753
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
754
|
-
|
755
|
-
# Configure API key authorization: x-client-secret
|
756
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
757
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
758
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
759
|
-
end
|
760
|
-
|
761
|
-
api_instance = DevDraftAI::TaxesApi.new
|
762
|
-
body = DevDraftAI::CreateTaxInput.new # CreateTaxInput |
|
763
|
-
|
764
|
-
|
765
|
-
begin
|
766
|
-
#Create a new tax
|
767
|
-
api_instance.tax_controller_create(body)
|
768
|
-
rescue DevDraftAI::ApiError => e
|
769
|
-
puts "Exception when calling TaxesApi->tax_controller_create: #{e}"
|
770
|
-
end
|
771
|
-
# Setup authorization
|
772
|
-
DevDraftAI.configure do |config|
|
773
|
-
# Configure API key authorization: x-client-key
|
774
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
775
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
776
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
777
|
-
|
778
|
-
# Configure API key authorization: x-client-secret
|
779
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
780
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
781
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
782
|
-
end
|
783
|
-
|
784
|
-
api_instance = DevDraftAI::TaxesApi.new
|
785
|
-
opts = {
|
786
|
-
skip: 'skip_example', # String | Number of records to skip
|
787
|
-
take: 'take_example' # String | Number of records to take
|
788
|
-
}
|
789
|
-
|
790
|
-
begin
|
791
|
-
#Get all taxes
|
792
|
-
api_instance.tax_controller_find_all(opts)
|
793
|
-
rescue DevDraftAI::ApiError => e
|
794
|
-
puts "Exception when calling TaxesApi->tax_controller_find_all: #{e}"
|
795
|
-
end
|
796
|
-
# Setup authorization
|
797
|
-
DevDraftAI.configure do |config|
|
798
|
-
# Configure API key authorization: x-client-key
|
799
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
800
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
801
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
802
|
-
|
803
|
-
# Configure API key authorization: x-client-secret
|
804
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
805
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
806
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
807
|
-
end
|
808
|
-
|
809
|
-
api_instance = DevDraftAI::TaxesApi.new
|
810
|
-
id = 'id_example' # String | Tax ID
|
811
|
-
|
812
|
-
|
813
|
-
begin
|
814
|
-
#Get a tax by ID
|
815
|
-
api_instance.tax_controller_find_one(id)
|
816
|
-
rescue DevDraftAI::ApiError => e
|
817
|
-
puts "Exception when calling TaxesApi->tax_controller_find_one: #{e}"
|
818
|
-
end
|
819
|
-
# Setup authorization
|
820
|
-
DevDraftAI.configure do |config|
|
821
|
-
# Configure API key authorization: x-client-key
|
822
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
823
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
824
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
825
|
-
|
826
|
-
# Configure API key authorization: x-client-secret
|
827
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
828
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
829
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
830
|
-
end
|
831
|
-
|
832
|
-
api_instance = DevDraftAI::TaxesApi.new
|
833
|
-
id = 'id_example' # String | Tax ID
|
834
|
-
|
835
|
-
|
836
|
-
begin
|
837
|
-
#Delete a tax
|
838
|
-
api_instance.tax_controller_remove(id)
|
839
|
-
rescue DevDraftAI::ApiError => e
|
840
|
-
puts "Exception when calling TaxesApi->tax_controller_remove: #{e}"
|
841
|
-
end
|
842
|
-
# Setup authorization
|
843
|
-
DevDraftAI.configure do |config|
|
844
|
-
# Configure API key authorization: x-client-key
|
845
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
846
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
847
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
848
|
-
|
849
|
-
# Configure API key authorization: x-client-secret
|
850
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
851
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
852
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
853
|
-
end
|
854
|
-
|
855
|
-
api_instance = DevDraftAI::TaxesApi.new
|
856
|
-
body = DevDraftAI::UpdateTaxInput.new # UpdateTaxInput |
|
857
|
-
id = 'id_example' # String | Tax ID
|
858
|
-
|
859
|
-
|
860
|
-
begin
|
861
|
-
#Update a tax
|
862
|
-
api_instance.tax_controller_update(body, id)
|
863
|
-
rescue DevDraftAI::ApiError => e
|
864
|
-
puts "Exception when calling TaxesApi->tax_controller_update: #{e}"
|
865
|
-
end
|
866
|
-
|
867
|
-
api_instance = DevDraftAI::TestPaymentsApi.new
|
868
|
-
body = DevDraftAI::PaymentRequestDto.new # PaymentRequestDto |
|
869
|
-
idempotency_key = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # String | Unique key to ensure the request is idempotent. If a request with the same key is sent multiple times, only the first will be processed, and subsequent requests will return the same response.
|
870
|
-
|
871
|
-
|
872
|
-
begin
|
873
|
-
#Process a test payment
|
874
|
-
result = api_instance.test_payment_controller_create_payment_v0(body, idempotency_key)
|
875
|
-
p result
|
876
|
-
rescue DevDraftAI::ApiError => e
|
877
|
-
puts "Exception when calling TestPaymentsApi->test_payment_controller_create_payment_v0: #{e}"
|
878
|
-
end
|
879
|
-
|
880
|
-
api_instance = DevDraftAI::TestPaymentsApi.new
|
881
|
-
id = 'id_example' # String | Payment ID
|
882
|
-
|
883
|
-
|
884
|
-
begin
|
885
|
-
#Get payment details by ID
|
886
|
-
result = api_instance.test_payment_controller_get_payment_v0(id)
|
887
|
-
p result
|
888
|
-
rescue DevDraftAI::ApiError => e
|
889
|
-
puts "Exception when calling TestPaymentsApi->test_payment_controller_get_payment_v0: #{e}"
|
890
|
-
end
|
891
|
-
|
892
|
-
api_instance = DevDraftAI::TestPaymentsApi.new
|
893
|
-
id = 'id_example' # String | Payment ID to refund
|
894
|
-
idempotency_key = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # String | Unique key to ensure the refund request is idempotent. If a request with the same key is sent multiple times, only the first will be processed, and subsequent requests will return the same response.
|
895
|
-
|
896
|
-
|
897
|
-
begin
|
898
|
-
#Refund a payment
|
899
|
-
result = api_instance.test_payment_controller_refund_payment_v0(id, idempotency_key)
|
900
|
-
p result
|
901
|
-
rescue DevDraftAI::ApiError => e
|
902
|
-
puts "Exception when calling TestPaymentsApi->test_payment_controller_refund_payment_v0: #{e}"
|
903
|
-
end
|
904
|
-
# Setup authorization
|
905
|
-
DevDraftAI.configure do |config|
|
906
|
-
# Configure API key authorization: x-client-key
|
907
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
908
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
909
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
910
|
-
|
911
|
-
# Configure API key authorization: x-client-secret
|
912
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
913
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
914
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
915
|
-
end
|
916
|
-
|
917
|
-
api_instance = DevDraftAI::TransfersApi.new
|
918
|
-
body = DevDraftAI::CreateDirectBankTransferDto.new # CreateDirectBankTransferDto |
|
919
|
-
|
920
|
-
|
921
|
-
begin
|
922
|
-
#Create a direct bank transfer
|
923
|
-
api_instance.transfer_controller_create_direct_bank_transfer(body)
|
924
|
-
rescue DevDraftAI::ApiError => e
|
925
|
-
puts "Exception when calling TransfersApi->transfer_controller_create_direct_bank_transfer: #{e}"
|
926
|
-
end
|
927
|
-
# Setup authorization
|
928
|
-
DevDraftAI.configure do |config|
|
929
|
-
# Configure API key authorization: x-client-key
|
930
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
931
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
932
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
933
|
-
|
934
|
-
# Configure API key authorization: x-client-secret
|
935
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
936
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
937
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
938
|
-
end
|
939
|
-
|
940
|
-
api_instance = DevDraftAI::TransfersApi.new
|
941
|
-
body = DevDraftAI::CreateDirectWalletTransferDto.new # CreateDirectWalletTransferDto |
|
942
|
-
|
943
|
-
|
944
|
-
begin
|
945
|
-
#Create a direct wallet transfer
|
946
|
-
api_instance.transfer_controller_create_direct_wallet_transfer(body)
|
947
|
-
rescue DevDraftAI::ApiError => e
|
948
|
-
puts "Exception when calling TransfersApi->transfer_controller_create_direct_wallet_transfer: #{e}"
|
949
|
-
end
|
950
|
-
# Setup authorization
|
951
|
-
DevDraftAI.configure do |config|
|
952
|
-
# Configure API key authorization: x-client-key
|
953
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
954
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
955
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
956
|
-
|
957
|
-
# Configure API key authorization: x-client-secret
|
958
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
959
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
960
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
961
|
-
end
|
962
|
-
|
963
|
-
api_instance = DevDraftAI::TransfersApi.new
|
964
|
-
body = DevDraftAI::CreateStablecoinConversionDto.new # CreateStablecoinConversionDto |
|
965
|
-
|
966
|
-
|
967
|
-
begin
|
968
|
-
#Create a stablecoin conversion
|
969
|
-
api_instance.transfer_controller_create_stablecoin_conversion(body)
|
970
|
-
rescue DevDraftAI::ApiError => e
|
971
|
-
puts "Exception when calling TransfersApi->transfer_controller_create_stablecoin_conversion: #{e}"
|
972
|
-
end
|
973
|
-
# Setup authorization
|
974
|
-
DevDraftAI.configure do |config|
|
975
|
-
# Configure API key authorization: x-client-key
|
976
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
977
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
978
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
979
|
-
|
980
|
-
# Configure API key authorization: x-client-secret
|
981
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
982
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
983
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
984
|
-
end
|
985
|
-
|
986
|
-
api_instance = DevDraftAI::WalletsApi.new
|
987
|
-
|
988
|
-
begin
|
989
|
-
#Get wallets for an app
|
990
|
-
api_instance.wallet_controller_get_wallets
|
991
|
-
rescue DevDraftAI::ApiError => e
|
992
|
-
puts "Exception when calling WalletsApi->wallet_controller_get_wallets: #{e}"
|
993
|
-
end
|
994
|
-
# Setup authorization
|
995
|
-
DevDraftAI.configure do |config|
|
996
|
-
# Configure API key authorization: x-client-key
|
997
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
998
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
999
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
1000
|
-
|
1001
|
-
# Configure API key authorization: x-client-secret
|
1002
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
1003
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
1004
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
1005
|
-
end
|
1006
|
-
|
1007
|
-
api_instance = DevDraftAI::WebhooksApi.new
|
1008
|
-
body = DevDraftAI::CreateWebhookDto.new # CreateWebhookDto | Webhook configuration details
|
1009
|
-
|
1010
|
-
|
1011
|
-
begin
|
1012
|
-
#Create a new webhook
|
1013
|
-
result = api_instance.webhook_controller_create(body)
|
1014
|
-
p result
|
1015
|
-
rescue DevDraftAI::ApiError => e
|
1016
|
-
puts "Exception when calling WebhooksApi->webhook_controller_create: #{e}"
|
27
|
+
```ruby
|
28
|
+
require 'devdraft'
|
29
|
+
|
30
|
+
# Configure the SDK
|
31
|
+
Devdraft.configure do |config|
|
32
|
+
# Set your API key (required for authenticated endpoints)
|
33
|
+
config.api_key['api_key'] = 'YOUR_API_KEY'
|
34
|
+
|
35
|
+
# Optional: Set a custom base URL if needed
|
36
|
+
# config.base_url = 'https://api.devdraft.com'
|
37
|
+
|
38
|
+
# Optional: Enable debug logging
|
39
|
+
config.debugging = true
|
1017
40
|
end
|
1018
|
-
|
1019
|
-
DevDraftAI.configure do |config|
|
1020
|
-
# Configure API key authorization: x-client-key
|
1021
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
1022
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
1023
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
41
|
+
```
|
1024
42
|
|
1025
|
-
|
1026
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
1027
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
1028
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
1029
|
-
end
|
43
|
+
### Examples
|
1030
44
|
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
take: DevDraftAI::BigDecimal.new # BigDecimal | Number of records to return (default: 10)
|
1035
|
-
}
|
45
|
+
#### Health Check
|
46
|
+
```ruby
|
47
|
+
api_instance = Devdraft::APIHealthApi.new
|
1036
48
|
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
p result
|
1041
|
-
rescue DevDraftAI::ApiError => e
|
1042
|
-
puts "Exception when calling WebhooksApi->webhook_controller_find_all: #{e}"
|
1043
|
-
end
|
1044
|
-
# Setup authorization
|
1045
|
-
DevDraftAI.configure do |config|
|
1046
|
-
# Configure API key authorization: x-client-key
|
1047
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
1048
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
1049
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
49
|
+
# Public health check (no auth required)
|
50
|
+
result = api_instance.health_controller_public_health_check_v0
|
51
|
+
puts result.inspect
|
1050
52
|
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
end
|
53
|
+
# Authenticated health check
|
54
|
+
result = api_instance.health_controller_check_v0
|
55
|
+
puts result.inspect
|
56
|
+
```
|
1056
57
|
|
1057
|
-
|
1058
|
-
|
58
|
+
#### List Customers
|
59
|
+
```ruby
|
60
|
+
api_instance = Devdraft::CustomersApi.new
|
61
|
+
|
62
|
+
# List customers with pagination
|
63
|
+
result = api_instance.customers_controller_list_v0(
|
64
|
+
page: 1,
|
65
|
+
limit: 10
|
66
|
+
)
|
67
|
+
puts result.inspect
|
68
|
+
```
|
1059
69
|
|
70
|
+
#### Create Payment Link
|
71
|
+
```ruby
|
72
|
+
api_instance = Devdraft::PaymentLinksApi.new
|
73
|
+
|
74
|
+
# Create a payment link
|
75
|
+
payment_link = Devdraft::CreatePaymentLinkDto.new(
|
76
|
+
amount: 100.00,
|
77
|
+
currency: 'USD',
|
78
|
+
description: 'Test Payment Link',
|
79
|
+
expires_at: (Time.now + 86400).iso8601 # 24 hours from now
|
80
|
+
)
|
81
|
+
|
82
|
+
result = api_instance.payment_links_controller_create_v0(payment_link)
|
83
|
+
puts result.inspect
|
84
|
+
```
|
1060
85
|
|
1061
|
-
|
1062
|
-
#Get a webhook by id
|
1063
|
-
result = api_instance.webhook_controller_find_one(id)
|
1064
|
-
p result
|
1065
|
-
rescue DevDraftAI::ApiError => e
|
1066
|
-
puts "Exception when calling WebhooksApi->webhook_controller_find_one: #{e}"
|
1067
|
-
end
|
1068
|
-
# Setup authorization
|
1069
|
-
DevDraftAI.configure do |config|
|
1070
|
-
# Configure API key authorization: x-client-key
|
1071
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
1072
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
1073
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
86
|
+
### Available APIs
|
1074
87
|
|
1075
|
-
|
1076
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
1077
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
1078
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
1079
|
-
end
|
88
|
+
The SDK provides access to the following APIs:
|
1080
89
|
|
1081
|
-
|
1082
|
-
|
90
|
+
- `APIHealthApi`: Health check endpoints
|
91
|
+
- `AppBalancesApi`: Balance management
|
92
|
+
- `CustomersApi`: Customer management
|
93
|
+
- `ExchangeRatesApi`: Exchange rate information
|
94
|
+
- `InvoicesApi`: Invoice management
|
95
|
+
- `LiquidationAddressesApi`: Liquidation address management
|
96
|
+
- `PaymentIntentsApi`: Payment intent management
|
97
|
+
- `PaymentLinksApi`: Payment link management
|
98
|
+
- `ProductsApi`: Product management
|
99
|
+
- `TaxesApi`: Tax management
|
100
|
+
- `TestPaymentsApi`: Test payment endpoints
|
101
|
+
- `TransfersApi`: Transfer management
|
102
|
+
- `WalletsApi`: Wallet management
|
103
|
+
- `WebhooksApi`: Webhook management
|
1083
104
|
|
105
|
+
## Development
|
1084
106
|
|
1085
|
-
|
1086
|
-
#Delete a webhook
|
1087
|
-
result = api_instance.webhook_controller_remove(id)
|
1088
|
-
p result
|
1089
|
-
rescue DevDraftAI::ApiError => e
|
1090
|
-
puts "Exception when calling WebhooksApi->webhook_controller_remove: #{e}"
|
1091
|
-
end
|
1092
|
-
# Setup authorization
|
1093
|
-
DevDraftAI.configure do |config|
|
1094
|
-
# Configure API key authorization: x-client-key
|
1095
|
-
config.api_key['x-client-key'] = 'YOUR API KEY'
|
1096
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
1097
|
-
#config.api_key_prefix['x-client-key'] = 'Bearer'
|
107
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests.
|
1098
108
|
|
1099
|
-
|
1100
|
-
config.api_key['x-client-secret'] = 'YOUR API KEY'
|
1101
|
-
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
1102
|
-
#config.api_key_prefix['x-client-secret'] = 'Bearer'
|
1103
|
-
end
|
109
|
+
## Contributing
|
1104
110
|
|
1105
|
-
|
1106
|
-
body = DevDraftAI::UpdateWebhookDto.new # UpdateWebhookDto | Webhook update details
|
1107
|
-
id = 'id_example' # String | Webhook ID
|
111
|
+
Bug reports and pull requests are welcome on GitHub.
|
1108
112
|
|
113
|
+
## License
|
1109
114
|
|
1110
|
-
|
1111
|
-
#Update a webhook
|
1112
|
-
result = api_instance.webhook_controller_update(body, id)
|
1113
|
-
p result
|
1114
|
-
rescue DevDraftAI::ApiError => e
|
1115
|
-
puts "Exception when calling WebhooksApi->webhook_controller_update: #{e}"
|
1116
|
-
end
|
1117
|
-
```
|
115
|
+
The gem is available as open source under the terms of the [Unlicense](http://unlicense.org/).
|
1118
116
|
|
1119
117
|
## Documentation for API Endpoints
|
1120
118
|
|