stripe 4.15.0 → 4.16.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
  SHA256:
3
- metadata.gz: bb8e5adf0ff8d1cdc28daf3a61fbe21cb05102a645aed78fb48208a6e5df51df
4
- data.tar.gz: 6710503e82fad61bef4c71405cc022f6e6784f0e6735d1ec36417848a41dd4ae
3
+ metadata.gz: '0934383f23cd5a8cf8c5b7f3ff4250a6921aac0e318c0444fc882430a2421e42'
4
+ data.tar.gz: f9f84de78f36c63215df15859cdbb46fab395fd34548eabee1d47431f71c4017
5
5
  SHA512:
6
- metadata.gz: cf9f9a61f78dc87ca85965762765ac30bea67308dd5627656574c215a5ec4a75ee23b35087bde24376b50a50d5487dc4be9953093e5bc8e66590dabb43d8ff77
7
- data.tar.gz: 560c3fb2162504c46a955ebe84ff0b062c6815ae89d1940dabeb7e70b8a84d0ae00c841ae6f7f416b4dafceca6c56745beab8d70bcfd3a57307e0726b731381e
6
+ metadata.gz: cc3cc8d160145bfe10b7b36f1d9e7210f061d0778b637784c3efac214699332abfaf2411f35e05807fc4f4e433ae2354301fe0335581fa9793b9280b4ae01af7
7
+ data.tar.gz: 3983a67fb632d6388aea881a68999604a25ffeac73e55ebe88b477956d61ef43a85f9510c42926fc07dc9e7817e601d73cdc7760d155328d3340d815a23af5e5
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.16.0 - 2019-04-24
4
+ * [#760](https://github.com/stripe/stripe-ruby/pull/760) Add support for the `TaxRate` resource and APIs
5
+
3
6
  ## 4.15.0 - 2019-04-22
4
7
  * [#762](https://github.com/stripe/stripe-ruby/pull/762) Add support for the `TaxId` resource and APIs
5
8
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.15.0
1
+ 4.16.0
@@ -98,6 +98,7 @@ require "stripe/subscription_item"
98
98
  require "stripe/subscription_schedule"
99
99
  require "stripe/subscription_schedule_revision"
100
100
  require "stripe/tax_id"
101
+ require "stripe/tax_rate"
101
102
  require "stripe/terminal/connection_token"
102
103
  require "stripe/terminal/location"
103
104
  require "stripe/terminal/reader"
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stripe
4
+ class TaxRate < APIResource
5
+ extend Stripe::APIOperations::Create
6
+ include Stripe::APIOperations::Save
7
+ extend Stripe::APIOperations::List
8
+
9
+ OBJECT_NAME = "tax_rate".freeze
10
+ end
11
+ end
@@ -108,6 +108,7 @@ module Stripe
108
108
  SubscriptionSchedule::OBJECT_NAME => SubscriptionSchedule,
109
109
  SubscriptionScheduleRevision::OBJECT_NAME => SubscriptionScheduleRevision,
110
110
  TaxId::OBJECT_NAME => TaxId,
111
+ TaxRate::OBJECT_NAME => TaxRate,
111
112
  Terminal::ConnectionToken::OBJECT_NAME => Terminal::ConnectionToken,
112
113
  Terminal::Location::OBJECT_NAME => Terminal::Location,
113
114
  Terminal::Reader::OBJECT_NAME => Terminal::Reader,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
- VERSION = "4.15.0".freeze
4
+ VERSION = "4.16.0".freeze
5
5
  end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ require ::File.expand_path("../../test_helper", __FILE__)
4
+
5
+ module Stripe
6
+ class TaxRateTest < Test::Unit::TestCase
7
+ should "be listable" do
8
+ tax_rates = Stripe::TaxRate.list
9
+ assert_requested :get, "#{Stripe.api_base}/v1/tax_rates"
10
+ assert tax_rates.data.is_a?(Array)
11
+ assert tax_rates.first.is_a?(Stripe::TaxRate)
12
+ end
13
+
14
+ should "be retrievable" do
15
+ tax_rate = Stripe::TaxRate.retrieve("txr_123")
16
+ assert_requested :get, "#{Stripe.api_base}/v1/tax_rates/txr_123"
17
+ assert tax_rate.is_a?(Stripe::TaxRate)
18
+ end
19
+
20
+ should "be creatable" do
21
+ tax_rate = Stripe::TaxRate.create(
22
+ display_name: "name",
23
+ inclusive: false,
24
+ percentage: 10.15
25
+ )
26
+ assert_requested :post, "#{Stripe.api_base}/v1/tax_rates"
27
+ assert tax_rate.is_a?(Stripe::TaxRate)
28
+ end
29
+
30
+ should "be saveable" do
31
+ tax_rate = Stripe::TaxRate.retrieve("txr_123")
32
+ tax_rate.metadata["key"] = "value"
33
+ tax_rate.save
34
+ assert_requested :post, "#{Stripe.api_base}/v1/tax_rates/#{tax_rate.id}"
35
+ end
36
+
37
+ should "be updateable" do
38
+ tax_rate = Stripe::TaxRate.update("txr_123", metadata: { key: "value" })
39
+ assert_requested :post, "#{Stripe.api_base}/v1/tax_rates/txr_123"
40
+ assert tax_rate.is_a?(Stripe::TaxRate)
41
+ end
42
+ end
43
+ 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: 4.15.0
4
+ version: 4.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-22 00:00:00.000000000 Z
11
+ date: 2019-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -139,6 +139,7 @@ files:
139
139
  - lib/stripe/subscription_schedule.rb
140
140
  - lib/stripe/subscription_schedule_revision.rb
141
141
  - lib/stripe/tax_id.rb
142
+ - lib/stripe/tax_rate.rb
142
143
  - lib/stripe/terminal/connection_token.rb
143
144
  - lib/stripe/terminal/location.rb
144
145
  - lib/stripe/terminal/reader.rb
@@ -219,6 +220,7 @@ files:
219
220
  - test/stripe/subscription_schedule_test.rb
220
221
  - test/stripe/subscription_test.rb
221
222
  - test/stripe/tax_id_test.rb
223
+ - test/stripe/tax_rate_test.rb
222
224
  - test/stripe/terminal/connection_token_test.rb
223
225
  - test/stripe/terminal/location_test.rb
224
226
  - test/stripe/terminal/reader_test.rb
@@ -324,6 +326,7 @@ test_files:
324
326
  - test/stripe/subscription_schedule_test.rb
325
327
  - test/stripe/subscription_test.rb
326
328
  - test/stripe/tax_id_test.rb
329
+ - test/stripe/tax_rate_test.rb
327
330
  - test/stripe/terminal/connection_token_test.rb
328
331
  - test/stripe/terminal/location_test.rb
329
332
  - test/stripe/terminal/reader_test.rb