unionpei 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/unionpei/log_util.rb +0 -1
- data/lib/unionpei/payment.rb +22 -0
- data/lib/unionpei/sdk_config.rb +0 -1
- data/lib/unionpei/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98b28f654f4ca48e64be757fc3d5fd74f523acd18388affdfcaca5f1125fcd31
|
4
|
+
data.tar.gz: 53d6ed97a4de7a451024c31ef9737f0e9eeb8d83fbf4898b22964d7288325b43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c170604ec476c96c0fbf3ec661ac1fedb2bc57a9952b3f8e8a6092aefe7e55bfc01f9e86fe7fd7eac88a0bc0df6a43ebee279cb97ebfcaa40dd2ef4e23aac2e8
|
7
|
+
data.tar.gz: 822b695d4549dbdcdb4b39a989f04ae842012684ea01b4ea69a85526be564286c7933edff124963e054b5389d2465e0a34a07a70d894add087186e631edeb558
|
data/lib/unionpei/log_util.rb
CHANGED
data/lib/unionpei/payment.rb
CHANGED
@@ -61,6 +61,28 @@ module UnionPei
|
|
61
61
|
url = UnionPei::SDKConfig.instance.frontTransUrl
|
62
62
|
UnionPei::AcpService.createAutoFormHtml(req, url)
|
63
63
|
end
|
64
|
+
|
65
|
+
@@default_trans_req = {
|
66
|
+
"version"=>UnionPei::SDKConfig.instance.version,
|
67
|
+
"encoding"=>UnionPei::SDKConfig.instance.encoding,
|
68
|
+
"bizType"=>"000000",
|
69
|
+
"txnTime"=>DateTime.parse(Time.now.to_s).strftime("%Y%m%d%H%M%S").to_s,
|
70
|
+
"txnType"=>"00",
|
71
|
+
"txnSubType"=>"00",
|
72
|
+
"accessType"=>"0",
|
73
|
+
"signMethod"=>UnionPei::SDKConfig.instance.signMethod,
|
74
|
+
"merId"=>"777290058189920",
|
75
|
+
"orderId"=>DateTime.parse(Time.now.to_s).strftime("%Y%m%d%H%M%S").to_s,
|
76
|
+
}
|
77
|
+
|
78
|
+
# query single transaction info
|
79
|
+
# doc https://open.unionpay.com/tjweb/acproduct/APIList?acpAPIId=757&apiservId=448&version=V2.2&bussType=0
|
80
|
+
def query_trans(req=@@default_trans_req)
|
81
|
+
req = @@default_trans_req.merge(req)
|
82
|
+
UnionPei::AcpService.sign(req)
|
83
|
+
url = UnionPei::SDKConfig.instance.singleQueryUrl
|
84
|
+
UnionPei::AcpService.post(req, url)
|
85
|
+
end
|
64
86
|
end
|
65
87
|
end
|
66
88
|
end
|
data/lib/unionpei/sdk_config.rb
CHANGED
@@ -17,7 +17,6 @@ module UnionPei
|
|
17
17
|
|
18
18
|
path = File.dirname(__FILE__)
|
19
19
|
ini = IniParse.parse(File.read("#{path}/acp_sdk.ini").force_encoding("UTF-8"))
|
20
|
-
puts 'load config: ' + "#{path}/acp_sdk.ini"
|
21
20
|
|
22
21
|
@frontTransUrl = ini["acpsdk"]["acpsdk.frontTransUrl"]
|
23
22
|
@singleQueryUrl = ini["acpsdk"]["acpsdk.singleQueryUrl"]
|
data/lib/unionpei/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unionpei
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shuang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: iniparse
|
@@ -58,7 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
58
58
|
- !ruby/object:Gem::Version
|
59
59
|
version: '0'
|
60
60
|
requirements: []
|
61
|
-
rubygems_version: 3.
|
61
|
+
rubygems_version: 3.3.5
|
62
62
|
signing_key:
|
63
63
|
specification_version: 4
|
64
64
|
summary: An unofficial unionpay gem
|