suning_pay 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/suning_pay/service.rb +1 -1
- data/lib/suning_pay/util.rb +6 -4
- data/lib/suning_pay/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d08ccdbeacfd4700b58052e65b068d863cb350f
|
4
|
+
data.tar.gz: 93fb05887b89199efffd6919da1d768b9c036112
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81ed60599580d3668002883a7d756c6e53c5cda96b323614a6f4cdbcde1d921d3bd49f8ecc215e34ef35c37d8abfdeae9960e7a404d3023a3b41eaa0a9976916
|
7
|
+
data.tar.gz: 984db1e1039a57ca8c41befbd659669fc3c91e76e09449227f79b4b070f798ef65fbcf8ff7813efe5d93a5ebd98e9115822d90c229249b710e840dd3a0c04f96
|
data/lib/suning_pay/service.rb
CHANGED
@@ -71,7 +71,7 @@ module SuningPay
|
|
71
71
|
:goodsType => goods_type,
|
72
72
|
:goodsName => Base64.urlsafe_encode64(goods_name),
|
73
73
|
:payTimeout => pay_timeout,
|
74
|
-
:remark => remark,
|
74
|
+
:remark => Base64.urlsafe_encode64(remark),
|
75
75
|
:tunnelData => Base64.urlsafe_encode64(tunnel_data)}
|
76
76
|
|
77
77
|
post_params = SuningPay.client_options.merge(options).merge(input_hash)
|
data/lib/suning_pay/util.rb
CHANGED
@@ -58,17 +58,19 @@ module SuningPay
|
|
58
58
|
summary = get_summary(func_params_hash)
|
59
59
|
#加签名的查询参数
|
60
60
|
func_params = signature_param(func_params_hash, summary)
|
61
|
+
conn = Faraday.new(:url => api_url)
|
62
|
+
|
63
|
+
response = conn.post '', func_params
|
64
|
+
html_response = response.body
|
65
|
+
|
61
66
|
if SuningPay.debug_mode
|
62
67
|
logger = Logger.new('suning_pay.log')
|
63
68
|
logger.info('--------------SUNING PAY DEBUG--------------')
|
64
69
|
logger.info("URL:#{api_url.to_s}")
|
65
70
|
logger.info("PARAMS:#{func_params.to_s}")
|
71
|
+
logger.info("RESPONSE:#{html_response.to_s}")
|
66
72
|
end
|
67
73
|
|
68
|
-
conn = Faraday.new(:url => api_url)
|
69
|
-
|
70
|
-
response = conn.post '', func_params
|
71
|
-
html_response = response.body
|
72
74
|
begin
|
73
75
|
msg = JSON.parse(html_response)
|
74
76
|
rescue JSON::ParserError => e
|
data/lib/suning_pay/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: suning_pay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Terry.Tu
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|