billingrails 0.1.4 → 0.1.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c6540c12536a79581b58dfe34526856d58c4a494683303d561d6015d2f754ee2
4
- data.tar.gz: cf68e2730ba1d797b01369663adc63360480c56f5766212e5dc3786eb6945065
3
+ metadata.gz: 4f0eda2df91ec2654e98f944817eb5325bf9c597685c27f7f20f56433075f454
4
+ data.tar.gz: e2d82ca82c7ec47bd6118fa35d74725b36ea5cc431e4c1a948fa2621edd46b2b
5
5
  SHA512:
6
- metadata.gz: cd76e5497426ff054db77fdc9547181bd2a541e75366f90c121aa324e81a931c56bb163dd8e06cbc84ce528ce99f60ba5683ae36dbf2a5f31dcba8b1e5269207
7
- data.tar.gz: 3a90f654fc1bb57ebf205fca028ca953d7ebb04631e3fa4d757ff67bb928117ea92874884bb9602499ba86eddc317af5d6ecf50be7032a529bc70f7e461fcdc3
6
+ metadata.gz: 77ac91beb1982d7f043deb7a483f34e2ee8b6eccb0e8323d42c84615fba60c683e7b285877da18be3c720d159f4d9abf15116ff7034f049aef40a6d21b660b66
7
+ data.tar.gz: 1284de3a16a9ff9b09f135fe0569846dbe3431efa4f556132eb73c1b003ca34c5ae643ddd1c1b1f0efbda5262acb2e4eadbaf66af4b21c0cf471825521b83e26
data/CHANGELOG.md CHANGED
@@ -12,5 +12,3 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
12
12
  - Complete API client with authentication
13
13
  - Resource-based API structure
14
14
  - Comprehensive error handling
