fix: 富友回调应答XMLName缺失 + term_ip自动探测服务器IP替代硬编码
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m8s

This commit is contained in:
2026-03-30 12:46:50 +08:00
parent 8296742cce
commit d56b841443
3 changed files with 26 additions and 3 deletions

View File

@@ -54,7 +54,7 @@ type fuiouPaymentProvider struct {
// CreateJSAPIPayment 创建富友 JSAPI 预下单。
func (f *fuiouPaymentProvider) CreateJSAPIPayment(ctx context.Context, orderNo, description, openID string, amount int) (*PaymentResult, error) {
amountStr := strconv.Itoa(amount)
resp, err := f.client.WxPreCreate(orderNo, amountStr, description, "127.0.0.1", f.tradeType, f.appID, openID)
resp, err := f.client.WxPreCreate(orderNo, amountStr, description, fuiou.GetServerIP(), f.tradeType, f.appID, openID)
if err != nil {
return nil, errors.Wrap(errors.CodeFuiouPayFailed, err, "富友预下单失败")
}