stripe 5.20.0 → 5.21.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: 53d5362cf3395da735662c079302a68f77a067db5ed0b33d9049ab47a5d610e6
4
- data.tar.gz: a33095d14ba39ec3d3a178c5b6a7aaf477f3290a060bc9955d840d30f284d9ad
3
+ metadata.gz: 9cdafae953d1c503aebdf2976b20a5c04dc01b61ac0b6bac2bd92993900b78f7
4
+ data.tar.gz: 1c382fee9a657f61b3862b27f638a58b1ea4cd795d3fff0d0e057c15ec2c182a
5
5
  SHA512:
6
- metadata.gz: 5708098cb83cae3806edc15aa7baa946f7e1107e380282e64012b59d849a8e5b1a6c394b23347b20dc94a81922760cdaea7cb6b634c8c2f35f8b8c74694e5bee
7
- data.tar.gz: 3add4e8a981bf84adabf38d6c6ee98c7dbebb0254709e38e3ee9c4aeddd68c9ce1b78cf594cf1aad7c1bb587767952cba0be15a273bdb6bf31ed215040c5162b
6
+ metadata.gz: 4bc22a8af3a1bae3156e536a7155533a4438814570e84aebbe318c1894b8775c9957e478df5d05c52d4627fabd0105b3c2a9036bda96282ffbac8cbb747b0ece
7
+ data.tar.gz: 61804b56ab0d6dd379eab1f0c9fcb6841a771d59705f1ffc9cd1616ccab24575eb81baf95d1dde8a32d99d45848cc723a7ddc87b465b68a68cb6be1900ec87d3
@@ -17,7 +17,7 @@ sudo: false
17
17
  env:
18
18
  global:
19
19
  # If changing this number, please also change it in `test/test_helper.rb`.
20
- - STRIPE_MOCK_VERSION=0.88.0
20
+ - STRIPE_MOCK_VERSION=0.89.0
21
21
 
22
22
  cache:
23
23
  directories:
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.21.0 - 2020-04-29
4
+ * [#917](https://github.com/stripe/stripe-ruby/pull/917) Add support for the `Price` resource and APIs
5
+
3
6
  ## 5.20.0 - 2020-04-27
4
7
  * [#916](https://github.com/stripe/stripe-ruby/pull/916) Add new `.generate_header` method for webhooks
5
8
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 5.20.0
1
+ 5.21.0
@@ -58,6 +58,7 @@ module Stripe
58
58
  Payout::OBJECT_NAME => Payout,
59
59
  Person::OBJECT_NAME => Person,
60
60
  Plan::OBJECT_NAME => Plan,
61
+ Price::OBJECT_NAME => Price,
61
62
  Product::OBJECT_NAME => Product,
62
63
  Radar::EarlyFraudWarning::OBJECT_NAME => Radar::EarlyFraudWarning,
63
64
  Radar::ValueList::OBJECT_NAME => Radar::ValueList,
@@ -47,6 +47,7 @@ require "stripe/resources/payment_method"
47
47
  require "stripe/resources/payout"
48
48
  require "stripe/resources/person"
49
49
  require "stripe/resources/plan"
50
+ require "stripe/resources/price"
50
51
  require "stripe/resources/product"
51
52
  require "stripe/resources/radar/early_fraud_warning"
52
53
  require "stripe/resources/radar/value_list"
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stripe
4
+ class Price < APIResource
5
+ extend Stripe::APIOperations::Create
6
+ extend Stripe::APIOperations::List
7
+ include Stripe::APIOperations::Save
8
+
9
+ OBJECT_NAME = "price"
10
+ end
11
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
- VERSION = "5.20.0"
4
+ VERSION = "5.21.0"
5
5
  end
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ require ::File.expand_path("../test_helper", __dir__)
4
+
5
+ module Stripe
6
+ class PriceTest < Test::Unit::TestCase
7
+ should "be listable" do
8
+ prices = Stripe::Price.list
9
+ assert_requested :get, "#{Stripe.api_base}/v1/prices"
10
+ assert prices.data.is_a?(Array)
11
+ assert prices.data[0].is_a?(Stripe::Price)
12
+ end
13
+
14
+ should "be retrievable" do
15
+ price = Stripe::Price.retrieve("price_123")
16
+ assert_requested :get, "#{Stripe.api_base}/v1/prices/price_123"
17
+ assert price.is_a?(Stripe::Price)
18
+ end
19
+
20
+ should "be creatable" do
21
+ price = Stripe::Price.create(
22
+ unit_amount: 5000,
23
+ currency: "usd",
24
+ recurring: {
25
+ interval: "month",
26
+ },
27
+ product_data: {
28
+ name: "Product name",
29
+ }
30
+ )
31
+ assert_requested :post, "#{Stripe.api_base}/v1/prices"
32
+ assert price.is_a?(Stripe::Price)
33
+ end
34
+
35
+ should "be saveable" do
36
+ price = Stripe::Price.retrieve("price_123")
37
+ price.metadata["key"] = "value"
38
+ price.save
39
+ assert_requested :post, "#{Stripe.api_base}/v1/prices/#{price.id}"
40
+ end
41
+
42
+ should "be updateable" do
43
+ price = Stripe::Price.update("price_123", metadata: { foo: "bar" })
44
+ assert_requested :post, "#{Stripe.api_base}/v1/prices/price_123"
45
+ assert price.is_a?(Stripe::Price)
46
+ end
47
+ end
48
+ end
@@ -16,7 +16,7 @@ require ::File.expand_path("test_data", __dir__)
16
16
  require ::File.expand_path("stripe_mock", __dir__)
17
17
 
18
18
  # If changing this number, please also change it in `.travis.yml`.
19
- MOCK_MINIMUM_VERSION = "0.88.0"
19
+ MOCK_MINIMUM_VERSION = "0.89.0"
20
20
  MOCK_PORT = Stripe::StripeMock.start
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: 5.20.0
4
+ version: 5.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-27 00:00:00.000000000 Z
11
+ date: 2020-04-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Stripe is the easiest way to accept payments online. See https://stripe.com
14
14
  for details.
@@ -102,6 +102,7 @@ files:
102
102
  - lib/stripe/resources/payout.rb
103
103
  - lib/stripe/resources/person.rb
104
104
  - lib/stripe/resources/plan.rb
105
+ - lib/stripe/resources/price.rb
105
106
  - lib/stripe/resources/product.rb
106
107
  - lib/stripe/resources/radar/early_fraud_warning.rb
107
108
  - lib/stripe/resources/radar/value_list.rb
@@ -191,6 +192,7 @@ files:
191
192
  - test/stripe/payout_test.rb
192
193
  - test/stripe/person_test.rb
193
194
  - test/stripe/plan_test.rb
195
+ - test/stripe/price_test.rb
194
196
  - test/stripe/product_test.rb
195
197
  - test/stripe/radar/early_fraud_warning_test.rb
196
198
  - test/stripe/radar/value_list_item_test.rb
@@ -307,6 +309,7 @@ test_files:
307
309
  - test/stripe/payout_test.rb
308
310
  - test/stripe/person_test.rb
309
311
  - test/stripe/plan_test.rb
312
+ - test/stripe/price_test.rb
310
313
  - test/stripe/product_test.rb
311
314
  - test/stripe/radar/early_fraud_warning_test.rb
312
315
  - test/stripe/radar/value_list_item_test.rb