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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 904760c4db4d6721e3c375761baa7b9b4cb65aa5
|
4
|
+
data.tar.gz: b79de16d857d69d62772a2bda6f712fc90a7a375
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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}/#{
|
93
|
+
"#{merchant_id}/#{data_pay_id}/#{timestamp}/#{CGI.escape(signature)}"
|
93
94
|
end
|
94
95
|
|
95
96
|
def put_data
|