stripe 1.43.0 → 1.43.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 +4 -0
- data/VERSION +1 -1
- data/lib/stripe/order.rb +1 -1
- data/lib/stripe/stripe_object.rb +4 -3
- data/lib/stripe/util.rb +12 -0
- data/lib/stripe/version.rb +1 -1
- data/stripe.gemspec +3 -3
- data/test/stripe/order_test.rb +3 -3
- data/test/test_data.rb +2 -2
- metadata +5 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57598a9b03ea0fbec114906e397d77c1269dec18
|
4
|
+
data.tar.gz: e40cb1a5699707e7279aba5abe1b0f4ee71a624c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0aaff9bcd96782e96d992c44d4d2af47131af21e508b0adcc3d92c9eb385bfc472bfb6d31dfbdcc413565160cf20a524f9763b1ba0bec06c4a84152b96465930
|
7
|
+
data.tar.gz: 856a3bcced4ff4830c13e58103febde22ab7c81cd058cff779996d2b574aa85fead3a5961716c9407061d9f49c2f46b6804e2ce1da6426837e780227cf6c33d3
|
data/History.txt
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.43.
|
1
|
+
1.43.1
|
data/lib/stripe/order.rb
CHANGED
data/lib/stripe/stripe_object.rb
CHANGED
@@ -72,12 +72,13 @@ module Stripe
|
|
72
72
|
#
|
73
73
|
# * +values+ - Hash of values to use to update the current attributes of
|
74
74
|
# the object.
|
75
|
-
# *
|
75
|
+
# * +opts+ - Options for +StripeObject+ like an API key that will be reused
|
76
|
+
# on subsequent API calls.
|
76
77
|
#
|
77
78
|
# ==== Options
|
78
79
|
#
|
79
|
-
# * +:dirty+ Whether values should be initiated as "dirty" (unsaved) and
|
80
|
-
# which applies only to new StripeObjects being
|
80
|
+
# * +:dirty+ - Whether values should be initiated as "dirty" (unsaved) and
|
81
|
+
# which applies only to new StripeObjects being initiated under this
|
81
82
|
# StripeObject. Defaults to true.
|
82
83
|
def update_attributes(values, opts = {}, method_options = {})
|
83
84
|
# Default to true. TODO: Convert to optional arguments after we're off
|
data/lib/stripe/util.rb
CHANGED
@@ -56,6 +56,18 @@ module Stripe
|
|
56
56
|
}
|
57
57
|
end
|
58
58
|
|
59
|
+
# Converts a hash of fields or an array of hashes into a +StripeObject+ or
|
60
|
+
# array of +StripeObject+s. These new objects will be created as a concrete
|
61
|
+
# type as dictated by their `object` field (e.g. an `object` value of
|
62
|
+
# `charge` would create an instance of +Charge+), but if `object` is not
|
63
|
+
# present or of an unkown type, the newly created instance will fall back
|
64
|
+
# to being a +StripeObject+.
|
65
|
+
#
|
66
|
+
# ==== Attributes
|
67
|
+
#
|
68
|
+
# * +resp+ - Hash of fields and values to be converted into a StripeObject.
|
69
|
+
# * +opts+ - Options for +StripeObject+ like an API key that will be reused
|
70
|
+
# on subsequent API calls.
|
59
71
|
def self.convert_to_stripe_object(resp, opts)
|
60
72
|
case resp
|
61
73
|
when Array
|
data/lib/stripe/version.rb
CHANGED
data/stripe.gemspec
CHANGED
@@ -8,9 +8,9 @@ spec = Gem::Specification.new do |s|
|
|
8
8
|
s.required_ruby_version = '>= 1.9.3'
|
9
9
|
s.summary = 'Ruby bindings for the Stripe API'
|
10
10
|
s.description = 'Stripe is the easiest way to accept payments online. See https://stripe.com for details.'
|
11
|
-
s.
|
12
|
-
s.email =
|
13
|
-
s.homepage = 'https://stripe.com/api'
|
11
|
+
s.author = 'Stripe'
|
12
|
+
s.email = 'support@stripe.com'
|
13
|
+
s.homepage = 'https://stripe.com/docs/api/ruby'
|
14
14
|
s.license = 'MIT'
|
15
15
|
|
16
16
|
s.add_dependency('rest-client', '~> 1.4')
|
data/test/stripe/order_test.rb
CHANGED
@@ -56,9 +56,9 @@ module Stripe
|
|
56
56
|
|
57
57
|
@mock.expects(:post).once.
|
58
58
|
with('https://api.stripe.com/v1/orders/or_test_order/returns', nil, 'items[][parent]=sku_foo').
|
59
|
-
returns(make_response(
|
60
|
-
order.return_order(:items => [{:parent => 'sku_foo'}])
|
61
|
-
assert_equal
|
59
|
+
returns(make_response(make_order_return({:order => order.id})))
|
60
|
+
order_return = order.return_order(:items => [{:parent => 'sku_foo'}])
|
61
|
+
assert_equal order.id, order_return.order
|
62
62
|
end
|
63
63
|
end
|
64
64
|
end
|
data/test/test_data.rb
CHANGED
@@ -692,7 +692,7 @@ module Stripe
|
|
692
692
|
}).merge(params)
|
693
693
|
end
|
694
694
|
|
695
|
-
def make_order_return
|
695
|
+
def make_order_return(params={})
|
696
696
|
{
|
697
697
|
:id => "orret_18CI1jDAu10Yox5R5kGPgbLN",
|
698
698
|
:object => "order_return",
|
@@ -722,7 +722,7 @@ module Stripe
|
|
722
722
|
:livemode => false,
|
723
723
|
:order => "or_189jaGDAu10Yox5R0F6LoH6K",
|
724
724
|
:refund => nil,
|
725
|
-
}
|
725
|
+
}.merge(params)
|
726
726
|
end
|
727
727
|
|
728
728
|
def make_order_return_array
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stripe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.43.
|
4
|
+
version: 1.43.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
8
|
-
- Greg Brockman
|
7
|
+
- Stripe
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2016-
|
11
|
+
date: 2016-06-17 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rest-client
|
@@ -27,9 +26,7 @@ dependencies:
|
|
27
26
|
version: '1.4'
|
28
27
|
description: Stripe is the easiest way to accept payments online. See https://stripe.com
|
29
28
|
for details.
|
30
|
-
email:
|
31
|
-
- boucher@stripe.com
|
32
|
-
- gdb@stripe.com
|
29
|
+
email: support@stripe.com
|
33
30
|
executables:
|
34
31
|
- stripe-console
|
35
32
|
extensions: []
|
@@ -130,7 +127,7 @@ files:
|
|
130
127
|
- test/stripe_test.rb
|
131
128
|
- test/test_data.rb
|
132
129
|
- test/test_helper.rb
|
133
|
-
homepage: https://stripe.com/api
|
130
|
+
homepage: https://stripe.com/docs/api/ruby
|
134
131
|
licenses:
|
135
132
|
- MIT
|
136
133
|
metadata: {}
|