aboutsummaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorMateja <mail@matejamaric.com>2021-07-15 22:51:08 +0200
committerMateja <mail@matejamaric.com>2021-07-15 22:51:08 +0200
commitdf8ab8735bcad64fc76e624940a0538681760775 (patch)
treef903a4c195d620f238e0d7362b0c1acc029054c4 /server
parent1b04c332c2562f52c11ca653c4cd55f4c24548e5 (diff)
downloadmevn-ecommerce-df8ab8735bcad64fc76e624940a0538681760775.tar.gz
mevn-ecommerce-df8ab8735bcad64fc76e624940a0538681760775.zip
Setup transaction routes.
Diffstat (limited to 'server')
-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;