paddle 2.0.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +12 -1
- data/lib/paddle/client.rb +2 -1
- data/lib/paddle/configuration.rb +2 -0
- data/lib/paddle/models/customer.rb +1 -1
- data/lib/paddle/models/subscription.rb +4 -3
- data/lib/paddle/models/transaction.rb +3 -2
- data/lib/paddle/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3b202300a613f8c4d1af151903c225f725c29e0457746d9bab2cf8c95d19d56
|
4
|
+
data.tar.gz: 0ae818794c9d212e744c91a23892c9ffbb378bc333fc659fd51f75f8c2537aec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e153e5b7116826cba567a00d73c9a3dbf86996f1d4fedf25d005a759d70e7f8e1e7458d45b7946006c82e350da63db57a6af4b86eb23a629a5597102f4f8ee7
|
7
|
+
data.tar.gz: 98156c3bc98bf3c15152a7457076514b9938aec353992fd97faa1673821a8b3886685b8c638d410e96ee44bb2a6d7668c4ea13660bec7fcc4076c2dabb0afc9a
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -7,7 +7,7 @@ A Ruby library for the Paddle APIs, both Classic and Billing.
|
|
7
7
|
Add this line to your application's Gemfile:
|
8
8
|
|
9
9
|
```ruby
|
10
|
-
gem "paddle", "~> 2.
|
10
|
+
gem "paddle", "~> 2.1"
|
11
11
|
```
|
12
12
|
|
13
13
|
## Billing API
|
@@ -27,6 +27,9 @@ Paddle.configure do |config|
|
|
27
27
|
# Or use :production for the Production API
|
28
28
|
config.environment = :sandbox
|
29
29
|
config.api_key = ENV["PADDLE_API_KEY"]
|
30
|
+
|
31
|
+
# Set the API version. Defaults to 1
|
32
|
+
config.version = 1
|
30
33
|
end
|
31
34
|
```
|
32
35
|
|
@@ -183,6 +186,10 @@ Paddle::Transaction.create(items: [ { price_id: "pri_abc123", quantity: 1 } ])
|
|
183
186
|
# Retrieve a transaction
|
184
187
|
Paddle::Transaction.retrieve(id: "txn_abc123")
|
185
188
|
|
189
|
+
# Retrieve a transaction with extra information
|
190
|
+
# extra can be either "address", "adjustment", "adjustments_totals", "business", "customer", "discount"
|
191
|
+
Paddle::Transaction.retrieve(id: "txn_abc123", extra: "customer")
|
192
|
+
|
186
193
|
# Update a transaction
|
187
194
|
# https://developer.paddle.com/api-reference/transaction/update-transaction
|
188
195
|
Paddle::Transaction.update(id: "txn_abc123", items: [ { price_id: "pri_abc123", quantity: 2 } ])
|
@@ -211,6 +218,10 @@ Paddle::Subscription.list(status: "canceled")
|
|
211
218
|
# Retrieve a subscription
|
212
219
|
Paddle::Subscription.retrieve(id: "sub_abc123")
|
213
220
|
|
221
|
+
# Retrieve a subscription with extra information
|
222
|
+
# extra can be either "next_transaction" or "recurring_transaction_details"
|
223
|
+
Paddle::Subscription.retrieve(id: "sub_abc123", extra: "next_transaction")
|
224
|
+
|
214
225
|
# Preview an update to a subscription
|
215
226
|
# https://developer.paddle.com/api-reference/subscriptions/preview-subscription
|
216
227
|
Paddle::Subscription.preview(id: "sub_abc123", items: [ { price_id: "pri_123abc", quantity: 2 } ])
|
data/lib/paddle/client.rb
CHANGED
@@ -8,7 +8,8 @@ module Paddle
|
|
8
8
|
conn.request :authorization, :Bearer, Paddle.config.api_key
|
9
9
|
|
10
10
|
conn.headers = {
|
11
|
-
"User-Agent" => "paddle/v#{VERSION} (github.com/deanpcmad/paddle)"
|
11
|
+
"User-Agent" => "paddle/v#{VERSION} (github.com/deanpcmad/paddle)",
|
12
|
+
"Paddle-Version" => Paddle.config.version.to_s
|
12
13
|
}
|
13
14
|
|
14
15
|
conn.request :json
|
data/lib/paddle/configuration.rb
CHANGED
@@ -8,14 +8,15 @@ module Paddle
|
|
8
8
|
Collection.from_response(response, type: Subscription)
|
9
9
|
end
|
10
10
|
|
11
|
-
def retrieve(id:)
|
12
|
-
|
11
|
+
def retrieve(id:, extra: nil)
|
12
|
+
params = extra ? {include: extra} : {}
|
13
|
+
response = Client.get_request("subscriptions/#{id}", params: params)
|
13
14
|
Subscription.new(response.body["data"])
|
14
15
|
end
|
15
16
|
|
16
17
|
def get_transaction(id:)
|
17
18
|
response = Client.get_request("subscriptions/#{id}/update-payment-method-transaction")
|
18
|
-
|
19
|
+
Transaction.new(response.body["data"])
|
19
20
|
end
|
20
21
|
|
21
22
|
def preview(id:, **params)
|
@@ -14,8 +14,9 @@ module Paddle
|
|
14
14
|
Transaction.new(response.body["data"])
|
15
15
|
end
|
16
16
|
|
17
|
-
def retrieve(id:)
|
18
|
-
|
17
|
+
def retrieve(id:, extra: nil)
|
18
|
+
params = extra ? {include: extra} : {}
|
19
|
+
response = Client.get_request("transactions/#{id}", params: params)
|
19
20
|
Transaction.new(response.body["data"])
|
20
21
|
end
|
21
22
|
|
data/lib/paddle/version.rb
CHANGED
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.
|
4
|
+
version: 2.1.1
|
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-
|
11
|
+
date: 2023-09-09 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: []
|
@@ -92,7 +92,7 @@ licenses: []
|
|
92
92
|
metadata:
|
93
93
|
homepage_uri: https://github.com/deanpcmad/paddle
|
94
94
|
source_code_uri: https://github.com/deanpcmad/paddle
|
95
|
-
post_install_message:
|
95
|
+
post_install_message:
|
96
96
|
rdoc_options: []
|
97
97
|
require_paths:
|
98
98
|
- lib
|
@@ -107,8 +107,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
107
|
- !ruby/object:Gem::Version
|
108
108
|
version: '0'
|
109
109
|
requirements: []
|
110
|
-
rubygems_version: 3.4.
|
111
|
-
signing_key:
|
110
|
+
rubygems_version: 3.4.10
|
111
|
+
signing_key:
|
112
112
|
specification_version: 4
|
113
113
|
summary: Ruby library for the Paddle Billing & Classic APIs
|
114
114
|
test_files: []
|