fix(renewal): update subscription retrieval method to use token instead of order ID
This commit is contained in:
parent
db63281250
commit
8976724c1e
@ -27,7 +27,7 @@ type RenewalLogic struct {
|
|||||||
svcCtx *svc.ServiceContext
|
svcCtx *svc.ServiceContext
|
||||||
}
|
}
|
||||||
|
|
||||||
// Renewal Subscription
|
// NewRenewalLogic Renewal Subscription
|
||||||
func NewRenewalLogic(ctx context.Context, svcCtx *svc.ServiceContext) *RenewalLogic {
|
func NewRenewalLogic(ctx context.Context, svcCtx *svc.ServiceContext) *RenewalLogic {
|
||||||
return &RenewalLogic{
|
return &RenewalLogic{
|
||||||
Logger: logger.WithContext(ctx),
|
Logger: logger.WithContext(ctx),
|
||||||
|
|||||||
@ -345,7 +345,7 @@ func (l *ActivateOrderLogic) Renewal(ctx context.Context, orderInfo *order.Order
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// find user subscribe by subscribe token
|
// find user subscribe by subscribe token
|
||||||
userSub, err := l.svc.UserModel.FindOneSubscribeByOrderId(ctx, orderInfo.ParentId)
|
userSub, err := l.svc.UserModel.FindOneSubscribeByToken(ctx, orderInfo.SubscribeToken)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.WithContext(ctx).Error("[ActivateOrderLogic] Find user subscribe failed",
|
logger.WithContext(ctx).Error("[ActivateOrderLogic] Find user subscribe failed",
|
||||||
logger.Field("error", err.Error()),
|
logger.Field("error", err.Error()),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user