wechat-pay-next 1.1.0 → 1.2.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 +4 -4
- data/README.md +5 -2
- data/Rakefile +1 -1
- data/lib/{wechat-pay → wechat-pay-next}/direct.rb +8 -8
- data/lib/{wechat-pay → wechat-pay-next}/ecommerce/applyment.rb +9 -9
- data/lib/{wechat-pay → wechat-pay-next}/ecommerce/balance.rb +1 -1
- data/lib/{wechat-pay → wechat-pay-next}/ecommerce/bill.rb +1 -1
- data/lib/{wechat-pay → wechat-pay-next}/ecommerce/combine_order.rb +4 -4
- data/lib/{wechat-pay → wechat-pay-next}/ecommerce/order.rb +5 -5
- data/lib/{wechat-pay → wechat-pay-next}/ecommerce/profitsharing.rb +5 -5
- data/lib/{wechat-pay → wechat-pay-next}/ecommerce/refund.rb +3 -3
- data/lib/{wechat-pay → wechat-pay-next}/ecommerce/subsidies.rb +1 -1
- data/lib/{wechat-pay → wechat-pay-next}/ecommerce/withdraw.rb +1 -1
- data/lib/{wechat-pay → wechat-pay-next}/ecommerce.rb +11 -11
- data/lib/{wechat-pay → wechat-pay-next}/helper.rb +1 -1
- data/lib/{wechat-pay → wechat-pay-next}/sign.rb +8 -8
- data/lib/wechat-pay-next/version.rb +5 -0
- data/lib/{wechat-pay.rb → wechat-pay-next.rb} +6 -6
- data/wechat-pay.gemspec +3 -3
- metadata +17 -17
- data/lib/wechat-pay/version.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0588c0203d0f2cad4e657a299fd1f931469f1caf13c3e1fded32e9eecdd56f4d'
|
4
|
+
data.tar.gz: b6ce3b7ad3694000fd2268c564199eb66654eb941e28714d57cc550ff456494c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04ca76a47b99c1efbbfcf17834c29e9937973e76bc65d3f5c5a6da8d440ec6deda343b9f311f3d5f81f8d4050123781750ef5e00116125ccfb3054f7123a558b
|
7
|
+
data.tar.gz: cdff4a6a287035aed6d8d02a584cb258c168f60f19d84d455e94528337f18e52b2037edab00137e5d8ce5a878c64eac0acfb697bec578ea12852bfb1bc24307a
|
data/README.md
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
# Wechat Pay
|
2
2
|
|
3
|
+
就是wechat-pay,我为了支持rails 7临时fork了一个wechat-pay-next...
|
4
|
+
|
5
|
+
|
3
6
|
A simple Wechat pay ruby gem, without unnecessary magic or wrapper. Just a simple wrapper for api V3. Refer to [wx_pay](https://github.com/jasl/wx_pay)
|
4
7
|
|
5
8
|
Please read official document first: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/pages/index.shtml
|
6
9
|
|
7
|
-
If you want check the present public api, you can find them in the [Document](https://www.rubydoc.info/github/lanzhiheng/wechat-pay/master/index)。
|
10
|
+
If you want check the present public api, you can find them in the [Document](https://www.rubydoc.info/github/lanzhiheng/wechat-pay-next/master/index)。
|
8
11
|
|
9
12
|
Summary:
|
10
13
|
|
@@ -14,7 +17,7 @@ Summary:
|
|
14
17
|
- 服务商: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/index.shtml
|
15
18
|
- 电商平台(电商收付通): https://pay.weixin.qq.com/wiki/doc/apiv3_partner/open/pay/chapter3_3_3.shtml
|
16
19
|
|
17
|
-
If you find any issue in this repo, don't shy to create issues https://github.com/lanzhiheng/wechat-pay/issues
|
20
|
+
If you find any issue in this repo, don't shy to create issues https://github.com/lanzhiheng/wechat-pay-next/issues
|
18
21
|
|
19
22
|
For more Information,you can check my posts: https://www.lanzhiheng.com/posts/preview/ruby-gem-for-wechat-pay-v3
|
20
23
|
|
data/Rakefile
CHANGED
@@ -13,7 +13,7 @@ end
|
|
13
13
|
require 'rdoc/task'
|
14
14
|
Rake::RDocTask.new do |rdoc|
|
15
15
|
rdoc.rdoc_dir = 'rdoc'
|
16
|
-
rdoc.title = "wechat-pay #{
|
16
|
+
rdoc.title = "wechat-pay-next #{WechatPayNext::VERSION}"
|
17
17
|
rdoc.rdoc_files.include('README*')
|
18
18
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
19
19
|
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'json'
|
4
|
-
require 'wechat-pay/helper'
|
4
|
+
require 'wechat-pay-next/helper'
|
5
5
|
|
6
|
-
module
|
6
|
+
module WechatPayNext
|
7
7
|
# # 直连商户相关接口封装(常用的已有,待完善)
|
8
8
|
# 文档: https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_1_1.shtml
|
9
9
|
module Direct
|
@@ -86,7 +86,7 @@ module WechatPay
|
|
86
86
|
const_set("INVOKE_COMBINE_TRANSACTIONS_IN_#{key.upcase}_FIELDS",
|
87
87
|
%i[combine_out_trade_no scene_info sub_orders notify_url].freeze)
|
88
88
|
define_singleton_method("invoke_combine_transactions_in_#{key}") do |params|
|
89
|
-
|
89
|
+
WechatPayNext::Ecommerce.send("invoke_combine_transactions_in_#{key}", params)
|
90
90
|
end
|
91
91
|
end
|
92
92
|
|
@@ -141,7 +141,7 @@ module WechatPay
|
|
141
141
|
url = "/v3/combine-transactions/out-trade-no/#{combine_out_trade_no}/close"
|
142
142
|
|
143
143
|
payload = {
|
144
|
-
combine_appid:
|
144
|
+
combine_appid: WechatPayNext.app_id
|
145
145
|
}.merge(params)
|
146
146
|
|
147
147
|
payload_json = payload.to_json
|
@@ -181,7 +181,7 @@ module WechatPay
|
|
181
181
|
end
|
182
182
|
|
183
183
|
params = params.merge({
|
184
|
-
mchid:
|
184
|
+
mchid: WechatPayNext.mch_id
|
185
185
|
})
|
186
186
|
|
187
187
|
method = 'GET'
|
@@ -213,7 +213,7 @@ module WechatPay
|
|
213
213
|
out_trade_no = params.delete(:out_trade_no)
|
214
214
|
url = "/v3/pay/transactions/out-trade-no/#{out_trade_no}/close"
|
215
215
|
params = params.merge({
|
216
|
-
mchid:
|
216
|
+
mchid: WechatPayNext.mch_id
|
217
217
|
})
|
218
218
|
|
219
219
|
method = 'POST'
|
@@ -353,8 +353,8 @@ module WechatPay
|
|
353
353
|
method = 'POST'
|
354
354
|
|
355
355
|
params = {
|
356
|
-
mchid:
|
357
|
-
appid:
|
356
|
+
mchid: WechatPayNext.mch_id,
|
357
|
+
appid: WechatPayNext.app_id
|
358
358
|
}.merge(params)
|
359
359
|
|
360
360
|
payload_json = params.to_json
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
module
|
3
|
+
module WechatPayNext
|
4
4
|
# 商户进件相关
|
5
5
|
module Ecommerce
|
6
6
|
# 二级商户进件
|
@@ -61,7 +61,7 @@ module WechatPay
|
|
61
61
|
# ```
|
62
62
|
#
|
63
63
|
# ``` ruby
|
64
|
-
#
|
64
|
+
# WechatPayNext::Ecommerce.applyment(params)
|
65
65
|
# ```
|
66
66
|
#
|
67
67
|
def self.applyment(payload)
|
@@ -76,7 +76,7 @@ module WechatPay
|
|
76
76
|
for_sign: payload_json,
|
77
77
|
payload: payload_json,
|
78
78
|
extra_headers: {
|
79
|
-
'Wechatpay-Serial' =>
|
79
|
+
'Wechatpay-Serial' => WechatPayNext.platform_serial_no
|
80
80
|
}
|
81
81
|
)
|
82
82
|
end
|
@@ -90,8 +90,8 @@ module WechatPay
|
|
90
90
|
# Example:
|
91
91
|
#
|
92
92
|
# ``` ruby
|
93
|
-
#
|
94
|
-
#
|
93
|
+
# WechatPayNext::Ecommerce.query_applyment(out_request_no: 'APPLYMENT_00000000005') # by out_request_no
|
94
|
+
# WechatPayNext::Ecommerce.query_applyment(applyment_id: '200040444455566667') # by_applyment_id
|
95
95
|
# ```
|
96
96
|
#
|
97
97
|
def self.query_applyment(params)
|
@@ -120,7 +120,7 @@ module WechatPay
|
|
120
120
|
# Example:
|
121
121
|
#
|
122
122
|
# ``` ruby
|
123
|
-
#
|
123
|
+
# WechatPayNext::Ecommerce.certificates
|
124
124
|
# ```
|
125
125
|
#
|
126
126
|
def self.certificates
|
@@ -145,7 +145,7 @@ module WechatPay
|
|
145
145
|
# Example:
|
146
146
|
#
|
147
147
|
# ``` ruby
|
148
|
-
#
|
148
|
+
# WechatPayNext::Ecommerce.query_settlement(sub_mchid: '16000000')
|
149
149
|
# ```
|
150
150
|
#
|
151
151
|
def self.query_settlement(params)
|
@@ -171,7 +171,7 @@ module WechatPay
|
|
171
171
|
# Example:
|
172
172
|
#
|
173
173
|
# ``` ruby
|
174
|
-
#
|
174
|
+
# WechatPayNext::Ecommerce.modify_settlement(sub_mchid: '15000000', account_type: 'ACCOUNT_TYPE_PRIVATE', account_bank: '工商银行', bank_address_code: '110000', account_number: WechatPayNext::Sign.sign_important_info('755555555'))
|
175
175
|
# ```
|
176
176
|
#
|
177
177
|
def self.modify_settlement(params)
|
@@ -187,7 +187,7 @@ module WechatPay
|
|
187
187
|
for_sign: payload_json,
|
188
188
|
payload: payload_json,
|
189
189
|
extra_headers: {
|
190
|
-
'Wechatpay-Serial' =>
|
190
|
+
'Wechatpay-Serial' => WechatPayNext.platform_serial_no
|
191
191
|
}
|
192
192
|
)
|
193
193
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
module
|
3
|
+
module WechatPayNext
|
4
4
|
# 合并订单相关
|
5
5
|
module Ecommerce
|
6
6
|
# @private
|
@@ -92,7 +92,7 @@ module WechatPay
|
|
92
92
|
url = "/v3/combine-transactions/out-trade-no/#{combine_out_trade_no}/close"
|
93
93
|
|
94
94
|
payload = {
|
95
|
-
combine_appid:
|
95
|
+
combine_appid: WechatPayNext.app_id
|
96
96
|
}.merge(params)
|
97
97
|
|
98
98
|
payload_json = payload.to_json
|
@@ -115,8 +115,8 @@ module WechatPay
|
|
115
115
|
method = 'POST'
|
116
116
|
|
117
117
|
params = {
|
118
|
-
combine_mchid:
|
119
|
-
combine_appid:
|
118
|
+
combine_mchid: WechatPayNext.mch_id,
|
119
|
+
combine_appid: WechatPayNext.app_id
|
120
120
|
}.merge(params)
|
121
121
|
|
122
122
|
payload_json = params.to_json
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
module
|
3
|
+
module WechatPayNext
|
4
4
|
# 订单相关
|
5
5
|
module Ecommerce
|
6
6
|
# @private
|
@@ -66,7 +66,7 @@ module WechatPay
|
|
66
66
|
end
|
67
67
|
|
68
68
|
params = params.merge({
|
69
|
-
sp_mchid:
|
69
|
+
sp_mchid: WechatPayNext.mch_id
|
70
70
|
})
|
71
71
|
|
72
72
|
method = 'GET'
|
@@ -96,7 +96,7 @@ module WechatPay
|
|
96
96
|
out_trade_no = params.delete(:out_trade_no)
|
97
97
|
url = "/v3/pay/partner/transactions/out-trade-no/#{out_trade_no}/close"
|
98
98
|
params = params.merge({
|
99
|
-
sp_mchid:
|
99
|
+
sp_mchid: WechatPayNext.mch_id
|
100
100
|
})
|
101
101
|
|
102
102
|
method = 'POST'
|
@@ -117,8 +117,8 @@ module WechatPay
|
|
117
117
|
method = 'POST'
|
118
118
|
|
119
119
|
params = {
|
120
|
-
sp_appid:
|
121
|
-
sp_mchid:
|
120
|
+
sp_appid: WechatPayNext.app_id,
|
121
|
+
sp_mchid: WechatPayNext.mch_id
|
122
122
|
}.merge(params)
|
123
123
|
|
124
124
|
payload_json = params.to_json
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
module
|
3
|
+
module WechatPayNext
|
4
4
|
# 分账相关
|
5
5
|
module Ecommerce
|
6
6
|
class << self
|
@@ -20,7 +20,7 @@ module WechatPay
|
|
20
20
|
url = '/v3/ecommerce/profitsharing/orders'
|
21
21
|
method = 'POST'
|
22
22
|
params = {
|
23
|
-
appid:
|
23
|
+
appid: WechatPayNext.app_id
|
24
24
|
}.merge(params)
|
25
25
|
|
26
26
|
payload_json = params.to_json
|
@@ -31,7 +31,7 @@ module WechatPay
|
|
31
31
|
for_sign: payload_json,
|
32
32
|
payload: payload_json,
|
33
33
|
extra_headers: {
|
34
|
-
'Wechatpay-Serial' =>
|
34
|
+
'Wechatpay-Serial' => WechatPayNext.platform_serial_no
|
35
35
|
}
|
36
36
|
)
|
37
37
|
end
|
@@ -183,7 +183,7 @@ module WechatPay
|
|
183
183
|
method = 'POST'
|
184
184
|
|
185
185
|
params = {
|
186
|
-
appid:
|
186
|
+
appid: WechatPayNext.app_id
|
187
187
|
}.merge(params)
|
188
188
|
|
189
189
|
payload_json = params.to_json
|
@@ -213,7 +213,7 @@ module WechatPay
|
|
213
213
|
method = 'POST'
|
214
214
|
|
215
215
|
params = {
|
216
|
-
appid:
|
216
|
+
appid: WechatPayNext.app_id
|
217
217
|
}.merge(params)
|
218
218
|
|
219
219
|
payload_json = params.to_json
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
module
|
3
|
+
module WechatPayNext
|
4
4
|
# 退款相关
|
5
5
|
module Ecommerce
|
6
6
|
INVOKE_REFUND_FIELDS = %i[sub_mchid out_trade_no total refund out_refund_no].freeze # :nodoc:
|
@@ -26,7 +26,7 @@ module WechatPay
|
|
26
26
|
|
27
27
|
params = {
|
28
28
|
amount: amount,
|
29
|
-
sp_appid:
|
29
|
+
sp_appid: WechatPayNext.app_id
|
30
30
|
}.merge(params)
|
31
31
|
|
32
32
|
make_request(
|
@@ -62,7 +62,7 @@ module WechatPay
|
|
62
62
|
end
|
63
63
|
|
64
64
|
params = params.merge({
|
65
|
-
sp_mchid:
|
65
|
+
sp_mchid: WechatPayNext.mch_id
|
66
66
|
})
|
67
67
|
|
68
68
|
method = 'GET'
|
@@ -1,18 +1,18 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'json'
|
4
|
-
require 'wechat-pay/helper'
|
5
|
-
require 'wechat-pay/ecommerce/withdraw'
|
6
|
-
require 'wechat-pay/ecommerce/balance'
|
7
|
-
require 'wechat-pay/ecommerce/applyment'
|
8
|
-
require 'wechat-pay/ecommerce/order'
|
9
|
-
require 'wechat-pay/ecommerce/combine_order'
|
10
|
-
require 'wechat-pay/ecommerce/profitsharing'
|
11
|
-
require 'wechat-pay/ecommerce/subsidies'
|
12
|
-
require 'wechat-pay/ecommerce/refund'
|
13
|
-
require 'wechat-pay/ecommerce/bill'
|
4
|
+
require 'wechat-pay-next/helper'
|
5
|
+
require 'wechat-pay-next/ecommerce/withdraw'
|
6
|
+
require 'wechat-pay-next/ecommerce/balance'
|
7
|
+
require 'wechat-pay-next/ecommerce/applyment'
|
8
|
+
require 'wechat-pay-next/ecommerce/order'
|
9
|
+
require 'wechat-pay-next/ecommerce/combine_order'
|
10
|
+
require 'wechat-pay-next/ecommerce/profitsharing'
|
11
|
+
require 'wechat-pay-next/ecommerce/subsidies'
|
12
|
+
require 'wechat-pay-next/ecommerce/refund'
|
13
|
+
require 'wechat-pay-next/ecommerce/bill'
|
14
14
|
|
15
|
-
module
|
15
|
+
module WechatPayNext
|
16
16
|
# # 服务商相关接口封装(电商平台,服务商有许多接口共用)
|
17
17
|
# 文档: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/open/pay/chapter3_3_3.shtml
|
18
18
|
#
|
@@ -13,7 +13,7 @@ module WechatPayHelper # :nodoc:
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def make_request(method:, path:, for_sign: '', payload: {}, extra_headers: {})
|
16
|
-
authorization =
|
16
|
+
authorization = WechatPayNext::Sign.build_authorization_header(method, path, for_sign)
|
17
17
|
headers = {
|
18
18
|
'Authorization' => authorization,
|
19
19
|
'Content-Type' => 'application/json',
|
@@ -5,7 +5,7 @@ require 'base64'
|
|
5
5
|
require 'securerandom'
|
6
6
|
require 'active_support/core_ext/hash'
|
7
7
|
|
8
|
-
module
|
8
|
+
module WechatPayNext
|
9
9
|
# # 微信签名相关的封装
|
10
10
|
# 文档: https://pay.weixin.qq.com/wiki/doc/apiv3/wechatpay/wechatpay4_0.shtml
|
11
11
|
#
|
@@ -47,7 +47,7 @@ module WechatPay
|
|
47
47
|
|
48
48
|
{
|
49
49
|
appId: appid,
|
50
|
-
partnerId:
|
50
|
+
partnerId: WechatPayNext.mch_id,
|
51
51
|
timeStamp: timestamp,
|
52
52
|
nonceStr: noncestr,
|
53
53
|
prepayId: prepay_id,
|
@@ -123,7 +123,7 @@ module WechatPay
|
|
123
123
|
def notification_from_wechat?(timestamp, noncestr, json_body, signature)
|
124
124
|
string = build_callback_string(timestamp, noncestr, json_body)
|
125
125
|
decoded_signature = Base64.strict_decode64(signature)
|
126
|
-
|
126
|
+
WechatPayNext.platform_cert.public_key.verify('SHA256', decoded_signature, string)
|
127
127
|
end
|
128
128
|
|
129
129
|
# For signing the sensitive information
|
@@ -142,7 +142,7 @@ module WechatPay
|
|
142
142
|
# "K0MK7g3laREAQ4HIlpIndVmFdz4IyxxiVp42hXFx2CzWRB1fn85ANBxnQXESq91vJ1P9mCt94cHZDoshlEOJRkE1KvcxpBCnG3ghIqiSsLKdLZ3ytO94GBDzCt8nsq+vJKXJbK2XuL9p5h0KYGKZyjt2ydU9Ig6daWTpZH8lAKIsLzPTsaUtScuw/v3M/7t8/4py8N0MOLKbDBDnR5Q+MRHbEWI9nCA3HTAWsSerIIgE7igWnzybxsUzhkV8m49P/Shr2zh6yJAlEnyPLFmQG7GuUaYwDTSLKOWzzPYwxMcucWQha2krC9OlwnZJe6ZWUAI3s4ej4kFRfheOYywRoQ=="
|
143
143
|
# ```
|
144
144
|
def sign_important_info(string)
|
145
|
-
platform_public_key =
|
145
|
+
platform_public_key = WechatPayNext.platform_cert.public_key
|
146
146
|
Base64.strict_encode64(platform_public_key.public_encrypt(string, OpenSSL::PKey::RSA::PKCS1_OAEP_PADDING))
|
147
147
|
end
|
148
148
|
|
@@ -171,7 +171,7 @@ module WechatPay
|
|
171
171
|
# https://contest-server.cs.uchicago.edu/ref/ruby_2_3_1_stdlib/libdoc/openssl/rdoc/OpenSSL/Cipher.html
|
172
172
|
tag_length = 16
|
173
173
|
decipher = OpenSSL::Cipher.new('aes-256-gcm').decrypt
|
174
|
-
decipher.key =
|
174
|
+
decipher.key = WechatPayNext.mch_key
|
175
175
|
decipher.iv = nonce
|
176
176
|
signature = Base64.strict_decode64(ciphertext)
|
177
177
|
length = signature.length
|
@@ -206,9 +206,9 @@ module WechatPay
|
|
206
206
|
signature = sign_string(string)
|
207
207
|
|
208
208
|
params = {
|
209
|
-
mchid:
|
209
|
+
mchid: WechatPayNext.mch_id,
|
210
210
|
nonce_str: nonce_str,
|
211
|
-
serial_no:
|
211
|
+
serial_no: WechatPayNext.apiclient_serial_no,
|
212
212
|
signature: signature,
|
213
213
|
timestamp: timestamp
|
214
214
|
}
|
@@ -219,7 +219,7 @@ module WechatPay
|
|
219
219
|
end
|
220
220
|
|
221
221
|
def sign_string(string)
|
222
|
-
result =
|
222
|
+
result = WechatPayNext.apiclient_key.sign('SHA256', string) # 商户私钥的SHA256-RSA2048签名
|
223
223
|
Base64.strict_encode64(result) # Base64处理
|
224
224
|
end
|
225
225
|
|
@@ -2,15 +2,15 @@
|
|
2
2
|
|
3
3
|
# frozen_string_literal: true
|
4
4
|
|
5
|
-
|
6
|
-
require 'wechat-pay/sign'
|
7
|
-
require 'wechat-pay/direct' # 直连模式
|
8
|
-
require 'wechat-pay/ecommerce' # 电商平台
|
5
|
+
|
6
|
+
require 'wechat-pay-next/sign'
|
7
|
+
require 'wechat-pay-next/direct' # 直连模式
|
8
|
+
require 'wechat-pay-next/ecommerce' # 电商平台
|
9
9
|
|
10
10
|
# # 微信支付
|
11
11
|
#
|
12
12
|
# 设置关键信息
|
13
|
-
module
|
13
|
+
module WechatPayNext
|
14
14
|
class << self
|
15
15
|
attr_accessor :app_id, :mch_id, :mch_key
|
16
16
|
attr_reader :apiclient_key, :apiclient_cert, :platform_cert
|
@@ -20,7 +20,7 @@ module WechatPay
|
|
20
20
|
@apiclient_key = OpenSSL::PKey::RSA.new(key)
|
21
21
|
end
|
22
22
|
|
23
|
-
# 设置平台证书,通过接口获取 https://github.com/lanzhiheng/wechat-pay/blob/master/lib/wechat-pay/ecommerce/applyment.rb#L116
|
23
|
+
# 设置平台证书,通过接口获取 https://github.com/lanzhiheng/wechat-pay-next/blob/master/lib/wechat-pay-next/ecommerce/applyment.rb#L116
|
24
24
|
def platform_cert=(cert)
|
25
25
|
@platform_cert = OpenSSL::X509::Certificate.new(cert)
|
26
26
|
end
|
data/wechat-pay.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
$LOAD_PATH.push File.expand_path('lib', __dir__)
|
4
4
|
|
5
|
-
require 'wechat-pay/version'
|
5
|
+
require 'wechat-pay-next/version'
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = 'wechat-pay-next'
|
9
|
-
s.version =
|
9
|
+
s.version = WechatPayNext::VERSION
|
10
10
|
s.summary = 'Wechat Pay in api V3'
|
11
11
|
s.description = 'A simple Wechat pay ruby gem in api V3.'
|
12
12
|
s.authors = ['rocky']
|
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
|
|
16
16
|
end
|
17
17
|
s.required_ruby_version = '>= 2.6'
|
18
18
|
s.require_paths = ['lib']
|
19
|
-
s.homepage = 'https://github.com/xurenlu/wechat-pay/'
|
19
|
+
s.homepage = 'https://github.com/xurenlu/wechat-pay-next/'
|
20
20
|
s.license = 'MIT'
|
21
21
|
|
22
22
|
s.add_development_dependency 'rspec', '~> 3.10.0'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wechat-pay-next
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rocky
|
@@ -53,23 +53,23 @@ files:
|
|
53
53
|
- Gemfile
|
54
54
|
- README.md
|
55
55
|
- Rakefile
|
56
|
-
- lib/wechat-pay.rb
|
57
|
-
- lib/wechat-pay/direct.rb
|
58
|
-
- lib/wechat-pay/ecommerce.rb
|
59
|
-
- lib/wechat-pay/ecommerce/applyment.rb
|
60
|
-
- lib/wechat-pay/ecommerce/balance.rb
|
61
|
-
- lib/wechat-pay/ecommerce/bill.rb
|
62
|
-
- lib/wechat-pay/ecommerce/combine_order.rb
|
63
|
-
- lib/wechat-pay/ecommerce/order.rb
|
64
|
-
- lib/wechat-pay/ecommerce/profitsharing.rb
|
65
|
-
- lib/wechat-pay/ecommerce/refund.rb
|
66
|
-
- lib/wechat-pay/ecommerce/subsidies.rb
|
67
|
-
- lib/wechat-pay/ecommerce/withdraw.rb
|
68
|
-
- lib/wechat-pay/helper.rb
|
69
|
-
- lib/wechat-pay/sign.rb
|
70
|
-
- lib/wechat-pay/version.rb
|
56
|
+
- lib/wechat-pay-next.rb
|
57
|
+
- lib/wechat-pay-next/direct.rb
|
58
|
+
- lib/wechat-pay-next/ecommerce.rb
|
59
|
+
- lib/wechat-pay-next/ecommerce/applyment.rb
|
60
|
+
- lib/wechat-pay-next/ecommerce/balance.rb
|
61
|
+
- lib/wechat-pay-next/ecommerce/bill.rb
|
62
|
+
- lib/wechat-pay-next/ecommerce/combine_order.rb
|
63
|
+
- lib/wechat-pay-next/ecommerce/order.rb
|
64
|
+
- lib/wechat-pay-next/ecommerce/profitsharing.rb
|
65
|
+
- lib/wechat-pay-next/ecommerce/refund.rb
|
66
|
+
- lib/wechat-pay-next/ecommerce/subsidies.rb
|
67
|
+
- lib/wechat-pay-next/ecommerce/withdraw.rb
|
68
|
+
- lib/wechat-pay-next/helper.rb
|
69
|
+
- lib/wechat-pay-next/sign.rb
|
70
|
+
- lib/wechat-pay-next/version.rb
|
71
71
|
- wechat-pay.gemspec
|
72
|
-
homepage: https://github.com/xurenlu/wechat-pay/
|
72
|
+
homepage: https://github.com/xurenlu/wechat-pay-next/
|
73
73
|
licenses:
|
74
74
|
- MIT
|
75
75
|
metadata: {}
|