da_funk 3.0.0 → 3.1.1

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: 14a0759211adad87f8e8ef78f3acbe61201e8d68
4
- data.tar.gz: 3f421864672af60122049e7e194303faa57d86ab
3
+ metadata.gz: 834613e7d4ad7c55f0c83ee2cf316e29d931f411
4
+ data.tar.gz: 52ec5afb74d88719e669e393d85e34914492a212
5
5
  SHA512:
6
- metadata.gz: bbd0ea30478678f50460cde1ded710d66e2bbd3a1216a155268659534a6907493828319a0d435ca16e9937f1f76d52c3716ecdb6cb42d660009406297c661d20
7
- data.tar.gz: f15f8b1226a9ce6c2445fb564c4ef3ad2e16e3f26c5711d9c734c55ea8c76f57c2df86c772d776fb08ce22d1af3618f31b16a72c7e1f13fb0977db25c90f42ab
6
+ metadata.gz: 2861468ccdcaece406d166ffb87b0e5ce7ee535478d6d87273f488f3f71fb5baa7734202eb67f0216bc9f907744d6c22741a4796cdf4476ca75ce3426ab6601d
7
+ data.tar.gz: f0132ee913e4e745facb147bd41d2bdb43d491ea53b2ec728fdb0de4a7234d4a54a22000506ccbb7eb1ba9cd65150a56120522b0e0b945e511ed2c326f9373aa
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- da_funk (3.0.0)
4
+ da_funk (3.1.1)
5
5
  archive-zip (~> 0.5)
6
6
  bundler
7
7
  cloudwalk_handshake
@@ -12,13 +12,13 @@ PATH
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- archive-zip (0.11.0)
15
+ archive-zip (0.12.0)
16
16
  io-like (~> 0.3.0)
17
17
  ast (2.4.0)
18
18
  cloudwalk (1.14.0)
19
19
  bundler
20
20
  rake
21
- cloudwalk_handshake (0.13.2)
21
+ cloudwalk_handshake (1.2.0)
22
22
  funky-emv (0.20.2)
23
23
  funky-tlv (~> 0.2)
24
24
  funky-simplehttp (0.5.0)
@@ -28,7 +28,7 @@ GEM
28
28
  parallel (1.13.0)
29
29
  parser (2.6.0.0)
30
30
  ast (~> 2.4.0)
31
- posxml_parser (2.14.0)
31
+ posxml_parser (2.15.0)
32
32
  funky-emv (~> 0.3)
33
33
  powerpack (0.1.2)
34
34
  rainbow (3.0.0)
data/RELEASE_NOTES.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # DaFunk
2
2
 
3
+ ### 3.1.1 - 2019-03-14
4
+
5
+ - Bug fix attach helper loop image and decrease display time to 200ms;
6
+ - Bugfix flag PaymentChannel::transaction_http use PaymentChannel didn’t change to payment channel approach when demand;
7
+ - Bug fix extend timeout to PaymentChannel handshake.
8
+
9
+ ### 3.1.0 - 2019-03-12
10
+
11
+ - Replace host config for http.
12
+
3
13
  ### 3.0.0 - 2019-02-28
4
14
 
5
15
  - Replace payment channel interface from WebSocket to HTTP;
@@ -113,14 +113,16 @@ module DaFunk
113
113
  time = timeout != 0 ? Time.now + timeout / 1000 : Time.now
114
114
  processing = Hash.new(keep: true)
115
115
  interation = 0
116
+ files = options[:bmps][:attach_loop] if options && options[:bmps].is_a?(Hash)
117
+ max = (files.size - 1) if files
118
+
116
119
  while(processing[:keep] && processing[:key] != Device::IO::CANCEL) do
117
- if options && options[:bmps] && files = options[:bmps][:attach_loop]
120
+ if files
118
121
  Device::Display.print_bitmap(files[interation])
119
- max = files.size - 1
120
- interation = (max >= interation) ? 0 : interation + 1
122
+ interation = (max >= interation) ? interation + 1 : 0
121
123
  end
122
124
  if processing[:keep] = block.call(processing)
123
- processing[:key] = getc(300)
125
+ processing[:key] = getc(200)
124
126
  end
125
127
  break if time < Time.now
126
128
  end
@@ -6,7 +6,7 @@ module DaFunk
6
6
  attr_accessor :client
7
7
  end
8
8
 
9
- attr_accessor :handshake_response, :client, :host, :port
9
+ attr_accessor :handshake_response, :handshake_request, :client, :host, :port
10
10
 
11
11
  def self.ready?
12
12
  Device::Network.connected? && self.configured?
@@ -149,8 +149,12 @@ module DaFunk
149
149
  def initialize(client = nil)
150
150
  @host = Device::Setting.host
151
151
  @port = (Device::Setting.apn == "gprsnac.com.br") ? 32304 : 443
152
- @client = client || CwHttpSocket.new(Device::Setting.transaction_http_host,
153
- Device::Setting.transaction_http_port)
152
+ if PaymentChannel.transaction_http?
153
+ @client = client || CwHttpSocket.new(Device::Setting.transaction_http_host,
154
+ Device::Setting.transaction_http_port)
155
+ else
156
+ @client = client || CwWebSocket::Client.new(@host, @port)
157
+ end
154
158
  rescue SocketError, PolarSSL::SSL::Error => e
155
159
  self.error(e)
156
160
  end
@@ -181,7 +185,7 @@ module DaFunk
181
185
  if self.client.respond_to?(:handshake?)
182
186
  self.client.handshake?
183
187
  else
184
- if self.connected? && ! @handshake_response
188
+ if self.connected? && @handshake_request && ! @handshake_response
185
189
  timeout = Time.now + Device::Setting.tcp_recv_timeout.to_i
186
190
  loop do
187
191
  break if @handshake_response = self.client.read
@@ -216,7 +220,8 @@ module DaFunk
216
220
  if self.handshake?
217
221
  true
218
222
  else
219
- @client.write(PaymentChannel.handshake_message)
223
+ @handshake_request = PaymentChannel.handshake_message
224
+ @client.write(handshake_request)
220
225
  end
221
226
  end
222
227
  end
@@ -1,4 +1,4 @@
1
1
  module DaFunk
2
- VERSION="3.0.0"
2
+ VERSION="3.1.1"
3
3
  end
4
4
 
@@ -4,8 +4,8 @@ class Device
4
4
  FILE_PATH = "./main/config.dat"
5
5
  HOST_PRODUCTION = "switch.cloudwalk.io"
6
6
  HOST_STAGING = "switch-staging.cloudwalk.io"
7
- HTTP_HOST_PRODUCTION = "switch-http.cloudwalk.io"
8
- HTTP_HOST_STAGING = "switch-http-staging.cloudwalk.io"
7
+ HTTP_HOST_PRODUCTION = "pos.cloudwalk.io"
8
+ HTTP_HOST_STAGING = "pos-staging.cloudwalk.io"
9
9
  HTTP_PORT = "443"
10
10
  PORT_TCP = "31415"
11
11
  PORT_TCP_SSL = "31416"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: da_funk
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thiago Scalone
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-28 00:00:00.000000000 Z
11
+ date: 2019-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake