在使用微信支付时,需将从前台接收的JSONObeject 格式数据转换为String类型,其具体的转换过程如下:
JSONObject jsonObject = JSONObject.parseObject(XmltoJsonUtil.xml2JSON(content));
JSONObject result_xml = jsonObject.getJSONObject("xml");
JSONArray result_code = result_xml.getJSONArray("result_code");
String code = (String) result_code.get(0);
System.out.println("回调code:activityNotify" + code);
本文介绍了一种将微信支付回调的JSONObeject格式数据转换为String类型的方法,通过解析XML内容,将其转换成JSON对象,进一步获取回调结果代码。
1万+

被折叠的 条评论
为什么被折叠?



