versapay 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -32,9 +32,9 @@ module Versapay
32
32
  when 200
33
33
  return JSON.parse(response)
34
34
  when 422
35
- raise Versapay::Unprocessable
35
+ raise Versapay::Unprocessable, response
36
36
  when 500
37
- raise Versapay::NotFound
37
+ raise Versapay::NotFound, response
38
38
  end
39
39
  end
40
40
  end
@@ -45,11 +45,11 @@ module Versapay
45
45
  when 200,201
46
46
  return JSON.parse(response)
47
47
  when 412
48
- raise Versapay::InvalidInput #(JSON.parse(response))
48
+ raise Versapay::InvalidInput, response
49
49
  when 422
50
- raise Versapay::Unprocessable
50
+ raise Versapay::Unprocessable, response
51
51
  when 500
52
- raise Versapay::NotFound
52
+ raise Versapay::NotFound, response
53
53
  end
54
54
  end
55
55
  end
@@ -7,7 +7,8 @@ module Versapay
7
7
  yield self if block_given?
8
8
  end
9
9
 
10
- def create
10
+ def create(args)
11
+ Versapay::make_request(:post, "/api/transactions.json", args)
11
12
  end
12
13
 
13
14
  def list(page = nil)
@@ -1,3 +1,3 @@
1
1
  module Versapay
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -17,13 +17,6 @@ class ActionController::Base
17
17
 
18
18
  url = controller.request.url.gsub /\?.*/, ""
19
19
  check = Versapay::WebhookSignature.hmac(controller.request.method, url, key, params)
20
- unless logger.nil? then
21
- logger.warn "============="
22
- logger.warn controller.request.method
23
- logger.warn url
24
- logger.warn key
25
- logger.warn params.inspect
26
- end
27
20
 
28
21
  if check == signature
29
22
  true
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: versapay
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 0
9
8
  - 1
10
- version: 0.0.1
9
+ - 0
10
+ version: 0.1.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sean Walberg
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-09-08 00:00:00 -05:00
18
+ date: 2011-09-14 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -127,7 +127,6 @@ files:
127
127
  - lib/versapay/transactions.rb
128
128
  - lib/versapay/version.rb
129
129
  - lib/versapay/webhooks.rb
130
- - test/basic_test.rb
131
130
  - test/debit_agreements_test.rb
132
131
  - test/fund_sources_test.rb
133
132
  - test/helper_test.rb
@@ -170,7 +169,6 @@ signing_key:
170
169
  specification_version: 3
171
170
  summary: A gem to use the Versapay API
172
171
  test_files:
173
- - test/basic_test.rb
174
172
  - test/debit_agreements_test.rb
175
173
  - test/fund_sources_test.rb
176
174
  - test/helper_test.rb
@@ -1,9 +0,0 @@
1
- require 'test_helper'
2
-
3
- class BasicTest < ActiveSupport::TestCase
4
-
5
- test "foo" do
6
- assert_equal "0.0.1", Versapay::VERSION
7
- end
8
-
9
- end