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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d356b022d7063f14b899676fdea7cdca23959578
4
- data.tar.gz: 04e99c26ba15d5cfaeaeb626cae12ea675136be6
3
+ metadata.gz: 083eab18104ef39dd85e2646f9a0a8da259d159d
4
+ data.tar.gz: 9f1695c23d275adcfef769c577b81865c1739e84
5
5
  SHA512:
6
- metadata.gz: d3e60ed73189c99a626246686b1dedd62402ad70c97fab4af71488c5c9ed40927981b4272d1ea2b0d10bae5c2577d68dc2406a588f86b4c9dd400619a98b967b
7
- data.tar.gz: c049b00c65f2cbab92ef02cec7c5604bf637d4bbb1b2dae44d537edbdfdd4285de41bd955f71acf4bf35fd2c866690600698115fcd2600c2a9f9bd3b416fab53
6
+ metadata.gz: 1ab0cdfe76978d120847fc213d4cfa5cb0887f5b1d7486471528630a8ff643828962d8620f42700e2ce7f355983ab252a932353bdaa2faf94f9524ac8c22eda9
7
+ data.tar.gz: d27dabf527fe69329dbf827d9bcab1deb3a4e3cec1fb00e59ffffcc68d414ded73bfa5f2eb8696288d6021cb85bbe537bf27cfb232e09b59a61627b56ca11fca
@@ -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.0
1
+ 1.28.1
@@ -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.create(params={}, opts={})
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
- response, opts = request(:post, url, params, opts)
13
- Util.convert_to_stripe_object(response, opts)
13
+ }.merge(Util.normalize_opts(opts))
14
+ super
14
15
  end
15
16
 
16
- def self.all(filters={}, opts={})
17
- opts = {:api_base => Stripe::uploads_base}.merge(opts)
18
- response, opts = request(:get, url, filters, opts)
19
- Util.convert_to_stripe_object(response, opts)
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
@@ -1,3 +1,3 @@
1
1
  module Stripe
2
- VERSION = '1.28.0'
2
+ VERSION = '1.28.1'
3
3
  end
@@ -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
- @mock.expects(:post).once.returns(make_response(make_file))
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.returns(make_response(make_file))
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.returns(make_response(make_file_array))
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stripe
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.28.0
4
+ version: 1.28.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ross Boucher