From e9de41ec0d3b53ef5a28a5b9fd6bd68030050d96 Mon Sep 17 00:00:00 2001
From: htoooth <ht.anglenx@gmail.com>
Date: Mon, 18 Jul 2016 14:09:25 +0800
Subject: [PATCH] init pay

---
 apps/shopping/controllers/finish.js | 13 +++++++++++++
 apps/shopping/controllers/pay.js    | 15 ++++++++++++---
 apps/shopping/models/finish.js      |  3 +++
 apps/shopping/models/pay-api.js     |  9 +++++++++
 apps/shopping/models/pay.js         | 12 ++++++++++++
 apps/shopping/router.js             | 12 ++++++++++--
 apps/shopping/views/action/pay.hbs  |  0
 7 files changed, 59 insertions(+), 5 deletions(-)
 create mode 100644 apps/shopping/controllers/finish.js
 create mode 100644 apps/shopping/models/finish.js
 create mode 100644 apps/shopping/models/pay-api.js
 create mode 100644 apps/shopping/views/action/pay.hbs

diff --git a/apps/shopping/controllers/finish.js b/apps/shopping/controllers/finish.js
new file mode 100644
index 0000000..d62534d
--- /dev/null
+++ b/apps/shopping/controllers/finish.js
@@ -0,0 +1,13 @@
+/**
+ * 支付成功页面
+ * @author: TaoHuang
+ * @date: 2016/07/18
+ */
+
+const finish = {
+    success: (req, res, next) => {
+
+    }
+};
+
+module.exports = finish;
\ No newline at end of file
diff --git a/apps/shopping/controllers/pay.js b/apps/shopping/controllers/pay.js
index d580b78..845ceee 100644
--- a/apps/shopping/controllers/pay.js
+++ b/apps/shopping/controllers/pay.js
@@ -1,5 +1,14 @@
 /**
- * 订单支付 controller
- * @author: TODO
- * @date: 2016/07/04
+ * 订单支付
+ * @author: TaoHuang
+ * @date: 2016/07/18
  */
+
+const PayService = require('../models/pay');
+
+const Pay = {
+    online: (req, res, next) => {
+    }
+};
+
+module.exports = Pay;
diff --git a/apps/shopping/models/finish.js b/apps/shopping/models/finish.js
new file mode 100644
index 0000000..93c6a13
--- /dev/null
+++ b/apps/shopping/models/finish.js
@@ -0,0 +1,3 @@
+/**
+ * Created by TaoHuang on 2016/7/18.
+ */
diff --git a/apps/shopping/models/pay-api.js b/apps/shopping/models/pay-api.js
new file mode 100644
index 0000000..56de594
--- /dev/null
+++ b/apps/shopping/models/pay-api.js
@@ -0,0 +1,9 @@
+/**
+ * Created by TaoHuang on 2016/7/18.
+ */
+
+const api = global.yoho.API;
+
+const API = {};
+
+module.exports = API;
diff --git a/apps/shopping/models/pay.js b/apps/shopping/models/pay.js
index 8b13789..3b356e7 100644
--- a/apps/shopping/models/pay.js
+++ b/apps/shopping/models/pay.js
@@ -1 +1,13 @@
+/**
+ * 订单支付
+ * @author: TaoHuang
+ * @date: 2016/07/18
+ */
+
+
+const api = require('pay-api');
+
+const Service = {};
+
+module.exports = Service;
 
diff --git a/apps/shopping/router.js b/apps/shopping/router.js
index 6f2aa4a..ac87b72 100644
--- a/apps/shopping/router.js
+++ b/apps/shopping/router.js
@@ -10,8 +10,10 @@ const router = require('express').Router(); // eslint-disable-line
 const cRoot = './controllers';
 const auth = require(`${global.middleware}/auth`);
 
-const cartCtrl = require(`${cRoot}/cart`); // 购物车
-const order = require(`${cRoot}/order`); // 下单
+const cartCtrl = require(`${cRoot}/cart`);  // 购物车
+const order = require(`${cRoot}/order`);    // 下单
+const pay = require(`${cRoot}/pay`);      // 支付
+const finish = require(`${cRoot}/finish`); // 完成
 
 // 购物车
 router.get('/cart', cartCtrl.index);
@@ -28,4 +30,10 @@ router.get('/order', auth, order.index);
 router.get('/order/compute', auth, order.compute);
 router.post('/order/submit', auth, order.orderSub);
 
+// 支付
+router.get('/pay/online', auth, pay.online);
+
+// 在线支持完成
+router.get('/pay/online/success', auth, finish.success);
+
 module.exports = router;
diff --git a/apps/shopping/views/action/pay.hbs b/apps/shopping/views/action/pay.hbs
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/apps/shopping/views/action/pay.hbs
--
libgit2 0.24.0