client_for_poslynx 0.2.3 → 0.2.4

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZDA5Y2Q1ODZhY2YxMTE5ZDU5NTRkNzAyODYxMGQxZmRiMjI5ZjQ0OQ==
4
+ Y2M2MDJlODNlYWUyOTQ4MGY2MWU5MjAxNzhjMzY3ZTYzYTY4YTZhMg==
5
5
  data.tar.gz: !binary |-
6
- MDliOWI5MmYwNzIxNTM2Zjk3Y2ZjZjczOWNmMWMzMGQzN2I4OTgyMQ==
6
+ MmRiYjM3YzcwN2MwNzM1NjdiNjlkNGUyNmU3NTViMDU3Mjg3MGNhOQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZTQyNzUyNmE1ZWQ4YmM0YjZkMjFjYjhjMGE5NTdmZjJhNzM1NzNiYmQyZmJk
10
- OGRkNTBlNWM4MTk2ZGQ1ZTc4NDNkOGRhMTRmNzIxYzhhY2NhMzkwM2E0ZTZk
11
- ZTQ2ZjhjMWUzNjViYjEyZDlhMTA3YjkxZGIzMmQ0M2RhOGYwNjE=
9
+ OTIwNDhmN2I4MzIyOTFkYmI5MzM2NzBhNTgzNDg1OGMxNDdlZjM3MzcyMjI1
10
+ ODVmZTk5YjNlMDVjMmMxNTNlMGNkZGM0NGNiM2RkNGRkMWIzYzY5YmM0NjNl
11
+ MjkyOTQzNWMyMWExZDBlOWU1YTRlYTc5YjQ3NjJiMDVjNzVkNGU=
12
12
  data.tar.gz: !binary |-
13
- Yzc4YzdlYTI1MzZiOTZmMzcxZjc5NTdmY2U4NjAyZjFhYjRiNTZmYmFiNGE2
14
- MGI3Y2ZiN2E4YTFkYTY5OGNmZWU3ODIyYWUwYTA1MDU0NzM2ZGY3ZWU0YjNh
15
- MGE0NzdhZDA0ODk1YzExMTIxMWE1OTA2NDBmOTk0YzMxYWMyMzk=
13
+ MzNiYmNmMDRhYmJjNmZjODc4MjEwNzhhMzNiZDk5ODA4MTc5Mjg1ODNjY2Fl
14
+ YWE5MDJiM2NkNmQwM2IwM2VmMzQ3NGVkZTAyZTg3OWExYWNiZTViOGEzMjQx
15
+ YjMzNjhhNWVkN2FkNjdjZDIwNWM2MDVlMWMwNjFkZmMxMDIxNjQ=
data/CHANGELOG CHANGED
@@ -17,5 +17,9 @@ Version 0.2.2
17
17
  - Specify Ruby version requirement of 1.9.3 or greater.
18
18
 
19
19
  Version 0.2.3
20
- - Fix bug: Fake termonal script crashes with stak overflow when
20
+ - Fix bug: Fake terminal script crashes with stak overflow when
21
21
  a single text value is supplied.
22
+
23
+ Version 0.2.4
24
+ - Fix bug: Fake terminal script crashes during user interaction
25
+ for a debit sale request without a specified cash back amount.
@@ -5,7 +5,7 @@ module ClientForPoslynx
5
5
  module RequestHandlers
6
6
 
7
7
  class AbstractHandler
8
- attr_reader :request, :response, :user_interface
8
+ attr_reader :original_request, :request, :response, :user_interface
9
9
 
10
10
  def self.call(*args)
11
11
  instance = new(*args)
@@ -14,8 +14,9 @@ module ClientForPoslynx
14
14
  end
15
15
 
16
16
  def initialize(request, user_interface)
17
- @request = request
18
- @user_interface = user_interface
17
+ @original_request = request
18
+ @request = request.dup
19
+ @user_interface = user_interface
19
20
  end
20
21
 
21
22
  def call
@@ -14,6 +14,7 @@ module ClientForPoslynx
14
14
  end
15
15
 
16
16
  def handle_supported_source_request
17
+ request.cash_back = '0.00' if "#{request.cash_back}".strip.empty?
17
18
  response.card_number_last_4 = get_card_swipe
18
19
  response.input_method = 'SWIPED'
19
20
  confirmed = get_confirmation
@@ -1,5 +1,5 @@
1
1
  # coding: utf-8
2
2
 
3
3
  module ClientForPoslynx
4
- VERSION = '0.2.3'
4
+ VERSION = '0.2.4'
5
5
  end
@@ -67,6 +67,31 @@ XML
67
67
  actual_instance = described_class.xml_deserialize xml_input
68
68
  expect( actual_instance.source_data ).to eq( xml_input )
69
69
  end
70
+
71
+ it "is duplicatable" do
72
+ original_inst = described_class.new
73
+ original_inst.client_mac = '0123456789AB'
74
+ original_inst.source_data = '...'
75
+
76
+ duplicate_inst = original_inst.dup
77
+
78
+ expect( duplicate_inst.client_mac ).not_to be( original_inst )
79
+ expect( duplicate_inst.client_mac ).to eq( '0123456789AB' )
80
+ expect( duplicate_inst.source_data ).to eq( '...' )
81
+ end
82
+
83
+ it "makes safe copy of attributes for duplicate" do
84
+ original_inst = described_class.new
85
+ original_inst.client_mac = '0123456789AB'
86
+ original_inst.source_data = '...'
87
+
88
+ duplicate_inst = original_inst.dup
89
+ duplicate_inst.client_mac = 'BA9876543210'
90
+ duplicate_inst.source_data = '###'
91
+
92
+ expect( original_inst.client_mac ).to eq( '0123456789AB' )
93
+ expect( original_inst.source_data ).to eq( '...' )
94
+ end
70
95
  end
71
96
 
72
97
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: client_for_poslynx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Jorgensen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-11 00:00:00.000000000 Z
11
+ date: 2014-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri