dwolla-ruby 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  [![Build Status](https://travis-ci.org/Dwolla/dwolla-ruby.png?branch=master)](https://travis-ci.org/Dwolla/dwolla-ruby)
5
5
 
6
6
  ## Version
7
- 2.1.0
7
+ 2.1.1
8
8
 
9
9
  ## Requirements
10
10
  - [Ruby](http://www.ruby-lang.org/)
@@ -32,6 +32,10 @@ This repo includes various usage examples, including:
32
32
 
33
33
  ## Changelog
34
34
 
35
+ 2.1.1
36
+
37
+ * Oops. POST request wasn't actually sending any params.
38
+
35
39
  2.1.0
36
40
 
37
41
  * Add tests! (OMG WOOT JK </LOL>)
@@ -61,7 +65,7 @@ This wrapper is heavily based off Stripe's Ruby Gem
61
65
 
62
66
  http://developers.dwolla.com/dev
63
67
 
64
- ## License
68
+ ## License
65
69
 
66
70
  (The MIT License)
67
71
 
@@ -1,7 +1,7 @@
1
1
  # Include the Dwolla gem
2
2
  require 'rubygems'
3
3
  require 'pp'
4
- require 'dwolla'
4
+ require '../lib/dwolla'
5
5
 
6
6
  # Include any required keys
7
7
  require './_keys.rb'
@@ -9,22 +9,22 @@ require './_keys.rb'
9
9
  # Instantiate a new Dwolla User client
10
10
  # And, seed a previously generated access token
11
11
  Dwolla::token = @token
12
+ Dwolla::debug = true
12
13
 
13
-
14
- # EXAMPLE 1:
15
- # Send money ($1.00) to a Dwolla ID
16
- transactionId = Dwolla::Transactions.send({:destinationId => '812-626-8794', :amount => 1.00, :pin => $pin})
14
+ # EXAMPLE 1:
15
+ # Send money ($1.00) to a Dwolla ID
16
+ transactionId = Dwolla::Transactions.send({:destinationId => '812-626-8794', :amount => 1.00, :pin => @pin})
17
17
  pp transactionId
18
18
 
19
- # EXAMPLE 2:
19
+ # EXAMPLE 2:
20
20
  # Send money ($1.00) to an email address, with a note
21
- transactionId = Dwolla::Transactions.send({:destinationId => '812-626-8794', :destinationType => 'Email', :amount => 1.00, :pin => $pin, :notes => 'Everyone loves getting money'})
21
+ transactionId = Dwolla::Transactions.send({:destinationId => '812-626-8794', :destinationType => 'Email', :amount => 1.00, :pin => @pin, :notes => 'Everyone loves getting money'})
22
22
  pp transactionId
23
23
 
24
- # EXAMPLE 3:
24
+ # EXAMPLE 3:
25
25
  # Get details about all recent transactions
26
26
  pp Dwolla::Transactions.get
27
27
 
28
- # EXAMPLE 4:
28
+ # EXAMPLE 4:
29
29
  # Get details about a certain Transaction
30
- pp Dwolla::Transactions.get(transactionId)
30
+ pp Dwolla::Transactions.get(transactionId)
data/lib/dwolla.rb CHANGED
@@ -90,12 +90,14 @@ module Dwolla
90
90
  end
91
91
 
92
92
  def self.request(method, url, params={}, headers={}, oauth=true, parse_response=true, custom_url=false)
93
- if oauth
93
+ if oauth and not params[:oauth_token]
94
94
  raise AuthenticationError.new('No OAuth Token Provided.') unless token
95
95
  params = {
96
96
  :oauth_token => token
97
97
  }.merge(params)
98
- else
98
+ elsif oauth and params[:oauth_token]
99
+ raise AuthenticationError.new('No OAuth Token Provided.') unless params[:oauth_token]
100
+ else not oauth
99
101
  raise AuthenticationError.new('No App Key & Secret Provided.') unless (api_key && api_secret)
100
102
  params = {
101
103
  :client_id => api_key,
@@ -134,7 +136,7 @@ module Dwolla
134
136
  end
135
137
  payload = nil
136
138
  else
137
- payload = ''
139
+ payload = JSON.dump(params)
138
140
  end
139
141
 
140
142
  begin
@@ -205,7 +207,7 @@ module Dwolla
205
207
  end
206
208
 
207
209
  private
208
-
210
+
209
211
  def self.execute_request(opts)
210
212
  RestClient::Request.execute(opts)
211
213
  end
@@ -272,4 +274,4 @@ module Dwolla
272
274
 
273
275
  raise APIConnectionError.new(message)
274
276
  end
275
- end
277
+ end
@@ -1,3 +1,3 @@
1
1
  module Dwolla
2
- VERSION = "2.1.0"
2
+ VERSION = "2.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dwolla-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-03 00:00:00.000000000 Z
12
+ date: 2013-06-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client