dwolla-ruby 2.6.8 → 2.6.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +8 -8
  3. data/.travis.yml +6 -6
  4. data/Gemfile +1 -1
  5. data/README.md +212 -209
  6. data/Rakefile +8 -8
  7. data/dwolla-ruby.gemspec +27 -27
  8. data/examples/balance.rb +15 -15
  9. data/examples/contacts.rb +32 -32
  10. data/examples/fundingSources.rb +39 -39
  11. data/examples/oauth.rb +59 -59
  12. data/examples/offsiteGateway.rb +31 -31
  13. data/examples/transactions.rb +72 -72
  14. data/examples/users.rb +30 -30
  15. data/gemfiles/json.gemfile +2 -2
  16. data/lib/dwolla.rb +327 -326
  17. data/lib/dwolla/accounts.rb +27 -27
  18. data/lib/dwolla/balance.rb +15 -15
  19. data/lib/dwolla/contacts.rb +30 -30
  20. data/lib/dwolla/errors/api_connection_error.rb +3 -3
  21. data/lib/dwolla/errors/api_error.rb +3 -3
  22. data/lib/dwolla/errors/authentication_error.rb +3 -3
  23. data/lib/dwolla/errors/dwolla_error.rb +19 -19
  24. data/lib/dwolla/errors/invalid_request_error.rb +10 -10
  25. data/lib/dwolla/errors/missing_parameter_error.rb +3 -3
  26. data/lib/dwolla/exceptions.rb +4 -4
  27. data/lib/dwolla/funding_sources.rb +65 -65
  28. data/lib/dwolla/json.rb +20 -20
  29. data/lib/dwolla/masspay.rb +52 -52
  30. data/lib/dwolla/oauth.rb +84 -84
  31. data/lib/dwolla/offsite_gateway.rb +152 -152
  32. data/lib/dwolla/requests.rb +56 -56
  33. data/lib/dwolla/transactions.rb +110 -110
  34. data/lib/dwolla/users.rb +39 -39
  35. data/lib/dwolla/version.rb +3 -3
  36. data/test/test_accounts.rb +18 -18
  37. data/test/test_balance.rb +9 -9
  38. data/test/test_contacts.rb +19 -19
  39. data/test/test_funding_sources.rb +64 -64
  40. data/test/test_masspay.rb +47 -47
  41. data/test/test_oauth.rb +36 -36
  42. data/test/test_offsite_gateway.rb +57 -57
  43. data/test/test_requests.rb +29 -29
  44. data/test/test_transactions.rb +117 -117
  45. data/test/test_users.rb +33 -33
  46. metadata +3 -3
@@ -1,30 +1,30 @@
1
- require 'test/unit'
2
- require 'mocha/test_unit'
3
- require 'dwolla'
4
-
5
- class RequestsTest < Test::Unit::TestCase
6
- def test_get
7
- Dwolla.stubs(:request).with(:get, '/requests/', {:limit => 10}, {}, 'abc')
8
- Dwolla::Requests.get({:limit => 10}, {}, 'abc')
9
- end
10
-
11
- def test_get_by_id
12
- Dwolla.stubs(:request).with(:get, '/requests/123456', {}, {}, 'abc')
13
- Dwolla::Requests.get('123456', {}, 'abc')
14
- end
15
-
16
- def test_create
17
- Dwolla.stubs(:request).with(:post, '/requests/', {:sourceId => '812-111-1234', :amount => 5.00}, {}, 'abc')
18
- Dwolla::Requests.create({:sourceId => '812-111-1234', :amount => 5.00}, 'abc')
19
- end
20
-
21
- def test_delete
22
- Dwolla.stubs(:request).with(:post, '/requests/123456/cancel', {}, {}, 'abc')
23
- Dwolla::Requests.delete('123456', 'abc')
24
- end
25
-
26
- def test_fulfill
27
- Dwolla.stubs(:request).with(:post, '/requests/123456/fulfill', {:pin => 1337}, {}, 'abc')
28
- Dwolla::Requests.fulfill('123456', {:pin => 1337}, 'abc')
29
- end
1
+ require 'test/unit'
2
+ require 'mocha/test_unit'
3
+ require 'dwolla'
4
+
5
+ class RequestsTest < Test::Unit::TestCase
6
+ def test_get
7
+ Dwolla.stubs(:request).with(:get, '/requests/', {:limit => 10}, {}, 'abc')
8
+ Dwolla::Requests.get({:limit => 10}, {}, 'abc')
9
+ end
10
+
11
+ def test_get_by_id
12
+ Dwolla.stubs(:request).with(:get, '/requests/123456', {}, {}, 'abc')
13
+ Dwolla::Requests.get('123456', {}, 'abc')
14
+ end
15
+
16
+ def test_create
17
+ Dwolla.stubs(:request).with(:post, '/requests/', {:sourceId => '812-111-1234', :amount => 5.00}, {}, 'abc')
18
+ Dwolla::Requests.create({:sourceId => '812-111-1234', :amount => 5.00}, 'abc')
19
+ end
20
+
21
+ def test_delete
22
+ Dwolla.stubs(:request).with(:post, '/requests/123456/cancel', {}, {}, 'abc')
23
+ Dwolla::Requests.delete('123456', 'abc')
24
+ end
25
+
26
+ def test_fulfill
27
+ Dwolla.stubs(:request).with(:post, '/requests/123456/fulfill', {:pin => 1337}, {}, 'abc')
28
+ Dwolla::Requests.fulfill('123456', {:pin => 1337}, 'abc')
29
+ end
30
30
  end
