LitleOnline 10.1 → 10.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6d2579c938a2cd3f7b6faf95171f2e4540a12105
4
- data.tar.gz: ce71d903457a0476d758c3ba1a5698bd1c3ed272
3
+ metadata.gz: 79b58589d4bf7e07cbfcbb1687604e616030be16
4
+ data.tar.gz: 4cce2e752b16f520b8a784f1a88ffe364a6e7b3c
5
5
  SHA512:
6
- metadata.gz: d191b166b62f2b2b5b29d9a940c47e001d322ad0c2a7ae74f403c8bd82f77718719ec22372cdd6ef0899a8377bf14187197338b7f9bfcb9e65326c95132f9df7
7
- data.tar.gz: f7e82cfd440af0d7e09f377069a5b36976bfed6464a82211bf45e8c3776b0e795db831c78b02470a497ccc8711b76cb9517ff1c7295825b27c8fc0b8c5c5a12b
6
+ metadata.gz: 4bf723f434360b9726ae9d74b498d716df4b4432a52ee91647425cacee2179072c47a050d9451576faaa37c3e0aeab5c1b80c2a1ddcce0e17fa2e98bf1395df8
7
+ data.tar.gz: efc74c1782f0b613661867fde6218735980a0e0ea0bc2dd842e804ad48c0b518ff53afc25a359dea64969a298f8159e7aa2b867cd80e2fa30da76d7170404b73
data/CHANGELOG CHANGED
@@ -1,11 +1,16 @@
1
1
  = LitleOnline CHANGELOG
2
2
 
3
+ <<<<<<< HEAD
3
4
  ==Version 10.1
4
5
  * Feature: Support for the following new transactions:
5
6
  FundingInstructionVoid and QueryTransaction
6
7
  * Feature: 'id' field should be added to all incoming transaction types
7
8
  * Feature: Constraints were added to ApplepayType and ApplyPayHeaderType
8
9
  * Feature: Wallet class was added and new enum types were introduced
10
+ =======
11
+ ==Version 9.3.3
12
+ *add fraudCheck transaction type
13
+ >>>>>>> ebfe3bd... add FraudCheck transaction type
9
14
 
10
15
  ==Version 9.3.2
11
16
  HTTP timeout set to 500ms
data/Rakefile CHANGED
@@ -34,7 +34,7 @@ spec = Gem::Specification.new do |s|
34
34
  s.description = File.read(File.join(File.dirname(__FILE__), 'DESCRIPTION'))
35
35
  s.requirements =
36
36
  [ 'Contact sdksupport@litle.com for more information' ]
37
- s.version = "10.1"
37
+ s.version = "10.1.1"
38
38
  s.author = "Vantiv - eCommerce"
39
39
  s.author = "Litle & Co"
40
40
  s.email = "sdksupport@litle.com"
@@ -229,13 +229,13 @@ module LitleOnline
229
229
  end
230
230
  end
231
231
  end
232
- #
233
- # class FraudCheckListener < DefaultLitleListener
234
- # def apply(duck)
235
- # if(duck["type"] == "fraudCheckResponse") then
236
- # @action.call(duck)
237
- # end
238
- # end
239
- # end
232
+
233
+ class FraudCheckListener < DefaultLitleListener
234
+ def apply(duck)
235
+ if(duck["type"] == "advancedFraudResult") then
236
+ @action.call(duck)
237
+ end
238
+ end
239
+ end
240
240
 
241
241
  end
@@ -229,18 +229,17 @@ module LitleOnline
229
229
  commit(transaction, :echeckVoid, options)
230
230
  end
231
231
 
232
- #SDK XML 10
233
232
  def query_Transaction(options)
234
233
  transaction = @litle_transaction.query_Transaction(options)
235
234
 
236
235
  commit(transaction, :queryTransaction, options)
237
236
  end
238
237
 
239
- # def fraud_check_request(options)
240
- # transaction = @litle_transaction.fraud_check_request(options)
241
- #
242
- # commit(transaction, :fraudCheck, options)
243
- # end
238
+ def fraud_check_request(options)
239
+ transaction = @litle_transaction.fraud_check_request(options)
240
+
241
+ commit(transaction, :fraudCheck, options)
242
+ end
244
243
 
245
244
  private
246
245
 
@@ -537,18 +537,16 @@ module LitleOnline
537
537
 
538
538
  return transaction
539
539
  end
540
- #
541
- # def fraud_check_request(options)
542
- # transaction = FraudCheckRequest.new
543
- # transaction.advancedFraudChecks = AdvancedFraudChecks.from_hash(options,'advancedFraudChecks')
544
- # transaction.billToAddress = Contact.from_hash(options,'billToAddress')
545
- # transaction.shipToAddress = Contact.from_hash(options,'shipToAddress')
546
- # transaction.amount = options['amount']
547
- #
548
- # add_account_info(transaction, options)
549
- #
550
- # return transaction
551
- # end
540
+
541
+ def fraud_check_request(options)
542
+ transaction = FraudCheckRequest.new
543
+ transaction.advancedFraudChecks = AdvancedFraudChecks.from_hash(options,'advancedFraudChecks')
544
+ transaction.transactionId = options["id"]
545
+
546
+ add_account_info(transaction, options)
547
+
548
+ return transaction
549
+ end
552
550
 
