allpay_client 1.0.7 → 1.0.8

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: 2fd48bf288b33e01c907f7fd39c305abdbb990e1
4
- data.tar.gz: 4247c6bd4dafaade49a1b801a1f2440997a26671
3
+ metadata.gz: cd1a1d782727b210d77774b7cedfcfaa3d6cb61b
4
+ data.tar.gz: 1dc0641c7e885b3e1b9a48fa42395224aef2780c
5
5
  SHA512:
6
- metadata.gz: 6a1b7bb7810fd387e379be8e4dc67862fef6fc13ffb7fd29babfa337c354f2b00476c1ffa27a623cd77eec025eb88fceb7f4d2f544e8e1b2eab0026d7d27cea0
7
- data.tar.gz: cbe7c2c5aacc89da4da69c497999f7b4df9c2104dee453d9e36d3454a7130cb9dd17a865b09a8601e9fbeaa501a803dda5da89994362bb70d3777f01638ef2f7
6
+ metadata.gz: 2f115369dffbcb05af65300c5e207a00017236a56f4a7507e86c15ffb64b82fa85072d8547c421a8a680caf04ed6150c252e5ad5dbec355d7fb5eb5cabdd3851
7
+ data.tar.gz: 518e237520a6e7ac98614bdc565f14435ffe72ca37f4d2d42f5cfe6fdc461d1ca7c1b2504e67c2ad036027f043332c71ecf335f36a4f7b39f1d96f01337208ed
data/lib/allpay/client.rb CHANGED
@@ -32,7 +32,7 @@ module Allpay
32
32
  end
33
33
 
34
34
  def verify_mac params = {}
35
- check_mac_value = params[:CheckMacValue]
35
+ check_mac_value = params[:CheckMacValue] || params['CheckMacValue']
36
36
  make_mac(params.reject{ |k,v| [:CheckMacValue, 'CheckMacValue'].include? k }) == check_mac_value
37
37
  end
38
38
 
@@ -1,3 +1,3 @@
1
1
  module Allpay
2
- VERSION = "1.0.7"
2
+ VERSION = "1.0.8"
3
3
  end
data/spec/allpay_spec.rb CHANGED
@@ -70,4 +70,20 @@ describe Allpay::Client do
70
70
  MerchantTradeNo: '355313'
71
71
  expect(result).to eq true
72
72
  end
73
+
74
+ it '#verify_mac with string hash' do
75
+ result = @client.verify_mac 'RtnCode' => '1',
76
+ 'PaymentType' => 'Credit_CreditCard',
77
+ 'TradeAmt' => '700',
78
+ 'PaymentTypeChargeFee' => '14',
79
+ 'PaymentDate' => '2015/02/07 14:21:00',
80
+ 'SimulatePaid' => '0',
81
+ 'CheckMacValue' => '3AF270CCCFA58CA0349F4FD462E21643',
82
+ 'TradeDate' => '2015/02/07 14:20:47',
83
+ 'MerchantID' => '2000132',
84
+ 'TradeNo' => '1502071420478656',
85
+ 'RtnMsg' => '交易成功',
86
+ 'MerchantTradeNo' => '355313'
87
+ expect(result).to eq true
88
+ end
73
89
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: allpay_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jian Weihang