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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 66408a45e6fe0aade6bed89e6b1fc94887ebfcf2
4
- data.tar.gz: e6e4bab0429b17fd67c8c55e4733549b4e982e7a
3
+ metadata.gz: 57598a9b03ea0fbec114906e397d77c1269dec18
4
+ data.tar.gz: e40cb1a5699707e7279aba5abe1b0f4ee71a624c
5
5
  SHA512:
6
- metadata.gz: cfcd581ed60fbf0e314e6ef79ce5e0db9db982a07ca5eda716092473b5d9ca29492a27920302b23fa74307e542ca4cd3323aa7bc728a1245d2324d79043e914e
7
- data.tar.gz: 8e8b2446f7410544c423bca16ed8bc1c18c936129cc5870ab2f8fb3d1f63978ad586a2db9cadcb9c79b970fbaf0e385c4dbc057bd5a454db268f2fe5261117cc
6
+ metadata.gz: 0aaff9bcd96782e96d992c44d4d2af47131af21e508b0adcc3d92c9eb385bfc472bfb6d31dfbdcc413565160cf20a524f9763b1ba0bec06c4a84152b96465930
7
+ data.tar.gz: 856a3bcced4ff4830c13e58103febde22ab7c81cd058cff779996d2b574aa85fead3a5961716c9407061d9f49c2f46b6804e2ce1da6426837e780227cf6c33d3
@@ -1,3 +1,7 @@
1
+ === 1.43.1 2016-06-17
2
+
3
+ * Fix type of resource returned from `Order#return_order`
4
+
1
5
  === 1.43.0 2016-05-20
2
6
 
3
7
  * Allow Relay orders to be returned and add associated types
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.43.0
1
+ 1.43.1
@@ -11,7 +11,7 @@ module Stripe
11
11
 
12
12
  def return_order(params, opts={})
13
13
  response, opts = request(:post, returns_url, params, opts)
14
- initialize_from(response, opts)
14
+ Util.convert_to_stripe_object(response, opts)
15
15
  end
16
16
 
17
17
  private
@@ -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
- # * +:opts+ Options for StripeObject like an API key.
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 ininiated under this
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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Stripe
2
- VERSION = '1.43.0'
2
+ VERSION = '1.43.1'
3
3
  end
@@ -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.authors = ['Ross Boucher', 'Greg Brockman']
12
- s.email = ['boucher@stripe.com', 'gdb@stripe.com']
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')
@@ -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(make_paid_order))
60
- order.return_order(:items => [{:parent => 'sku_foo'}])
61
- assert_equal "paid", order.status
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
@@ -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.0
4
+ version: 1.43.1
5
5
  platform: ruby
6
6
  authors:
7
- - Ross Boucher
8
- - Greg Brockman
7
+ - Stripe
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2016-05-20 00:00:00.000000000 Z
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: {}