package service // XpayProductIdMap 微信道具 productId(QCXG*)→ 本系统 product_en(toc_*) // mp 后台道具 id 须与左侧 QCXG 编码一致;支付签名 productId 使用 QCXG,业务订单仍用 product_en。 var XpayProductIdMap = map[string]string{ "QCXG6B4E": "toc_VehicleClaimVerify", "QCXGP00W": "toc_VehicleClaimDetail", "QCXG3Z3L": "toc_VehicleMaintenanceDetail", "QCXG3Y6B": "toc_VehicleMaintenanceSimple", "QCXG4I1Z": "toc_VehicleTransferDetail", "QCXG1H7Y": "toc_VehicleTransferSimple", "QCXGY7F2": "toc_VehicleVinValuation", "QCXG1U4U": "toc_VehicleMileageMixed", "QCXG5U0Z": "toc_VehicleStaticInfo", "QCXG4D2E": "toc_VehiclesUnderNameCount", "QCXG9P1C": "toc_VehiclesUnderNamePlate", "QCXGYTS2": "toc_PersonVehicleVerificationDetail", "QCXGGB2Q": "toc_PersonVehicleVerification", "QCXG7A2B": "toc_VehiclesUnderName", } var xpayProductEnToId map[string]string func init() { xpayProductEnToId = make(map[string]string, len(XpayProductIdMap)) for xpayID, productEn := range XpayProductIdMap { xpayProductEnToId[productEn] = xpayID } } // ResolveXpayProductId 将 product_en 转为 mp 道具 id;未配置时回退 product_en 本身。 func ResolveXpayProductId(productEn string) string { if id, ok := xpayProductEnToId[productEn]; ok { return id } return productEn }