553
551
  private
554
552
 
@@ -616,4 +614,4 @@ module LitleOnline
616
614
  options['reportGroup']
617
615
  end
618
616
  end
619
- end
617
+ end
@@ -1370,19 +1370,19 @@ module LitleOnline
1370
1370
  end
1371
1371
  end
1372
1372
  end
1373
- #
1374
- # class FraudCheckRequest
1375
- # include XML::Mapping
1376
- # root_element_name "fraudCheck"
1377
- # text_node :reportGroup, "@reportGroup", :default_value=>nil
1378
- # text_node :transactionId, "@id", :default_value=>nil
1379
- # text_node :customerId, "@customerId", :default_value=>nil
1380
- # object_node :advancedFraudChecks, "advancedFraudChecks", :default_value=>nil
1381
- # object_node :billToAddress, "billToAddress", :class=>Contact, :default_value=>nil
1382
- # object_node :shipToAddress, "shipToAddress", :class=>Contact, :default_value=>nil
1383
- # text_node :amount, "amount", :default_value=>nil
1384
- # end
1385
1373
 
1374
+ class FraudCheckRequest
1375
+ include XML::Mapping
1376
+ root_element_name "fraudCheck"
1377
+ text_node :reportGroup, "@reportGroup", :default_value=>nil
1378
+ text_node :transactionId, "@id", :default_value=>nil
1379
+ text_node :customerId, "@customerId", :default_value=>nil
1380
+ object_node :advancedFraudChecks, "advancedFraudChecks", :default_value=>nil
1381
+ object_node :billToAddress, "billToAddress", :class=>Contact, :default_value=>nil
1382
+ object_node :shipToAddress, "shipToAddress", :class=>Contact, :default_value=>nil
1383
+ text_node :amount, "amount", :default_value=>nil
1384
+ end
1385
+
1386
1386
  class Authorization
1387
1387
  include XML::Mapping
1388
1388
  root_element_name "authorization"
@@ -2028,8 +2028,8 @@ end
2028
2028
  :elsif, 'loadReversal', :then, (object_node :loadReversal,"loadReversal", :class=>LoadReversal),
2029
2029
  :elsif, 'unloadReversal', :then, (object_node :unloadReversal,"unloadReversal", :class=>UnloadReversal),
2030
2030
  :elsif, 'advancedFraudResults', :then, (object_node :advancedFraudResults,"advancedFraudResults", :class=>AdvancedFraudResults),
2031
- #SDK XML 10
2032
- :elsif, 'queryTransaction', :then, (object_node :queryTransaction, "queryTransaction", :class=>QueryTransaction)
2031
+ :elsif, 'queryTransaction', :then, (object_node :queryTransaction, "queryTransaction", :class=>QueryTransaction),
2032
+ :elsif, 'fraudCheck', :then, (object_node :fraudCheck, "fraudCheck", :class=>FraudCheck)
2033
2033
  def post_save(xml, options={:Mapping=>:_default})
