paddle 2.1.1 → 2.1.3

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: c3b202300a613f8c4d1af151903c225f725c29e0457746d9bab2cf8c95d19d56
4
- data.tar.gz: 0ae818794c9d212e744c91a23892c9ffbb378bc333fc659fd51f75f8c2537aec
3
+ metadata.gz: 457fd5bd63d3324da10687d2796e4582e2693021ab8a6fa7bfeddbfa7b47dda0
4
+ data.tar.gz: 38ef8f0c9baf2ddc2515d1a3a1c9a032e5c3a8788299052762e4741f1f81e236
5
5
  SHA512:
6
- metadata.gz: 8e153e5b7116826cba567a00d73c9a3dbf86996f1d4fedf25d005a759d70e7f8e1e7458d45b7946006c82e350da63db57a6af4b86eb23a629a5597102f4f8ee7
7
- data.tar.gz: 98156c3bc98bf3c15152a7457076514b9938aec353992fd97faa1673821a8b3886685b8c638d410e96ee44bb2a6d7668c4ea13660bec7fcc4076c2dabb0afc9a
6
+ metadata.gz: c2c14b85b564116f6b5c3d771b010b4fefa66ef9e899960c6bd3fc9e0919a9e864b398d73106318e62c2bb8c4684a8a2f5b211ff9e6ec67fcdfd337b1b6465a8
7
+ data.tar.gz: c604c94ac7770198ed78f57318327efcbf293d68a127bfdfcb419a4aa52aa7ee4db8ac7542df3d9045b662d5a5b6a3cbea9aa3f02be7559b8e04232db6eb6c33
data/Gemfile.lock CHANGED
@@ -1,14 +1,16 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- paddle (2.1.1)
4
+ paddle (2.1.3)
5
5
  faraday (~> 2.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
+ base64 (0.1.1)
10
11
  dotenv (2.7.6)
11
- faraday (2.7.10)
12
+ faraday (2.7.11)
13
+ base64
12
14
  faraday-net_http (>= 2.0, < 3.1)
13
15
  ruby2_keywords (>= 0.0.4)
14
16
  faraday-net_http (3.0.2)
@@ -28,4 +30,4 @@ DEPENDENCIES
28
30
  vcr
29
31
 
30
32
  BUNDLED WITH
31
- 2.3.22
33
+ 2.4.21
data/README.md CHANGED
@@ -130,6 +130,10 @@ Paddle::Customer.retrieve(id: "ctm_abc123")
130
130
  # Update a customer
131
131
  # https://developer.paddle.com/api-reference/customers/update-customer
132
132
  Paddle::Customer.update(id: "ctm_abc123", status: "archived")
133
+
134
+ # Retrieve credit balance for a customer
135
+ # https://developer.paddle.com/api-reference/customers/list-credit-balances
136
+ Paddle::Customer.credit(id: "ctm_abc123")
133
137
  ```
134
138
 
135
139
  ### Addresses
@@ -214,6 +218,8 @@ Paddle::Subscription.list(customer_id: "ctm_abc123")
214
218
  Paddle::Subscription.list(price_id: "pri_abc123")
215
219
  Paddle::Subscription.list(status: "active")
216
220
  Paddle::Subscription.list(status: "canceled")
221
+ Paddle::Subscription.list(collection_mode: "automatic")
222
+ Paddle::Subscription.list(scheduled_change_action: "cancel")
217
223
 
218
224
  # Retrieve a subscription
219
225
  Paddle::Subscription.retrieve(id: "sub_abc123")
@@ -242,14 +248,21 @@ Paddle::Subscription.charge(id: "sub_abc123", items: [ { price_id: "pri_123abc",
242
248
  # https://developer.paddle.com/api-reference/subscriptions/pause-subscription
243
249
  Paddle::Subscription.pause(id: "sub_abc123")
244
250
  Paddle::Subscription.pause(id: "sub_abc123", effective_from: "next_billing_period")
251
+ Paddle::Subscription.pause(id: "sub_abc123", effective_from: "immediately")
245
252
 
246
253
  # Resume a paused subscription
247
254
  # https://developer.paddle.com/api-reference/subscriptions/resume-subscription
248
255
  Paddle::Subscription.resume(id: "sub_abc123", effective_from: "next_billing_period")
256
+ Paddle::Subscription.resume(id: "sub_abc123", effective_from: "immediately")
249
257
 
250
258
  # Cancel a subscription
251
259
  # https://developer.paddle.com/api-reference/subscriptions/cancel-subscription
252
260
  Paddle::Subscription.cancel(id: "sub_abc123", effective_from: "next_billing_period")
261
+ Paddle::Subscription.cancel(id: "sub_abc123", effective_from: "immediately")
262
+
263
+ # Activate a trialing subscription
264
+ # https://developer.paddle.com/api-reference/subscriptions/activate-subscription
265
+ Paddle::Subscription.activate(id: "sub_abc123")
253
266
  ```
254
267
 
255
268
  ### Adjustments
@@ -72,7 +72,7 @@ module Paddle
72
72
  def connection
73
73
  @connection ||= Faraday.new(url) do |conn|
74
74
  conn.headers = {
75
- "User-Agent" => "paddlerb/v#{VERSION} (github.com/deanpcmad/paddlerb)"
75
+ "User-Agent" => "paddle/v#{VERSION} (github.com/deanpcmad/paddle)"
76
76
  }
77
77
 
78
78
  conn.request :json
@@ -0,0 +1,4 @@
1
+ module Paddle
2
+ class CreditBalance < Object
3
+ end
4
+ end
@@ -24,6 +24,11 @@ module Paddle
24
24
  Customer.new(response.body["data"])
25
25
  end
26
26
 
27
+ def credit(id:)
28
+ response = Client.get_request("customers/#{id}/credit-balances")
29
+ CreditBalance.new(response.body["data"][0])
30
+ end
31
+
27
32
  end
28
33
 
29
34
  end
@@ -51,6 +51,11 @@ module Paddle
51
51
  Subscription.new(response.body["data"])
52
52
  end
53
53
 
54
+ def activate(id:)
55
+ response = Client.post_request("subscriptions/#{id}/activate")
56
+ Subscription.new(response.body["data"])
57
+ end
58
+
54
59
  end
55
60
 
56
61
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Paddle
4
- VERSION = "2.1.1"
4
+ VERSION = "2.1.3"
5
5
  end
data/lib/paddle.rb CHANGED
@@ -39,7 +39,9 @@ module Paddle
39
39
  autoload :Event, "paddle/models/event"
40
40
  autoload :NotificationSetting, "paddle/models/notification_setting"
41
41
  autoload :Notification, "paddle/models/notification"
42
+
42
43
  autoload :NotificationLog, "paddle/models/notification_log"
44
+ autoload :CreditBalance, "paddle/models/credit_balance"
43
45
 
44
46
  # Load Classic APIs
45
47
  module Classic
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paddle
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dean Perry
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-09-09 00:00:00.000000000 Z
11
+ date: 2023-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -24,7 +24,7 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.0'
27
- description:
27
+ description:
28
28
  email:
29
29
  - dean@deanpcmad.com
30
30
  executables: []
@@ -72,6 +72,7 @@ files:
72
72
  - lib/paddle/models/address.rb
73
73
  - lib/paddle/models/adjustment.rb
74
74
  - lib/paddle/models/business.rb
75
+ - lib/paddle/models/credit_balance.rb
75
76
  - lib/paddle/models/customer.rb
76
77
  - lib/paddle/models/discount.rb
77
78
  - lib/paddle/models/event.rb
@@ -92,7 +93,7 @@ licenses: []
92
93
  metadata:
93
94
  homepage_uri: https://github.com/deanpcmad/paddle
94
95
  source_code_uri: https://github.com/deanpcmad/paddle
95
- post_install_message:
96
+ post_install_message:
96
97
  rdoc_options: []
97
98
  require_paths:
98
99
  - lib
@@ -107,8 +108,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
108
  - !ruby/object:Gem::Version
108
109
  version: '0'
109
110
  requirements: []
110
- rubygems_version: 3.4.10
111
- signing_key:
111
+ rubygems_version: 3.4.21
112
+ signing_key:
112
113
  specification_version: 4
113
114
  summary: Ruby library for the Paddle Billing & Classic APIs
114
115
  test_files: []