router.js
860 Bytes
/**
* router of sub app shopping
* @author: xiaoxiao.hao<xiaoxiao.hao@yoho.cn>
* @date: 2017/03/20
*/
'use strict';
const router = require('express').Router(); // eslint-disable-line
const cRoot = './controllers';
const auth = require(`${global.middleware}/auth`);
const pay = require(`${cRoot}/pay`); // 支付
// 支付
router.get('/newpay', auth, pay.online);
router.get('/newpay/weixin', auth, pay.weixinQr);
router.post('/newpay/weixin/state', auth, pay.weixinPayState);
router.post('/newpay/go', auth, pay.toPay);
router.post('/newpay/sendPayConfirm', auth, pay.sendPayConfirm);
// 支付回调
router.get('/newpay/callback/:type', auth, pay.callback);
router.post('/newpay/callback/:type', auth, pay.callback);// 银联是post方式返回的
// 支付异步回调
router.get('/newpay/notify/:type', auth, pay.notify);
module.exports = router;