stripe 3.19.0 → 3.20.0
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 +5 -5
- data/.rubocop.yml +9 -0
- data/.rubocop_todo.yml +0 -10
- data/.travis.yml +1 -1
- data/CHANGELOG.md +3 -0
- data/VERSION +1 -1
- data/lib/stripe.rb +1 -0
- data/lib/stripe/file_link.rb +11 -0
- data/lib/stripe/util.rb +2 -1
- data/lib/stripe/version.rb +1 -1
- data/test/stripe/file_link_test.rb +41 -0
- data/test/stripe/sigma/scheduled_query_run_test.rb +0 -5
- data/test/stripe/source_transaction_test.rb +0 -11
- data/test/test_helper.rb +1 -1
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b8ce3302551b0366a5fa332ffa1d5a6a8fcddee860deadbdfbc3c97e97a13cdc
|
4
|
+
data.tar.gz: 1f9f744430ed5948fab2fe8bece1e63d9fa3c9d3449764cf477afc04952e7fba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e28a1d16c743140d1716d9666a6098d76606a7f6b1a2f87c977cab55261850efae02e84f72d29495c96b0490904d5e96e643bb6de570518a3ea107332600680
|
7
|
+
data.tar.gz: f14c519344d45df88b5d2ac2dd3f4d8462b203da878a166917edb29a342de88c7ff653b8087f57b106d15496b98eb5cbbf03d802e82011f4cdc0a5d964004a29
|
data/.rubocop.yml
CHANGED
@@ -13,6 +13,15 @@ Layout/IndentArray:
|
|
13
13
|
Layout/IndentHash:
|
14
14
|
EnforcedStyle: consistent
|
15
15
|
|
16
|
+
Metrics/MethodLength:
|
17
|
+
# There's ~2 long methods in `StripeClient`. If we want to truncate those a
|
18
|
+
# little, we could move this to be closer to ~30 (but the default of 10 is
|
19
|
+
# probably too short).
|
20
|
+
Max: 50
|
21
|
+
|
22
|
+
Metrics/ModuleLength:
|
23
|
+
Enabled: false
|
24
|
+
|
16
25
|
Style/FrozenStringLiteralComment:
|
17
26
|
EnforcedStyle: always
|
18
27
|
|
data/.rubocop_todo.yml
CHANGED
@@ -30,16 +30,6 @@ Metrics/CyclomaticComplexity:
|
|
30
30
|
Metrics/LineLength:
|
31
31
|
Max: 310
|
32
32
|
|
33
|
-
# Offense count: 32
|
34
|
-
# Configuration parameters: CountComments.
|
35
|
-
Metrics/MethodLength:
|
36
|
-
Max: 55
|
37
|
-
|
38
|
-
# Offense count: 1
|
39
|
-
# Configuration parameters: CountComments.
|
40
|
-
Metrics/ModuleLength:
|
41
|
-
Max: 315
|
42
|
-
|
43
33
|
# Offense count: 6
|
44
34
|
# Configuration parameters: CountKeywordArgs.
|
45
35
|
Metrics/ParameterLists:
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 3.20.0 - 2018-08-03
|
4
|
+
* [#669](https://github.com/stripe/stripe-ruby/pull/669) Add support for file links
|
5
|
+
|
3
6
|
## 3.19.0 - 2018-07-27
|
4
7
|
* [#666](https://github.com/stripe/stripe-ruby/pull/666) Add support for scheduled query runs (`Stripe::Sigma::ScheduledQueryRun`) for Sigma
|
5
8
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.20.0
|
data/lib/stripe.rb
CHANGED
data/lib/stripe/util.rb
CHANGED
@@ -39,7 +39,7 @@ module Stripe
|
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
-
def self.object_classes
|
42
|
+
def self.object_classes # rubocop:disable Metrics/MethodLength
|
43
43
|
@object_classes ||= {
|
44
44
|
# data structures
|
45
45
|
ListObject::OBJECT_NAME => ListObject,
|
@@ -64,6 +64,7 @@ module Stripe
|
|
64
64
|
EphemeralKey::OBJECT_NAME => EphemeralKey,
|
65
65
|
Event::OBJECT_NAME => Event,
|
66
66
|
ExchangeRate::OBJECT_NAME => ExchangeRate,
|
67
|
+
FileLink::OBJECT_NAME => FileLink,
|
67
68
|
FileUpload::OBJECT_NAME => FileUpload,
|
68
69
|
Invoice::OBJECT_NAME => Invoice,
|
69
70
|
InvoiceItem::OBJECT_NAME => InvoiceItem,
|
data/lib/stripe/version.rb
CHANGED
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require File.expand_path("../../test_helper", __FILE__)
|
4
|
+
|
5
|
+
module Stripe
|
6
|
+
class FileLinkTest < Test::Unit::TestCase
|
7
|
+
should "be listable" do
|
8
|
+
file_links = Stripe::FileLink.list
|
9
|
+
assert_requested :get, "#{Stripe.api_base}/v1/file_links"
|
10
|
+
assert file_links.data.is_a?(Array)
|
11
|
+
assert file_links.first.is_a?(Stripe::FileLink)
|
12
|
+
end
|
13
|
+
|
14
|
+
should "be retrievable" do
|
15
|
+
file_link = Stripe::FileLink.retrieve("link_123")
|
16
|
+
assert_requested :get, "#{Stripe.api_base}/v1/file_links/link_123"
|
17
|
+
assert file_link.is_a?(Stripe::FileLink)
|
18
|
+
end
|
19
|
+
|
20
|
+
should "be creatable" do
|
21
|
+
file_link = Stripe::FileLink.create(
|
22
|
+
file: "file_123"
|
23
|
+
)
|
24
|
+
assert_requested :post, "#{Stripe.api_base}/v1/file_links"
|
25
|
+
assert file_link.is_a?(Stripe::FileLink)
|
26
|
+
end
|
27
|
+
|
28
|
+
should "be saveable" do
|
29
|
+
file_link = Stripe::FileLink.retrieve("link_123")
|
30
|
+
file_link.metadata["key"] = "value"
|
31
|
+
file_link.save
|
32
|
+
assert_requested :post, "#{Stripe.api_base}/v1/file_links/#{file_link.id}"
|
33
|
+
end
|
34
|
+
|
35
|
+
should "be updateable" do
|
36
|
+
file_link = Stripe::FileLink.update("link_123", metadata: { key: "value" })
|
37
|
+
assert_requested :post, "#{Stripe.api_base}/v1/file_links/link_123"
|
38
|
+
assert file_link.is_a?(Stripe::FileLink)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -6,9 +6,6 @@ module Stripe
|
|
6
6
|
module Issuing
|
7
7
|
class ScheduledQueryRunTest < Test::Unit::TestCase
|
8
8
|
should "be listable" do
|
9
|
-
stub_request(:get, "#{Stripe.api_base}/v1/sigma/scheduled_query_runs")
|
10
|
-
.to_return(body: JSON.generate(object: "list", data: [{ id: "sqr_123", object: "scheduled_query_run" }]))
|
11
|
-
|
12
9
|
runs = Stripe::Sigma::ScheduledQueryRun.list
|
13
10
|
assert_requested :get, "#{Stripe.api_base}/v1/sigma/scheduled_query_runs"
|
14
11
|
assert runs.data.is_a?(Array)
|
@@ -16,8 +13,6 @@ module Stripe
|
|
16
13
|
end
|
17
14
|
|
18
15
|
should "be retrievable" do
|
19
|
-
stub_request(:get, "#{Stripe.api_base}/v1/sigma/scheduled_query_runs/sqr_123")
|
20
|
-
.to_return(body: JSON.generate(id: "sqr_123", object: "scheduled_query_run"))
|
21
16
|
run = Stripe::Sigma::ScheduledQueryRun.retrieve("sqr_123")
|
22
17
|
assert_requested :get, "#{Stripe.api_base}/v1/sigma/scheduled_query_runs/sqr_123"
|
23
18
|
assert run.is_a?(Stripe::Sigma::ScheduledQueryRun)
|
@@ -9,17 +9,6 @@ module Stripe
|
|
9
9
|
end
|
10
10
|
|
11
11
|
should "be listable" do
|
12
|
-
# TODO: remove the stub once stripe-mock supports /v1/sources/src_.../source_transactions
|
13
|
-
stub_request(:get, "#{Stripe.api_base}/v1/sources/#{@source.id}/source_transactions")
|
14
|
-
.to_return(body: JSON.generate(
|
15
|
-
object: "list",
|
16
|
-
data: [
|
17
|
-
{
|
18
|
-
object: "source_transaction",
|
19
|
-
},
|
20
|
-
]
|
21
|
-
))
|
22
|
-
|
23
12
|
transactions = @source.source_transactions
|
24
13
|
|
25
14
|
assert_requested :get, "#{Stripe.api_base}/v1/sources/#{@source.id}/source_transactions"
|
data/test/test_helper.rb
CHANGED
@@ -16,7 +16,7 @@ PROJECT_ROOT = File.expand_path("../../", __FILE__)
|
|
16
16
|
require File.expand_path("../test_data", __FILE__)
|
17
17
|
|
18
18
|
# If changing this number, please also change it in `.travis.yml`.
|
19
|
-
MOCK_MINIMUM_VERSION = "0.
|
19
|
+
MOCK_MINIMUM_VERSION = "0.25.0".freeze
|
20
20
|
MOCK_PORT = ENV["STRIPE_MOCK_PORT"] || 12_111
|
21
21
|
|
22
22
|
# Disable all real network connections except those that are outgoing to
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stripe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.20.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stripe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -76,6 +76,7 @@ files:
|
|
76
76
|
- lib/stripe/errors.rb
|
77
77
|
- lib/stripe/event.rb
|
78
78
|
- lib/stripe/exchange_rate.rb
|
79
|
+
- lib/stripe/file_link.rb
|
79
80
|
- lib/stripe/file_upload.rb
|
80
81
|
- lib/stripe/invoice.rb
|
81
82
|
- lib/stripe/invoice_item.rb
|
@@ -142,6 +143,7 @@ files:
|
|
142
143
|
- test/stripe/ephemeral_key_test.rb
|
143
144
|
- test/stripe/errors_test.rb
|
144
145
|
- test/stripe/exchange_rate_test.rb
|
146
|
+
- test/stripe/file_link_test.rb
|
145
147
|
- test/stripe/file_upload_test.rb
|
146
148
|
- test/stripe/invoice_item_test.rb
|
147
149
|
- test/stripe/invoice_line_item_test.rb
|
@@ -203,7 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
203
205
|
version: '0'
|
204
206
|
requirements: []
|
205
207
|
rubyforge_project:
|
206
|
-
rubygems_version: 2.
|
208
|
+
rubygems_version: 2.7.7
|
207
209
|
signing_key:
|
208
210
|
specification_version: 4
|
209
211
|
summary: Ruby bindings for the Stripe API
|
@@ -231,6 +233,7 @@ test_files:
|
|
231
233
|
- test/stripe/ephemeral_key_test.rb
|
232
234
|
- test/stripe/errors_test.rb
|
233
235
|
- test/stripe/exchange_rate_test.rb
|
236
|
+
- test/stripe/file_link_test.rb
|
234
237
|
- test/stripe/file_upload_test.rb
|
235
238
|
- test/stripe/invoice_item_test.rb
|
236
239
|
- test/stripe/invoice_line_item_test.rb
|