2034
2034
  xml.each_element() {|el|
2035
2035
  if(el.name == 'captureTxn')
@@ -0,0 +1,77 @@
1
+ =begin
2
+ Copyright (c) 2012 Litle & Co.
3
+
4
+ Permission is hereby granted, free of charge, to any person
5
+ obtaining a copy of this software and associated documentation
6
+ files (the "Software"), to deal in the Software without
7
+ restriction, including without limitation the rights to use,
8
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the
10
+ Software is furnished to do so, subject to the following
11
+ conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
18
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23
+ OTHER DEALINGS IN THE SOFTWARE.
24
+ =end
25
+ require File.expand_path("../../../lib/LitleOnline",__FILE__)
26
+ require 'test/unit'
27
+
28
+ #test FraudCheck Transaction
29
+ module LitleOnline
30
+ class TestFraudCheck < Test::Unit::TestCase
31
+ def test_fraud_check_happy_path
32
+ hash = {
33
+ 'merchantId' => '101',
34
+ 'version'=>'10.1',
35
+ 'id' => '127',
36
+ 'reportGroup'=>'Planets',
37
+ 'advancedFraudChecks' => {
38
+ 'threatMetrixSessionId' => 'test1-BXXXXXX003',
39
+ 'customAttribute1' => 'pass',
40
+ 'customAttribute2' => '55',
41
+ 'customAttribute3' => '5'}
42
+ }
43
+ response = LitleOnlineRequest.new.fraud_check_request(hash)
44
+ assert_equal('001', response.fraudCheckResponse.response)
45
+ assert_equal('Transaction Received', response.fraudCheckResponse.message)
46
+ assert_equal('pass', response.fraudCheckResponse.advancedFraudResult.deviceReviewStatus)
47
+ assert_equal('55', response.fraudCheckResponse.advancedFraudResult.deviceReputationScore)
48
+ assert_equal('triggered_rule_1', response.fraudCheckResponse.advancedFraudResult.triggeredRule[0])
49
+ assert_equal(5, response.fraudCheckResponse.advancedFraudResult.triggeredRule.size())
50
+ end
51
+
52
+ def test_fraud_check_session_id
53
+ hash = {
54
+ 'merchantId' => '101',
55
+ 'version'=>'10.1',
56
+ 'id' => '127',
57
+ 'reportGroup'=>'Planets',
58
+ 'advancedFraudChecks' => {
59
+ 'threatMetrixSessionId' => 'test2-BXXXXXX003'
60
+ }
61
+ }
62
+ response = LitleOnlineRequest.new.fraud_check_request(hash)
63
+ assert_equal('001', response.fraudCheckResponse.response)
64
+ assert_equal('Transaction Received', response.fraudCheckResponse.message)
65
+ assert_equal('pass', response.fraudCheckResponse.advancedFraudResult.deviceReviewStatus)
66
+ assert_equal('42', response.fraudCheckResponse.advancedFraudResult.deviceReputationScore)
67
+ # kind of a hack to get around the variable # of triggered rule elements. ie. 1 element is added as a string not
68
+ # an Array. Fix is to write an unmarshaller or custom node class in XMLFields.rb
69
+ if(response.fraudCheckResponse.advancedFraudResult.triggeredRule.is_a?(Array))
70
+ assert_equal('triggered_rule_default', response.fraudCheckResponse.advancedFraudResult.triggeredRule[0])
71
+ elsif
72
+ assert_equal('triggered_rule_default', response.fraudCheckResponse.advancedFraudResult.triggeredRule)
73
+ end
74
+ end
75
+
76
+ end
77
+ end
@@ -66,4 +66,4 @@ require_relative 'test_unloadReversal'
66
66
  require_relative 'test_deactivateReversal'
67
67
  require_relative 'test_override'
68
68
  require_relative 'test_configuration'
69
-
69
+ require_relative 'test_fraudCheck'
@@ -0,0 +1,45 @@
1
+ =begin
2
+ Copyright (c) 2012 Litle & Co.
3
+
4
+ Permission is hereby granted, free of charge, to any person
5
+ obtaining a copy of this software and associated documentation
6
+ files (the "Software"), to deal in the Software without
7
+ restriction, including without limitation the rights to use,
8
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the
10
+ Software is furnished to do so, subject to the following
11
+ conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
18
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23
+ OTHER DEALINGS IN THE SOFTWARE.
24
+ =end
25
+ require File.expand_path("../../../lib/LitleOnline",__FILE__)
26
+ require 'test/unit'
27
+ require 'mocha/setup'
28
+
29
+ #test FraudCheck Transaction
30
+ module LitleOnline
31
+ class TestFraudCheck < Test::Unit::TestCase
32
+ def test_success_fraud_check
33
+ hash = {
34
+ 'merchantId' => '101',
35
+ 'version'=>'10.1',
36
+ 'id' => '127',
37
+ 'reportGroup'=>'Planets',
38
+ 'advancedFraudChecks' => {'threatMetrixSessionId' => 'test2-BXXXXXX003'},
39
+ }
40
+
41
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<threatMetrixSessionId>test2-BXXXXXX003<\/threatMetrixSessionId>.*/m), is_a(Hash))
42
+ LitleOnlineRequest.new.fraud_check_request(hash)
43
+ end
44
+ end
45
+ end
@@ -87,7 +87,7 @@ module LitleOnline
87
87
  'orderId'=>'12344',
88
88
  'amount'=>'106',
89
89
  'orderSource'=>'ecommerce',
90
- # 'fraudCheck'=>{'authenticationTransactionId'=>'123'}, #for test
90
+ 'fraudCheck'=>{'authenticationTransactionId'=>'123'}, #for test
91
91
  'card'=>{
92
92
  'type'=>'VI',
93
93
  'number' =>'4100000000000002',
@@ -63,4 +63,5 @@ require_relative 'test_unloadReversal'
63
63
  require_relative 'test_deactivateReversal'
64
64
  require_relative 'test_wallet'
65
65
  require_relative 'test_queryTransaction'
66
+ require_relative 'test_fraudCheck'
66
67
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: LitleOnline
3
3
  version: !ruby/object:Gem::Version
4
- version: '10.1'
4
+ version: 10.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Litle & Co
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-19 00:00:00.000000000 Z
11
+ date: 2016-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xml-object
@@ -175,6 +175,7 @@ files:
175
175
  - test/functional/test_echeckVerification.rb
176
176
  - test/functional/test_echeckVoid.rb
177
177
  - test/functional/test_forceCapture.rb
178
+ - test/functional/test_fraudCheck.rb
178
179
  - test/functional/test_litle_requests.rb
179
180
  - test/functional/test_load.rb
180
181
  - test/functional/test_loadReversal.rb
@@ -215,6 +216,7 @@ files:
215
216
  - test/unit/test_echeckVerification.rb
216
217
  - test/unit/test_echeckVoid.rb
217
218
  - test/unit/test_forceCapture.rb
219
+ - test/unit/test_fraudCheck.rb
218
220
  - test/unit/test_load.rb
219
221
  - test/unit/test_loadReversal.rb
220
222
  - test/unit/test_queryTransaction.rb