virtual_merchant 0.3.6 → 0.3.7

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: e254a4ac57dd98de1815472d1917cb35880faa4c
4
- data.tar.gz: 901f1cd93d01ff0486f87ebab0dcf7b09658120d
3
+ metadata.gz: 3b1b7f1a58e7d1f8f48fbe6e66d17e9df282d58e
4
+ data.tar.gz: 53dacdb6f8e393a0cad6cbb4c56fe4d87c65f058
5
5
  SHA512:
6
- metadata.gz: a29c5b03dc6621083d98d9ea4f5ab39200510a2e7938fbc0d1284cf1c8b7c566428fcfa1090edc3949ff643c04ff603371701dfc4219d8f29382b16e8f3b748a
7
- data.tar.gz: 13038ff17dcf6d4a2a1952b70604dae4565300894dec0ed3c64f85c2d7a2ab8c205fcd85bbecee4e076d4d9c883a38775cdd1cd4f39c8b40e80807be25d18e8d
6
+ metadata.gz: c35d80b83e3f89239a86f3ed7a58ed20210dce3b430486e37ab3753a51f41ad3a94077b4accefe55496b92f5ef3d5eb3a457489dfa0058768521ad289d08f6fb
7
+ data.tar.gz: 7877cc54d64b3146b5725f5fdb1c6bb78f68bbc1231efefcf7927027935ce6616ed0a3a01350a620d3df250a94755c96e17edb7d5e43c43cfddbdf8dc8bba35d
@@ -6,13 +6,13 @@ class Gateway
6
6
  @creds = creds
7
7
  end
8
8
 
9
- def ccsale(card, amount)
10
- xml = VirtualMerchant::XMLGenerator.generate(card, amount, creds, "ccsale")
9
+ def ccsale(card, amount, custom_fields)
10
+ xml = VirtualMerchant::XMLGenerator.generate(card, amount, creds, custom_fields, "ccsale")
11
11
  process(xml, amount)
12
12
  end
13
13
 
14
- def ccauth(card, amount)
15
- xml = VirtualMerchant::XMLGenerator.generate(card, amount, creds, "ccauthonly")
14
+ def ccauth(card, amount, custom_fields)
15
+ xml = VirtualMerchant::XMLGenerator.generate(card, amount, creds, custom_fields, "ccauthonly")
16
16
  process(xml, amount)
17
17
  end
18
18
 
@@ -28,12 +28,12 @@ class Gateway
28
28
  end
29
29
 
30
30
  def ccaddrecurring(card, amount)
31
- xml = VirtualMerchant::XMLGenerator.generate(card, amount, creds, "ccaddrecurring")
31
+ xml = VirtualMerchant::XMLGenerator.generate(card, amount, creds, custom_fields, "ccaddrecurring")
32
32
  process(xml, amount)
33
33
  end
34
34
 
35
35
  def cccredit(card, amount)
36
- xml = VirtualMerchant::XMLGenerator.generate(card, amount, creds, 'cccredit')
36
+ xml = VirtualMerchant::XMLGenerator.generate(card, amount, creds, custom_fields, 'cccredit')
37
37
  process(xml, amount)
38
38
  end
39
39
 
@@ -11,7 +11,7 @@ module VirtualMerchant
11
11
  return xml
12
12
  end
13
13
 
14
- def self.generate(card, amount, creds, transaction_type)
14
+ def self.generate(card, amount, creds, custom_fields, transaction_type)
15
15
  xml = "xmldata=<txn>"
16
16
  xml += credentials(creds)
17
17
  xml += basic(card, transaction_type, amount)
@@ -21,6 +21,9 @@ module VirtualMerchant
21
21
  else
22
22
  xml += for_clear_text(card)
23
23
  end
24
+ custom_fields.each do |key,value|
25
+ xml += "<#{key}>#{value}</#{key}>"
26
+ end
24
27
  xml += "</txn>"
25
28
  xml
26
29
  end
@@ -8,11 +8,11 @@ require 'virtual_merchant/logger'
8
8
  require 'virtual_merchant/xml_generator'
9
9
  require 'virtual_merchant/gateway'
10
10
  module VirtualMerchant
11
- def self.charge(card, amount, creds, gateway=Gateway.new(creds))
12
- gateway.ccsale(card, amount)
11
+ def self.charge(card, amount, creds, custom_fields={}, gateway=Gateway.new(creds))
12
+ gateway.ccsale(card, amount, custom_fields)
13
13
  end
14
14
 
15
- def self.authorize(card, amount, creds, gateway=Gateway.new(creds))
15
+ def self.authorize(card, amount, creds, custom_fields={}, gateway=Gateway.new(creds))
16
16
  gateway.ccauth(card, amount)
17
17
  end
18
18
 
@@ -24,8 +24,8 @@ module VirtualMerchant
24
24
  gateway.ccdelete(transaction_id)
25
25
  end
26
26
 
27
- def self.add_recurring(card, amount, creds, gateway=Gateway.new(creds))
28
- gateway.ccaddrecurring(card, amount)
27
+ def self.add_recurring(card, amount, creds, custom_fields={}, gateway=Gateway.new(creds))
28
+ gateway.ccaddrecurring(card, amount, custom_fields)
29
29
  end
30
30
 
31
31
  def self.refund(card, amount, creds, gateway=Gateway.new(creds))
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: virtual_merchant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Quarella
@@ -11,7 +11,7 @@ cert_chain: []
11
11
  date: 2012-11-02 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Makes it easy to charge credit cards with the VirtualMerchant API.
14
- email: lee@lucidfrog.com
14
+ email: leequarella@gmail.com
15
15
  executables: []
16
16
  extensions: []
17
17
  extra_rdoc_files: []
@@ -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
24
25
  - lib/virtual_merchant/logger.rb
25
26
  - lib/virtual_merchant/response.rb
26
27
  - 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.1.10
48
+ rubygems_version: 2.2.2
49
49
  signing_key:
50
50
  specification_version: 4
51
51
  summary: Virtual Merchant API