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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +27 -19
  3. data/lib/billingrails/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 533de1c2ddd178a3ce99a071fb42338e66ccd8b0d17ea93c3166ed89d56412b5
4
- data.tar.gz: 64ebd4646a1309903e4ebb263a7477d72fd50fb0340504e2bb2cbab574c24e8a
3
+ metadata.gz: 578d04e03ffeda8152c01935292f52b588d735dd51410fd1cd1b738f207f8ea4
4
+ data.tar.gz: 0e717f9b4d706c23c22e1cd73858f43af220c1a44515c0b4f5a6e4f1bd3aec61
5
5
  SHA512:
6
- metadata.gz: e1efb59f2b63b4474cb7e2f75e95017dddfbf7ce6970352327c2dd6e44a9e5026eb8833e095010f5d9898c3ee4629f642282dd78a4a8fc7ca3aa0b2fd836a431
7
- data.tar.gz: d3b5487d232aa5d22c8415fe21c365b6bfc79997bfef9f594f86eef8a37c47b3b31a7ea7c0626cae8802ac9e781d13966182116aa17e91edde5320be8716e55e
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
+ [![Gem Version](https://badge.fury.io/rb/billingrails.svg)](https://rubygems.org/gems/billingrails)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](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
- # Access top-level resources
37
- accounts = client.accounts.list
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
- # Access nested seller resources
47
- products = client.seller.products.list
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 resources
57
- updated_account = client.accounts.update(
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
- # Delete resources
63
- client.accounts.delete('account_id')
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).
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Billingrails
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: billingrails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Billingrails