paddle 2.1.3 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +31 -1
- data/lib/paddle/configuration.rb +1 -1
- data/lib/paddle/models/report.rb +32 -0
- data/lib/paddle/version.rb +1 -1
- data/lib/paddle.rb +1 -0
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0c36c67374aa35e91a2497199311888ef26eb0265cd14dddf57f535e7dabb6e
|
4
|
+
data.tar.gz: 287d3e39a116eb4b19bba68baaa0772c67306e0f47249c81c815a29ab5a82f0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30ab0451e76ea879e948373553f707359e9847f92f9a06a1d962dad8f327e471d89858b505e27e7e030570db5413d161943b6aa29b7efe68dc26cdb9723bad7b
|
7
|
+
data.tar.gz: 10fd334a894063e6f14c69fb9e03d1931e9153877037b786cc127fec82d2ba4d0cf992ec1441ca4550ae469dcf444e8abf64404f4478573e28f834ab00d745e5
|
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.2"
|
11
11
|
```
|
12
12
|
|
13
13
|
## Billing API
|
@@ -33,6 +33,11 @@ Paddle.configure do |config|
|
|
33
33
|
end
|
34
34
|
```
|
35
35
|
|
36
|
+
### Caveats
|
37
|
+
|
38
|
+
The Paddle API doesn't take `nil` values for optional parameters. If you want to
|
39
|
+
remove a value, you'll need to pass `"null"` instead.
|
40
|
+
|
36
41
|
### Products
|
37
42
|
|
38
43
|
```ruby
|
@@ -119,6 +124,7 @@ Paddle::Discount.update(id: "dsc_abc123", description: "An updated description")
|
|
119
124
|
# https://developer.paddle.com/api-reference/customers/list-customers
|
120
125
|
Paddle::Customer.list
|
121
126
|
Paddle::Customer.list(status: "active")
|
127
|
+
Paddle::Customer.list(email: "me@mydomain.com")
|
122
128
|
|
123
129
|
# Create a customer
|
124
130
|
# https://developer.paddle.com/api-reference/customers/create-customer
|
@@ -363,6 +369,30 @@ Paddle::Notification.replay(id: "ntf_abc123")
|
|
363
369
|
Paddle::Notification.logs(id: "ntf_abc123")
|
364
370
|
```
|
365
371
|
|
372
|
+
### Reports
|
373
|
+
|
374
|
+
```ruby
|
375
|
+
# List all reports
|
376
|
+
Paddle::Report.list
|
377
|
+
|
378
|
+
# Retrieve a report
|
379
|
+
Paddle::Report.retrieve(id: "rpt_abc123")
|
380
|
+
|
381
|
+
# Get CSV download link for a report
|
382
|
+
# Returns a raw URL. This URL is not permanent and will expire.
|
383
|
+
# https://developer.paddle.com/api-reference/reports/get-report-csv
|
384
|
+
Paddle::Report.csv(id: "rpt_abc123")
|
385
|
+
|
386
|
+
# Create a Report
|
387
|
+
# https://developer.paddle.com/api-reference/reports/create-report
|
388
|
+
Paddle::Report.create(
|
389
|
+
type: "transactions",
|
390
|
+
filters: [
|
391
|
+
{name: "updated_at", operator: "lt", value: "2024-04-30"},
|
392
|
+
{name: "updated_at", operator: "gte", value: "2024-04-01"}
|
393
|
+
]
|
394
|
+
)
|
395
|
+
```
|
366
396
|
|
367
397
|
## Classic API
|
368
398
|
|
data/lib/paddle/configuration.rb
CHANGED
@@ -0,0 +1,32 @@
|
|
1
|
+
module Paddle
|
2
|
+
class Report < Object
|
3
|
+
|
4
|
+
class << self
|
5
|
+
|
6
|
+
def list(**params)
|
7
|
+
response = Client.get_request("reports", params: params)
|
8
|
+
Collection.from_response(response, type: Report)
|
9
|
+
end
|
10
|
+
|
11
|
+
def create(type:, filters:, **params)
|
12
|
+
attrs = {type: type, filters: filters}
|
13
|
+
response = Client.post_request("reports", body: attrs.merge(params))
|
14
|
+
Report.new(response.body["data"])
|
15
|
+
end
|
16
|
+
|
17
|
+
def retrieve(id:)
|
18
|
+
response = Client.get_request("reports/#{id}")
|
19
|
+
Report.new(response.body["data"])
|
20
|
+
end
|
21
|
+
|
22
|
+
def csv(id:)
|
23
|
+
response = Client.get_request("reports/#{id}/download-url")
|
24
|
+
if response.success?
|
25
|
+
return response.body["data"]["url"]
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
data/lib/paddle/version.rb
CHANGED
data/lib/paddle.rb
CHANGED
@@ -39,6 +39,7 @@ 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
|
+
autoload :Report, "paddle/models/report"
|
42
43
|
|
43
44
|
autoload :NotificationLog, "paddle/models/notification_log"
|
44
45
|
autoload :CreditBalance, "paddle/models/credit_balance"
|
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.2.0
|
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:
|
11
|
+
date: 2024-04-24 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: []
|
@@ -83,6 +83,7 @@ files:
|
|
83
83
|
- lib/paddle/models/price.rb
|
84
84
|
- lib/paddle/models/pricing_preview.rb
|
85
85
|
- lib/paddle/models/product.rb
|
86
|
+
- lib/paddle/models/report.rb
|
86
87
|
- lib/paddle/models/subscription.rb
|
87
88
|
- lib/paddle/models/transaction.rb
|
88
89
|
- lib/paddle/object.rb
|
@@ -93,7 +94,7 @@ licenses: []
|
|
93
94
|
metadata:
|
94
95
|
homepage_uri: https://github.com/deanpcmad/paddle
|
95
96
|
source_code_uri: https://github.com/deanpcmad/paddle
|
96
|
-
post_install_message:
|
97
|
+
post_install_message:
|
97
98
|
rdoc_options: []
|
98
99
|
require_paths:
|
99
100
|
- lib
|
@@ -108,8 +109,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
109
|
- !ruby/object:Gem::Version
|
109
110
|
version: '0'
|
110
111
|
requirements: []
|
111
|
-
rubygems_version: 3.
|
112
|
-
signing_key:
|
112
|
+
rubygems_version: 3.5.9
|
113
|
+
signing_key:
|
113
114
|
specification_version: 4
|
114
115
|
summary: Ruby library for the Paddle Billing & Classic APIs
|
115
116
|
test_files: []
|