|
@@ -50,34 +50,35 @@ func OrdState(c *gin.Context) { |
|
|
e.OutErr(c, e.ERR_NO_DATA, "未查询到对应订单记录") |
|
|
e.OutErr(c, e.ERR_NO_DATA, "未查询到对应订单记录") |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
if ord.State == enum.CentralKitchenForSchoolPackageOrdStateForWait { |
|
|
|
|
|
//处于待支付状态,请求支付宝同步订单状态 |
|
|
|
|
|
sysCfgDb := db.SysCfgDb{} |
|
|
|
|
|
sysCfgDb.Set() |
|
|
|
|
|
sysCfg := sysCfgDb.SysCfgFindWithDb(enum.JsapiPayAppAutToken, enum.OpenAlipayAppid, enum.OpenAlipayAppPrivateKey, enum.OpenAlipayPublicKey) |
|
|
|
|
|
err2, result := svc.CurlAlipayTradeQuery(md.CurlAlipayTradeQueryReq{ |
|
|
|
|
|
Config: struct { |
|
|
|
|
|
PayAliAppId string `json:"pay_ali_app_id" label:"支付宝开放平台-第三方应用-appid"` |
|
|
|
|
|
PayAliPrivateKey string `json:"pay_ali_private_key" label:"支付宝开放平台-第三方应用-接口加签-应用私钥"` |
|
|
|
|
|
PayAliPublicKey string `json:"pay_ali_public_key" label:"支付宝开放平台-第三方应用-接口加签-支付宝公钥"` |
|
|
|
|
|
}{ |
|
|
|
|
|
PayAliAppId: sysCfg[enum.OpenAlipayAppid], |
|
|
|
|
|
PayAliPrivateKey: sysCfg[enum.OpenAlipayAppPrivateKey], |
|
|
|
|
|
PayAliPublicKey: sysCfg[enum.OpenAlipayPublicKey], |
|
|
|
|
|
}, |
|
|
|
|
|
OutTradeNo: outTradeNo, |
|
|
|
|
|
AppAuthToken: sysCfg[enum.JsapiPayAppAutToken], |
|
|
|
|
|
}) |
|
|
|
|
|
if err2 != nil { |
|
|
|
|
|
e.OutErr(c, e.ERR, err2.Error()) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
ord.State, err2 = svc.DealCentralKitchenForSchoolOrderCallBack(outTradeNo, result.TradeStatus) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
e.OutErr(c, e.ERR, err2.Error()) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//if ord.State == enum.CentralKitchenForSchoolPackageOrdStateForWait { |
|
|
|
|
|
// //处于待支付状态,请求支付宝同步订单状态 |
|
|
|
|
|
// sysCfgDb := db.SysCfgDb{} |
|
|
|
|
|
// sysCfgDb.Set() |
|
|
|
|
|
// sysCfg := sysCfgDb.SysCfgFindWithDb(enum.JsapiPayAppAutToken, enum.OpenAlipayAppid, enum.OpenAlipayAppPrivateKey, enum.OpenAlipayPublicKey) |
|
|
|
|
|
// err2, result := svc.CurlAlipayTradeQuery(md.CurlAlipayTradeQueryReq{ |
|
|
|
|
|
// Config: struct { |
|
|
|
|
|
// PayAliAppId string `json:"pay_ali_app_id" label:"支付宝开放平台-第三方应用-appid"` |
|
|
|
|
|
// PayAliPrivateKey string `json:"pay_ali_private_key" label:"支付宝开放平台-第三方应用-接口加签-应用私钥"` |
|
|
|
|
|
// PayAliPublicKey string `json:"pay_ali_public_key" label:"支付宝开放平台-第三方应用-接口加签-支付宝公钥"` |
|
|
|
|
|
// }{ |
|
|
|
|
|
// PayAliAppId: sysCfg[enum.OpenAlipayAppid], |
|
|
|
|
|
// PayAliPrivateKey: sysCfg[enum.OpenAlipayAppPrivateKey], |
|
|
|
|
|
// PayAliPublicKey: sysCfg[enum.OpenAlipayPublicKey], |
|
|
|
|
|
// }, |
|
|
|
|
|
// OutTradeNo: outTradeNo, |
|
|
|
|
|
// AppAuthToken: sysCfg[enum.JsapiPayAppAutToken], |
|
|
|
|
|
// }) |
|
|
|
|
|
// if err2 != nil { |
|
|
|
|
|
// e.OutErr(c, e.ERR, err2.Error()) |
|
|
|
|
|
// return |
|
|
|
|
|
// } |
|
|
|
|
|
// ord.State, err2 = svc.DealCentralKitchenForSchoolOrderCallBack(outTradeNo, result.TradeStatus) |
|
|
|
|
|
// if err != nil { |
|
|
|
|
|
// e.OutErr(c, e.ERR, err2.Error()) |
|
|
|
|
|
// return |
|
|
|
|
|
// } |
|
|
|
|
|
//} |
|
|
|
|
|
|
|
|
e.OutSuc(c, map[string]interface{}{ |
|
|
e.OutSuc(c, map[string]interface{}{ |
|
|
"sate": ord.State, |
|
|
"sate": ord.State, |
|
|