15
- - Retry logic with exponential backoff
16
- - Full test coverage
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![Gem Version](https://badge.fury.io/rb/billingrails.svg)](https://rubygems.org/gems/billingrails)
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
5
 
6
- Official Ruby SDK for the [Billingrails](https://billingrails.com) API - Flexible, composable, and intuitive API-first commerce platform.
6
+ Official Ruby SDK for the [Billingrails](https://billingrails.com) API
7
7
 
8
8
  ## Installation
9
9
 
@@ -101,14 +101,6 @@ client = Billingrails::Client.new(
101
101
  )
102
102
  ```
103
103
 
104
- ## Development
105
-
106
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests.
107
-
108
- ## Contributing
109
-
110
- Bug reports and pull requests are welcome on GitHub at https://github.com/billingrails/billingrails-ruby.
111
-
112
104
  ## License
113
105
 
114
106
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -34,9 +34,10 @@ module Billingrails
34
34
  @checkout_sessions = Resources::CheckoutSessions.new(self)
35
35
 
36
36
  @subscriptions = Resources::Subscriptions.new(self)
37
- @plans = Resources::Plans.new(self)
37
+ @products = Resources::Products.new(self)
38
38
  @fees = Resources::Fees.new(self)
39
39
  @prices = Resources::Prices.new(self)
40
+ @plans = Resources::Plans.new(self)
40
41
  @events = Resources::Events.new(self)
41
42
  @meters = Resources::Meters.new(self)
42
43
 
@@ -69,7 +69,7 @@ module Billingrails
69
69
 
70
70
  # Archive a fee
71
71
  #
72
- # Archives a fee, making it inactive for new subscriptions.
72
+ # Archives a fee.
73
73
  #
74
74
  # @param id [String] Resource ID
75
75
  # @return [Hash] Response data
@@ -80,11 +80,11 @@ module Billingrails
80
80
 
81
81
  # Unarchive a fee
82
82
  #
83
- # Restores an archived fee to active status.
83
+ # Restores an archived fee.
84
84
  #
85
85
  # @param id [String] Resource ID
86
86
  # @return [Hash] Response data
87
- def undo_archive(id)
87
+ def unarchive(id)
88
88
  path = "/fees/#{id}/unarchive"
89
89
  @client.request(:post, path)
90
90
  end
@@ -35,7 +35,7 @@ module Billingrails
35
35
 
36
36
  # Retrieve a plan
37
37
  #
38
- # Retrieves plan by ID.
38
+ # Retrieves a plan by ID.
39
39
  #
40
40
  # @param id [String] Resource ID
41
41
  # @param params [Hash, nil] Query parameters
@@ -57,6 +57,50 @@ module Billingrails
57
57
  @client.request(:put, path, body: data)
58
58
  end
59
59
 
60
+ # Delete a plan
61
+ #
62
+ # Deletes a plan.
63
+ #
64
+ # @param id [String] Resource ID
65
+ # @return [Hash] Response data
66
+ def delete(id)
67
+ path = "/plans/#{id}"
68
+ @client.request(:delete, path)
69
+ end
70
+
71
+ # Archive a plan
72
+ #
73
+ # Archives a plan.
74
+ #
75
+ # @param id [String] Resource ID
76
+ # @return [Hash] Response data
77
+ def archive(id)
78
+ path = "/plans/#{id}/archive"
79
+ @client.request(:post, path)
80
+ end
81
+
82
+ # Unarchive a plan
83
+ #
84
+ # Restores an archived plan.
85
+ #
86
+ # @param id [String] Resource ID
87
+ # @return [Hash] Response data
88
+ def unarchive(id)
89
+ path = "/plans/#{id}/unarchive"
90
+ @client.request(:post, path)
91
+ end
92
+
93
+ # Duplicate a plan
94
+ #
95
+ # Creates a new plan with the same attributes and items. The new plan's origin_id is set to the source plan.
96
+ #
97
+ # @param id [String] Resource ID
98
+ # @return [Hash] Response data
99
+ def duplicate(id)
100
+ path = "/plans/#{id}/duplicate"
101
+ @client.request(:post, path)
102
+ end
103
+
60
104
  end
61
105
  end
62
106
  end
@@ -59,7 +59,7 @@ module Billingrails
59
59
 
60
60
  # Archive a price
61
61
  #
62
- # Archives a price, making it inactive for new subscriptions.
62
+ # Archives a price.
63
63
  #
64
64
  # @param id [String] Resource ID
65
65
  # @return [Hash] Response data
@@ -70,11 +70,11 @@ module Billingrails
70
70
 
71
71
  # Unarchive a price
72
72
  #
73
- # Restores an archived price to active status.
73
+ # Restores an archived price.
74
74
  #
75
75
  # @param id [String] Resource ID
76
76
  # @return [Hash] Response data
77
- def undo_archive(id)
77
+ def unarchive(id)
78
78
  path = "/prices/#{id}/unarchive"
79
79
  @client.request(:post, path)
80
80
  end
@@ -0,0 +1,84 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file is auto-generated. Do not edit manually.
4
+
5
+ module Billingrails
6
+ module Resources
7
+ # Products resource
8
+ class Products
9
+ # @param client [Client] The API client
10
+ def initialize(client)
11
+ @client = client
12
+ end
13
+
14
+ # List products
15
+ #
16
+ # Retrieves a list of products.
17
+ #
18
+ # @param params [Hash, nil] Query parameters
19
+ # @return [Hash] Response data
20
+ def list(params: nil)
21
+ path = "/products"
22
+ @client.request(:get, path, params: params)
23
+ end
24
+
25
+ # Create a product
26
+ #
27
+ # Creates a product.
28
+ #
29
+ # @param data [Hash] Request body
30
+ # @return [Hash] Response data
31
+ def create(data)
32
+ path = "/products"
33
+ @client.request(:post, path, body: data)
34
+ end
35
+
36
+ # Retrieve a product
37
+ #
38
+ # Retrieves product by ID.
39
+ #
40
+ # @param id [String] Resource ID
41
+ # @param params [Hash, nil] Query parameters
42
+ # @return [Hash] Response data
43
+ def retrieve(id, params: nil)
44
+ path = "/products/#{id}"
45
+ @client.request(:get, path, params: params)
46
+ end
47
+
48
+ # Update a product
49
+ #
50
+ # Updates a product.
51
+ #
52
+ # @param id [String] Resource ID
53
+ # @param data [Hash] Request body
54
+ # @return [Hash] Response data
55
+ def update(id, data)
56
+ path = "/products/#{id}"
57
+ @client.request(:put, path, body: data)
58
+ end
59
+
60
+ # Archive a product
61
+ #
62
+ # Archives a product.
63
+ #
64
+ # @param id [String] Resource ID
65
+ # @return [Hash] Response data
66
+ def archive(id)
67
+ path = "/products/#{id}/archive"
68
+ @client.request(:post, path)
69
+ end
70
+
71
+ # Unarchive a product
72
+ #
73
+ # Restores an archived product.
74
+ #
75
+ # @param id [String] Resource ID
76
+ # @return [Hash] Response data
77
+ def unarchive(id)
78
+ path = "/products/#{id}/unarchive"
79
+ @client.request(:post, path)
80
+ end
81
+
82
+ end
83
+ end
84
+ end
@@ -70,7 +70,7 @@ module Billingrails
70
70
 
71
71
  # Archive a tax rate
72
72
  #
73
- # Archives a tax rate. Sets status to archived.
73
+ # Archives a tax rate.
74
74
  #
75
75
  # @param id [String] Resource ID
76
76
  # @return [Hash] Response data
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Billingrails
4
- VERSION = '0.1.4'
4
+ VERSION = '0.1.6'
5
5
  end
data/lib/billingrails.rb CHANGED
@@ -10,8 +10,9 @@ require_relative 'billingrails/resources/accounts'
10
10
  require_relative 'billingrails/resources/checkout_sessions'
11
11
  require_relative 'billingrails/resources/events'
12
12
  require_relative 'billingrails/resources/fees'
13
- require_relative 'billingrails/resources/meters'
14
13
  require_relative 'billingrails/resources/plans'
14
+ require_relative 'billingrails/resources/meters'
15
+ require_relative 'billingrails/resources/products'
15
16
  require_relative 'billingrails/resources/subscriptions'
16
17
  require_relative 'billingrails/resources/tax_rates'
17
18
  require_relative 'billingrails/resources/credit_grants'
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.4
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Billingrails
@@ -91,6 +91,7 @@ files:
91
91
  - lib/billingrails/resources/payments.rb
92
92
  - lib/billingrails/resources/plans.rb
93
93
  - lib/billingrails/resources/prices.rb
94
+ - lib/billingrails/resources/products.rb
94
95
  - lib/billingrails/resources/subscriptions.rb
95
96
  - lib/billingrails/resources/tax_rates.rb
96
97
  - lib/billingrails/version.rb