devdraft 1.0.0 → 1.0.2
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 +138 -1073
- data/devdraft_ai_sdk.gemspec +5 -5
- data/example.rb +129 -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 +6 -5
data/devdraft_ai_sdk.gemspec
CHANGED
@@ -16,11 +16,11 @@ require "devdraft/version"
|
|
16
16
|
|
17
17
|
Gem::Specification.new do |s|
|
18
18
|
s.name = "devdraft"
|
19
|
-
s.version =
|
19
|
+
s.version = Devdraft::VERSION
|
20
20
|
s.platform = Gem::Platform::RUBY
|
21
|
-
s.authors = ["
|
22
|
-
s.email = [""]
|
23
|
-
s.homepage = "https://github.com/
|
21
|
+
s.authors = ["Devdraft Engineer"]
|
22
|
+
s.email = ["engineering@devdraft.ai"]
|
23
|
+
s.homepage = "https://github.com/devdraftengineer/devdraft-sdk-ruby"
|
24
24
|
s.summary = "Devdraft Payment & Business Management API Ruby Gem"
|
25
25
|
s.description = " A comprehensive payment processing and business management API that enables seamless integration of cryptocurrency and traditional payment methods. "
|
26
26
|
s.license = "Unlicense"
|
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
|
|
31
31
|
|
32
32
|
s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
|
33
33
|
|
34
|
-
s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
|
34
|
+
s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? && !f.end_with?('.gem') }
|
35
35
|
s.test_files = `find spec/*`.split("\n")
|
36
36
|
s.executables = []
|
37
37
|
s.require_paths = ["lib"]
|
data/example.rb
ADDED
@@ -0,0 +1,129 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# Example usage of the Devdraft Ruby SDK
|
3
|
+
#
|
4
|
+
# Installation:
|
5
|
+
# gem install devdraft
|
6
|
+
#
|
7
|
+
# Usage:
|
8
|
+
# ruby example.rb
|
9
|
+
|
10
|
+
require 'devdraft'
|
11
|
+
|
12
|
+
# Configure the SDK
|
13
|
+
Devdraft.configure do |config|
|
14
|
+
# Set your authentication headers (required for authenticated endpoints)
|
15
|
+
config.default_headers = {
|
16
|
+
'x-client-key' => 'YOUR_CLIENT_KEY',
|
17
|
+
'x-secret-key' => 'YOUR_SECRET_KEY'
|
18
|
+
}
|
19
|
+
|
20
|
+
# Optional: Set a custom base URL if needed
|
21
|
+
# config.base_url = 'https://api.devdraft.com'
|
22
|
+
|
23
|
+
# Optional: Enable debug logging
|
24
|
+
config.debugging = true
|
25
|
+
end
|
26
|
+
|
27
|
+
# Example 1: Health Check
|
28
|
+
def check_health
|
29
|
+
puts "\n=== Health Check Example ==="
|
30
|
+
api_instance = Devdraft::APIHealthApi.new
|
31
|
+
|
32
|
+
begin
|
33
|
+
# Public health check (no auth required)
|
34
|
+
result = api_instance.health_controller_public_health_check_v0
|
35
|
+
puts "Public Health Check Response:"
|
36
|
+
puts result.inspect
|
37
|
+
|
38
|
+
# Authenticated health check
|
39
|
+
result = api_instance.health_controller_check_v0
|
40
|
+
puts "\nAuthenticated Health Check Response:"
|
41
|
+
puts result.inspect
|
42
|
+
rescue => e
|
43
|
+
puts "Error during health check: #{e}"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
# Example 2: Create Customer
|
48
|
+
def create_customer
|
49
|
+
puts "\n=== Create Customer Example ==="
|
50
|
+
api_instance = Devdraft::CustomersApi.new
|
51
|
+
|
52
|
+
begin
|
53
|
+
# Create a new customer
|
54
|
+
customer_data = Devdraft::CreateCustomerDto.new(
|
55
|
+
email: 'customer@example.com',
|
56
|
+
name: 'John Doe',
|
57
|
+
status: 'active'
|
58
|
+
)
|
59
|
+
|
60
|
+
result = api_instance.customer_controller_create(customer_data)
|
61
|
+
puts "Customer Created:"
|
62
|
+
puts result.inspect
|
63
|
+
rescue => e
|
64
|
+
puts "Error creating customer: #{e}"
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
# Example 3: Create Payment Link
|
69
|
+
def create_payment_link
|
70
|
+
puts "\n=== Create Payment Link Example ==="
|
71
|
+
api_instance = Devdraft::PaymentLinksApi.new
|
72
|
+
|
73
|
+
begin
|
74
|
+
# Create a payment link
|
75
|
+
payment_link = Devdraft::CreatePaymentLinkDto.new(
|
76
|
+
amount: 99.99,
|
77
|
+
currency: 'USD',
|
78
|
+
description: 'Premium Subscription',
|
79
|
+
expires_at: (Time.now + 7.days).iso8601, # Expires in 7 days
|
80
|
+
products: [
|
81
|
+
Devdraft::PaymentLinkProductDto.new(
|
82
|
+
name: 'Premium Plan',
|
83
|
+
quantity: 1,
|
84
|
+
price: 99.99
|
85
|
+
)
|
86
|
+
]
|
87
|
+
)
|
88
|
+
|
89
|
+
result = api_instance.payment_links_controller_create(payment_link)
|
90
|
+
puts "Payment Link Created:"
|
91
|
+
puts result.inspect
|
92
|
+
rescue => e
|
93
|
+
puts "Error creating payment link: #{e}"
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
# Example 4: Check Balance
|
98
|
+
def check_balance
|
99
|
+
puts "\n=== Check Balance Example ==="
|
100
|
+
api_instance = Devdraft::AppBalancesApi.new
|
101
|
+
|
102
|
+
begin
|
103
|
+
# Get all balances
|
104
|
+
balances = api_instance.balance_controller_get_all_balances
|
105
|
+
puts "All Balances:"
|
106
|
+
puts balances.inspect
|
107
|
+
|
108
|
+
# Get specific currency balance
|
109
|
+
usdc_balance = api_instance.balance_controller_get_usdc_balance
|
110
|
+
puts "\nUSDC Balance:"
|
111
|
+
puts usdc_balance.inspect
|
112
|
+
rescue => e
|
113
|
+
puts "Error checking balance: #{e}"
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
# Run examples
|
118
|
+
puts "Devdraft Ruby SDK Examples"
|
119
|
+
puts "=========================="
|
120
|
+
puts "Make sure to set your client key and secret key in the configuration block above."
|
121
|
+
puts "You can generate these keys from https://console.devdraft.ai under App Settings."
|
122
|
+
puts "Running examples..."
|
123
|
+
|
124
|
+
check_health
|
125
|
+
create_customer
|
126
|
+
create_payment_link
|
127
|
+
check_balance
|
128
|
+
|
129
|
+
puts "\nExamples completed!"
|
data/git_push.sh
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
# Set repository details
|
10
10
|
GIT_USER_ID="devraftengineer"
|
11
11
|
GIT_REPO_ID="devdraft-sdk-ruby"
|
12
|
-
RELEASE_NOTE="Initial release:
|
12
|
+
RELEASE_NOTE="Initial release: Devdraft Ruby SDK"
|
13
13
|
GIT_REPO_BASE_URL="github.com"
|
14
14
|
|
15
15
|
# Initialize the local directory as a Git repository
|
data/lib/devdraft/api_error.rb
CHANGED
data/lib/devdraft/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devdraft
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Devdraft Engineer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-06-
|
11
|
+
date: 2025-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -74,7 +74,7 @@ description: " A comprehensive payment processing and business management API th
|
|
74
74
|
enables seamless integration of cryptocurrency and traditional payment methods.
|
75
75
|
\ "
|
76
76
|
email:
|
77
|
-
-
|
77
|
+
- engineering@devdraft.ai
|
78
78
|
executables: []
|
79
79
|
extensions: []
|
80
80
|
extra_rdoc_files: []
|
@@ -146,6 +146,7 @@ files:
|
|
146
146
|
- docs/WalletsApi.md
|
147
147
|
- docs/WebhookResponseDto.md
|
148
148
|
- docs/WebhooksApi.md
|
149
|
+
- example.rb
|
149
150
|
- git_push.sh
|
150
151
|
- lib/devdraft.rb
|
151
152
|
- lib/devdraft/api/api_health_api.rb
|
@@ -282,7 +283,7 @@ files:
|
|
282
283
|
- spec/models/update_webhook_dto_spec.rb
|
283
284
|
- spec/models/webhook_response_dto_spec.rb
|
284
285
|
- spec/spec_helper.rb
|
285
|
-
homepage: https://github.com/
|
286
|
+
homepage: https://github.com/devdraftengineer/devdraft-sdk-ruby
|
286
287
|
licenses:
|
287
288
|
- Unlicense
|
288
289
|
metadata: {}
|