stripe 2.0.3 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +4 -0
- data/VERSION +1 -1
- data/lib/stripe/card.rb +3 -3
- data/lib/stripe/source.rb +11 -1
- data/lib/stripe/util.rb +1 -0
- data/lib/stripe/version.rb +1 -1
- data/openapi/fixtures.json +121 -107
- data/openapi/fixtures.yaml +123 -109
- data/test/stripe/customer_card_test.rb +1 -1
- data/test/stripe/source_test.rb +26 -2
- metadata +2 -2
data/test/stripe/source_test.rb
CHANGED
@@ -16,7 +16,7 @@ module Stripe
|
|
16
16
|
token: API_FIXTURES.fetch(:token)[:id]
|
17
17
|
)
|
18
18
|
assert_requested :post, "#{Stripe.api_base}/v1/sources"
|
19
|
-
assert source.kind_of?(Stripe::
|
19
|
+
assert source.kind_of?(Stripe::Source)
|
20
20
|
end
|
21
21
|
|
22
22
|
should "be saveable" do
|
@@ -29,7 +29,31 @@ module Stripe
|
|
29
29
|
should "be updateable" do
|
30
30
|
source = Stripe::Source.update(FIXTURE[:id], metadata: {foo: 'bar'})
|
31
31
|
assert_requested :post, "#{Stripe.api_base}/v1/sources/#{FIXTURE[:id]}"
|
32
|
-
assert source.kind_of?(Stripe::
|
32
|
+
assert source.kind_of?(Stripe::Source)
|
33
|
+
end
|
34
|
+
|
35
|
+
context "#delete" do
|
36
|
+
should "not be deletable when unattached" do
|
37
|
+
source = Stripe::Source.retrieve(FIXTURE[:id])
|
38
|
+
|
39
|
+
assert_raises NotImplementedError do
|
40
|
+
source.delete
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
should "be deletable when attached to a customer" do
|
45
|
+
customer_id = API_FIXTURES.fetch(:customer)[:id]
|
46
|
+
source = Stripe::Source.construct_from(FIXTURE.merge(customer: customer_id))
|
47
|
+
stub_request(:delete, "#{Stripe.api_base}/v1/customers/#{customer_id}/sources/#{FIXTURE[:id]}").
|
48
|
+
to_return(body: JSON.generate(FIXTURE))
|
49
|
+
assert source.kind_of?(Stripe::Source)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
should 'not be listable' do
|
54
|
+
assert_raises NoMethodError do
|
55
|
+
Stripe::Source.list
|
56
|
+
end
|
33
57
|
end
|
34
58
|
|
35
59
|
context "#verify" do
|
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: 2.0
|
4
|
+
version: 2.1.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-03-
|
11
|
+
date: 2017-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|