stripe 3.4.1 → 3.5.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/source.rb +9 -4
- data/lib/stripe/version.rb +1 -1
- data/test/stripe/source_test.rb +21 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 318be0fcbe32bab36c77a9390c936aba1735106a
|
4
|
+
data.tar.gz: b060b65d599adf9a51cb6c0d9f1ba81b3a6acc5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83a649dc5dcdb5c62511afcad9367fb4368078950de40ad1e0472250eb4d1521034f27dd98740a759e4694937bf648aac692d2d6546687537e8bf9934fe0e17a
|
7
|
+
data.tar.gz: 8695ec3cf4e68d269c5e9826af93a50f2e61db554d4f2898035aacdf178240f7ed3ccd4f8fc4cd408a398f72d3ea428ed6bbd115d8e323357c41cb05d384b192
|
data/History.txt
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.5.0
|
data/lib/stripe/source.rb
CHANGED
@@ -5,12 +5,11 @@ module Stripe
|
|
5
5
|
|
6
6
|
OBJECT_NAME = "source".freeze
|
7
7
|
|
8
|
-
def
|
8
|
+
def detach(params = {}, opts = {})
|
9
9
|
if !respond_to?(:customer) || customer.nil? || customer.empty?
|
10
10
|
raise NotImplementedError,
|
11
|
-
"
|
12
|
-
"
|
13
|
-
"be currently attached to a customer object."
|
11
|
+
"This source object does not appear to be currently attached " \
|
12
|
+
"to a customer object."
|
14
13
|
end
|
15
14
|
|
16
15
|
url = "#{Customer.resource_url}/#{CGI.escape(customer)}/sources/#{CGI.escape(id)}"
|
@@ -18,6 +17,12 @@ module Stripe
|
|
18
17
|
initialize_from(resp.data, opts)
|
19
18
|
end
|
20
19
|
|
20
|
+
def delete(params = {}, opts = {})
|
21
|
+
detach(params, opts)
|
22
|
+
end
|
23
|
+
extend Gem::Deprecate
|
24
|
+
deprecate :delete, "#detach", 2017, 10
|
25
|
+
|
21
26
|
def verify(params = {}, opts = {})
|
22
27
|
resp, opts = request(:post, resource_url + "/verify", params, Util.normalize_opts(opts))
|
23
28
|
initialize_from(resp.data, opts)
|
data/lib/stripe/version.rb
CHANGED
data/test/stripe/source_test.rb
CHANGED
@@ -30,12 +30,12 @@ module Stripe
|
|
30
30
|
assert source.is_a?(Stripe::Source)
|
31
31
|
end
|
32
32
|
|
33
|
-
context "#
|
33
|
+
context "#detach" do
|
34
34
|
should "not be deletable when unattached" do
|
35
35
|
source = Stripe::Source.retrieve("src_123")
|
36
36
|
|
37
37
|
assert_raises NotImplementedError do
|
38
|
-
source.
|
38
|
+
source.detach
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
@@ -43,12 +43,30 @@ module Stripe
|
|
43
43
|
source = Stripe::Source.construct_from(customer: "cus_123",
|
44
44
|
id: "src_123",
|
45
45
|
object: "source")
|
46
|
-
source = source.
|
46
|
+
source = source.detach
|
47
47
|
assert_requested :delete, "#{Stripe.api_base}/v1/customers/cus_123/sources/src_123"
|
48
48
|
assert source.is_a?(Stripe::Source)
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
+
context "#delete" do
|
53
|
+
should "warn that #delete is deprecated" do
|
54
|
+
old_stderr = $stderr
|
55
|
+
$stderr = StringIO.new
|
56
|
+
begin
|
57
|
+
source = Stripe::Source.construct_from(customer: "cus_123",
|
58
|
+
id: "src_123",
|
59
|
+
object: "source")
|
60
|
+
source.delete
|
61
|
+
message = "NOTE: Stripe::Source#delete is " \
|
62
|
+
"deprecated; use #detach instead"
|
63
|
+
assert_match Regexp.new(message), $stderr.string
|
64
|
+
ensure
|
65
|
+
$stderr = old_stderr
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
52
70
|
should "not be listable" do
|
53
71
|
assert_raises NoMethodError do
|
54
72
|
Stripe::Source.list
|
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.
|
4
|
+
version: 3.5.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-
|
11
|
+
date: 2017-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|