家庭组逻辑导致支付失败
Build docker and publish / build (20.15.1) (push) Successful in 8m11s

This commit is contained in:
2026-03-05 03:20:38 -08:00
parent 9f4d71770b
commit ce6351368d
5 changed files with 1193 additions and 44 deletions
@@ -3,6 +3,7 @@ package apple
import (
"context"
"encoding/json"
"fmt"
"strings"
"time"
@@ -153,6 +154,26 @@ SIRDAVLcWemp0fMlnfDE4EHmqcD58arEJWsr3aWEhc4BHocOUIGjko0cVWGchrFa
// But for now, we only rely on appAccountToken or just skip order linking.
exp := iapapple.CalcExpire(txp.PurchaseDate, m.DurationDays)
if l.svcCtx.Config.Subscribe.SingleModel {
anchorSub, anchorErr := findSingleModeMergeTarget(l.ctx, l.svcCtx, u.Id, m.SubscribeId)
switch {
case errors.Is(anchorErr, commonLogic.ErrSingleModePlanMismatch):
return errors.Wrapf(xerr.NewErrCode(xerr.SingleSubscribePlanMismatch), "single subscribe mode plan mismatch")
case anchorErr == nil && anchorSub != nil && anchorSub.Id > 0:
if exp.After(anchorSub.ExpireTime) {
anchorSub.ExpireTime = exp
}
anchorSub.Status = 1
anchorSub.FinishedAt = nil
if err := l.svcCtx.UserModel.UpdateSubscribe(l.ctx, anchorSub, tx); err != nil {
return err
}
continue
case errors.Is(anchorErr, gorm.ErrRecordNotFound):
case anchorErr != nil:
return anchorErr
}
}
userSub := user.Subscribe{
UserId: u.Id,
SubscribeId: m.SubscribeId,
@@ -161,7 +182,7 @@ SIRDAVLcWemp0fMlnfDE4EHmqcD58arEJWsr3aWEhc4BHocOUIGjko0cVWGchrFa
Traffic: 0,
Download: 0,
Upload: 0,
Token: txp.OriginalTransactionId,
Token: fmt.Sprintf("iap:%s", txp.OriginalTransactionId),
UUID: uuid.New().String(),
Status: 1,
}