fix: fixed bug for HuPiPay qrcode generation. set field 'openid' of result struct to Any data type

This commit is contained in:
RockYang
2023-12-19 11:31:57 +08:00
parent ff76e4bd89
commit cae5c049e4
3 changed files with 9 additions and 5 deletions

View File

@@ -99,14 +99,15 @@ func (h *PaymentHandler) DoPay(c *gin.Context) {
}
var r struct {
Openid int64 `json:"openid"`
UrlQrcode string `json:"url_qrcode"`
URL string `json:"url"`
ErrCode int `json:"errcode"`
ErrMsg string `json:"errmsg"`
Openid interface{} `json:"openid"`
UrlQrcode string `json:"url_qrcode"`
URL string `json:"url"`
ErrCode int `json:"errcode"`
ErrMsg string `json:"errmsg,omitempty"`
}
err = utils.JsonDecode(res, &r)
if err != nil {
logger.Debugf(res)
resp.ERROR(c, "error with decode payment result: "+err.Error())
return
}