@@ -1,118 +1,118 @@
1
- require 'test/unit'
2
- require 'mocha/test_unit'
3
- require 'dwolla'
4
-
5
- class TransactionsTest < Test::Unit::TestCase
6
- def test_get
7
- Dwolla.stubs(:request).with(:get, '/transactions/', {:limit => 10}, {}, 'abc')
8
- Dwolla::Transactions.get({:limit => 10}, {}, 'abc')
9
- end
10
-
11
- def test_get_by_id
12
- Dwolla.stubs(:request).with(:get, '/transactions/123456', {}, {}, 'abc')
13
- Dwolla::Transactions.get('123456', {}, 'abc')
14
- end
15
-
16
- def test_stats
17
- Dwolla.stubs(:request).with(:get, '/transactions/stats', {:types => 'TransactionsCount'}, {}, 'abc')
18
- Dwolla::Transactions.stats({:types => 'TransactionsCount'}, 'abc')
19
- end
20
-
21
- def test_send
22
- Dwolla.stubs(:request).with(:post, '/transactions/send',
23
- {
24
- :pin => 1337,
25
- :amount => 15.00,
26
- :destinationId => '812-111-1111'
27
- }, {}, 'abc')
28
-
29
- # Send is also an alias but is not tested since it is redundant
30
- Dwolla::Transactions.create({
31
- :pin => 1337,
32
- :amount => 15.00,
33
- :destinationId => '812-111-1111'
34
- }, 'abc')
35
- end
36
-
37
- def test_refund
38
- Dwolla.stubs(:request).with(:post, '/transactions/refund',
39
- {
40
- :pin => 1337,
41
- :fundsSource => 'Balance',
42
- :transactionId => '123456',
43
- :amount => 15.00
44
- }, {}, 'abc')
45
- Dwolla::Transactions.refund({
46
- :pin => 1337,
47
- :fundsSource => 'Balance',
48
- :transactionId => '123456',
49
- :amount => 15.00
50
- }, 'abc')
51
- end
52
-
53
- def test_schedule
54
- Dwolla.stubs(:request).with(:post, '/transactions/scheduled',
55
- {
56
- :pin => 1337,
57
- :amount => 15.00,
58
- :destinationId => '812-111-1111',
59
- :fundsSource => 'abcdef',
60
- :scheduleDate => '2015-10-19'
61
- }, {}, 'abc')
62
-
63
- Dwolla::Transactions.schedule({
64
- :pin => 1337,
65
- :amount => 15.00,
66
- :destinationId => '812-111-1111',
67
- :fundsSource => 'abcdef',
68
- :scheduleDate => '2015-10-19'
69
- }, 'abc')
70
- end
71
-
72
- def test_scheduled
73
- Dwolla.stubs(:request).with(:get, '/transactions/scheduled',
74
- {}, {}, 'abc')
75
-
76
- Dwolla::Transactions.scheduled({}, 'abc')
77
- end
78
-
79
- def test_scheduled_by_id
80
- Dwolla.stubs(:request).with(:get, '/transactions/scheduled/1234',
81
- {}, {}, 'abc')
82
-
83
- Dwolla::Transactions.scheduled_by_id('1234', 'abc')
84
- end
85
-
86
- def test_edit_scheduled
87
- Dwolla.stubs(:request).with(:put, '/transactions/scheduled/12345',
88
- {
89
- :pin => 1337,
90
- :amount => 15.00,
91
- }, {}, 'abc')
92
-
93
- Dwolla::Transactions.edit_scheduled('12345', {
94
- :pin => 1337,
95
- :amount => 15.00}, 'abc')
96
- end
97
-
98
- def test_delete_scheduled_by_id
99
- Dwolla.stubs(:request).with(:delete, '/transactions/scheduled/12345',
100
- {
101
- :pin => 1337,
102
- }, {}, 'abc')
103
-
104
- Dwolla::Transactions.delete_scheduled_by_id('12345', {
105
- :pin => 1337}, 'abc')
106
- end
107
-
108
- def test_delete_all_scheduled
109
- Dwolla.stubs(:request).with(:delete, '/transactions/scheduled',
110
- {
111
- :pin => 1337,
112
- }, {}, 'abc')
113
-
114
- Dwolla::Transactions.delete_all_scheduled({
115
- :pin => 1337}, 'abc')
116
- end
117
-
1
+ require 'test/unit'
2
+ require 'mocha/test_unit'
3
+ require 'dwolla'
4
+
5
+ class TransactionsTest < Test::Unit::TestCase
6
+ def test_get
7
+ Dwolla.stubs(:request).with(:get, '/transactions/', {:limit => 10}, {}, 'abc')
8
+ Dwolla::Transactions.get({:limit => 10}, {}, 'abc')
9
+ end
10
+
11
+ def test_get_by_id
12
+ Dwolla.stubs(:request).with(:get, '/transactions/123456', {}, {}, 'abc')
13
+ Dwolla::Transactions.get('123456', {}, 'abc')
14
+ end
15
+
16
+ def test_stats
17
+ Dwolla.stubs(:request).with(:get, '/transactions/stats', {:types => 'TransactionsCount'}, {}, 'abc')
18
+ Dwolla::Transactions.stats({:types => 'TransactionsCount'}, 'abc')
19
+ end
20
+
21
+ def test_send
22
+ Dwolla.stubs(:request).with(:post, '/transactions/send',
23
+ {
24
+ :pin => 1337,
25
+ :amount => 15.00,
26
+ :destinationId => '812-111-1111'
27
+ }, {}, 'abc')
28
+
29
+ # Send is also an alias but is not tested since it is redundant
30
+ Dwolla::Transactions.create({
31
+ :pin => 1337,
32
+ :amount => 15.00,
33
+ :destinationId => '812-111-1111'
34
+ }, 'abc')
35
+ end
36
+
37
+ def test_refund
38
+ Dwolla.stubs(:request).with(:post, '/transactions/refund',
39
+ {
40
+ :pin => 1337,
41
+ :fundsSource => 'Balance',
42
+ :transactionId => '123456',
43
+ :amount => 15.00
44
+ }, {}, 'abc')
45
+ Dwolla::Transactions.refund({
46
+ :pin => 1337,
47
+ :fundsSource => 'Balance',
48
+ :transactionId => '123456',
49
+ :amount => 15.00
50
+ }, 'abc')
51
+ end
52
+
53
+ def test_schedule
54
+ Dwolla.stubs(:request).with(:post, '/transactions/scheduled',
55
+ {
56
+ :pin => 1337,
57
+ :amount => 15.00,
58
+ :destinationId => '812-111-1111',
59
+ :fundsSource => 'abcdef',
60
+ :scheduleDate => '2015-10-19'
61
+ }, {}, 'abc')
62
+
63
+ Dwolla::Transactions.schedule({
64
+ :pin => 1337,
65
+ :amount => 15.00,
66
+ :destinationId => '812-111-1111',
67
+ :fundsSource => 'abcdef',
68
+ :scheduleDate => '2015-10-19'
69
+ }, 'abc')
70
+ end
71
+
72
+ def test_scheduled
73
+ Dwolla.stubs(:request).with(:get, '/transactions/scheduled',
74
+ {}, {}, 'abc')
75
+
76
+ Dwolla::Transactions.scheduled({}, 'abc')
77
+ end
78
+
79
+ def test_scheduled_by_id
80
+ Dwolla.stubs(:request).with(:get, '/transactions/scheduled/1234',
81
+ {}, {}, 'abc')
82
+
83
+ Dwolla::Transactions.scheduled_by_id('1234', 'abc')
84
+ end
85
+
86
+ def test_edit_scheduled
87
+ Dwolla.stubs(:request).with(:put, '/transactions/scheduled/12345',
88
+ {
89
+ :pin => 1337,
90
+ :amount => 15.00,
91
+ }, {}, 'abc')
92
+
93
+ Dwolla::Transactions.edit_scheduled('12345', {
94
+ :pin => 1337,
95
+ :amount => 15.00}, 'abc')
96
+ end
97
+
98
+ def test_delete_scheduled_by_id
99
+ Dwolla.stubs(:request).with(:delete, '/transactions/scheduled/12345',
100
+ {
101
+ :pin => 1337,
102
+ }, {}, 'abc')
103
+
104
+ Dwolla::Transactions.delete_scheduled_by_id('12345', {
105
+ :pin => 1337}, 'abc')
106
+ end
107
+
108
+ def test_delete_all_scheduled
109
+ Dwolla.stubs(:request).with(:delete, '/transactions/scheduled',
110
+ {
111
+ :pin => 1337,
112
+ }, {}, 'abc')
113
+
114
+ Dwolla::Transactions.delete_all_scheduled({
115
+ :pin => 1337}, 'abc')
116
+ end
117
+
118
118
  end
