stripe 1.37.0 → 1.38.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/api_operations/update.rb +6 -2
- data/lib/stripe/version.rb +1 -1
- data/test/stripe/api_resource_test.rb +25 -0
- 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: 004d768dc2a4f11d96636a68dff3e31891d2e27a
|
4
|
+
data.tar.gz: d7f1a7fa8310ae02dcd6994ece7499558a4d65a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90fa0546b9523e82eeca3dbbdc940dceeb2bf75ddb275d800b1eb53a8d4774333cbbc843d8a3fa9d4d976dd9b6080b6cfcf9af27a031415e1372d20d21aaf450
|
7
|
+
data.tar.gz: a0b56c9de14ced6bedd61463c30c32175363bf8a05ab5ef8d70089c8c5d30abcafa44684bd8446c35e7b9ec2b32e83dfed43842a28a5c70303b55197f1980477
|
data/History.txt
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.38.0
|
@@ -13,7 +13,11 @@ module Stripe
|
|
13
13
|
# and includes them in the create or update. If +:req_url:+ is included
|
14
14
|
# in the list, it overrides the update URL used for the create or
|
15
15
|
# update.
|
16
|
-
|
16
|
+
# * +opts+ - A Hash of additional options (separate from the params /
|
17
|
+
# object values) to be added to the request. E.g. to allow for an
|
18
|
+
# idempotency_key to be passed in the request headers, or for the
|
19
|
+
# api_key to be overwritten. See {APIOperations::Request.request}.
|
20
|
+
def save(params={}, opts={})
|
17
21
|
# We started unintentionally (sort of) allowing attributes sent to
|
18
22
|
# +save+ to override values used during the update. So as not to break
|
19
23
|
# the API, this makes that official here.
|
@@ -28,7 +32,7 @@ module Stripe
|
|
28
32
|
# generated a uri for this object with an identifier baked in
|
29
33
|
values.delete(:id)
|
30
34
|
|
31
|
-
response, opts = request(:post, save_url, values)
|
35
|
+
response, opts = request(:post, save_url, values, opts)
|
32
36
|
initialize_from(response, opts)
|
33
37
|
|
34
38
|
self
|
data/lib/stripe/version.rb
CHANGED
@@ -387,6 +387,31 @@ module Stripe
|
|
387
387
|
assert_equal false, c.livemode
|
388
388
|
end
|
389
389
|
|
390
|
+
should "updating should send along the idempotency-key header" do
|
391
|
+
Stripe.expects(:execute_request).with do |opts|
|
392
|
+
opts[:headers][:idempotency_key] == 'bar'
|
393
|
+
end.returns(make_response(make_customer))
|
394
|
+
c = Stripe::Customer.new
|
395
|
+
c.save({}, { :idempotency_key => 'bar' })
|
396
|
+
assert_equal false, c.livemode
|
397
|
+
end
|
398
|
+
|
399
|
+
should "updating should fail if api_key is overwritten with nil" do
|
400
|
+
c = Stripe::Customer.new
|
401
|
+
assert_raises TypeError do
|
402
|
+
c.save({}, { :api_key => nil })
|
403
|
+
end
|
404
|
+
end
|
405
|
+
|
406
|
+
should "updating should use the supplied api_key" do
|
407
|
+
Stripe.expects(:execute_request).with do |opts|
|
408
|
+
opts[:headers][:authorization] == 'Bearer sk_test_local'
|
409
|
+
end.returns(make_response(make_customer))
|
410
|
+
c = Stripe::Customer.new
|
411
|
+
c.save({}, { :api_key => 'sk_test_local' })
|
412
|
+
assert_equal false, c.livemode
|
413
|
+
end
|
414
|
+
|
390
415
|
should "deleting should send no props and result in an object that has no props other deleted" do
|
391
416
|
@mock.expects(:get).never
|
392
417
|
@mock.expects(:post).never
|
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.
|
4
|
+
version: 1.38.0
|
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: 2016-03-
|
12
|
+
date: 2016-03-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|