fix payment resume result consistency
This commit is contained in:
@@ -30,6 +30,15 @@ func (s *PaymentService) GetPublicOrderByResumeToken(ctx context.Context, token
|
||||
if claims.PaymentType != "" && strings.TrimSpace(order.PaymentType) != claims.PaymentType {
|
||||
return nil, fmt.Errorf("resume token payment type mismatch")
|
||||
}
|
||||
if order.Status == OrderStatusPending || order.Status == OrderStatusExpired {
|
||||
result := s.checkPaid(ctx, order)
|
||||
if result == checkPaidResultAlreadyPaid {
|
||||
order, err = s.entClient.PaymentOrder.Get(ctx, order.ID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("reload order by resume token: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return order, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user