virtual_merchant 0.3.7 → 0.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/virtual_merchant/gateway.rb +3 -4
- data/lib/virtual_merchant/logger.rb +12 -1
- data/lib/virtual_merchant.rb +3 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ac34cc9c1554e88c53674e8bb01f2dedfb356de
|
4
|
+
data.tar.gz: 343f72027befad114837e030e0cf669c92d5ab4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0ad4523bdff048db0cd6edcebbbc26b8aa9f523a2c0da696f105b320ab6b69eec64419dcdd677dc568e03493f18845952d47712b9a6facbc4f9b0e70f3d5915
|
7
|
+
data.tar.gz: d8fa3aa086f4edb3d5ef0c6cd2c8c7d44ee224f9607c8c024d83d7f8889d0b0f0110734492e4fdf269b5cd173e459af5dda15b00d6b913bab8d8b27491d33d4b
|
@@ -1,4 +1,3 @@
|
|
1
|
-
require "pp"
|
2
1
|
class Gateway
|
3
2
|
attr_reader :creds
|
4
3
|
|
@@ -27,12 +26,12 @@ class Gateway
|
|
27
26
|
process(xml)
|
28
27
|
end
|
29
28
|
|
30
|
-
def ccaddrecurring(card, amount)
|
29
|
+
def ccaddrecurring(card, amount, custom_fields)
|
31
30
|
xml = VirtualMerchant::XMLGenerator.generate(card, amount, creds, custom_fields, "ccaddrecurring")
|
32
31
|
process(xml, amount)
|
33
32
|
end
|
34
33
|
|
35
|
-
def cccredit(card, amount)
|
34
|
+
def cccredit(card, amount, custom_fields)
|
36
35
|
xml = VirtualMerchant::XMLGenerator.generate(card, amount, creds, custom_fields, 'cccredit')
|
37
36
|
process(xml, amount)
|
38
37
|
end
|
@@ -47,7 +46,7 @@ class Gateway
|
|
47
46
|
{xml: xml, url: url(creds.demo), referer: creds.referer})
|
48
47
|
vm_response = communication.send
|
49
48
|
response = VirtualMerchant::Response.new(vm_response)
|
50
|
-
VirtualMerchant::Logger.
|
49
|
+
VirtualMerchant::Logger.log_response(response)
|
51
50
|
response
|
52
51
|
end
|
53
52
|
|
@@ -1,6 +1,17 @@
|
|
1
1
|
module VirtualMerchant
|
2
2
|
class Logger
|
3
|
-
|
3
|
+
@@on = false
|
4
|
+
|
5
|
+
def self.on!
|
6
|
+
@@on = true
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.off!
|
10
|
+
@@on = false
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.log_response(response)
|
14
|
+
return unless @@on
|
4
15
|
p "!!!!!!!!!!!!!!!!!!!!!!!! Credit Response !!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
5
16
|
if response.result
|
6
17
|
p "result " + response.result
|
data/lib/virtual_merchant.rb
CHANGED
@@ -13,7 +13,7 @@ module VirtualMerchant
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def self.authorize(card, amount, creds, custom_fields={}, gateway=Gateway.new(creds))
|
16
|
-
gateway.ccauth(card, amount)
|
16
|
+
gateway.ccauth(card, amount, custom_fields)
|
17
17
|
end
|
18
18
|
|
19
19
|
def self.complete(amount, creds, transaction_id, gateway=Gateway.new(creds))
|
@@ -28,8 +28,8 @@ module VirtualMerchant
|
|
28
28
|
gateway.ccaddrecurring(card, amount, custom_fields)
|
29
29
|
end
|
30
30
|
|
31
|
-
def self.refund(card, amount, creds, gateway=Gateway.new(creds))
|
32
|
-
gateway.cccredit(card, amount)
|
31
|
+
def self.refund(card, amount, creds, custom_fields={}, gateway=Gateway.new(creds))
|
32
|
+
gateway.cccredit(card, amount, custom_fields)
|
33
33
|
end
|
34
34
|
|
35
35
|
def self.void(transaction_id, creds, gateway=Gateway.new(creds))
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: virtual_merchant
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lee Quarella
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Makes it easy to charge credit cards with the VirtualMerchant API.
|
14
14
|
email: leequarella@gmail.com
|
@@ -21,10 +21,10 @@ files:
|
|
21
21
|
- lib/virtual_merchant/communication.rb
|
22
22
|
- lib/virtual_merchant/credentials.rb
|
23
23
|
- lib/virtual_merchant/credit_card.rb
|
24
|
-
- lib/virtual_merchant/gateway.rb
|
25
24
|
- lib/virtual_merchant/logger.rb
|
26
25
|
- lib/virtual_merchant/response.rb
|
27
26
|
- lib/virtual_merchant/xml_generator.rb
|
27
|
+
- lib/virtual_merchant/gateway.rb
|
28
28
|
homepage: https://github.com/leequarella/VirtualMerchant-Ruby
|
29
29
|
licenses:
|
30
30
|
- MIT
|
@@ -45,7 +45,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
45
45
|
version: '0'
|
46
46
|
requirements: []
|
47
47
|
rubyforge_project:
|
48
|
-
rubygems_version: 2.
|
48
|
+
rubygems_version: 2.1.10
|
49
49
|
signing_key:
|
50
50
|
specification_version: 4
|
51
51
|
summary: Virtual Merchant API
|