billingrails 0.1.0 → 0.1.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 +27 -19
- data/lib/billingrails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 578d04e03ffeda8152c01935292f52b588d735dd51410fd1cd1b738f207f8ea4
|
|
4
|
+
data.tar.gz: 0e717f9b4d706c23c22e1cd73858f43af220c1a44515c0b4f5a6e4f1bd3aec61
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6ca2172ccfe271014ff2dfb8a6cdd16486334345b6dabf53e992112560e170dfe02e8fa7884d0a2411f0231567eb2485612024b545172e2cdbdce5e5d276e279
|
|
7
|
+
data.tar.gz: 284159ff6cf0727e3315ee82b06ecdc7536f4e98a3ef70b64a2e0d7f5962420e0b4a1dd27eceffb3e7d8e87096822c80f95ff6d305cc29bb4d80d9d2ab27e4d1
|
data/README.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# Billingrails Ruby SDK
|
|
2
2
|
|
|
3
|
+
[](https://rubygems.org/gems/billingrails)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
|
|
3
6
|
Official Ruby SDK for the Billingrails API - Flexible, composable, and intuitive API-first commerce platform.
|
|
4
7
|
|
|
5
8
|
## Installation
|
|
@@ -33,34 +36,34 @@ client = Billingrails::Client.new(
|
|
|
33
36
|
base_url: 'https://api.billingrails.com/v1' # optional
|
|
34
37
|
)
|
|
35
38
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
account = client.accounts.get('account_id')
|
|
39
|
-
|
|
40
|
-
# Access nested biller resources
|
|
41
|
-
events = client.biller.events.list
|
|
42
|
-
meters = client.biller.meters.list
|
|
43
|
-
plans = client.biller.plans.list
|
|
44
|
-
subscriptions = client.biller.subscriptions.list
|
|
39
|
+
list_response = client.accounts.list
|
|
40
|
+
puts list_response['accounts']
|
|
45
41
|
|
|
46
|
-
#
|
|
47
|
-
|
|
48
|
-
orders = client.seller.orders.list
|
|
49
|
-
|
|
50
|
-
# Create resources
|
|
51
|
-
new_account = client.accounts.create(
|
|
42
|
+
# Create account
|
|
43
|
+
create_response = client.accounts.create(
|
|
52
44
|
name: 'Acme Corp',
|
|
53
45
|
email: 'billing@acme.com'
|
|
54
46
|
)
|
|
47
|
+
puts create_response['account']
|
|
48
|
+
|
|
49
|
+
# Get account
|
|
50
|
+
retrieve_response = client.accounts.get('account_id')
|
|
51
|
+
puts retrieve_response['account']
|
|
55
52
|
|
|
56
|
-
# Update
|
|
57
|
-
|
|
53
|
+
# Update account
|
|
54
|
+
update_response = client.accounts.update(
|
|
58
55
|
'account_id',
|
|
59
56
|
name: 'Acme Corporation'
|
|
60
57
|
)
|
|
58
|
+
puts update_response['account']
|
|
61
59
|
|
|
62
|
-
#
|
|
63
|
-
client.accounts.
|
|
60
|
+
# Get account balances
|
|
61
|
+
balances_response = client.accounts.get_balances('account_id')
|
|
62
|
+
puts balances_response['balances']
|
|
63
|
+
|
|
64
|
+
# Debit an account
|
|
65
|
+
debit_response = client.accounts.debit('account_id', amount: 1000, currency: 'USD')
|
|
66
|
+
puts debit_response['balances']
|
|
64
67
|
```
|
|
65
68
|
|
|
66
69
|
## Error Handling
|
|
@@ -80,6 +83,7 @@ rescue Billingrails::ApiError => e
|
|
|
80
83
|
puts "API error: #{e.message}"
|
|
81
84
|
puts "Status: #{e.status}"
|
|
82
85
|
puts "Code: #{e.code}"
|
|
86
|
+
puts "Details: #{e.details}"
|
|
83
87
|
rescue Billingrails::ConnectionError => e
|
|
84
88
|
puts "Connection error: #{e.message}"
|
|
85
89
|
end
|
|
@@ -108,3 +112,7 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/billin
|
|
|
108
112
|
## License
|
|
109
113
|
|
|
110
114
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
|
115
|
+
|
|
116
|
+
## Support
|
|
117
|
+
|
|
118
|
+
For support, please contact [ugo@billingrails.com](mailto:ugo@billingrails.com) or visit our [documentation](https://docs.billingrails.com).
|
data/lib/billingrails/version.rb
CHANGED