stripe 3.7.0 → 3.8.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 +4 -4
- data/.rubocop_todo.yml +3 -3
- data/CHANGELOG.md +3 -0
- data/VERSION +1 -1
- data/lib/stripe.rb +1 -0
- data/lib/stripe/exchange_rate.rb +11 -0
- data/lib/stripe/util.rb +1 -0
- data/lib/stripe/version.rb +1 -1
- data/test/stripe/exchange_rate_test.rb +44 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb5911659a15e36fb6977fa722246896dcd236dc
|
4
|
+
data.tar.gz: 63ddbf69f947ed2c70b6a8c136802d4abff22712
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e80711ed5f44ceedece00a4ed078eb22ea5597e553e44260042a67936e89e83e6c594700e8e88bf7bea8cd16e227c9b70b2f31d6514746bb1f99343d4d48047
|
7
|
+
data.tar.gz: 7afde30a7491263b1cd909077b1fe88ab2a03abf2fb72ba0841a1caa33506fecd3a10b5da37fe2ae9ce8a5e8b59d5e00f3036265871bb98435f23f56c8d5dac0
|
data/.rubocop_todo.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on 2017-10-
|
3
|
+
# on 2017-10-30 14:39:50 +0100 using RuboCop version 0.50.0.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
@@ -38,7 +38,7 @@ Metrics/MethodLength:
|
|
38
38
|
# Offense count: 1
|
39
39
|
# Configuration parameters: CountComments.
|
40
40
|
Metrics/ModuleLength:
|
41
|
-
Max:
|
41
|
+
Max: 304
|
42
42
|
|
43
43
|
# Offense count: 5
|
44
44
|
# Configuration parameters: CountKeywordArgs.
|
@@ -55,6 +55,6 @@ Style/ClassVars:
|
|
55
55
|
- 'lib/stripe/stripe_object.rb'
|
56
56
|
- 'test/stripe/api_resource_test.rb'
|
57
57
|
|
58
|
-
# Offense count:
|
58
|
+
# Offense count: 52
|
59
59
|
Style/Documentation:
|
60
60
|
Enabled: false
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.8.0
|
data/lib/stripe.rb
CHANGED
data/lib/stripe/util.rb
CHANGED
@@ -61,6 +61,7 @@ module Stripe
|
|
61
61
|
Dispute::OBJECT_NAME => Dispute,
|
62
62
|
EphemeralKey::OBJECT_NAME => EphemeralKey,
|
63
63
|
Event::OBJECT_NAME => Event,
|
64
|
+
ExchangeRate::OBJECT_NAME => ExchangeRate,
|
64
65
|
FileUpload::OBJECT_NAME => FileUpload,
|
65
66
|
Invoice::OBJECT_NAME => Invoice,
|
66
67
|
InvoiceItem::OBJECT_NAME => InvoiceItem,
|
data/lib/stripe/version.rb
CHANGED
@@ -0,0 +1,44 @@
|
|
1
|
+
require File.expand_path("../../test_helper", __FILE__)
|
2
|
+
|
3
|
+
module Stripe
|
4
|
+
class ExchangeRateTest < Test::Unit::TestCase
|
5
|
+
should "be listable" do
|
6
|
+
# TODO: remove stub once stripe-mock supports /v1/exchange_rates
|
7
|
+
stub_request(:get, "#{Stripe.api_base}/v1/exchange_rates")
|
8
|
+
.to_return(body: JSON.generate(
|
9
|
+
object: "list",
|
10
|
+
data: [
|
11
|
+
{
|
12
|
+
id: "eur",
|
13
|
+
object: "exchange_rate",
|
14
|
+
rates: { "usd" => 1.18221 },
|
15
|
+
},
|
16
|
+
{
|
17
|
+
id: "usd",
|
18
|
+
object: "exchange_rate",
|
19
|
+
rates: { "eur" => 0.845876 },
|
20
|
+
},
|
21
|
+
]
|
22
|
+
))
|
23
|
+
|
24
|
+
list_rates = Stripe::ExchangeRate.list
|
25
|
+
assert_requested :get, "#{Stripe.api_base}/v1/exchange_rates"
|
26
|
+
assert list_rates.data.is_a?(Array)
|
27
|
+
assert list_rates.data.first.is_a?(Stripe::ExchangeRate)
|
28
|
+
end
|
29
|
+
|
30
|
+
should "be retrievable" do
|
31
|
+
# TODO: remove stub once stripe-mock supports /v1/exchange_rates
|
32
|
+
stub_request(:get, "#{Stripe.api_base}/v1/exchange_rates/usd")
|
33
|
+
.to_return(body: JSON.generate(
|
34
|
+
id: "usd",
|
35
|
+
object: "exchange_rate",
|
36
|
+
rates: { "eur" => 0.845876 }
|
37
|
+
))
|
38
|
+
|
39
|
+
rates = Stripe::ExchangeRate.retrieve("usd")
|
40
|
+
assert_requested :get, "#{Stripe.api_base}/v1/exchange_rates/usd"
|
41
|
+
assert rates.is_a?(Stripe::ExchangeRate)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
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.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stripe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -75,6 +75,7 @@ files:
|
|
75
75
|
- lib/stripe/ephemeral_key.rb
|
76
76
|
- lib/stripe/errors.rb
|
77
77
|
- lib/stripe/event.rb
|
78
|
+
- lib/stripe/exchange_rate.rb
|
78
79
|
- lib/stripe/file_upload.rb
|
79
80
|
- lib/stripe/invoice.rb
|
80
81
|
- lib/stripe/invoice_item.rb
|
@@ -129,6 +130,7 @@ files:
|
|
129
130
|
- test/stripe/dispute_test.rb
|
130
131
|
- test/stripe/ephemeral_key_test.rb
|
131
132
|
- test/stripe/errors_test.rb
|
133
|
+
- test/stripe/exchange_rate_test.rb
|
132
134
|
- test/stripe/file_upload_test.rb
|
133
135
|
- test/stripe/invoice_item_test.rb
|
134
136
|
- test/stripe/invoice_line_item_test.rb
|
@@ -207,6 +209,7 @@ test_files:
|
|
207
209
|
- test/stripe/dispute_test.rb
|
208
210
|
- test/stripe/ephemeral_key_test.rb
|
209
211
|
- test/stripe/errors_test.rb
|
212
|
+
- test/stripe/exchange_rate_test.rb
|
210
213
|
- test/stripe/file_upload_test.rb
|
211
214
|
- test/stripe/invoice_item_test.rb
|
212
215
|
- test/stripe/invoice_line_item_test.rb
|