stripe 1.20.0 → 1.20.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ === 1.20.1 2015-02-26
2
+
3
+ * Updated Card to point to customer sources endpoint when customer property is set
4
+
1
5
  === 1.20.0 2015-02-19
2
6
 
3
7
  * Added Update & Delete operations to Bitcoin Receivers
@@ -5,7 +5,7 @@
5
5
  You don't need this source code unless you want to modify the gem. If
6
6
  you just want to use the Stripe Ruby bindings, you should run:
7
7
 
8
- gem install --source https://code.stripe.com stripe
8
+ gem install stripe
9
9
 
10
10
  If you want to build the gem from source:
11
11
 
@@ -23,17 +23,12 @@ If you want to build the gem from source:
23
23
 
24
24
  * rest-client, json
25
25
 
26
- == Mirrors
26
+ == Bundler
27
27
 
28
- The stripe gem is mirrored on Rubygems, so you should be able to
29
- install it via <tt>gem install stripe</tt> if desired. We recommend using
30
- the https://code.stripe.com mirror so all code is fetched over SSL.
31
-
32
- Note that if you are installing via bundler, you should be sure to use the https
28
+ If you are installing via bundler, you should be sure to use the https
33
29
  rubygems source in your Gemfile, as any gems fetched over http could potentially be
34
30
  compromised in transit and alter the code of gems fetched securely over https:
35
31
 
36
- source 'https://code.stripe.com'
37
32
  source 'https://rubygems.org'
38
33
 
39
34
  gem 'rails'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.20.0
1
+ 1.20.1
@@ -8,7 +8,7 @@ module Stripe
8
8
  if respond_to?(:recipient)
9
9
  "#{Recipient.url}/#{CGI.escape(recipient)}/cards/#{CGI.escape(id)}"
10
10
  elsif respond_to?(:customer)
11
- "#{Customer.url}/#{CGI.escape(customer)}/cards/#{CGI.escape(id)}"
11
+ "#{Customer.url}/#{CGI.escape(customer)}/sources/#{CGI.escape(id)}"
12
12
  end
13
13
  end
14
14
 
@@ -1,3 +1,3 @@
1
1
  module Stripe
2
- VERSION = '1.20.0'
2
+ VERSION = '1.20.1'
3
3
  end
@@ -2,7 +2,7 @@ require File.expand_path('../../test_helper', __FILE__)
2
2
 
3
3
  module Stripe
4
4
  class CustomerCardTest < Test::Unit::TestCase
5
- CUSTOMER_CARD_URL = '/v1/customers/test_customer/cards/test_card'
5
+ CUSTOMER_CARD_URL = '/v1/customers/test_customer/sources/test_card'
6
6
 
7
7
  def customer
8
8
  @mock.expects(:get).once.returns(test_response(test_customer))
@@ -11,8 +11,8 @@ module Stripe
11
11
 
12
12
  should "customer cards should be listable" do
13
13
  c = customer
14
- @mock.expects(:get).once.returns(test_response(test_card_array(customer.id)))
15
- cards = c.cards.all.data
14
+ @mock.expects(:get).once.returns(test_response(test_customer_card_array(customer.id)))
15
+ cards = c.sources.all(:object => "card").data
16
16
  assert cards.kind_of? Array
17
17
  assert cards[0].kind_of? Stripe::Card
18
18
  end
@@ -23,7 +23,7 @@ module Stripe
23
23
  :id => 'test_card',
24
24
  :customer => 'test_customer'
25
25
  )))
26
- card = c.cards.retrieve('card')
26
+ card = c.sources.retrieve('card')
27
27
  assert_equal CUSTOMER_CARD_URL, card.url
28
28
  end
29
29
 
@@ -31,7 +31,7 @@ module Stripe
31
31
  c = customer
32
32
  @mock.expects(:get).once.returns(test_response(test_card))
33
33
  @mock.expects(:delete).once.returns(test_response(test_card(:deleted => true)))
34
- card = c.cards.retrieve('card')
34
+ card = c.sources.retrieve('card')
35
35
  card.delete
36
36
  assert card.deleted
37
37
  end
@@ -40,7 +40,7 @@ module Stripe
40
40
  c = customer
41
41
  @mock.expects(:get).once.returns(test_response(test_card(:exp_year => "2000")))
42
42
  @mock.expects(:post).once.returns(test_response(test_card(:exp_year => "2100")))
43
- card = c.cards.retrieve('card')
43
+ card = c.sources.retrieve('card')
44
44
  assert_equal "2000", card.exp_year
45
45
  card.exp_year = "2100"
46
46
  card.save
@@ -50,7 +50,7 @@ module Stripe
50
50
  should "create should return a new customer card" do
51
51
  c = customer
52
52
  @mock.expects(:post).once.returns(test_response(test_card(:id => "test_card")))
53
- card = c.cards.create(:card => "tok_41YJ05ijAaWaFS")
53
+ card = c.sources.create(:source => "tok_41YJ05ijAaWaFS")
54
54
  assert_equal "test_card", card.id
55
55
  end
56
56
  end
@@ -11,7 +11,7 @@ module Stripe
11
11
 
12
12
  should "recipient cards should be listable" do
13
13
  c = recipient
14
- @mock.expects(:get).once.returns(test_response(test_card_array(recipient.id)))
14
+ @mock.expects(:get).once.returns(test_response(test_recipient_card_array(recipient.id)))
15
15
  cards = c.cards.all.data
16
16
  assert cards.kind_of? Array
17
17
  assert cards[0].kind_of? Stripe::Card
@@ -103,7 +103,7 @@ module Stripe
103
103
  :id => id,
104
104
  :default_card => "cc_test_card",
105
105
  :created => 1304114758,
106
- :cards => test_card_array(id),
106
+ :sources => test_customer_card_array(id),
107
107
  :metadata => {},
108
108
  :subscriptions => test_subscription_array(id)
109
109
  }.merge(params)
@@ -151,11 +151,19 @@ module Stripe
151
151
  }
152
152
  end
153
153
 
154
- def test_card_array(customer_id)
154
+ def test_recipient_card_array(recipient_id)
155
155
  {
156
156
  :data => [test_card, test_card, test_card],
157
157
  :object => 'list',
158
- :url => '/v1/customers/' + customer_id + '/cards'
158
+ :url => '/v1/recipients/' + recipient_id + '/cards'
159
+ }
160
+ end
161
+
162
+ def test_customer_card_array(customer_id)
163
+ {
164
+ :data => [test_card, test_card, test_card],
165
+ :object => 'list',
166
+ :url => '/v1/customers/' + customer_id + '/sources'
159
167
  }
160
168
  end
161
169
 
@@ -330,7 +338,7 @@ module Stripe
330
338
  :livemode => false,
331
339
  :object => "recipient",
332
340
  :id => "rp_test_recipient",
333
- :cards => test_card_array(id),
341
+ :cards => test_recipient_card_array(id),
334
342
  :default_card => "debit_test_card",
335
343
  :active_account => {
336
344
  :last4 => "6789",
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.20.0
4
+ version: 1.20.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-02-20 00:00:00.000000000 Z
13
+ date: 2015-02-27 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rest-client