vantiv_lite 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -10
- data/lib/vantiv_lite/config.rb +2 -2
- data/lib/vantiv_lite/request.rb +11 -11
- data/lib/vantiv_lite/version.rb +1 -1
- data/lib/vantiv_lite.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4782fb49b793badc095bdf9acdaa35986031dabc
|
4
|
+
data.tar.gz: ee000b2ae92a4a05b5e346ec6fcf3a83c06f1f07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa12d86c48824f7eda942471835f5d7694e94d89c9a6587b1bc759309aa04ae481175df1fd2e575fd8f62b1573c234e139632aa2219a05ec0804cc2eb4ffd9bd
|
7
|
+
data.tar.gz: 29f88adb3311a7c7ee1f7401a095457fbaed8b9b3c77f9f481ead4e1e4e4914ab02a0109fd4418188cabfd0c788a7736f32d7550cb43226dbcab78762baf507d
|
data/README.md
CHANGED
@@ -34,16 +34,16 @@ If you're integrating into a system that's using a single configuration---pretty
|
|
34
34
|
### Programmatically
|
35
35
|
|
36
36
|
```ruby
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
37
|
+
VantivLite.configure do
|
38
|
+
env 'sandbox'
|
39
|
+
merchant_id 'default'
|
40
|
+
password 'sandbox'
|
41
|
+
proxy_url 'http://user:passsword@proxy.internal:8888'
|
42
|
+
report_group 'Default Report Group'
|
43
|
+
username 'sandbox'
|
44
|
+
version '8.22'
|
45
|
+
xml_lib 'REXML'
|
46
|
+
end
|
47
47
|
```
|
48
48
|
|
49
49
|
Note: All values displayed above are the default values, with the exception of `proxy_url` which is `nil` by default. (There's a good chance you'll need to set `proxy_url` in `prelive` and `postlive` environments since they are IP-whitelisted.)
|
data/lib/vantiv_lite/config.rb
CHANGED
@@ -57,7 +57,7 @@ module VantivLite
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def with(**opts)
|
60
|
-
new(@opts.merge(opts))
|
60
|
+
self.class.new(@opts.merge(opts))
|
61
61
|
end
|
62
62
|
|
63
63
|
OPTS.each { |o| define_method(o) { @opts[o] } }
|
@@ -91,7 +91,7 @@ module VantivLite
|
|
91
91
|
end
|
92
92
|
|
93
93
|
def proxy_uri!
|
94
|
-
return unless (url = @opts[
|
94
|
+
return unless (url = @opts[:proxy_url] || ENV['HTTP_PROXY'] || ENV['http_proxy'])
|
95
95
|
@proxy_uri = URI(url)
|
96
96
|
end
|
97
97
|
end
|
data/lib/vantiv_lite/request.rb
CHANGED
@@ -5,15 +5,15 @@ require 'vantiv_lite/response'
|
|
5
5
|
require 'vantiv_lite/xml'
|
6
6
|
|
7
7
|
module VantivLite
|
8
|
-
TRANSACTIONS =
|
9
|
-
auth_reversal
|
10
|
-
authorization
|
11
|
-
capture
|
12
|
-
credit
|
13
|
-
register_token
|
14
|
-
sale
|
15
|
-
void
|
16
|
-
|
8
|
+
TRANSACTIONS = {
|
9
|
+
auth_reversal: :auth_reversal,
|
10
|
+
authorization: :authorization,
|
11
|
+
capture: :capture,
|
12
|
+
credit: :credit,
|
13
|
+
register_token: :register_token_request,
|
14
|
+
sale: :sale,
|
15
|
+
void: :void
|
16
|
+
}.freeze
|
17
17
|
|
18
18
|
class Request
|
19
19
|
InvalidConfig = Class.new(StandardError)
|
@@ -37,8 +37,8 @@ module VantivLite
|
|
37
37
|
http.start { |h| h.request(post_request(xml)) }
|
38
38
|
end
|
39
39
|
|
40
|
-
TRANSACTIONS.each do |
|
41
|
-
define_method(
|
40
|
+
TRANSACTIONS.each do |name, request_name|
|
41
|
+
define_method(name) { |hash| call({ request_name => hash }, :"#{name}_response") }
|
42
42
|
end
|
43
43
|
|
44
44
|
private
|
data/lib/vantiv_lite/version.rb
CHANGED
data/lib/vantiv_lite.rb
CHANGED
@@ -24,7 +24,7 @@ module VantivLite
|
|
24
24
|
end
|
25
25
|
alias call request
|
26
26
|
|
27
|
-
TRANSACTIONS.each { |t| define_method(t) { |hash| default_request.public_send(t, hash) } }
|
27
|
+
TRANSACTIONS.keys.each { |t| define_method(t) { |hash| default_request.public_send(t, hash) } }
|
28
28
|
end
|
29
29
|
configure
|
30
30
|
end
|