allpay_client 1.0.7 → 1.0.8
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 +4 -4
- data/lib/allpay/client.rb +1 -1
- data/lib/allpay/version.rb +1 -1
- data/spec/allpay_spec.rb +16 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd1a1d782727b210d77774b7cedfcfaa3d6cb61b
|
4
|
+
data.tar.gz: 1dc0641c7e885b3e1b9a48fa42395224aef2780c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
data/lib/allpay/version.rb
CHANGED
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
|