stripe 1.27.0 → 1.27.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: 760f0f55706fd57c28bd816239bce54e737af027
4
- data.tar.gz: f130be8395aa8171a34281613132a4810f4a6933
3
+ metadata.gz: 1f4235e27307b38df8ab0559790ed8198ee52fa8
4
+ data.tar.gz: 9370238b510e753ff6259f67150048b366266d6e
5
5
  SHA512:
6
- metadata.gz: 811530350758ac6aa6eee05ce63591ac77272e2d0dc66b503d86e3897d79060237352dd3fa1f4b0997b1387e8360dd672e3c82fc9293e644b86636fc31bbdec6
7
- data.tar.gz: daa6cad45b40d685193cc63b90fbcbf5f51967d34d8f5b63e095200958ff9902d0b99edc7ea40b19bcab26697aff6517a75e26c90f768083c04ebc04215b0538
6
+ metadata.gz: 03cbd36f734b4644c508168daaae265027977988f24b68b925febec71350aba92aa6e119a9a0b5902db13112d05c32d7946ba34db853744122548868768470d3
7
+ data.tar.gz: efec64ae57b51dbf989db5da396678fd4a375b2e312c9459a0ca2fa2b8edeb698fafd1a1d6b22333cfd9a7aad07ab5da394090f2a229076cbb5f294fe7230eb8
@@ -1,3 +1,7 @@
1
+ === 1.27.1 2015-09-20
2
+
3
+ * Use hash rockets for backwards compatibility.
4
+
1
5
  === 1.27.0 2015-09-14
2
6
 
3
7
  * Add Orders, Products, and SKUs for Relay.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.27.0
1
+ 1.27.1
@@ -253,7 +253,8 @@ module Stripe
253
253
  begin
254
254
  error_obj = JSON.parse(resp.body)
255
255
  error_obj = Util.symbolize_names(error_obj)
256
- error = error_obj[:error] or raise StripeError.new # escape from parsing
256
+ error = error_obj[:error]
257
+ raise StripeError.new unless error && error.is_a?(Hash)
257
258
 
258
259
  rescue JSON::ParserError, StripeError
259
260
  raise general_api_error(resp.code, resp.body)
@@ -10,7 +10,7 @@ module Stripe
10
10
 
11
11
  # Override Stripe::APIOperations::Update#save to explicitly pass URL.
12
12
  def save
13
- super(req_url: api_url)
13
+ super(:req_url => api_url)
14
14
  end
15
15
  end
16
16
  end
@@ -1,3 +1,3 @@
1
1
  module Stripe
2
- VERSION = '1.27.0'
2
+ VERSION = '1.27.1'
3
3
  end
@@ -125,6 +125,28 @@ module Stripe
125
125
  'sk_test_local')
126
126
  end
127
127
 
128
+ should "handle error response with empty body" do
129
+ response = make_response('', 500)
130
+ @mock.expects(:post).once.raises(RestClient::ExceptionWithResponse.new(response, 500))
131
+
132
+ e = assert_raises Stripe::APIError do
133
+ Stripe::Charge.create
134
+ end
135
+
136
+ assert_equal 'Invalid response object from API: "" (HTTP response code was 500)', e.message
137
+ end
138
+
139
+ should "handle error response with non-object error value" do
140
+ response = make_response('{"error": "foo"}', 500)
141
+ @mock.expects(:post).once.raises(RestClient::ExceptionWithResponse.new(response, 500))
142
+
143
+ e = assert_raises Stripe::APIError do
144
+ Stripe::Charge.create
145
+ end
146
+
147
+ assert_equal 'Invalid response object from API: "{\"error\": \"foo\"}" (HTTP response code was 500)', e.message
148
+ end
149
+
128
150
  should "have default open and read timeouts" do
129
151
  assert_equal Stripe.open_timeout, 30
130
152
  assert_equal Stripe.read_timeout, 80
@@ -45,7 +45,7 @@ module Stripe
45
45
  @mock.expects(:post).once.
46
46
  with('https://api.stripe.com/v1/orders/or_test_order/pay', nil, 'token=test_token').
47
47
  returns(make_response(make_paid_order))
48
- order.pay(token: 'test_token')
48
+ order.pay(:token => 'test_token')
49
49
  assert_equal "paid", order.status
50
50
  end
51
51
  end
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.27.0
4
+ version: 1.27.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ross Boucher
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-09-14 00:00:00.000000000 Z
12
+ date: 2015-09-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client