unionpei 0.0.2 → 0.0.3
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/unionpei/payment.rb +40 -1
- data/lib/unionpei/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a9db99bb911b49ce82670c30d45d876b88ba800dc2c7c982c0426c92e9e4237
|
4
|
+
data.tar.gz: 37e69e2ae3d9c24e2aaa1f9fd6abc3b074194cef42dfb6df56c58953733d7a3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cccedd1d3d5e8d829af7bf6b63aa9d60abba33843a061bff090cf699b14c894e76d5deed7401d2f96b8706579455b1d02f125f0e466a38fcb97173f21378641
|
7
|
+
data.tar.gz: 536c723c8be4f7b9b241a04498fa3ce2aaf8198cfa10204a1059c456fa5f759b74492c5447333282d485c338061a872f5864d741e830e082414b7a076dbe04c4
|
data/lib/unionpei/payment.rb
CHANGED
@@ -7,7 +7,7 @@ require_relative 'acp_service'
|
|
7
7
|
module UnionPei
|
8
8
|
class Payment
|
9
9
|
class << self
|
10
|
-
def
|
10
|
+
def b2c
|
11
11
|
req = {}
|
12
12
|
|
13
13
|
req["version"] = UnionPei::SDKConfig.instance.version
|
@@ -37,6 +37,45 @@ module UnionPei
|
|
37
37
|
resp = UnionPei::AcpService.createAutoFormHtml(req, url)
|
38
38
|
resp
|
39
39
|
end
|
40
|
+
|
41
|
+
def b2b
|
42
|
+
req = {}
|
43
|
+
|
44
|
+
req["version"] = Com::UnionPay::Acp::Sdk::SDKConfig.instance.version
|
45
|
+
req["encoding"] = Com::UnionPay::Acp::Sdk::SDKConfig.instance.encoding
|
46
|
+
req["signMethod"] = Com::UnionPay::Acp::Sdk::SDKConfig.instance.signMethod
|
47
|
+
|
48
|
+
req["frontUrl"] = Com::UnionPay::Acp::Sdk::SDKConfig.instance.frontUrl
|
49
|
+
req["backUrl"] = Com::UnionPay::Acp::Sdk::SDKConfig.instance.backUrl
|
50
|
+
|
51
|
+
req["txnType"] = "01"
|
52
|
+
req["txnSubType"] = "01"
|
53
|
+
req["bizType"] = "000202" # 000201 是b2c / 000202 是 b2b
|
54
|
+
req["channelType"] = "07"
|
55
|
+
req["currencyCode"] = "156"
|
56
|
+
req["txnAmt"] = "881000"
|
57
|
+
|
58
|
+
req["merId"] = "777290058189920"
|
59
|
+
req["orderId"] = DateTime.parse(Time.now.to_s).strftime("%Y%m%d%H%M%S").to_s
|
60
|
+
req["txnTime"] = DateTime.parse(Time.now.to_s).strftime("%Y%m%d%H%M%S").to_s
|
61
|
+
req["accessType"] = "0"
|
62
|
+
|
63
|
+
|
64
|
+
req["payTimeout"] = DateTime.parse((Time.now + 15 * 60 * 1000).to_s).strftime("%Y%m%d%H%M%S").to_s
|
65
|
+
req["bizScene"] = "110001"
|
66
|
+
req["payeeAcctNm"] = "xx商户"
|
67
|
+
req["payeeAcctNo"] = "12345678"
|
68
|
+
req["payeeBankName"] = "xx行"
|
69
|
+
|
70
|
+
|
71
|
+
#签名示例
|
72
|
+
Com::UnionPay::Acp::Sdk::AcpService.sign(req)
|
73
|
+
url = Com::UnionPay::Acp::Sdk::SDKConfig.instance.frontTransUrl
|
74
|
+
|
75
|
+
#前台自提交表单示例
|
76
|
+
resp = Com::UnionPay::Acp::Sdk::AcpService.createAutoFormHtml(req, url)
|
77
|
+
resp
|
78
|
+
end
|
40
79
|
end
|
41
80
|
end
|
42
81
|
end
|
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: 0.0.
|
4
|
+
version: 0.0.3
|
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-
|
11
|
+
date: 2021-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: iniparse
|