seb_elink 0.9.2 → 0.9.3

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: 64f56b37d4019992c2b1fa1a5a1cf288a93d3f54
4
- data.tar.gz: 990bb0a7d4c8461d01f58fb7fa99d1cec58d99b9
3
+ metadata.gz: 5283ed18506553638a681afb5b1bb1ed0799c38b
4
+ data.tar.gz: 6582c3b9bcf74f6f9ac177046a77c4981c2f6834
5
5
  SHA512:
6
- metadata.gz: e3cf750728e68d49ed9ae6350afdeacd86541ba93690901c24d3c39f233246d117a06e4907814a00dc2575fa58ef104c9977f290357f9cef8b33137afd235f7a
7
- data.tar.gz: 14894d91c3b7a6f1b20c6cd72c1f632e83ce4876c42667057c6c50061b9745eafc1ed1b1470a6dd4df8ad301def4bef2b5aa3a20dfc5edf936161568434090ea
6
+ metadata.gz: a3fae22ac25e64cf39f0722e8a0275daa42af6e0fb5a25f4d3630b233e14cc756754c8f5693572607ebe23731b9522cf7a56da775ea98ecc57d47c2124384dc7
7
+ data.tar.gz: a0d9d2b9faecccf621ea2d6a34f88aab0d5766d3b5730228b98c7fd5e0a8eb5947ec81b6ee721cc9b9e176bff3e496c5d8cd8bd2785775c66371d3225a281630
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- seb_elink (0.9.2)
4
+ seb_elink (0.9.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -18,7 +18,7 @@ Please note that for consistency in this gem all hash keys are constant-case __s
18
18
 
19
19
  The gem has three elements represented as Ruby classes:
20
20
 
21
- __1. SebElink::Gateway__
21
+ ### 1. SebElink::Gateway
22
22
  Think of this as the communication adapter. Initialize it with a base64-encoded private key string (the human-readable .pem format). You can store the instance in a constant to reduce processing overhead.
23
23
 
24
24
  You can pass an optional options hash as the second argument that will specify default values for communications processed by that gateway instance. Useful for setting company-related data just once.
@@ -49,7 +49,7 @@ Instances of `SebElink::Gateway` have one method for public use:
49
49
  gateway.ibank_api_uri #=> uri for POSTing intial message to.
50
50
  ```
51
51
 
52
- __2. SebElink::Message__
52
+ ### 2. SebElink::Message
53
53
  Instances represent requests to i-bank, generally for payment.
54
54
 
55
55
  Initialize these with `SebElink::Message.new(gateway_instance, message_code, data_hash)`
@@ -71,7 +71,7 @@ message_instance.digital_signature
71
71
  #=> outputs the value of :IB_CRC key, the base64-encoded digital signature of the message
72
72
  ```
73
73
 
74
- __3. SebElink::Response__
74
+ ### 3. SebElink::Response
75
75
  Instances represent responses from SEB.lv i-bank server.
76
76
  Well-formedness is not validated since if digital signature is OK, one would think that the bank adheres to it's own spec.
77
77
 
@@ -86,13 +86,9 @@ module SebElink
86
86
  IB_REC_ID: {no: 4, in_signature: true},
87
87
  IB_PAYMENT_ID: {no: 5, in_signature: true},
88
88
  IB_PAYMENT_DESC: {no: 6, in_signature: true},
89
- # -- IB_FROM_SERVER {no: 7, in_signature: true},
90
- IB_STATUS: {no: 7, in_signature: true},
89
+ IB_FROM_SERVER: {no: 7, in_signature: true},
90
+ IB_STATUS: {no: 8, in_signature: true},
91
91
  }.freeze
92
92
 
93
-
94
-
95
-
96
-
97
93
  end
98
94
  end
@@ -26,8 +26,8 @@ class SebElink::Response
26
26
 
27
27
  @valid = gateway_instance.verify({
28
28
  version: version,
29
- message_footprint: footprint,
30
- message_signature: body_hash[:IB_CRC]
29
+ message: footprint,
30
+ base64_signature: body_hash[:IB_CRC]
31
31
  })
32
32
  end
33
33
 
@@ -41,9 +41,9 @@ class SebElink::Response
41
41
 
42
42
  private
43
43
  def body_hash
44
- @body_hash ||= body.split("&").each_with_object({}) do |q_pair, hash|
45
- pair = q_pair # CGI.unescape(q_pair)
46
- split_index = CGI.unescape(pair).index("=")
44
+ # @body_hash ||= body.split("&").each_with_object({}) do |q_pair, hash|
45
+ @body_hash ||= CGI.unescape(body).split("&").each_with_object({}) do |pair, hash|
46
+ split_index = pair.index("=")
47
47
  key, value = pair[0..(split_index - 1)], pair[split_index.next..-1]
48
48
  hash[key.to_sym] = value.to_s
49
49
  end
@@ -1,3 +1,3 @@
1
1
  module SebElink
2
- VERSION = "0.9.2"
2
+ VERSION = "0.9.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seb_elink
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Epigene