2017-05-30 06:06:14 +00:00
|
|
|
var express = require('express');
|
|
|
|
var router = new express.Router();
|
|
|
|
var mail = require('../mail.js');
|
2017-10-02 09:19:55 +00:00
|
|
|
var auth = require('../auth.js');
|
|
|
|
|
|
|
|
// Auth middleware
|
|
|
|
var requestToken = function(request, response, next) {
|
|
|
|
auth.init(request, response, next);
|
|
|
|
};
|
2017-05-30 06:06:14 +00:00
|
|
|
|
2017-08-31 14:11:37 +00:00
|
|
|
// Payment method changes
|
2017-10-02 09:19:55 +00:00
|
|
|
router.post('/payment-update/:clientId', requestToken, function(request, response, next) {
|
|
|
|
mail.sendWithTemplate('payment-update', {recipient: request.params.clientId}, result => {
|
2017-08-30 12:50:46 +00:00
|
|
|
return response.json(result);
|
2017-05-30 06:06:14 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = router;
|