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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2f3c2d68b5396bc0d6ab54b7364dfcd878e7c288395cf4f2a4a233b7dce703b3
4
- data.tar.gz: 6d89532568698dfea3deacdd20a90d57fa392ecbf247ea3975a9dc1779c266a0
3
+ metadata.gz: 3a9db99bb911b49ce82670c30d45d876b88ba800dc2c7c982c0426c92e9e4237
4
+ data.tar.gz: 37e69e2ae3d9c24e2aaa1f9fd6abc3b074194cef42dfb6df56c58953733d7a3e
5
5
  SHA512:
6
- metadata.gz: 8a4025bfd73566fc47e575bfa801cc21ea191be9ef1ad47f9b34dec458d4d99ee809681beb41e0694ff91ebaefccb6f4385cefecb383083df5c87e01c9f48818
7
- data.tar.gz: 292d06e8f6be34f1cc652ff01db8cc9dfb58ae2f7966a8e102a0335ced68e0fa917c2eda4e89186656e0ce4769dee9c064b3f21b503e60734b1b0262a8d4bcd3
6
+ metadata.gz: 8cccedd1d3d5e8d829af7bf6b63aa9d60abba33843a061bff090cf699b14c894e76d5deed7401d2f96b8706579455b1d02f125f0e466a38fcb97173f21378641
7
+ data.tar.gz: 536c723c8be4f7b9b241a04498fa3ce2aaf8198cfa10204a1059c456fa5f759b74492c5447333282d485c338061a872f5864d741e830e082414b7a076dbe04c4
@@ -7,7 +7,7 @@ require_relative 'acp_service'
7
7
  module UnionPei
8
8
  class Payment
9
9
  class << self
10
- def B2C
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
@@ -2,8 +2,8 @@
2
2
 
3
3
  module UnionPei
4
4
  class Version
5
- def self.to_string
6
- "0.0.2"
5
+ def self.to_str
6
+ "0.0.3"
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: 0.0.2
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-05 00:00:00.000000000 Z
11
+ date: 2021-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: iniparse