new_alipay 0.2.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +2 -0
- data/lib/new_alipay/batch_trans.rb +6 -1
- data/lib/new_alipay/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: def41a10fcc4cb5ed4986c2d4896db9edf486135
|
4
|
+
data.tar.gz: 5cf4e211b26c5a8929f4c3d3f20b75544f124994
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c291cfa75b8eebc2465eee2a7364f0858b1000a97dba4a4b79bbb192a397213655d558bd42b63b63882e21ba425b507c719a779904ed2e6ed6001a44f23a117f
|
7
|
+
data.tar.gz: 109e2d2c9eb4cba8c7cc0f1febe58a557c4eb8a623018a27815913f63356ec73d665250b3cf16fcfcbed031b455816fa2ecfbb4b32c1cbf4aa9985d946cf755c
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -120,6 +120,7 @@ NewAlipay.account_name='xxxx公司/你的真实姓名'
|
|
120
120
|
####验证付款结果
|
121
121
|
|
122
122
|
```ruby
|
123
|
+
#params.except(*request.env.keys.push(:route_info))
|
123
124
|
request_result = NewAlipay::BatchTrans.verify_notify?({
|
124
125
|
_input_charset: 'utf-8',
|
125
126
|
batch_fee: 0.01,
|
@@ -129,6 +130,7 @@ request_result = NewAlipay::BatchTrans.verify_notify?({
|
|
129
130
|
sign: 'bc98542c95d33b08752qweq2a1ce162c8d',
|
130
131
|
detail_data: '201603316694019891235827213^152xxxxyyyy^xxxx^0.01^测试支付&email=yyyyxxx@qq.com¬ify_url=http://test.yourserver.com/',
|
131
132
|
pay_date: '2016-03-31',
|
133
|
+
notify_id: 'xxxxxxxx',
|
132
134
|
batch_num: 1,
|
133
135
|
service: 'batch_trans_notify',
|
134
136
|
sign_type: 'MD5'
|
@@ -73,10 +73,15 @@ module NewAlipay
|
|
73
73
|
#params.except(*request.env.keys.push(:route_info))
|
74
74
|
# @param post_params 除去系统变量的参数
|
75
75
|
def verify_notify?(post_params)
|
76
|
+
post_sign = post_params[:sign]
|
76
77
|
verifing_sign = Digest::MD5.hexdigest(post_params.reject { |p| [:sign, :sign_type].include?(p) }
|
77
78
|
.inject([]) { |memo, (key, v)| memo << "#{key}=#{v}"; memo }
|
78
79
|
.sort! { |m, n| m.to_s <=> n.to_s }.join('&')+NewAlipay.key)
|
79
|
-
|
80
|
+
|
81
|
+
puts "#{verifing_sign}:#{post_sign}"
|
82
|
+
unless verifing_sign == post_sign
|
83
|
+
return false
|
84
|
+
end
|
80
85
|
|
81
86
|
begin
|
82
87
|
conn = Faraday.new(:url => 'https://mapi.alipay.com') do |faraday|
|
data/lib/new_alipay/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: new_alipay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- saxer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|