vantiv_lite 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5fc133b7d98fa13b255fa742c638a61b4967ab37
4
- data.tar.gz: 667a4b905d9937d14f62abaefa30967dd9dd428f
3
+ metadata.gz: 4782fb49b793badc095bdf9acdaa35986031dabc
4
+ data.tar.gz: ee000b2ae92a4a05b5e346ec6fcf3a83c06f1f07
5
5
  SHA512:
6
- metadata.gz: db7cea41c6b32da8c25c827de18fa7f407b933dbfce1efd26e43f8da7da8cd86f6bb2e85d9e5b1e0f6b3a6631ad3045f4b1bbac9ffc32d570fc32c9042e57f6d
7
- data.tar.gz: 78930183f9f3581eb86dc160c77439af517ba4c549a79a8659a7250d94a6ef792c4779f2e98110086de9d249a46a90fa1c5693b0739d6d791d9c0adedbdf489b
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
- 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
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.)
@@ -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['proxy_url'] || ENV['HTTP_PROXY'] || ENV['http_proxy'])
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
@@ -5,15 +5,15 @@ require 'vantiv_lite/response'
5
5
  require 'vantiv_lite/xml'
6
6
 
7
7
  module VantivLite
8
- TRANSACTIONS = %w[
9
- auth_reversal
10
- authorization
11
- capture
12
- credit
13
- register_token
14
- sale
15
- void
16
- ].freeze
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 |t|
41
- define_method(t) { |hash| call({ :"#{t}_request" => hash }, :"#{t}_response") }
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
@@ -3,7 +3,7 @@
3
3
  module VantivLite
4
4
  MAJOR = 0
5
5
  MINOR = 1
6
- TINY = 0
6
+ TINY = 1
7
7
  VERSION = [MAJOR, MINOR, TINY].join('.').freeze
8
8
 
9
9
  def self.version
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vantiv_lite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua