wechat_payment 2.0.6 → 2.0.7
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/app/services/wechat_payment/service.rb +2 -2
- data/lib/wechat_payment/concern/goods.rb +14 -14
- data/lib/wechat_payment/version.rb +1 -1
- 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: 47ac17c0ea1a99ad55e63958da4dfbefc0282f9962ce038a738b4322d09a501c
|
4
|
+
data.tar.gz: e61cc08c219cb5c90cb74be1836ada62f120ccb64481e5d2e2be6aa7ed4f7fcb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6310f34d9941e697640cb0902415cc7dd9ecfdd743c2b02fa0b05d1202f57d81afd262a81d45999046f0b4f2e90dfc42f66c745ed1278339dc08207adb621297
|
7
|
+
data.tar.gz: dabde1251f1337d373be190c1dfd23b022d6b5e32ca4b50ceaa6b1a1aeccb54fd1c55cb354b47fdb43846948d3a6847b06f28dc4b926ca4be50b405d20bfc03e
|
@@ -44,7 +44,7 @@ module WechatPayment
|
|
44
44
|
result = WechatPayment::Client.handle_payment_notify(notify_data)
|
45
45
|
payment_order = WechatPayment::PaymentOrder.find_by(out_trade_no: notify_data["out_trade_no"])
|
46
46
|
|
47
|
-
if result.success? && payment_order.
|
47
|
+
if result.success? && payment_order.pending_pay?
|
48
48
|
payment_order.with_lock do
|
49
49
|
payment_order.payment_exec_success(result.data)
|
50
50
|
end
|
@@ -60,7 +60,7 @@ module WechatPayment
|
|
60
60
|
result = WechatPayment::Client.handle_refund_notify(notify_data)
|
61
61
|
refund_order = WechatPayment::RefundOrder.find_by(out_refund_no: result.data["out_refund_no"])
|
62
62
|
|
63
|
-
if result.success? && refund_order.
|
63
|
+
if result.success? && refund_order.pending_pay?
|
64
64
|
refund_order.with_lock do
|
65
65
|
refund_order.refund_exec_success(result.data)
|
66
66
|
end
|
@@ -49,20 +49,20 @@ module WechatPayment
|
|
49
49
|
|
50
50
|
# 重新支付,应用场景是: 用户取消了支付后,使用最后一张订单进行支付
|
51
51
|
# @return [WechatPayment::ServiceResult]
|
52
|
-
def repay
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
result = payment_orders.last.repay
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
end
|
52
|
+
# def repay
|
53
|
+
# # 如果不是待支付状态
|
54
|
+
# unless pending?
|
55
|
+
# WechatPayment::ServiceResult.new(message: "当前状态不可支付")
|
56
|
+
# end
|
57
|
+
|
58
|
+
# result = payment_orders.last.repay
|
59
|
+
|
60
|
+
# if result.success?
|
61
|
+
# WechatPayment::ServiceResult.new(success: true, data: result.data[:js_payload])
|
62
|
+
# else
|
63
|
+
# WechatPayment::ServiceResult.new(message: result.errors.first[:err_code_des])
|
64
|
+
# end
|
65
|
+
# end
|
66
66
|
|
67
67
|
|
68
68
|
# 退款
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wechat_payment
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
11
|
+
date: 2022-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|