ralipay 1.0.1 → 1.0.2
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/README.md +4 -0
- data/lib/ralipay/version.rb +1 -1
- data/test/test_ralipay.rb +65 -64
- 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: 965a0498c340b30c9b1fe7891ac6a35bfa43e9de
|
|
4
|
+
data.tar.gz: d6765a3bd5178e67c396efdffb2184203b2acf92
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 046217e5c92278f6325ed249aa6e8ac9d4a67a1cf37971dc61a942a843252a170e9ef1c941a73d80b643e2f4eae7eddd106b7ef70c5c810df984646bf3a3b1dc
|
|
7
|
+
data.tar.gz: 5ed0805204ea44468b9dcafd4e964249dbc31cd50765a834f8daa28685bba8c162aa7e28b9e2a9c861d800aab7583c4dea907a26c1422ae6229615855ad6da92
|
data/README.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Ralipay
|
|
2
2
|
|
|
3
|
+
[](http://badge.fury.io/rb/ralipay)
|
|
4
|
+
|
|
5
|
+
[](https://travis-ci.org/RaymondChou/ralipay)
|
|
6
|
+
|
|
3
7
|
A ruby Gem for Alipay, contains web payment and mobile client payment
|
|
4
8
|
|
|
5
9
|
- HomePage [http://ledbk.com/ralipay/](http://ledbk.com/ralipay/)
|
data/lib/ralipay/version.rb
CHANGED
data/test/test_ralipay.rb
CHANGED
|
@@ -1,74 +1,75 @@
|
|
|
1
|
+
# coding: utf-8
|
|
1
2
|
require 'test/unit'
|
|
2
3
|
require 'ralipay'
|
|
3
4
|
|
|
4
5
|
class TestRalipay < Test::Unit::TestCase
|
|
5
6
|
|
|
6
|
-
def test_generate_wap_pay_url
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
end
|
|
7
|
+
#def test_generate_wap_pay_url
|
|
8
|
+
# configs = {
|
|
9
|
+
# :partner => '2088701817081672',
|
|
10
|
+
# :seller_email => 'service@iiseeuu.com',
|
|
11
|
+
# :rsa_private_key_path => '/Users/ZhouYT/Desktop/rsa_private_key.pem',
|
|
12
|
+
# :rsa_public_key_path => '/Users/ZhouYT/Desktop/alipay_public_key.pem',
|
|
13
|
+
# :subject => '测试商品',
|
|
14
|
+
# :out_trade_no => '1222222233',
|
|
15
|
+
# :total_fee => '0.01',
|
|
16
|
+
# :notify_url => 'http://180.110.74.118/post.php',
|
|
17
|
+
# :merchant_url => 'http://www.iiseeuu.com',
|
|
18
|
+
# :call_back_url => 'http://www.iiseeuu.com'
|
|
19
|
+
# }
|
|
20
|
+
# assert_equal "需要手动访问url进行测试",
|
|
21
|
+
# Ralipay::WapPayment.new(configs).generate_pay_url
|
|
22
|
+
#end
|
|
22
23
|
|
|
23
|
-
def test_callback_verify
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
end
|
|
24
|
+
#def test_callback_verify
|
|
25
|
+
# configs = {
|
|
26
|
+
# :partner => '2088701817081672',
|
|
27
|
+
# :seller_email => 'service@iiseeuu.com',
|
|
28
|
+
# :rsa_private_key_path => '/Users/ZhouYT/Desktop/rsa_private_key.pem',
|
|
29
|
+
# :rsa_public_key_path => '/Users/ZhouYT/Desktop/alipay_public_key.pem',
|
|
30
|
+
# :subject => '测试商品',
|
|
31
|
+
# :out_trade_no => '1222222232',
|
|
32
|
+
# :total_fee => '1',
|
|
33
|
+
# :notify_url => 'http://180.110.74.118/post.php',
|
|
34
|
+
# :merchant_url => 'http://www.iiseeuu.com',
|
|
35
|
+
# :call_back_url => 'http://www.iiseeuu.com'
|
|
36
|
+
# }
|
|
37
|
+
# #'out_trade_no=1222222232&request_token=requestToken&result=success&trade_no=2013032325639837&sign=cANAWkI1dgF1WeyRpp%2F0xzfKXXo50JxRyUxcDh6z%2BZbps1YFiWYRTSUmdCx7HT%2BjAG79ebMWEVIf2HmdIYEIzQDJwu2nl0fElqRgcm9%2BT%2B5b75DbtUg9COla1tr34NLpOcM0P0lcq6byNM0wFbdycUIIoH5Z6JKu66B1YuQLNag%3D&sign_type=0001'
|
|
38
|
+
# gets = {
|
|
39
|
+
# :out_trade_no => '1222222232',
|
|
40
|
+
# :request_token => 'requestToken',
|
|
41
|
+
# :result => 'success',
|
|
42
|
+
# :trade_no => '2013032325639837',
|
|
43
|
+
# :sign => 'cANAWkI1dgF1WeyRpp%2F0xzfKXXo50JxRyUxcDh6z%2BZbps1YFiWYRTSUmdCx7HT%2BjAG79ebMWEVIf2HmdIYEIzQDJwu2nl0fElqRgcm9%2BT%2B5b75DbtUg9COla1tr34NLpOcM0P0lcq6byNM0wFbdycUIIoH5Z6JKu66B1YuQLNag%3D',
|
|
44
|
+
# :sign_type => '0001'
|
|
45
|
+
# }
|
|
46
|
+
# assert_equal true,
|
|
47
|
+
# Ralipay::WapPayment.new(configs).callback_verify?(gets)
|
|
48
|
+
#end
|
|
48
49
|
|
|
49
|
-
def test_notify_verify
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
end
|
|
50
|
+
#def test_notify_verify
|
|
51
|
+
# configs = {
|
|
52
|
+
# :partner => '2088701817081672',
|
|
53
|
+
# :seller_email => 'service@iiseeuu.com',
|
|
54
|
+
# :rsa_private_key_path => '/Users/ZhouYT/Desktop/rsa_private_key.pem',
|
|
55
|
+
# :rsa_public_key_path => '/Users/ZhouYT/Desktop/alipay_public_key.pem',
|
|
56
|
+
# :subject => '测试商品',
|
|
57
|
+
# :out_trade_no => '1222222233',
|
|
58
|
+
# :total_fee => '1',
|
|
59
|
+
# :notify_url => 'http://180.110.74.118/post.php',
|
|
60
|
+
# :merchant_url => 'http://www.iiseeuu.com',
|
|
61
|
+
# :call_back_url => 'http://www.iiseeuu.com'
|
|
62
|
+
# }
|
|
63
|
+
# posts = {
|
|
64
|
+
# :service => 'alipay.wap.trade.create.direct',
|
|
65
|
+
# :sign => 'pCEWVfxBWqvpndkXmCPbd70Tqfo7IG3tP68WmH4wWuUDylb6Rv2RzOghs7m+ANtAx+NyCIuE4KpoonS4qZrc16Qh7/bnwZL2C4FHQJ903HrV0c4n/Pdko0owksnb9VYUGMEppVEBvYPap0bP1GZsbCtI1iuXb2cI1h4vlKJjdGw=',
|
|
66
|
+
# :sec_id => '0001',
|
|
67
|
+
# :v => '1.0',
|
|
68
|
+
# :notify_data => 'Ych9Cg/zaLHsqaBePwoFtxAE7vX0ZvslWCLFTP1AdsxQgvrEcwflAFdbhIHgqsy8AZdRGp7rNeP1Bpn9v+feNlHD96RQit4p1/JHTAOfdoNmQsRaDvBNH9xUlCANXC4zTFDxCZEJN79ppSAzhOu1iMAdUOzim+ZAacxpkMfM4c+YSkpXrEK7kt3Lw4FpkJwwkRAUlYNtrlva94Qo6RZDmo4UpDlUyS1GkqIOih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zYUPVK8xKxO4WW/7T00rZ8B1YjnUaBdWKGdmWmv0itnLx6rK8NWBw=='
|
|
69
|
+
# }
|
|
70
|
+
# assert_equal true,
|
|
71
|
+
# Ralipay::WapPayment.new(configs).notify_verify?(posts)
|
|
72
|
+
#end
|
|
72
73
|
|
|
73
74
|
def test_para_filter
|
|
74
75
|
input_para = {:a => 'abc', :sign_type => 'abc', :c => '', :d => nil}
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ralipay
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- RaymondChou
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2013-
|
|
11
|
+
date: 2013-04-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|