Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
adding recycling creditLitleTxnId to void response
making the version sent up in the litleOnlineRequest match the
major.minor version of the sdk.  It should not use the version from the
config.
  • Loading branch information
Gregory,Dake committed Mar 15, 2013
1 parent 57822a5 commit cf959fd
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Expand Up @@ -2,9 +2,12 @@

== Version 8.16.0 (NOT YET RELEASED)

* Feature: Add recyling to voidResponse
* Bugfix: Force the "version" attribute of a LitleOnlineRequest to be the major and minor version of the sdk submitting the transaction instead of using the value from the configuration file
* Bugfix: Add Connection: close header to reduce the chance of 403s from reaching the ip connection limit
* Bugfix: Merged pull request #5 from simeonwillbanks to fix a typo in sale when payPalOrderComplete is specified


== Version 8.15.0 (January 31, 2013)

* Feature: Add merchantData to echeck verifications and echeck redeposits
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
@@ -1,4 +1,4 @@
Litle Online Ruby SDK created for version 8.15 of Litle XML online format, see the XSD schema for specific fields that are supported by this format.
Litle Online Ruby SDK created for version 8.16 of Litle XML online format, see the XSD schema for specific fields that are supported by this format.

This gem contains an application interface in the Ruby programming language created by Litle & Co.

Expand Down
4 changes: 2 additions & 2 deletions Rakefile
Expand Up @@ -30,11 +30,11 @@ require 'rake/clean'
spec = Gem::Specification.new do |s|
FileUtils.rm_rf('pkg')
s.name = "LitleOnline"
s.summary = "Ruby SDK produced by Litle & Co. for online transaction processing using Litle XML format v8.15"
s.summary = "Ruby SDK produced by Litle & Co. for online transaction processing using Litle XML format v8.16"
s.description = File.read(File.join(File.dirname(__FILE__), 'DESCRIPTION'))
s.requirements =
[ 'Contact sdksupport@litle.com for more information' ]
s.version = "8.15.0"
s.version = "8.16.0"
s.author = "Litle & Co"
s.email = "sdksupport@litle.com"
s.homepage = "http://www.litle.com/developers"
Expand Down
3 changes: 1 addition & 2 deletions SETUP.md
Expand Up @@ -40,8 +40,7 @@ Sample configuration file contents
```
user: test_user
password: test_password
version: 8.15
url: https://precert.litle.com/vap/communicator/online
url: https://www.testlitle.com/vap/communicator/online
proxy_addr: yourproxyserver
proxy_port: 8080
```
1 change: 0 additions & 1 deletion bin/Setup.rb
Expand Up @@ -44,7 +44,6 @@ def initialize(filename)
f.puts "currency_merchant_map:"
f.puts " DEFAULT: " + gets
f.puts "default_report_group: 'Default Report Group'"
f.puts "version: '8.15'"
puts "Please choose Litle url from the following list (example: 'cert') or directly input another URL: \nsandbox => https://www.testlitle.com/sandbox/communicator/online \ncert => https://cert.litle.com/vap/communicator/online \nprecert => https://precert.litle.com/vap/communicator/online \nproduction1 => https://payments.litle.com/vap/communicator/online \nproduction2 => https://payments2.litle.com/vap/communicator/online"
f.puts "url: " + Setup.choice(gets)
puts "Please input the proxy address, if no proxy hit enter key: "
Expand Down
4 changes: 2 additions & 2 deletions lib/LitleOnlineRequest.rb
Expand Up @@ -268,7 +268,7 @@ def build_request(options)

request.authentication = authentication
request.merchantId = get_merchant_id(options)
request.version = get_config(:version, options)
request.version = '8.16'
request.loggedInUser = get_logged_in_user(options)
request.xmlns = "http://www.litle.com/schema"
request.merchantSdk = get_merchant_sdk(options)
Expand Down Expand Up @@ -299,7 +299,7 @@ def get_merchant_id(options)
end

def get_merchant_sdk(options)
options['merchantSdk'] || 'Ruby;8.15.0'
options['merchantSdk'] || 'Ruby;8.16.0'
end

def get_report_group(options)
Expand Down
27 changes: 26 additions & 1 deletion test/unit/test_LitleOnlineRequest.rb
Expand Up @@ -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.15.0', litle.send(:get_merchant_sdk, {'NotMerchantSdk'=>'ActiveMerchant;3.2'})
assert_equal 'Ruby;8.16.0', litle.send(:get_merchant_sdk, {'NotMerchantSdk'=>'ActiveMerchant;3.2'})
end

def test_sale_paypal_order_complete_typo
Expand All @@ -267,6 +267,31 @@ def test_sale_paypal_order_complete_typo

response = LitleOnlineRequest.new.sale(hash)
end

def test_version_matches_sdk_major_and_minor_version_ignoring_config
Configuration.any_instance.stubs(:config).returns({'currency_merchant_map'=>{'DEFAULT'=>'1'}, 'user'=>'a','password'=>'b','version'=>'8.10'})
hash={
'litleTxnId' => '006'
}

Communications.expects(:http_post).with(regexp_matches(/<litleOnlineRequest.*version="8\.16".*/m),kind_of(Hash))
XMLObject.expects(:new)

response = LitleOnlineRequest.new.void(hash)
end

def test_void_response_contains_recycling
Configuration.any_instance.stubs(:config).returns({'currency_merchant_map'=>{'DEFAULT'=>'1'}, 'user'=>'a','password'=>'b','version'=>'8.10'})
hash={
'litleTxnId' => '123'
}

Communications.expects(:http_post).with(kind_of(String),kind_of(Hash)).returns('<litleOnlineResponse><voidResponse><recycling><creditLitleTxnId>65</creditLitleTxnId></recycling></voidResponse></litleOnlineResponse>')

response = LitleOnlineRequest.new.void(hash)
assert_equal '65', response.voidResponse.recycling.creditLitleTxnId
end


end
end

0 comments on commit cf959fd

Please sign in to comment.