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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6459fe4e17f22379c48abcbfa329299988905193
4
- data.tar.gz: dd77754bb1759b1d44517f0028e2eba9f45c0b63
3
+ metadata.gz: cb5911659a15e36fb6977fa722246896dcd236dc
4
+ data.tar.gz: 63ddbf69f947ed2c70b6a8c136802d4abff22712
5
5
  SHA512:
6
- metadata.gz: bb6cf5b6f13f6147049609a1e5c3c1d34a93529611bd9aa0e5a3568eec1532d9f991f91b4d9c51b0e1ad833b88cebe3bbcd00d1d341b812517f93a9f86cf0b02
7
- data.tar.gz: 0a4f934af55f2b2167672e37f5b8fc792002fc31dee67f952c94b50d79a26634f7b1f01f4a10810f5f0f1d07e4367189910b987318b992e115c90455ed3a490b
6
+ metadata.gz: 2e80711ed5f44ceedece00a4ed078eb22ea5597e553e44260042a67936e89e83e6c594700e8e88bf7bea8cd16e227c9b70b2f31d6514746bb1f99343d4d48047
7
+ data.tar.gz: 7afde30a7491263b1cd909077b1fe88ab2a03abf2fb72ba0841a1caa33506fecd3a10b5da37fe2ae9ce8a5e8b59d5e00f3036265871bb98435f23f56c8d5dac0
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2017-10-26 15:43:11 +0200 using RuboCop version 0.50.0.
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: 303
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: 51
58
+ # Offense count: 52
59
59
  Style/Documentation:
60
60
  Enabled: false
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.8.0 - 2017-10-31
4
+ * [#606](https://github.com/stripe/stripe-ruby/pull/606) Support for exchange rates APIs
5
+
3
6
  ## 3.7.0 - 2017-10-26
4
7
  * [#603](https://github.com/stripe/stripe-ruby/pull/603) Support for listing source transactions
5
8
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.7.0
1
+ 3.8.0
@@ -52,6 +52,7 @@ require "stripe/customer"
52
52
  require "stripe/dispute"
53
53
  require "stripe/ephemeral_key"
54
54
  require "stripe/event"
55
+ require "stripe/exchange_rate"
55
56
  require "stripe/file_upload"
56
57
  require "stripe/invoice"
57
58
  require "stripe/invoice_item"
@@ -0,0 +1,11 @@
1
+ module Stripe
2
+ class ExchangeRate < APIResource
3
+ extend Stripe::APIOperations::List
4
+
5
+ OBJECT_NAME = "exchange_rate".freeze
6
+
7
+ def self.resource_url
8
+ "/v1/exchange_rates"
9
+ end
10
+ end
11
+ end
@@ -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,
@@ -1,3 +1,3 @@
1
1
  module Stripe
2
- VERSION = "3.7.0".freeze
2
+ VERSION = "3.8.0".freeze
3
3
  end
@@ -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.7.0
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-26 00:00:00.000000000 Z
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