unionpei 1.0.0 → 1.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 873151ea6fe19398b75fb59859966a9b24cff017f2b993a6cdee337275b24553
4
- data.tar.gz: 988869dfbec8acb49da6fa1497aa0907e68a4beea06aded21f85c379ffba7263
3
+ metadata.gz: 98b28f654f4ca48e64be757fc3d5fd74f523acd18388affdfcaca5f1125fcd31
4
+ data.tar.gz: 53d6ed97a4de7a451024c31ef9737f0e9eeb8d83fbf4898b22964d7288325b43
5
5
  SHA512:
6
- metadata.gz: 8bd6c723b2e5bba4745f4daade5d185128bc8a53d8958b0e9e37caf8aad27b5834bc6af347b74f53362f57a41a47d2c5c7907daabd7abb6e156436495b55d86d
7
- data.tar.gz: 769762c3bcffd2b3e8bb9839c9183f7cf98f2129bfd28995777c32a23bf31e044f999e5da80a9e3f69052eabfbbfdb55c12cda6b0829bfc91ba0db2c7e925f45
6
+ metadata.gz: c170604ec476c96c0fbf3ec661ac1fedb2bc57a9952b3f8e8a6092aefe7e55bfc01f9e86fe7fd7eac88a0bc0df6a43ebee279cb97ebfcaa40dd2ef4e23aac2e8
7
+ data.tar.gz: 822b695d4549dbdcdb4b39a989f04ae842012684ea01b4ea69a85526be564286c7933edff124963e054b5389d2465e0a34a07a70d894add087186e631edeb558
@@ -17,7 +17,6 @@ module UnionPei
17
17
 
18
18
  def LogUtil.getLogger
19
19
  if !@@logger
20
- puts "init LogUtil"
21
20
  if SDKConfig.instance.logFilePath.nil?
22
21
  @@logger = Logger.new(STDOUT)
23
22
  else
@@ -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
@@ -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"]
@@ -3,7 +3,7 @@
3
3
  module UnionPei
4
4
  class Version
5
5
  def self.to_str
6
- "0.0.5"
6
+ "1.1.0"
7
7
  end
8
8
  end
9
9
  end
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.0.0
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: 2021-05-12 00:00:00.000000000 Z
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.1.4
61
+ rubygems_version: 3.3.5
62
62
  signing_key:
63
63
  specification_version: 4
64
64
  summary: An unofficial unionpay gem