|
@@ -71,6 +71,7 @@ type WeixinStruct struct {
|
|
|
Sjdc_bodymsg string
|
|
|
Sjdc_detailmsg string
|
|
|
Sjbg_msg string
|
|
|
+ OpenidSwitch *map[string]interface{}
|
|
|
}
|
|
|
|
|
|
func (w *WeixinStruct) GetTradeno(tp string) string {
|
|
@@ -103,10 +104,11 @@ func (w *WeixinStruct) CreatePrepayOrder(weixinrpc, tradeno, ip, openid, detailm
|
|
|
}
|
|
|
}
|
|
|
tradeno = w.GetTradeno(tradeno)
|
|
|
- if openid == "oRvqm1GPauaYHbCoBmOFsaxTs9X4" || openid == "oIMvJvrVXG89597EFmYiSiznbyyY" { //测试支付使用
|
|
|
- openid = "oHwE_wEQlEBvjZJOyZeNnQcgKQMo"
|
|
|
- } else if openid == "oIMvJvhl7CntkeLe3jEukHWhuKRc" {
|
|
|
- openid = "oHwE_wPk1VERbfcK2GRYtFWaStpk"
|
|
|
+ //测试环境微信支付需要转换对应的正式环境的openid
|
|
|
+ if w.OpenidSwitch != nil {
|
|
|
+ if oid, ok := (*(w.OpenidSwitch))[openid]; ok {
|
|
|
+ openid = oid.(string)
|
|
|
+ }
|
|
|
}
|
|
|
log.Println(w.Appid, "---", openid)
|
|
|
//获取预订单号
|