dwolla-ruby 3.0.1 → 3.0.2

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: 7f39a230f6d602e791045db44602b31ccbfe6c7a
4
- data.tar.gz: 6b7c5a7c0ce735966f8f55915e7927977270a300
3
+ metadata.gz: 89bd0e968d1240efc11c53b943b41bcd2d2bd5c8
4
+ data.tar.gz: 007d152579d26663dcd064b63a982812dc9e35b6
5
5
  SHA512:
6
- metadata.gz: 4c2cd535ae06a871ed4f89d4b873f6755e487238fc04843e534b37a6c9b82c9ceb5bfa8d5382ac446233e4568a516fa9d8168a4bd8daadaa30c8ed50490da96d
7
- data.tar.gz: 4ef1fd88fa358d18096968eb0e1ee86a1d028372730528e0db5fb2916c4e561450b4f1de9887977c04adc3024177bb12bd7de40a3878eb4bc0e8874b8fe30d9a
6
+ metadata.gz: fa66cd7bd8090b0eeb67a5520478e6e510bbc04f4d5b7d2aab7aabd6b852fe779a3cd6c8be81f5ae89d8c539427541637977ab161d916fc5cb5b07854db8d53f
7
+ data.tar.gz: 633ece0a60e5891c062f2139180afaa04ec271f69d4bb3a860c17437a373bfd5c9b6cb63879275ac3a76784fb64ea28be28101086db26e8b2e0fb6507867b49a
data/README.md CHANGED
@@ -8,7 +8,7 @@ This repository is for an old version of our API and is no longer actively maint
8
8
  [![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/)
9
9
 
10
10
  ## Version
11
- 3.0.1
11
+ 3.0.2
12
12
 
13
13
  [![Build Status](https://travis-ci.org/Dwolla/dwolla-ruby.svg?branch=master)](https://travis-ci.org/Dwolla/dwolla-ruby)
14
14
 
@@ -54,6 +54,9 @@ Dwolla::Contacts.get(nil, "your_token")
54
54
 
55
55
  ## Changelog
56
56
 
57
+ 3.0.2
58
+ * [Stop passing nil token by default](https://github.com/Dwolla/dwolla-ruby/pull/49)
59
+
57
60
  3.0.1
58
61
  * [Match extract_authorization expectations](https://github.com/Dwolla/dwolla-ruby/pull/47)
59
62
 
@@ -1,6 +1,6 @@
1
1
  module Dwolla
2
2
  class Accounts
3
- def self.get_auto_withdrawal_status(token=nil)
3
+ def self.get_auto_withdrawal_status(token=true)
4
4
  url = accounts_url + 'features/auto_withdrawl'
5
5
 
6
6
  Dwolla.request(:get, url, {}, {}, token)
@@ -1,6 +1,6 @@
1
1
  module Dwolla
2
2
  class Balance
3
- def self.get(token=nil)
3
+ def self.get(token=true)
4
4
  url = balance_url
5
5
 
6
6
  Dwolla.request(:get, url, {}, {}, token)
@@ -1,6 +1,6 @@
1
1
  module Dwolla
2
2
  class Contacts
3
- def self.get(filters={}, token=nil)
3
+ def self.get(filters={}, token=true)
4
4
  url = contacts_url
5
5
 
6
6
  Dwolla.request(:get, url, filters, {}, token)
@@ -1,6 +1,6 @@
1
1
  module Dwolla
2
2
  class FundingSources
3
- def self.get(id=nil, token=nil)
3
+ def self.get(id=nil, token=true)
4
4
  url = funding_sources_url
5
5
 
6
6
  url += id.to_s unless id.nil?
@@ -8,7 +8,7 @@ module Dwolla
8
8
  Dwolla.request(:get, url, {}, {}, token)
9
9
  end
10
10
 
11
- def self.withdraw(id=nil, params={}, token=nil)
11
+ def self.withdraw(id=nil, params={}, token=true)
12
12
  raise MissingParameterError.new('No Funding Source ID Provided.') if id.nil?
13
13
  raise MissingParameterError.new('No PIN Provided.') unless params[:pin]
14
14
  raise MissingParameterError.new('No Amount Provided.') unless params[:amount]
@@ -19,7 +19,7 @@ module Dwolla
19
19
  Dwolla.request(:post, url, params, {}, token)
20
20
  end
21
21
 
22
- def self.deposit(id=nil, params={}, token=nil)
22
+ def self.deposit(id=nil, params={}, token=true)
23
23
  raise MissingParameterError.new('No Funding Source ID Provided.') if id.nil?
24
24
  raise MissingParameterError.new('No PIN Provided.') unless params[:pin]
25
25
  raise MissingParameterError.new('No Amount Provided.') unless params[:amount]
@@ -30,7 +30,7 @@ module Dwolla
30
30
  Dwolla.request(:post, url, params, {}, token)
31
31
  end
32
32
 
33
- def self.add(params={}, token=nil)
33
+ def self.add(params={}, token=true)
34
34
  raise MissingParameterError.new('No Account Number Provided.') unless params[:account_number]
35
35
  raise MissingParameterError.new('No Routing Number (ABA) Provided.') unless params[:routing_number]
36
36
  raise MissingParameterError.new('No Account Type Provided.') unless params[:account_type]
@@ -41,7 +41,7 @@ module Dwolla
41
41
  Dwolla.request(:post, url, params, {}, token)
42
42
  end
43
43
 
44
- def self.verify(id=nil, params={}, token=nil)
44
+ def self.verify(id=nil, params={}, token=true)
45
45
  raise MissingParameterError.new('No Funding Source ID Provided.') if id.nil?
46
46
  raise MissingParameterError.new('No Deposit 1 Amount Provided.') unless params[:deposit1]
47
47
  raise MissingParameterError.new('No Deposit 2 Amount Provided.') unless params[:deposit2]
@@ -1,11 +1,11 @@
1
1
  module Dwolla
2
2
  class MassPay
3
3
 
4
- def self.get(token=nil)
4
+ def self.get(token=true)
5
5
  Dwolla.request(:get, masspay_url, {}, {}, token);
6
6
  end
7
7
 
8
- def self.create(params={}, token=nil)
8
+ def self.create(params={}, token=true)
9
9
  raise MissingParameterError.new('No fundsSource ID Provided.') unless params[:fundsSource]
10
10
  raise MissingParameterError.new('No PIN Provided.') unless params[:pin]
11
11
  raise MissingParameterError.new('No Items Provided.') unless params[:items]
@@ -13,7 +13,7 @@ module Dwolla
13
13
  Dwolla.request(:post, masspay_url, params, {}, token)
14
14
  end
15
15
 
16
- def self.getItems(id=nil, params={}, token=nil)
16
+ def self.getItems(id=nil, params={}, token=true)
17
17
  raise MissingParameterError.new('No MassPay Job ID Provided.') if id.nil?
18
18
  url = masspay_url
19
19
  url += id.to_s unless id.nil?
@@ -22,7 +22,7 @@ module Dwolla
22
22
  Dwolla.request(:get, url, params, {}, token)
23
23
  end
24
24
 
25
- def self.getItem(jobId=nil, itemId=nil, token=nil)
25
+ def self.getItem(jobId=nil, itemId=nil, token=true)
26
26
  raise MissingParameterError.new('No MassPay Job ID Provided.') if jobId.nil?
27
27
  raise MissingParameterError.new('No Item ID Provided.') if itemId.nil?
28
28
 
@@ -34,7 +34,7 @@ module Dwolla
34
34
  Dwolla.request(:get, url, {}, {}, token)
35
35
  end
36
36
 
37
- def self.getJob(id=nil, token=nil)
37
+ def self.getJob(id=nil, token=true)
38
38
  raise MissingParameterError.new('No MassPay Job ID Provided.') if id.nil?
39
39
 
40
40
  url = masspay_url
@@ -50,4 +50,4 @@ module Dwolla
50
50
  end
51
51
 
52
52
  end
53
- end
53
+ end
@@ -64,7 +64,7 @@ module Dwolla
64
64
  return resp
65
65
  end
66
66
 
67
- def self.catalog(token=nil)
67
+ def self.catalog(token=true)
68
68
  resp = Dwolla.request(:get, '/catalog', {}, {}, token, false, false)
69
69
 
70
70
  return "No data received." unless resp.is_a?(Hash)
@@ -82,4 +82,4 @@ module Dwolla
82
82
  Dwolla.hostname + '/oauth/v2/token'
83
83
  end
84
84
  end
85
- end
85
+ end
@@ -1,6 +1,6 @@
1
1
  module Dwolla
2
2
  class Transactions
3
- def self.get(id=nil, filters={}, token=nil)
3
+ def self.get(id=nil, filters={}, token=true)
4
4
  url = transactions_url
5
5
 
6
6
  if id.is_a?(Hash)
@@ -13,13 +13,13 @@ module Dwolla
13
13
  Dwolla.request(:get, url, filters, {}, token)
14
14
  end
15
15
 
16
- def self.stats(filters={}, token=nil)
16
+ def self.stats(filters={}, token=true)
17
17
  url = transactions_url + 'stats'
18
18
 
19
19
  Dwolla.request(:get, url, filters, {}, token)
20
20
  end
21
21
 
22
- def self.create(params={}, token=nil)
22
+ def self.create(params={}, token=true)
23
23
  raise MissingParameterError.new('No Destination ID Provided.') unless params[:destinationId]
24
24
  raise MissingParameterError.new('No Amount Provided.') unless params[:amount]
25
25
 
@@ -28,7 +28,7 @@ module Dwolla
28
28
  Dwolla.request(:post, url, params, {}, token)
29
29
  end
30
30
 
31
- def self.refund(params={}, token=nil)
31
+ def self.refund(params={}, token=true)
32
32
  raise MissingParameterError.new('No PIN Provided.') unless params[:pin]
33
33
  raise MissingParameterError.new('No Funding Source Provided.') unless params[:fundsSource]
34
34
  raise MissingParameterError.new('No Transaction ID Provided.') unless params[:transactionId]
@@ -39,7 +39,7 @@ module Dwolla
39
39
  Dwolla.request(:post, url, params, {}, token)
40
40
  end
41
41
 
42
- def self.schedule(params={}, token=nil)
42
+ def self.schedule(params={}, token=true)
43
43
  raise MissingParameterError.new('No PIN Provided.') unless params[:pin]
44
44
  raise MissingParameterError.new('No Destination ID Provided.') unless params[:destinationId]
45
45
  raise MissingParameterError.new('No Amount Provided.') unless params[:amount]
@@ -51,13 +51,13 @@ module Dwolla
51
51
  Dwolla.request(:post, url, params, {}, token)
52
52
  end
53
53
 
54
- def self.scheduled(filters={}, token=nil)
54
+ def self.scheduled(filters={}, token=true)
55
55
  url = transactions_url + 'scheduled'
56
56
 
57
57
  Dwolla.request(:get, url, filters, {}, token)
58
58
  end
59
59
 
60
- def self.scheduled_by_id(id, token=nil)
60
+ def self.scheduled_by_id(id, token=true)
61
61
  raise MissingParameterError.new('No Scheduled Transaction ID Provided.') unless id
62
62
 
63
63
  url = transactions_url + 'scheduled/'
@@ -66,7 +66,7 @@ module Dwolla
66
66
  Dwolla.request(:get, url, {}, {}, token)
67
67
  end
68
68
 
69
- def self.edit_scheduled(id, params={}, token=nil)
69
+ def self.edit_scheduled(id, params={}, token=true)
70
70
  raise MissingParameterError.new('No PIN Provided.') unless params[:pin]
71
71
  raise MissingParameterError.new('No Scheduled Transaction ID Provided.') unless id
72
72
 
@@ -76,7 +76,7 @@ module Dwolla
76
76
  Dwolla.request(:put, url, params, {}, token)
77
77
  end
78
78
 
79
- def self.delete_scheduled_by_id(id, params={}, token=nil)
79
+ def self.delete_scheduled_by_id(id, params={}, token=true)
80
80
  raise MissingParameterError.new('No PIN Provided.') unless params[:pin]
81
81
  raise MissingParameterError.new('No Scheduled Transaction ID Provided.') unless id
82
82
 
@@ -86,7 +86,7 @@ module Dwolla
86
86
  Dwolla.request(:delete, url, params, {}, token)
87
87
  end
88
88
 
89
- def self.delete_all_scheduled(params={}, token=nil)
89
+ def self.delete_all_scheduled(params={}, token=true)
90
90
  raise MissingParameterError.new('No PIN Provided.') unless params[:pin]
91
91
 
92
92
  url = transactions_url + 'scheduled'
@@ -1,6 +1,6 @@
1
1
  module Dwolla
2
2
  class Users
3
- def self.get(id=nil, token=nil)
3
+ def self.get(id=nil, token=true)
4
4
  url = users_url
5
5
 
6
6
  unless id.nil?
@@ -13,7 +13,7 @@ module Dwolla
13
13
  Dwolla.request(:get, url, {}, {}, @oauth)
14
14
  end
15
15
 
16
- def self.me(token=nil)
16
+ def self.me(token=true)
17
17
  # I'm not using the 'alias_method' fn
18
18
  # because the .me method should not
19
19
  # honor any parameters (i.e. User IDs)
@@ -1,3 +1,3 @@
1
1
  module Dwolla
2
- VERSION = "3.0.1"
2
+ VERSION = "3.0.2"
3
3
  end
@@ -7,6 +7,16 @@ class FundingSourcesTest < Test::Unit::TestCase
7
7
  Dwolla.stubs(:request).with(:get, '/fundingsources/123456', {}, {}, 'abc')
8
8
  Dwolla::FundingSources.get('123456', 'abc')
9
9
  end
10
+
11
+ def test_get_without_specifying_token
12
+ Dwolla.stubs(:request).with(:get, '/fundingsources/123456', {}, {}, true)
13
+ Dwolla::FundingSources.get('123456')
14
+ end
15
+
16
+ def test_get_all_without_specifying_token
17
+ Dwolla.stubs(:request).with(:get, '/fundingsources/', {}, {}, true)
18
+ Dwolla::FundingSources.get()
19
+ end
10
20
 
11
21
  def test_withdraw
12
22
  Dwolla.stubs(:request).with(:post, '/fundingsources/123456/withdraw',
@@ -62,4 +72,4 @@ class FundingSourcesTest < Test::Unit::TestCase
62
72
  :deposit2 => 0.08
63
73
  }, 'abc')
64
74
  end
65
- end
75
+ end
@@ -31,4 +31,4 @@ class UsersTest < Test::Unit::TestCase
31
31
  :longitude => 50
32
32
  })
33
33
  end
34
- end
34
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dwolla-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Schonfeld
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-15 00:00:00.000000000 Z
11
+ date: 2017-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -180,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
180
180
  version: '0'
181
181
  requirements: []
182
182
  rubyforge_project: dwolla-ruby
183
- rubygems_version: 2.6.13
183
+ rubygems_version: 2.6.12
184
184
  signing_key:
185
185
  specification_version: 4
186
186
  summary: Official Ruby Wrapper for Dwolla's API