Card stripe update
This commit is contained in:
@@ -6,8 +6,8 @@ const cards = require('../../service/cards.js');
|
||||
//const logger = require('../../app/logger');
|
||||
|
||||
const cardsControllers = {
|
||||
createApplications: function(req, res){
|
||||
cards.createApplications(req, res, function (err, result) {
|
||||
cardApplications: function(req, res){
|
||||
cards.cardApplications(req, res, function (err, result) {
|
||||
res.status(200).json({
|
||||
'status': 'OK',
|
||||
'internal_return': 0,
|
||||
@@ -30,6 +30,18 @@ const cardsControllers = {
|
||||
console.log(r);
|
||||
});
|
||||
},
|
||||
retrieveCard: function (req, res) {
|
||||
cards.retrieveCard(req, res, function (err, result) {
|
||||
res.status(200).json({
|
||||
'status': 'OK',
|
||||
'internal_return': 0,
|
||||
'result_list': result.result,
|
||||
'total_record': result.total_record
|
||||
})
|
||||
}).then(r =>{
|
||||
console.log(r);
|
||||
});
|
||||
},
|
||||
createCard: function (req, res) {
|
||||
cards.createCard(req, res, function (err, result) {
|
||||
res.status(200).json({
|
||||
@@ -42,6 +54,30 @@ const cardsControllers = {
|
||||
console.log(r);
|
||||
});
|
||||
},
|
||||
createCardWallet: function (req, res){
|
||||
cards.createCardWallet(req, res, function (err, dist) {
|
||||
if (err) {
|
||||
res.send(err);
|
||||
}
|
||||
res.status(200).json({
|
||||
'status': 'OK',
|
||||
'result': dist,
|
||||
'internal_return': 0,
|
||||
})
|
||||
});
|
||||
},
|
||||
listCards: function (req, res){
|
||||
cards.acceptCardTerms(req, res, function (err, dist) {
|
||||
if (err) {
|
||||
res.send(err);
|
||||
}
|
||||
res.status(200).json({
|
||||
'status': 'OK',
|
||||
'result': dist,
|
||||
'internal_return': 0,
|
||||
})
|
||||
});
|
||||
},
|
||||
acceptCardTerms: function (req, res){
|
||||
cards.acceptCardTerms(req, res, function (err, dist) {
|
||||
if (err) {
|
||||
|
||||
+7
-5
@@ -5,7 +5,7 @@ const cardsControllers = require('../controller/cardsController.js');
|
||||
|
||||
module.exports = function(app) {
|
||||
app.route('/cardapplications')
|
||||
.post(cardsControllers.createApplications);
|
||||
.post(cardsControllers.cardApplications);
|
||||
app.route('/createCardHolder')
|
||||
.post(cardsControllers.createCardHolder);
|
||||
app.route('/acceptterms')
|
||||
@@ -14,10 +14,12 @@ module.exports = function(app) {
|
||||
.post(cardsControllers.createCard);
|
||||
app.route('/activate')
|
||||
.post(cardsControllers.activateCard);
|
||||
|
||||
app.route('/create')
|
||||
.post(cardsControllers.acceptCardTerms);
|
||||
|
||||
app.route('/cardwallet')
|
||||
.post(cardsControllers.createCardWallet);
|
||||
app.route('/listcards')
|
||||
.post(cardsControllers.listCards);
|
||||
app.route('/retrievecard')
|
||||
.post(cardsControllers.retrieveCard);
|
||||
// app.route('/eventSendMoney')
|
||||
// .post(controller.activateCard);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user