updating tpv notification

parent fe41e670
...@@ -79,7 +79,7 @@ module.exports = { ...@@ -79,7 +79,7 @@ module.exports = {
if (!params.number) if (!params.number)
return res.badRequest(); return res.badRequest();
License.activate(req.license, req.body.id_stu, function(err, license) { License.activate(params.number, params.id_stu, function(err, license) {
if (err) if (err)
return res.badRequest(err); return res.badRequest(err);
return res.ok(license); return res.ok(license);
......
...@@ -59,9 +59,9 @@ module.exports = { ...@@ -59,9 +59,9 @@ module.exports = {
DS_MERCHANT_TRANSACTIONTYPE: "0", // Type of the transaction (0: authorized) DS_MERCHANT_TRANSACTIONTYPE: "0", // Type of the transaction (0: authorized)
DS_MERCHANT_AMOUNT: amount + "00", // Amount DS_MERCHANT_AMOUNT: amount + "00", // Amount
DS_MERCHANT_ORDER: moment().format('YYMMDD') + license.id.toString().slice(-6), // hast to be from 4 to 12 characters long DS_MERCHANT_ORDER: moment().format('YYMMDD') + license.id.toString().slice(-6), // hast to be from 4 to 12 characters long
DS_MERCHANT_MERCHANTURL: sails.getBaseUrl() + "/tpv/notify", // not used DS_MERCHANT_MERCHANTURL: 'https://' + req.headers.host + "/license/" + license.number + "/stu/" + params.id_stu, // notification to activate
DS_MERCHANT_URLOK: sails.getBaseUrl() + '/app/#/student/' + params.id_stu + "/setup/renewed/" + license.number, // Returning URL (success) DS_MERCHANT_URLOK: 'https://' + req.headers.host + '/app/#/student/' + params.id_stu + "/setup/renewed/1" + license.number, // Returning URL (success)
DS_MERCHANT_URLKO: sails.getBaseUrl() + '/app/#/student/' + params.id_stu + "/setup/renewed/0" // Returning URL (error) DS_MERCHANT_URLKO: 'https://' + req.headers.host + '/app/#/student/' + params.id_stu + "/setup/renewed/0" // Returning URL (error)
}; };
console.log("Data: " + JSON.stringify(tpvdata)); console.log("Data: " + JSON.stringify(tpvdata));
...@@ -101,7 +101,4 @@ module.exports = { ...@@ -101,7 +101,4 @@ module.exports = {
.catch((err) => {return res.serverError(err)}); .catch((err) => {return res.serverError(err)});
}, },
notify: function(res, req) {
return res.ok();
}
}; };
...@@ -130,7 +130,7 @@ module.exports.policies = { ...@@ -130,7 +130,7 @@ module.exports.policies = {
// create: ['tokenAuth', 'isAdmin'], // create: ['tokenAuth', 'isAdmin'],
// activate: ['tokenAuth'] // activate: ['tokenAuth']
create: ['tokenAuth'], create: ['tokenAuth'],
activate: ['tokenAuth'], activate: true,
getByEmail: ['tokenAuth'] getByEmail: ['tokenAuth']
}, },
......
...@@ -41,7 +41,7 @@ module.exports.routes = { ...@@ -41,7 +41,7 @@ module.exports.routes = {
'GET /license/:email': 'LicenseController.getByEmail', 'GET /license/:email': 'LicenseController.getByEmail',
'POST /license': 'LicenseController.create', 'POST /license': 'LicenseController.create',
'PUT /license/:number': 'LicenseController.activate', 'GET /license/:number/stu/:id_stu': 'LicenseController.activate',
'PUT /method/:id': 'MethodController.update', 'PUT /method/:id': 'MethodController.update',
'POST /method': 'MethodController.create', 'POST /method': 'MethodController.create',
...@@ -149,5 +149,4 @@ module.exports.routes = { ...@@ -149,5 +149,4 @@ module.exports.routes = {
'POST /ws/:id_ws/close': 'WorkingSessionController.close', 'POST /ws/:id_ws/close': 'WorkingSessionController.close',
'POST /tpv/init': 'TPVController.init', 'POST /tpv/init': 'TPVController.init',
'POST /tpv/notify': 'TPVController.notify'
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment