Permalink
Browse files

bumping to 8.13.1

adding support for echeckVoid
  • Loading branch information...
1 parent bd30525 commit 66881375dfe129fa750ef3f0caf0a9f3eddb71d5 @GregDake GregDake committed May 22, 2012
View
@@ -1,5 +1,9 @@
= LitleOnline CHANGELOG
+== Version 8.13.1 (May 22, 2012)
+
+* Feature: Echeck Void now supported
+
== Version 8.13.0 (May 18, 2012)
* Feature: Authorizations and Sales can accept an optional fraudFilterOverride parameter
View
@@ -34,7 +34,7 @@ spec = Gem::Specification.new do |s|
s.description = File.read(File.join(File.dirname(__FILE__), 'DESCRIPTION'))
s.requirements =
[ 'Contact sdksupport@litle.com for more information' ]
- s.version = "8.13.0"
+ s.version = "8.13.1"
s.author = "Litle & Co"
s.email = "sdksupport@litle.com"
s.homepage = "http://www.litle.com/developers"
View
@@ -552,6 +552,36 @@ def void(hash_in)
xml = request.save_to_xml.to_s
LitleXmlMapper.request(xml, @config_hash)
end
+
+ def echeck_void(hash_in)
+ @config_hash['proxy_addr'] = hash_in['proxy_addr'].nil? ? @config_hash['proxy_addr'] : hash_in['proxy_addr']
+ @config_hash['proxy_port'] = hash_in['proxy_port'].nil? ? @config_hash['proxy_port'] : hash_in['proxy_port']
+ @config_hash['url'] = hash_in['url'].nil? ? @config_hash['url'] : hash_in['url']
+
+ request = OnlineRequest.new
+ void = EcheckVoid.new
+ void.reportGroup = get_report_group(hash_in)
+ void.transactionId = hash_in['id']
+ void.customerId = hash_in['customerId']
+
+ void.litleTxnId = hash_in['litleTxnId']
+
+ request.echeckVoid = void
+
+ authentication = Authentication.new
+ authentication.user = 'PHXMLTEST'
+ authentication.password = 'password'
+ request.authentication = authentication
+
+ request.merchantId = get_merchant_id(hash_in)
+ request.version = get_version(hash_in)
+ request.xmlns = "http://www.litle.com/schema"
+ request.merchantSdk = get_merchant_sdk(hash_in)
+
+ xml = request.save_to_xml.to_s
+ LitleXmlMapper.request(xml, @config_hash)
+ end
+
private
@@ -573,7 +603,7 @@ def get_version(hash_in)
def get_merchant_sdk(hash_in)
if(!hash_in['merchantSdk'])
- return 'Ruby;8.13.0'
+ return 'Ruby;8.13.1'
else
return hash_in['merchantSdk']
end
@@ -0,0 +1,41 @@
+=begin
+Copyright (c) 2012 Litle & Co.
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+=end
+require 'lib/LitleOnline'
+require 'test/unit'
+
+module LitleOnline
+ class TestAuthReversal < Test::Unit::TestCase
+ def test_simple_echeck_void
+ hash = {
+ 'merchantId' => '101',
+ 'version'=>'8.8',
+ 'reportGroup'=>'Planets',
+ 'litleTxnId'=>'12345678000',
+ }
+ response= LitleOnlineRequest.new.echeck_void(hash)
+ assert_equal('Approved', response.echeckVoidResponse.message)
+ end
+ end
+end
@@ -39,3 +39,4 @@
require_relative 'test_echeckSale'
require_relative 'test_echeckCredit'
require_relative 'test_echeckVerification'
+require_relative 'test_echeckVoid'
@@ -244,7 +244,7 @@ def test_set_merchant_sdk
#Explicit - used for integrations
assert_equal 'ActiveMerchant;3.2', litle.send(:get_merchant_sdk, {'merchantSdk'=>'ActiveMerchant;3.2'})
#Implicit - used raw when nothing is specified
- assert_equal 'Ruby;8.13.0', litle.send(:get_merchant_sdk, {'NotMerchantSdk'=>'ActiveMerchant;3.2'})
+ assert_equal 'Ruby;8.13.1', litle.send(:get_merchant_sdk, {'NotMerchantSdk'=>'ActiveMerchant;3.2'})
end
@@ -0,0 +1,41 @@
+=begin
+Copyright (c) 2012 Litle & Co.
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+=end
+require 'lib/LitleOnline'
+require 'test/unit'
+
+module LitleOnline
+ class Test_echeckVoid < Test::Unit::TestCase
+ def test_echeck_void
+ hash = {
+ 'merchantId' => '101',
+ 'version'=>'8.8',
+ 'reportGroup'=>'Planets',
+ 'litleTxnId'=>'123456',
+ }
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<echeckVoid.*<litleTxnId>123456<\/litleTxnId>.*/m), is_a(Hash))
+ LitleOnlineRequest.new.echeck_void(hash)
+ end
+ end
+end
View
@@ -38,4 +38,5 @@
require_relative 'test_echeckRedeposit'
require_relative 'test_echeckSale'
require_relative 'test_echeckCredit'
-require_relative 'test_echeckVerification'
+require_relative 'test_echeckVerification'
+require_relative 'test_echeckVoid'

0 comments on commit 6688137

Please sign in to comment.