lemonsqueezy 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ca29faa717ccfdc417a761a105fa39b1a3ee8ca7d61f03b1ac9b83f1f2a0785a
4
- data.tar.gz: 1480cfb125ae58d1295bdb0aca4603ca8440309314079b23b96dd79fd6162623
3
+ metadata.gz: 5d3696e1ba538e89d4ea65a77f90a20c024f79790700981191437e09c22bf183
4
+ data.tar.gz: 11186062f312505a6dbe326c9ff27a8c940573475f788b5d44cabbb3e27c95ac
5
5
  SHA512:
6
- metadata.gz: 26e001c1de7c812783602d68d821999e874cbf46301810883e953773f4b4418103b8beede64158fd3e521cea0eb9d0101bc8339657211389daa913f3b7d93337
7
- data.tar.gz: 00faf6c801928c90bcbbf6e6c21c35960a1f323d50b8494d789c0adead95ef1434e533458436f13fa7dfa5c1cdf7bb74efa52a1cfbc9c4d60dfc94ae60421e6a
6
+ metadata.gz: 47b685c7e6d41eaf056789dbdfbe58b2e080626cc20fe2fc997d78cc16d95545547d25efd1b54fbc51fc7c296cc6bd532b95a6193b94a43d97e2c4749bf44057
7
+ data.tar.gz: 1894f19062e99ea38437dd0fc9c2691e90148c2974d8ca7390f1daf8a96de1291d455551a97f29b64cbf6f7dc955b6bc444bd4863b77a422f8e74281b826b9c3
data/README.md CHANGED
@@ -114,6 +114,19 @@ Firstly you'll need to create an API Access Token on your [settings page](https:
114
114
  @client.subscriptions.change_plan id: 123, plan_id: 111, variant_id: 111
115
115
  ```
116
116
 
117
+ ### Subscription Invoices
118
+
119
+ ```ruby
120
+ # Retrieves a list of Subscription Invoices
121
+ @client.subscription_invoices.list
122
+
123
+ # Retrieves a list of Subscription Invoices for a specified Store
124
+ @client.subscription_invoices.list store_id: 123
125
+
126
+ # Retrieves a Subscription Invoice
127
+ @client.subscription_invoices.get id: "123"
128
+ ```
129
+
117
130
  ### Discounts
118
131
 
119
132
  ```ruby
@@ -32,6 +32,10 @@ module LemonSqueezy
32
32
  SubscriptionsResource.new(self)
33
33
  end
34
34
 
35
+ def subscription_invoices
36
+ SubscriptionInvoicesResource.new(self)
37
+ end
38
+
35
39
  def discounts
36
40
  DiscountsResource.new(self)
37
41
  end
@@ -0,0 +1,12 @@
1
+ module LemonSqueezy
2
+ class SubscriptionInvoice < Object
3
+
4
+ def initialize(options = {})
5
+ options.delete "relationships"
6
+ options.delete "links"
7
+
8
+ super options
9
+ end
10
+
11
+ end
12
+ end
@@ -0,0 +1,15 @@
1
+ module LemonSqueezy
2
+ class SubscriptionInvoicesResource < Resource
3
+
4
+ def list(**params)
5
+ response = get_request("subscription-invoices", params: params)
6
+ Collection.from_response(response, type: SubscriptionInvoice)
7
+ end
8
+
9
+ def get(id:)
10
+ response = get_request("subscription-invoices/#{id}")
11
+ SubscriptionInvoice.new(response.body["data"]) if response.success?
12
+ end
13
+
14
+ end
15
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LemonSqueezy
4
- VERSION = "0.2.1"
4
+ VERSION = "0.2.2"
5
5
  end
data/lib/lemon_squeezy.rb CHANGED
@@ -17,6 +17,7 @@ module LemonSqueezy
17
17
  autoload :VariantsResource, "lemon_squeezy/resources/variants"
18
18
  autoload :OrdersResource, "lemon_squeezy/resources/orders"
19
19
  autoload :SubscriptionsResource, "lemon_squeezy/resources/subscriptions"
20
+ autoload :SubscriptionInvoicesResource, "lemon_squeezy/resources/subscription_invoices"
20
21
  autoload :DiscountsResource, "lemon_squeezy/resources/discounts"
21
22
  autoload :LicenseKeysResource, "lemon_squeezy/resources/license_keys"
22
23
  autoload :LicenseKeyInstancesResource, "lemon_squeezy/resources/license_key_instances"
@@ -30,6 +31,7 @@ module LemonSqueezy
30
31
  autoload :Order, "lemon_squeezy/objects/order"
31
32
  autoload :OrderItem, "lemon_squeezy/objects/order_item"
32
33
  autoload :Subscription, "lemon_squeezy/objects/subscription"
34
+ autoload :SubscriptionInvoice, "lemon_squeezy/objects/subscription_invoice"
33
35
  autoload :Discount, "lemon_squeezy/objects/discount"
34
36
  autoload :LicenseKey, "lemon_squeezy/objects/license_key"
35
37
  autoload :LicenseKeyInstance, "lemon_squeezy/objects/license_key_instance"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lemonsqueezy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dean Perry
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-01-22 00:00:00.000000000 Z
11
+ date: 2023-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -55,6 +55,7 @@ files:
55
55
  - lib/lemon_squeezy/objects/product.rb
56
56
  - lib/lemon_squeezy/objects/store.rb
57
57
  - lib/lemon_squeezy/objects/subscription.rb
58
+ - lib/lemon_squeezy/objects/subscription_invoice.rb
58
59
  - lib/lemon_squeezy/objects/variant.rb
59
60
  - lib/lemon_squeezy/resource.rb
60
61
  - lib/lemon_squeezy/resources/checkouts.rb
@@ -66,6 +67,7 @@ files:
66
67
  - lib/lemon_squeezy/resources/orders.rb
67
68
  - lib/lemon_squeezy/resources/products.rb
68
69
  - lib/lemon_squeezy/resources/stores.rb
70
+ - lib/lemon_squeezy/resources/subscription_invoices.rb
69
71
  - lib/lemon_squeezy/resources/subscriptions.rb
70
72
  - lib/lemon_squeezy/resources/variants.rb
71
73
  - lib/lemon_squeezy/version.rb
@@ -90,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
92
  - !ruby/object:Gem::Version
91
93
  version: '0'
92
94
  requirements: []
93
- rubygems_version: 3.4.5
95
+ rubygems_version: 3.3.7
94
96
  signing_key:
95
97
  specification_version: 4
96
98
  summary: Ruby library for interacting with the Lemon Squeezy API