收藏
回答

电子发票卡券插入用户卡包 一直报47001

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug 发票同步卡包 微信安卓客户端 8.0.29 2.0.0

9月20日之前调用该接口可正常同步发票到微信卡包,10月11日同步失败,一直返回:{

    "errcode"47001,

    "errmsg""data format error hint: [3OwrSa06291167]"

} 使用文档下示例进行发送统样报47001,代码执行,postman执行都是报47001


使用参数json:{

    "card_ext": {

        "user_card": {

            "invoice_user_data": {

                "fee"1500,

                "s_pdf_media_id""11829446666907648",

                "maker""爱迪生",

                "tax"71,

                "title""黎小小",

                "seller_address_and_phone""深圳市南山区金蝶软件园0755-6897569",

                "billing_code""011001800304",

                "billing_time""1665417600",

                "check_code""83626667713483431831",

                "cashier""深圳动漫园小程序",

                "fee_without_tax"1429,

                "billing_no""46921165",

                "seller_number""440301999999118",

                "seller_bank_account""6214568978985632",

                "remarks""深圳动漫园微信小程序支付订单发票",

                "info": [

                    {

                        "price"1500,

                        "name""经营租赁车费"

                    }

                ]

            }

        },

        "nonce_str""20221011182553209938"

    },

    "appid""wxd11ca28f501f46ac",

    "order_id""DMFP20221011180549577719",

    "card_id""pGe36wo4t_B1wc09HXmNRal2WEro"

}


请求代码:public JSONObject invoiceInsert(Map map) {
    JSONObject jsonObject =null;
    StringEntity stringEntity = new StringEntity(JSON.toJSONString(map), ContentType.APPLICATION_JSON);
    log.info("将电子发票卡券插入用户卡包参数:{}",JSON.toJSONString(map));
    try {
        HttpClient client = HttpClientBuilder.create().build();
        HttpPost post = new HttpPost(JDInvoiceConstant.INVOICE_INSERT+"?access_token="+redisTemplate.opsForValue().get("wechat:token:"+JDInvoiceConstant.SERVICE_AREA_CODE+"AccessToken"));
        post.setHeader("Content-Type", "application/json;charset=UTF-8");
        post.setEntity(stringEntity);
        HttpResponse response = client.execute(post);
        HttpEntity he = response.getEntity();
        String string = EntityUtils.toString(he);
        jsonObject = JSON.parseObject(string);
    } catch (Exception e) {
        log.error("将电子发票卡券插入用户卡包异常,返回数据:{}, e:{}",  e.getMessage());
    }
    return jsonObject;
}


postman:





回答关注问题邀请回答
收藏

1 个回答

  • 刘鑫
    刘鑫
    2022-10-12

    实体是否有过修改, 重新对比匹配下呢

    2022-10-12
    有用
    回复
登录 后发表内容