【请求地址】:https://api.mch.weixin.qq.com/v3/fund-app/mch-transfer/transfer-bills
【请求数据】:{"appid":"wx96ee39a9125c3f21","out_bill_no":"1747381927634","transfer_scene_id":"1000","openid":"oU7Tx64SBYEAK5y4iX7zVzzGhr2U","transfer_amount":30,"transfer_remark":"新会员开通有礼","transfer_scene_report_infos":[{"info_type":"新会员有礼","info_content":"注册会员抽中一等奖"}]}
【异常信息】:需传入转账场景报备信息,请检查
WxPayException(customErrorMsg=需传入转账场景报备信息,请检查, returnCode=null, returnMsg=null, resultCode=null, errCode=PARAM_ERROR, errCodeDes=需传入转账场景报备信息,请检查, xmlString=null)
麻烦问下是为啥?程序哪里写错了吗
可以参考这里的赋值规则: https://wechatpay.im/openapi/v3/fund-app/mch-transfer/transfer-bills
transfer_scene_id":"1000"
transfer_scene_report_infos":[{"info_type"应该是 活动名称 而不是 新会员有礼
List<JSONObject> detailList = new ArrayList<>(); JSONObject transferDetail = new JSONObject(); transferDetail.put("info_type", "活动名称"); transferDetail.put("info_content", "新会员有礼"); JSONObject transferDetai1l = new JSONObject(); transferDetai1l.put("info_type", "奖励说明"); transferDetai1l.put("info_content", "注册会员抽奖"); detailList.add(transferDetail); detailList.add(transferDetai1l); requestBody.put("transfer_scene_report_infos", detailList);