csob_payment_gateway 0.0.11 → 0.0.12

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: 8c4d632343a5a4d47e4e6145886ff34c72ebd937
4
- data.tar.gz: 9afbe5a2a0a1fe1d1ee6d07af98225757db6a4d8
3
+ metadata.gz: 904760c4db4d6721e3c375761baa7b9b4cb65aa5
4
+ data.tar.gz: b79de16d857d69d62772a2bda6f712fc90a7a375
5
5
  SHA512:
6
- metadata.gz: 7809e837f420eb921f6efdc5761a354b30a1fd2f94cd50f229362cfb10eed8c8504812af2bc68023a6fbb52ffc04dfb8d07ed1158714ebeabbb49b3659b316db
7
- data.tar.gz: 13f0cb1198eeab7a7ca5a522a2d8cc4394c853ccc6b72187737fda49fa54f50798f40b5c80ddb4dae23afb362d7ecf9cb0be676666a7d5097b470b5f8dfb80b4
6
+ metadata.gz: 96b277b460e36126a164857a0c83b03a00cebb544bd62bb02614decc2c9408bb43029eb65dc051f0d52a9ebf21b25de100772f42849dcfd6cb9e85126acc7e94
7
+ data.tar.gz: bc5b10820bdee8a62ed82e760ad6f5072fb7d91375849d0de88a81b948fc504646b9a82a747b7ef576e145d761ac81ec189018c4e92eece9753aae0ab37c8c2b
@@ -20,7 +20,7 @@ module CsobPaymentGateway
20
20
  @timestamp = Time.now.strftime("%Y%m%d%H%M%S")
21
21
  end
22
22
 
23
- attr_reader :merchant_id, :public_key, :gateway_url, :cart_items, :currency, :order_id, :total_price, :customer_id, :timestamp, :default_currency, :close_payment, :return_url, :description, :keys_directory, :logger
23
+ attr_reader :merchant_id, :public_key, :gateway_url, :cart_items, :currency, :order_id, :total_price, :customer_id, :timestamp, :default_currency, :close_payment, :return_url, :description, :keys_directory, :logger, :pay_id
24
24
 
25
25
  attr_accessor :response
26
26
 
@@ -39,7 +39,7 @@ module CsobPaymentGateway
39
39
  def payment_status
40
40
  api_status_url = CsobPaymentGateway.configuration.urls["status"]
41
41
 
42
- response = RestClient.get gateway_url + api_status_url + get_data
42
+ response = RestClient.get gateway_url + api_status_url + get_data(false)
43
43
  self.response = JSON.parse(response)
44
44
  end
45
45
 
@@ -81,15 +81,16 @@ module CsobPaymentGateway
81
81
  CsobPaymentGateway::Crypt.verify(text, response["signature"])
82
82
  end
83
83
 
84
- def get_data
84
+ def get_data(use_response: true)
85
+ data_pay_id = (use_response ? response["payId"] : pay_id)
85
86
  text = [
86
87
  merchant_id,
87
- response["payId"],
88
+ data_pay_id,
88
89
  timestamp
89
90
  ].map { |param| param.is_a?(Hash) ? "" : param.to_s }.join("|")
90
91
 
91
92
  signature = CsobPaymentGateway::Crypt.sign(text, "GET")
92
- "#{merchant_id}/#{response["payId"]}/#{timestamp}/#{CGI.escape(signature)}"
93
+ "#{merchant_id}/#{data_pay_id}/#{timestamp}/#{CGI.escape(signature)}"
93
94
  end
94
95
 
95
96
  def put_data
@@ -1,3 +1,3 @@
1
1
  module CsobPaymentGateway
2
- VERSION = "0.0.11"
2
+ VERSION = "0.0.12"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csob_payment_gateway
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jiří Kratochvíl