Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yotta
/
pictogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
60
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
bcb511fa
authored
Sep 15, 2017
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
updating tpv notification
parent
fe41e670
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
10 deletions
sails/src/api/controllers/LicenseController.js
sails/src/api/controllers/TPVController.js
sails/src/config/policies.js
sails/src/config/routes.js
sails/src/api/controllers/LicenseController.js
View file @
bcb511fa
...
@@ -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
);
...
...
sails/src/api/controllers/TPVController.js
View file @
bcb511fa
...
@@ -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
();
}
};
};
sails/src/config/policies.js
View file @
bcb511fa
...
@@ -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'
]
},
},
...
...
sails/src/config/routes.js
View file @
bcb511fa
...
@@ -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'
};
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment