'use strict'; /** * [微信公众号通讯路由] * @author szjcomo * @createTime 2020-08-03 * @param {[type]} app [description] * @return {[type]} [description] */ module.exports = app => { /** * [subRouter 命名空间路由] * @type {[type]} */ const subRouter = app.router.namespace(`/${process.env.APP_CUSTOME || 'universal'}`); // 通讯验证 subRouter.get('/wechat/validate', app.controller.wechat.wechat.tokenSign); // 接收消息 subRouter.post('/wechat/validate', app.controller.wechat.wechat.message); // 微信JSAPI subRouter.get('/wechat/jsapi', app.controller.wechat.wechat.wxJsAPIConfig); // 微信支付回调 subRouter.post('/wechat/pay/callbck', app.controller.wechat.wechat.payCallback); }; // <xml><appid><![CDATA[wx6aab892e5b7b6023]]></appid> // <attach><![CDATA[{"user_id":2,"order_id":21,"scene_info":"orderCreate"}]]></attach> // <bank_type><![CDATA[OTHERS]]></bank_type> // <cash_fee><![CDATA[10]]></cash_fee> // <fee_type><![CDATA[CNY]]></fee_type> // <is_subscribe><![CDATA[Y]]></is_subscribe> // <mch_id><![CDATA[1490421362]]></mch_id> // <nonce_str><![CDATA[IHxRkUVRR2QfCVAcawWLqTXIsihbu2PI]]></nonce_str> // <openid><![CDATA[okXHRwVqk39baIntOSADkiFLSNNQ]]></openid> // <out_trade_no><![CDATA[20220329150651146468]]></out_trade_no> // <result_code><![CDATA[SUCCESS]]></result_code> // <return_code><![CDATA[SUCCESS]]></return_code> // <sign><![CDATA[22FE37BA8C5E42BA0891D8D0A8BDFCC9]]></sign> // <time_end><![CDATA[20220329150706]]></time_end> // <total_fee>10</total_fee> // <trade_type><![CDATA[JSAPI]]></trade_type> // <transaction_id><![CDATA[4200001367202203291541331216]]></transaction_id> // </xml>