router.js 841 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('/pay', auth, pay.online);
router.get('/pay/weixin', auth, pay.weixinQr);
router.post('/pay/weixin/state', auth, pay.weixinPayState);
router.post('/pay/go', auth, pay.toPay);
router.post('/pay/sendPayConfirm', auth, pay.sendPayConfirm);

// 支付回调
router.get('/pay/callback/:type', auth, pay.callback);
router.post('/pay/callback/:type', auth, pay.callback);// 银联是post方式返回的

// 支付异步回调
router.get('/pay/notify/:type', auth, pay.notify);

module.exports = router;