aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/controllers/transaction.js14
-rw-r--r--server/routes/api.js4
2 files changed, 18 insertions, 0 deletions
diff --git a/server/controllers/transaction.js b/server/controllers/transaction.js
new file mode 100644
index 0000000..119705e
--- /dev/null
+++ b/server/controllers/transaction.js
@@ -0,0 +1,14 @@
+const paypal = require('@paypal/checkout-server-sdk');
+const paypalClient = require('../config/paypal');
+
+module.exports = {
+
+ async setup(req, res) {
+
+ },
+
+ async capture(req, res) {
+
+ }
+
+};
diff --git a/server/routes/api.js b/server/routes/api.js
index 33885c9..c48e169 100644
--- a/server/routes/api.js
+++ b/server/routes/api.js
@@ -3,6 +3,7 @@ const router = express.Router();
const userController = require('../controllers/user');
const productsController = require('../controllers/products');
+const transactionController = require('../controllers/transaction');
const {isAuth, isAdmin, upload} = require('../lib/middleware');
@@ -16,4 +17,7 @@ router.post('/products', isAuth, isAdmin, upload.single('image'), productsContro
router.patch('/products/:id', isAuth, isAdmin, upload.single('image'), productsController.update);
router.delete('/products/:id', isAuth, isAdmin, productsController.destroy);
+router.post('/transaction/setup', isAuth, transactionController.setup);
+router.get('/transaction/capture', transactionController.capture);
+
module.exports = router;