stripe 1.28.0 → 1.28.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +8 -0
- data/VERSION +1 -1
- data/lib/stripe/file_upload.rb +11 -9
- data/lib/stripe/version.rb +1 -1
- data/test/stripe/file_upload_test.rb +16 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 083eab18104ef39dd85e2646f9a0a8da259d159d
|
4
|
+
data.tar.gz: 9f1695c23d275adcfef769c577b81865c1739e84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ab0cdfe76978d120847fc213d4cfa5cb0887f5b1d7486471528630a8ff643828962d8620f42700e2ce7f355983ab252a932353bdaa2faf94f9524ac8c22eda9
|
7
|
+
data.tar.gz: d27dabf527fe69329dbf827d9bcab1deb3a4e3cec1fb00e59ffffcc68d414ded73bfa5f2eb8696288d6021cb85bbe537bf27cfb232e09b59a61627b56ca11fca
|
data/History.txt
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
=== 1.28.1 2015-10-05
|
2
|
+
|
3
|
+
* DESCRIBE CHANGES HERE (try to use the same style, tense, etc. as the other entries)
|
4
|
+
|
5
|
+
=== 1.28.1 2015-10-05
|
6
|
+
|
7
|
+
* Fix URI being referenced by file upload resources
|
8
|
+
|
1
9
|
=== 1.28.0 2015-10-05
|
2
10
|
|
3
11
|
* Make StripeObject's #save "upsert"-like; creates an object if new
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.28.
|
1
|
+
1.28.1
|
data/lib/stripe/file_upload.rb
CHANGED
@@ -1,22 +1,24 @@
|
|
1
1
|
module Stripe
|
2
2
|
class FileUpload < APIResource
|
3
|
+
include Stripe::APIOperations::Create
|
4
|
+
include Stripe::APIOperations::List
|
5
|
+
|
3
6
|
def self.url
|
4
7
|
"/v1/files"
|
5
8
|
end
|
6
9
|
|
7
|
-
def self.
|
10
|
+
def self.request(method, url, params={}, opts={})
|
8
11
|
opts = {
|
9
|
-
:content_type => 'multipart/form-data',
|
10
12
|
:api_base => Stripe::uploads_base
|
11
|
-
}.merge(opts)
|
12
|
-
|
13
|
-
Util.convert_to_stripe_object(response, opts)
|
13
|
+
}.merge(Util.normalize_opts(opts))
|
14
|
+
super
|
14
15
|
end
|
15
16
|
|
16
|
-
def self.
|
17
|
-
opts = {
|
18
|
-
|
19
|
-
Util.
|
17
|
+
def self.create(params={}, opts={})
|
18
|
+
opts = {
|
19
|
+
:content_type => 'multipart/form-data',
|
20
|
+
}.merge(Util.normalize_opts(opts))
|
21
|
+
super
|
20
22
|
end
|
21
23
|
end
|
22
24
|
end
|
data/lib/stripe/version.rb
CHANGED
@@ -3,23 +3,34 @@ require File.expand_path('../../test_helper', __FILE__)
|
|
3
3
|
module Stripe
|
4
4
|
class FileUploadTest < Test::Unit::TestCase
|
5
5
|
should "create should return a new file" do
|
6
|
-
|
7
|
-
f = Stripe::FileUpload.create({
|
6
|
+
params = {
|
8
7
|
:purpose => "dispute_evidence",
|
9
8
|
:file => File.new(__FILE__),
|
10
|
-
}
|
9
|
+
}
|
10
|
+
|
11
|
+
@mock.expects(:post).once.
|
12
|
+
with("#{Stripe.uploads_base}/v1/files", nil, params).
|
13
|
+
returns(make_response(make_file))
|
14
|
+
|
15
|
+
f = Stripe::FileUpload.create(params)
|
11
16
|
assert_equal "fil_test_file", f.id
|
12
17
|
end
|
13
18
|
|
14
19
|
should "files should be retrievable" do
|
15
|
-
@mock.expects(:get).once.
|
20
|
+
@mock.expects(:get).once.
|
21
|
+
with("#{Stripe.uploads_base}/v1/files/fil_test_file", nil, nil).
|
22
|
+
returns(make_response(make_file))
|
23
|
+
|
16
24
|
c = Stripe::FileUpload.new("fil_test_file")
|
17
25
|
c.refresh
|
18
26
|
assert_equal 1403047735, c.created
|
19
27
|
end
|
20
28
|
|
21
29
|
should "files should be listable" do
|
22
|
-
@mock.expects(:get).once.
|
30
|
+
@mock.expects(:get).once.
|
31
|
+
with("#{Stripe.uploads_base}/v1/files", nil, nil).
|
32
|
+
returns(make_response(make_file_array))
|
33
|
+
|
23
34
|
c = Stripe::FileUpload.all.data
|
24
35
|
assert c.kind_of? Array
|
25
36
|
assert c[0].kind_of? Stripe::FileUpload
|