stripe 1.50.0 → 1.50.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: 47fa516346de50085b6d53182b625dfcbbf84841
4
- data.tar.gz: 2291666563711b5cde74e6368f4c397d0a386300
3
+ metadata.gz: d7a6e05be384fc9ff98e33581d00aeb9deead4fb
4
+ data.tar.gz: 4dde279ff2795efc7d7607b0772ca594fa4afd26
5
5
  SHA512:
6
- metadata.gz: dbc4c2ed22d8600cf72701aefc1e7b4846e079a143f08f9970b0e851cebe21e0bd027102483717513ecea60b423248b28ab6a5429912d3ba17ba44f824a1e4af
7
- data.tar.gz: 357351a1a873ae4606e4573d575f832cf0aa6daedd260bddeb17e19f4a00b282b51e0588b3280818f3349a38358ad756fc6e5e5c3722ee99c2bd45373cf5278d
6
+ metadata.gz: 0773fbcc58390263df79f5d53b186689b4f6b95ca22463502b99754c47227f49610d92e85fb48a529f38c05ceb23ea2c7769582b17179ea9352dc9a8a68ac8a4
7
+ data.tar.gz: 260b73c85e24a8fc19fede4dd078e3b84ecb217b0edcb5f720c33cbf20ba9778ed006d1ef721c46a89147893a4599bee29aaade8e9686d4a81bed0cdf4399e35
@@ -1,3 +1,7 @@
1
+ === 1.50.1 2016-08-25
2
+
3
+ * Fix encoding of arrays of maps where maps unequal sets of keys
4
+
1
5
  === 1.50.0 2016-08-15
2
6
 
3
7
  * Allow sources to be created
data/README.md CHANGED
@@ -30,12 +30,12 @@ If you want to build the gem from source:
30
30
 
31
31
  gem build stripe.gemspec
32
32
 
33
- ## Requirements
33
+ ### Requirements
34
34
 
35
35
  * Ruby 1.9.3 or above.
36
36
  * rest-client
37
37
 
38
- ## Bundler
38
+ ### Bundler
39
39
 
40
40
  If you are installing via bundler, you should be sure to use the https rubygems
41
41
  source in your Gemfile, as any gems fetched over http could potentially be
@@ -48,6 +48,50 @@ gem 'rails'
48
48
  gem 'stripe'
49
49
  ```
50
50
 
51
+ ## Usage
52
+
53
+ The library needs to be configured with your account's secret key which is
54
+ available in the [Dashboard][dashboard]. Assign its value to `Stripe.api_key`
55
+ and the library will send it along automatically with every request:
56
+
57
+ ``` ruby
58
+ require "stripe"
59
+ Stripe.api_key = "sk_test_..."
60
+
61
+ # list charges
62
+ Stripe::Charge.list()
63
+
64
+ # retrieve single charge
65
+ Stripe::Charge.retrieve(
66
+ "ch_18atAXCdGbJFKhCuBAa4532Z",
67
+ )
68
+ ```
69
+
70
+ You can also set a per-request key and/or account like in the examples below.
71
+ This is often useful for Connect applications that use multiple API keys during
72
+ the lifetime of a process.
73
+
74
+ Authentication is transparently handled for you in subsequent method calls on
75
+ the returned object.
76
+
77
+ For example:
78
+
79
+ ``` ruby
80
+ require "stripe"
81
+
82
+ Stripe::Charge.list(
83
+ {},
84
+ :api_key => "sk_test_...",
85
+ :stripe_account => "acct_..."
86
+ )
87
+
88
+ Stripe::Charge.retrieve(
89
+ "ch_18atAXCdGbJFKhCuBAa4532Z",
90
+ :api_key => "sk_test_...",
91
+ :stripe_account => "acct_..."
92
+ )
93
+ ```
94
+
51
95
  ## Development
52
96
 
53
97
  Run all tests:
@@ -87,3 +131,4 @@ Example:
87
131
  Stripe.max_network_retries = 2
88
132
 
89
133
  [curl]: http://curl.haxx.se/docs/caextract.html
134
+ [dashboard]: https://dashboard.stripe.com/account
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.50.0
1
+ 1.50.1
@@ -135,7 +135,7 @@ module Stripe
135
135
 
136
136
  # do not sort the final output because arrays (and arrays of hashes
137
137
  # especially) can be order sensitive, but do sort incoming parameters
138
- params.sort_by { |(k, _)| k.to_s }.each do |key, value|
138
+ params.each do |key, value|
139
139
  calculated_key = parent_key ? "#{parent_key}[#{key}]" : "#{key}"
140
140
  if value.is_a?(Hash)
141
141
  result += flatten_params(value, calculated_key)
@@ -1,3 +1,3 @@
1
1
  module Stripe
2
- VERSION = '1.50.0'
2
+ VERSION = '1.50.1'
3
3
  end
@@ -105,7 +105,7 @@ module Stripe
105
105
  }
106
106
  @mock.expects(:post).
107
107
  once.
108
- with('https://api.stripe.com/v1/accounts/acct_foo', nil, 'legal_entity[address][line1]=2+Three+Four&legal_entity[first_name]=Bob').
108
+ with('https://api.stripe.com/v1/accounts/acct_foo', nil, 'legal_entity[first_name]=Bob&legal_entity[address][line1]=2+Three+Four').
109
109
  returns(make_response(resp))
110
110
 
111
111
  a = Stripe::Account.update('acct_foo', :legal_entity => {
@@ -36,8 +36,8 @@ module Stripe
36
36
  [:d, { :a => "a", :b => "b" }],
37
37
  [:e, [0, 1]],
38
38
  [:f, [
39
- { :bar => "1", :foo => "2" },
40
- { :baz => "3", :foo => "4" },
39
+ { :foo => "1", :ghi => "2" },
40
+ { :foo => "3", :bar => "4" },
41
41
  ]],
42
42
  ]
43
43
  assert_equal([
@@ -52,10 +52,10 @@ module Stripe
52
52
  # *The key here is the order*. In order to be properly interpreted as
53
53
  # an array of hashes on the server, everything from a single hash must
54
54
  # come in at once. A duplicate key in an array triggers a new element.
55
- ["f[][bar]", "1"],
56
- ["f[][foo]", "2"],
57
- ["f[][baz]", "3"],
58
- ["f[][foo]", "4"],
55
+ ["f[][foo]", "1"],
56
+ ["f[][ghi]", "2"],
57
+ ["f[][foo]", "3"],
58
+ ["f[][bar]", "4"],
59
59
  ], Stripe::Util.flatten_params(params))
60
60
  end
61
61
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stripe
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.50.0
4
+ version: 1.50.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-15 00:00:00.000000000 Z
11
+ date: 2016-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client