data/test/test_users.rb CHANGED
@@ -1,34 +1,34 @@
1
- require 'test/unit'
2
- require 'mocha/test_unit'
3
- require 'dwolla'
4
-
5
- class UsersTest < Test::Unit::TestCase
6
- def test_get_oauth
7
- Dwolla.stubs(:request).with(:get, '/users/', {}, {}, 'abc')
8
- Dwolla::Users.get(nil, 'abc')
9
- end
10
-
11
- def test_get_id
12
- Dwolla.stubs(:request).with(:get, '/users/812-111-1111', {}, {}, false)
13
- Dwolla::Users.get('812-111-1111')
14
- end
15
-
16
- # This test is redundant, however it is a different function and therefore
17
- # I'm going to test it anyway.
18
- def test_me
19
- Dwolla.stubs(:request).with(:get, '/users/', {}, {}, 'abc')
20
- Dwolla::Users.me('abc')
21
- end
22
-
23
- def test_nearby
24
- Dwolla.stubs(:request).with(:get, '/users/nearby',
25
- {
26
- :latitude => 45,
27
- :longitude => 50
28
- }, {}, false)
29
- Dwolla::Users.nearby({
30
- :latitude => 45,
31
- :longitude => 50
32
- })
33
- end
1
+ require 'test/unit'
2
+ require 'mocha/test_unit'
3
+ require 'dwolla'
4
+
5
+ class UsersTest < Test::Unit::TestCase
6
+ def test_get_oauth
7
+ Dwolla.stubs(:request).with(:get, '/users/', {}, {}, 'abc')
8
+ Dwolla::Users.get(nil, 'abc')
9
+ end
10
+
11
+ def test_get_id
12
+ Dwolla.stubs(:request).with(:get, '/users/812-111-1111', {}, {}, false)
13
+ Dwolla::Users.get('812-111-1111')
14
+ end
15
+
16
+ # This test is redundant, however it is a different function and therefore
17
+ # I'm going to test it anyway.
18
+ def test_me
19
+ Dwolla.stubs(:request).with(:get, '/users/', {}, {}, 'abc')
20
+ Dwolla::Users.me('abc')
21
+ end
22
+
23
+ def test_nearby
24
+ Dwolla.stubs(:request).with(:get, '/users/nearby',
25
+ {
26
+ :latitude => 45,
27
+ :longitude => 50
28
+ }, {}, false)
29
+ Dwolla::Users.nearby({
30
+ :latitude => 45,
31
+ :longitude => 50
32
+ })
33
+ end
34
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: 2.6.8
4
+ version: 2.6.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Schonfeld
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-14 00:00:00.000000000 Z
11
+ date: 2015-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -179,7 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
179
179
  version: '0'
180
180
  requirements: []
181
181
  rubyforge_project: dwolla-ruby
182
- rubygems_version: 2.2.2
182
+ rubygems_version: 2.4.5.1
183
183
  signing_key:
184
184
  specification_version: 4
185
185
  summary: Official Ruby Wrapper for Dwolla's API