Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
iwl-live
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Anthony.Suerte
iwl-live
Commits
1dfc78c1
Commit
1dfc78c1
authored
Dec 07, 2021
by
Antonio.Suerte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Payment API Session Expiration Enhancement
parent
57f9b8dc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
18 deletions
+50
-18
controller.php
logic/settlement/controller.php
+3
-0
model.php
logic/settlement/model.php
+47
-18
No files found.
logic/settlement/controller.php
View file @
1dfc78c1
...
@@ -41,6 +41,9 @@ class ControlSettlement extends LogicSettlement {
...
@@ -41,6 +41,9 @@ class ControlSettlement extends LogicSettlement {
case
TYPE_FAIL
:
case
TYPE_FAIL
:
require_once
(
$this
->
getUserHTML
(
'TEMPLATE_SETTLEMENT_FAIL_PATH'
));
require_once
(
$this
->
getUserHTML
(
'TEMPLATE_SETTLEMENT_FAIL_PATH'
));
break
;
break
;
case
TYPE_REQUEST_SESSION_EXPIRED
:
require_once
(
$this
->
getUserHTML
(
'TEMPLATE_SETTLEMENT_REQUEST_EXPIRED_PATH'
));
break
;
}
}
}
catch
(
Exception
$e
)
{
}
catch
(
Exception
$e
)
{
...
...
logic/settlement/model.php
View file @
1dfc78c1
...
@@ -343,11 +343,11 @@ class SettlementModelClass extends ModelClassEx {
...
@@ -343,11 +343,11 @@ class SettlementModelClass extends ModelClassEx {
$this
->
settleForm
=
$this
->
getSettlementForm
(
$midsign
->
uniqueKey
);
$this
->
settleForm
=
$this
->
getSettlementForm
(
$midsign
->
uniqueKey
);
$redirection
=
function
(
$deleteForm
=
true
)
use
(
$midsign
,
$settleData
)
{
$redirection
=
function
(
$deleteForm
=
true
)
use
(
$midsign
,
$settleData
)
{
if
(
$deleteForm
)
if
(
$deleteForm
)
{
$this
->
accessModify
(
"DELETE_SETTLEMENT_FORM"
,
[
$midsign
->
uniqueKey
],
false
);
$this
->
accessModify
(
"DELETE_SETTLEMENT_FORM"
,
[
$midsign
->
uniqueKey
],
false
);
$this
->
setType
(
TYPE_REQUEST_SESSION_EXPIRED
);
header
(
"Location: /
{
$settleData
->
language
}
"
);
}
else
exit
(
);
header
(
"Location: /
{
$settleData
->
language
}
"
);
};
};
if
(
$this
->
settleForm
){
if
(
$this
->
settleForm
){
...
@@ -455,21 +455,50 @@ class SettlementModelClass extends ModelClassEx {
...
@@ -455,21 +455,50 @@ class SettlementModelClass extends ModelClassEx {
$this
->
setType
(
TYPE_FAIL
);
$this
->
setType
(
TYPE_FAIL
);
}
}
private
function
validateProcessing
(){
private
function
validateProcessing
(){
if
(
$this
->
uniqueSubmission
==
$this
->
formName
.
md5
(
$this
->
paymentAPIConf
->
middleware_sig_passphrase
))
{
try
{
$
this
->
setData
()
;
$
midPsignKey
=
$this
->
paymentAPIConf
->
middleware_sig_passphrase
;
$
this
->
arrangeFreeParams
(
);
$
jwtTokenKey
=
$this
->
midconf
->
token_secretkey
.
strtotime
(
date
(
"Ymd"
)
);
if
(
$this
->
balance
<
(
$this
->
debitAmount
+
$this
->
getFeeEx
()))
{
// throwable
$this
->
invalidFormParams
[]
=
$this
->
getMessage
(
ERROR
,
'E_INSUFFICIENT_FUNDS'
,
$decoded
=
JWT
::
decode
(
array
(
$this
->
debitCurrency
,
$this
->
paymentToken
,
$this
->
formatCurrency
((
$this
->
debitAmount
+
$this
->
getFeeEx
()),
$this
->
debitCurrency
)));
$jwtTokenKey
,
}
[
$this
->
midconf
->
algorithm
]);
}
else
$this
->
invalidFormParams
[]
=
"Invalid Submission Identifier!"
;
// throwable
$midsign
=
Crypto
::
decryptWithPassword
(
$decoded
->
midsign
,
$midPsignKey
);
if
(
$this
->
isLoopData
(
$this
->
invalidFormParams
))
$this
->
setType
(
TYPE_FAIL
);
if
(
$this
->
checkJSONString
(
$midsign
)){
$midsign
=
json_decode
(
$midsign
);
$expire
=
strtotime
(
$midsign
->
expiration
);
$now
=
strtotime
(
date
(
"YmdHis"
));
if
(
$now
>
$expire
)
throw
new
Exception
(
"Session Expired"
);
}
else
throw
new
Exception
(
"Not a JSON String"
);
if
(
$this
->
uniqueSubmission
==
$this
->
formName
.
md5
(
$this
->
paymentAPIConf
->
middleware_sig_passphrase
)){
$this
->
setData
();
$this
->
arrangeFreeParams
();
if
(
$this
->
balance
<
(
$this
->
debitAmount
+
$this
->
getFeeEx
()))
{
$this
->
invalidFormParams
[]
=
$this
->
getMessage
(
ERROR
,
'E_INSUFFICIENT_FUNDS'
,
array
(
$this
->
debitCurrency
,
$this
->
formatCurrency
((
$this
->
debitAmount
+
$this
->
getFeeEx
()),
$this
->
debitCurrency
)));
}
}
else
$this
->
invalidFormParams
[]
=
"Invalid Submission Identifier!"
;
if
(
$this
->
isLoopData
(
$this
->
invalidFormParams
))
$this
->
setType
(
TYPE_FAIL
);
}
catch
(
Exception
$e
){
$this
->
accessModify
(
"DELETE_SETTLEMENT_FORM"
,
[
$this
->
formName
],
false
);
$this
->
setType
(
TYPE_REQUEST_SESSION_EXPIRED
);
}
}
}
private
function
arrangeFormLink
(){
private
function
arrangeFormLink
(){
...
...
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