更新密码找回uniapp
This commit is contained in:
1 parent
7f9a66da0f
commit
3fdda89833
1304 files changed
+3503
-26132
No files matched your search
@@ -12,15 +12,10 @@ import (
|
||||
"github.com/beego/beego/v2/client/orm"
|
||||
)
|
||||
|
||||
// 支付成功 -> 产品/套餐购买订单同步:
|
||||
// 渠道异步回调(或主动查询)把支付单置为 paid 时,支付服务会调用此处注册的钩子,
|
||||
// 自动把购买订单置为已开通;否则订单只能等前端轮询兜底或平台手动开通。
|
||||
func init() {
|
||||
payment.RegisterOrderSyncHook(syncProductOrderFromPayment)
|
||||
}
|
||||
|
||||
// syncProductOrderFromPayment 支付单成功后的钩子:按业务订单号同步购买订单状态并自动开通。
|
||||
// 返回错误时支付服务会保留 order_synced=0,由支付补偿任务(5 分钟一轮)重试。
|
||||
func syncProductOrderFromPayment(_ context.Context, payOrder *models.PlatformPaymentOrder) error {
|
||||
if payOrder == nil {
|
||||
return nil
|
||||
@@ -36,8 +31,6 @@ func syncProductOrderFromPayment(_ context.Context, payOrder *models.PlatformPay
|
||||
Filter("delete_time__isnull", true).
|
||||
One(&order)
|
||||
if err == orm.ErrNoRows {
|
||||
// 下单链路先建支付单、后落业务订单,渠道回调可能抢先到达:
|
||||
// 短时间内保留重试;超过窗口仍不存在说明不是本模块的支付单,视为无需同步。
|
||||
if time.Since(payOrder.CreateTime) < 10*time.Minute {
|
||||
return fmt.Errorf("产品订单 %s 尚未入库,等待重试", orderNo)
|
||||
}
|
||||
@@ -46,7 +39,6 @@ func syncProductOrderFromPayment(_ context.Context, payOrder *models.PlatformPay
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// 已开通/已关闭等终态无需处理
|
||||
if order.Status != models.ProductOrderStatusPending && order.Status != models.ProductOrderStatusPaid {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user