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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 90c090f0b694b2ed3af227bf9a44bfbebbbfc3f6
4
- data.tar.gz: 20b8e78fc95d33f3c869b2eb35788483abc6f7ad
3
+ metadata.gz: def41a10fcc4cb5ed4986c2d4896db9edf486135
4
+ data.tar.gz: 5cf4e211b26c5a8929f4c3d3f20b75544f124994
5
5
  SHA512:
6
- metadata.gz: 527613c7693bae0eec616e826e18da37d8d07f29dbed52f8a6111493bf78853fe929e783898fdb13b9ea45649fedc63167de69edb3f6ac228c56874dae7bd268
7
- data.tar.gz: f3ee623d64ae6b77e1b56e793b2304d3ee53b1de393aaf4b9077124ef5a90364abd6e56d8e10eac7ae0c31b140c856327548380c6f1e2f90f23109039cdb27a9
6
+ metadata.gz: c291cfa75b8eebc2465eee2a7364f0858b1000a97dba4a4b79bbb192a397213655d558bd42b63b63882e21ba425b507c719a779904ed2e6ed6001a44f23a117f
7
+ data.tar.gz: 109e2d2c9eb4cba8c7cc0f1febe58a557c4eb8a623018a27815913f63356ec73d665250b3cf16fcfcbed031b455816fa2ecfbb4b32c1cbf4aa9985d946cf755c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- new_alipay (0.1.9)
4
+ new_alipay (0.2.1)
5
5
 
6
6
  GEM
7
7
  remote: https://ruby.taobao.org/
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&notify_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
- verifing_sign == post_params[:sign]
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|
@@ -1,3 +1,3 @@
1
1
  module NewAlipay
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.2"
3
3
  end
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.0
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-27 00:00:00.000000000 Z
11
+ date: 2016-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler