billingrails 0.1.0 → 0.1.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 +22 -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: 51e32909ce012de12e828bc182f1d551c6fdec8f495ce7bd86990174e29ae2bd
|
|
4
|
+
data.tar.gz: fe67a0677ae3ac21c849c05a95d7c979ad50fa714cc1f5657421908293eb4e18
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7d0200556471c793462be1bd2151aba7aa413cb2ef09908f613ed14b4b6d4c8f18920b31671fa2a33a396f9cfcac2c9b467069325b5ec3b288261a1352667a56
|
|
7
|
+
data.tar.gz: 5abc2ecbc45b64538e8cb26629305a8a42471e5667960204ee9b081f563fd8ad910a9864660bf85533f9e34f57da528b50d62a8730cf31e65ca859ee0450a7d4
|
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
|
|
45
|
-
|
|
46
|
-
# Access nested seller resources
|
|
47
|
-
products = client.seller.products.list
|
|
48
|
-
orders = client.seller.orders.list
|
|
39
|
+
accounts_response = client.accounts.list
|
|
40
|
+
puts accounts_response['accounts']
|
|
49
41
|
|
|
50
|
-
# Create
|
|
51
|
-
|
|
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']
|
|
55
48
|
|
|
56
|
-
#
|
|
57
|
-
|
|
49
|
+
# Get account
|
|
50
|
+
retrieve_response = client.accounts.get('account_id')
|
|
51
|
+
puts retrieve_response['account']
|
|
52
|
+
|
|
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']
|
|
59
|
+
|
|
60
|
+
# Get account balances
|
|
61
|
+
balances_response = client.accounts.get_balances('account_id')
|
|
62
|
+
puts balances_response['balances']
|
|
61
63
|
|
|
62
|
-
#
|
|
63
|
-
client.accounts.
|
|
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
|
data/lib/billingrails/version.rb
CHANGED