fix(v2): 币种错误映射 409/503(不再误导 500 重试)+ DailyLimit 量纲注释

- handler: ErrCurrencyMismatch → 409, ErrNoSettleCurrency → 503
- test: TestV2RetryCurrencyMismatch409 验证重试不同币种渠道返回 409
- config: DailyLimit 添加量纲注释(minor units)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
This commit is contained in:
wangjia
2026-07-10 14:27:39 +08:00
parent 585133532c
commit 98b95dde19
3 changed files with 89 additions and 4 deletions
+4
View File
@@ -154,6 +154,10 @@ func (h *GatewayHandler) writeCreateErr(c *gin.Context, action, method string, e
util.RespondError(c, http.StatusBadRequest, "unknown_method", "不支持的支付方式")
case errors.Is(err, gateway.ErrNoAccount):
util.RespondError(c, http.StatusServiceUnavailable, "no_account", "该支付方式暂不可用")
case errors.Is(err, gateway.ErrCurrencyMismatch):
util.RespondError(c, http.StatusConflict, "currency_mismatch", "该支付方式结算币种与订单不符,请换一种支付方式")
case errors.Is(err, gateway.ErrNoSettleCurrency):
util.RespondError(c, http.StatusServiceUnavailable, "no_settle_currency", "该支付方式配置不完整,暂不可用")
default:
log.Printf("[v2 order] %s失败 method=%s: %v", action, method, err)
util.RespondError(c, http.StatusInternalServerError, "create_failed", action+"失败,请稍后重试")