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 +4 -4
- data/.travis.yml +1 -1
- data/CHANGELOG.md +3 -0
- data/VERSION +1 -1
- data/lib/stripe/object_types.rb +1 -0
- data/lib/stripe/resources.rb +1 -0
- data/lib/stripe/resources/price.rb +11 -0
- data/lib/stripe/version.rb +1 -1
- data/test/stripe/price_test.rb +48 -0
- data/test/test_helper.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9cdafae953d1c503aebdf2976b20a5c04dc01b61ac0b6bac2bd92993900b78f7
|
|
4
|
+
data.tar.gz: 1c382fee9a657f61b3862b27f638a58b1ea4cd795d3fff0d0e057c15ec2c182a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4bc22a8af3a1bae3156e536a7155533a4438814570e84aebbe318c1894b8775c9957e478df5d05c52d4627fabd0105b3c2a9036bda96282ffbac8cbb747b0ece
|
|
7
|
+
data.tar.gz: 61804b56ab0d6dd379eab1f0c9fcb6841a771d59705f1ffc9cd1616ccab24575eb81baf95d1dde8a32d99d45848cc723a7ddc87b465b68a68cb6be1900ec87d3
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -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.
|
|
1
|
+
5.21.0
|
data/lib/stripe/object_types.rb
CHANGED
|
@@ -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,
|
data/lib/stripe/resources.rb
CHANGED
|
@@ -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"
|
data/lib/stripe/version.rb
CHANGED
|
@@ -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
|
data/test/test_helper.rb
CHANGED
|
@@ -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.
|
|
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.
|
|
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-
|
|
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
|