- 售药的微信小程序可以接入直播功能吗
微信小程序接入直播功能,可以直播卖药吗?非处方药,非器械
2021-03-25 - 沙箱获取API密钥 返回 【请确认请求参数是否正确param mch_id invalid】
实在看不出有啥问题,另外这里的sign要用到真实的key去签名申请沙箱的key是吗,之后用沙箱的key去进行签名,沙箱测试是吗 <xml> <nonce_str><![CDATA[U1H69337IYSWCUB39ZCCH7BFNBUUN766]]></nonce_str> <sign><![CDATA[314A81B6EC5F7A5A90E389D01605616B]]></sign> <mch_id><![CDATA[1603461445]]></mch_id> </xml>
2020-10-30 - 微信支付 沙箱环境 请求API密钥 返回【请求参数xml格式错误】
请求的参数为: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <xml> <nonce_str>WSRQ7N7FFTVUG2DUSMY74C913XJK1ZNI</nonce_str> <sign>3FB43D66CFD8111E007F8641E0907C89</sign> <mch_id>1603461441</mch_id> //为安全考虑,商户ID已做了更改 </xml> 返回的结果为: <xml> <return_code><![CDATA[FAIL]]></return_code> <retmsg><![CDATA[输入请求参数xml格式错误]]></retmsg> <retcode><![CDATA[1]]></retcode> </xml> Map转xml的代码用的是官方jdk里的,如下 //沙箱环境下需先请求获取key Map testMap = new HashMap<>(); testMap.put("mch_id", mchId); testMap.put("nonce_str",getRandomString()); //生成符合规格的签名串 String stringTestSignTemp = getParamStr(testMap); //进行MD5运算,并转为大写,获得sign参数的值 String signTestValue = MD5(stringTestSignTemp.toString()).toUpperCase(); //把sign放入map中 testMap.put("sign",signTestValue); //map转义为xml格式 String requestTestParam = mapToXml(testMap); LOG.info("request sandbox API key - [parameters]:" +requestTestParam); //发送请求 String testResult = sendPostParam(sandBoxUrl, requestTestParam); LOG.info("request sandbox API key - [results]:" +testResult); //Map转xml方法 public static DocumentBuilder newDocumentBuilder() throws ParserConfigurationException { DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); documentBuilderFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); documentBuilderFactory.setFeature("http://xml.org/sax/features/external-general-entities", false); documentBuilderFactory.setFeature("http://xml.org/sax/features/external-parameter-entities", false); documentBuilderFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); documentBuilderFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); documentBuilderFactory.setXIncludeAware(false); documentBuilderFactory.setExpandEntityReferences(false); return documentBuilderFactory.newDocumentBuilder(); } public static String mapToXml(Map data) throws Exception { org.w3c.dom.Document document = newDocumentBuilder().newDocument(); org.w3c.dom.Element root = document.createElement("xml"); document.appendChild(root); for (String key: data.keySet()) { String value = data.get(key); if (value == null) { value = ""; } value = value.trim(); org.w3c.dom.Element filed = document.createElement(key); filed.appendChild(document.createTextNode(value)); root.appendChild(filed); } TransformerFactory tf = TransformerFactory.newInstance(); Transformer transformer = tf.newTransformer(); DOMSource source = new DOMSource(document); transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); StringWriter writer = new StringWriter(); StreamResult result = new StreamResult(writer); transformer.transform(source, result); String output = writer.getBuffer().toString(); try { writer.close(); } catch (Exception ex) { } return output; }
2020-10-29 - 编译.wxml文件错误,unexpected end。 一直显示文件的最后一处地方错误?
标签都核对过,没有遗漏的,一直显示文件编译错误,unexpected end VM89:1 ./pages/order-list/order-list.wxml unexpected end 44 | <template is="apifmLogin" data="{{wxlogin: wxlogin}}" /> 45 | > 46 | | ^ at files://pages/order-list/order-list.wxml#46
2020-07-23