leshua_pay 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/leshua_pay/service.rb +9 -7
- data/lib/leshua_pay/sign.rb +2 -0
- data/lib/leshua_pay/version.rb +1 -1
- data/lib/leshua_pay.rb +2 -2
- data/spec/leshua_pay/utils_spec.rb +0 -1
- metadata +2 -3
- data/lib/leshua_pay/utils.rb +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23d3aca522ac9302b61e918e4d79cd3b422f912e
|
4
|
+
data.tar.gz: 87cbd70a820e27c70f39056e6ab6a80798dd7133
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cbb8dcedd8aa446f3aa9b223cccb72be7e5ff7ab8055fdcb3fa13af55a1899140ad5732f8952fbc48814cf46481d5168e6a5ed76c5ef3ac391ce6b76ec04e4c
|
7
|
+
data.tar.gz: 41279cf0475abfb80b65aa5661aab9eb74503d8cfbf94b951f47969da97c07838ba4c1dc7e060479a3b35e289805a5031f9f6a16bcf1696180a48c1e7ced74f9
|
data/lib/leshua_pay/service.rb
CHANGED
@@ -11,26 +11,27 @@ module LeshuaPay
|
|
11
11
|
def scan_code_pay opt
|
12
12
|
options = {
|
13
13
|
merchant_id: Config.mch_id,
|
14
|
-
nonce_str: SecureRandom.
|
14
|
+
nonce_str: SecureRandom.hex(16),
|
15
15
|
service: 'get_tdcode',
|
16
16
|
pay_way: 'WXZF',
|
17
17
|
appid: Config.app_id,
|
18
18
|
body: 'LeshuaPay',
|
19
|
-
jspay_flag:
|
19
|
+
jspay_flag: 3,
|
20
20
|
}
|
21
21
|
|
22
22
|
ext_opt = opt.slice(
|
23
|
-
:pay_way, :sub_openid, :third_order_id, :body, :client_ip, :amount, :notify_url,
|
23
|
+
:pay_way, :sub_openid, :jspay_flag, :third_order_id, :body, :client_ip, :amount, :notify_url,
|
24
24
|
:callback_url, :goods_tag, :limit_pay, :shop_no, :pos_no, :attach, :app_id)
|
25
25
|
|
26
26
|
options = options.merge ext_opt
|
27
|
+
|
27
28
|
http_post(Config::LEPOS_PAY_GATEWAY_URL, Sign.signature(options))
|
28
29
|
end
|
29
30
|
|
30
31
|
def barcode_pay opt
|
31
32
|
options = {
|
32
33
|
merchant_id: Config.mch_id,
|
33
|
-
nonce_str: SecureRandom.
|
34
|
+
nonce_str: SecureRandom.hex(16),
|
34
35
|
service: 'upload_authcode',
|
35
36
|
appid: Config.app_id,
|
36
37
|
body: 'LeshuaPay',
|
@@ -49,7 +50,7 @@ module LeshuaPay
|
|
49
50
|
merchant_id: Config.mch_id,
|
50
51
|
service: 'query_status',
|
51
52
|
third_order_id: order_id,
|
52
|
-
nonce_str: SecureRandom.
|
53
|
+
nonce_str: SecureRandom.hex(16),
|
53
54
|
}
|
54
55
|
|
55
56
|
http_post(Config::LEPOS_PAY_GATEWAY_URL, Sign.signature(options))
|
@@ -58,7 +59,7 @@ module LeshuaPay
|
|
58
59
|
def refund opt
|
59
60
|
options = {
|
60
61
|
merchant_id: Config.mch_id,
|
61
|
-
nonce_str: SecureRandom.
|
62
|
+
nonce_str: SecureRandom.hex(16),
|
62
63
|
service: 'unified_refund',
|
63
64
|
}
|
64
65
|
|
@@ -72,7 +73,7 @@ module LeshuaPay
|
|
72
73
|
def unified_query_refund opt
|
73
74
|
options = {
|
74
75
|
merchant_id: Config.mch_id,
|
75
|
-
nonce_str: SecureRandom.
|
76
|
+
nonce_str: SecureRandom.hex(16),
|
76
77
|
service: 'unified_query_refund',
|
77
78
|
}
|
78
79
|
|
@@ -86,6 +87,7 @@ module LeshuaPay
|
|
86
87
|
private
|
87
88
|
|
88
89
|
def http_post url, body
|
90
|
+
puts body
|
89
91
|
response = HTTParty.post(
|
90
92
|
url,
|
91
93
|
body: body,
|
data/lib/leshua_pay/sign.rb
CHANGED
data/lib/leshua_pay/version.rb
CHANGED
data/lib/leshua_pay.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
require "leshua_pay/version"
|
2
2
|
require "leshua_pay/sign"
|
3
|
-
require "leshua_pay/utils"
|
4
3
|
require "leshua_pay/service"
|
5
4
|
|
6
5
|
module LeshuaPay
|
7
6
|
|
8
7
|
class Config
|
9
8
|
|
10
|
-
API_HOST = '
|
9
|
+
# API_HOST = 'https://testpaygate.yeahka.s'
|
10
|
+
API_HOST = 'https://mobilepos.yeahka.com'
|
11
11
|
LEPOS_PAY_GATEWAY_URL = API_HOST + '/cgi-bin/lepos_pay_gateway.cgi'
|
12
12
|
|
13
13
|
class << self
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: leshua_pay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tony Tong
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -182,7 +182,6 @@ files:
|
|
182
182
|
- lib/leshua_pay.rb
|
183
183
|
- lib/leshua_pay/service.rb
|
184
184
|
- lib/leshua_pay/sign.rb
|
185
|
-
- lib/leshua_pay/utils.rb
|
186
185
|
- lib/leshua_pay/version.rb
|
187
186
|
- spec/leshua_pay/sign_spec.rb
|
188
187
|
- spec/leshua_pay/utils_spec.rb
|