borika 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,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f3fffdd4f3bc9982e01e466a9bca8bdc7309b1ec9861593380856bcdd0d3b1b
4
- data.tar.gz: b2bd83c95c526d6bf0ff65f133c35adcb5ddacabc3318d69297a3d682f342b83
3
+ metadata.gz: c26bb66055c33a874e9c233bbecb30fdfa88f0c850776320ebe0d94ad7bd3a05
4
+ data.tar.gz: 4a6fa3128dbc45e9af9b2f90d72adcb3c705628af21240063239c945cc7c1fad
5
5
  SHA512:
6
- metadata.gz: 66651bb71ccf5563681262fd4cdce83d8e210cb64b7b72140aa8ff27e3714a76ce8b2bb5af9ba33fa55f1e1d956628ed6164468d8a9a6aaf7ac5f75666a4be63
7
- data.tar.gz: fdd9aec221c0ca405e11352678ce088d4a9d5aa1308dacfa92213b750afe4539ca6e4f7e1a6d3e515d633f11884d7a39645aae65c29648440d65570244342e32
6
+ metadata.gz: 6918055e7dd5b5932db6172eef4a220c301065c9e7006cf7171e154a58429de5a78e262dd1034ee5ef7ce6f92fdceaa34c51a5f8c9a21fd8e1d998e4677c886f
7
+ data.tar.gz: 8e12a0d6b8b090423c82e9f06dd32aadc37e1c872e0c017b78cfcf9c5a91bb957a930ca02f49241b9a08df87bcd9002350bc5e1b0b17fb065519af38e838686b
data/README.md CHANGED
@@ -24,6 +24,7 @@ Here is a possible configuration for development `config/environments/developmen
24
24
  Borika.configure do |config|
25
25
  config.private_key = File.binread "testPrivateKey.key"
26
26
  config.private_key_password = "Password"
27
+ config.public_key = File.binread "testPublicKey.cer"
27
28
  config.borika_terminal_id = "11111111" # Borika KEY
28
29
  config.borika_url = "https://gatet.borica.bg/boreps/"
29
30
  config.request_type = "registerTransaction"
@@ -53,7 +54,7 @@ Borika::Request.new(order_id, amount, order_summary: "Order #{order_id}",
53
54
 
54
55
  Lets parse the response comes from callback, in your controller:
55
56
  ```ruby
56
- Borika::Response.new(params[:eBorica]) # returns hash
57
+ Borika::Response.new(params[:eBorica]).hash # returns hash
57
58
  ```
58
59
 
59
60
  ### Testing
@@ -13,9 +13,10 @@ module Borika
13
13
  end
14
14
  data = str.byteslice(0,56)
15
15
  sign = str.byteslice(56,128)
16
- pkeyid = OpenSSL::PKey::RSA.new(Borika.config.private_key, Borika.config.private_key_password)
16
+ cert = OpenSSL::X509::Certificate.new(Borika.config.public_key)
17
+ pkeyid = cert.public_key
17
18
  unless pkeyid.verify(OpenSSL::Digest::SHA1.new, sign, data)
18
- # raise InvalidSignatureError.new "Borica Response RSA SHA1 Sign Verification failed"
19
+ raise InvalidSignatureError.new "Borica Response RSA SHA1 Sign Verification failed"
19
20
  end
20
21
  # get data
21
22
  @hash = {
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Borika
4
- VERSION = "0.2.3"
4
+ VERSION = "0.2.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: borika
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
  - Mehmet Aydoğdu