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
435afa02
Commit
435afa02
authored
Aug 12, 2021
by
Antonio.Suerte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Help2Pay Migration [Withdrawal Webhook Debugger]
parent
b9dc972e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
32 deletions
+35
-32
H2PWithdrawalWebhook.php
api/H2PWithdrawalWebhook.php
+35
-32
No files found.
api/H2PWithdrawalWebhook.php
View file @
435afa02
...
@@ -77,21 +77,44 @@ class H2PWithdrawalWebhook extends System {
...
@@ -77,21 +77,44 @@ class H2PWithdrawalWebhook extends System {
return
$params
;
return
$params
;
}
}
public
function
listen
(){
private
function
logEvent
(
$message
,
$logType
){
$logDate
=
date
(
"Y-m-d"
);
$logDir
=
NO_STRING
;
$response
=
implode
(
"&"
,
$_POST
);
switch
(
$logType
){
case
VAL_INT_1
:
$logDir
=
$this
->
accessLog
;
break
;
case
VAL_INT_2
:
$logDir
=
$this
->
errorLog
;
break
;
case
VAL_INT_3
:
$logDir
=
$this
->
successLog
;
break
;
}
$logDate
=
date
(
"Y-m-d"
);
$logTimeStamp
=
date
(
"[Y-m-d H:i:s]"
);
//log the access details
error_log
(
error_log
(
date
(
"[Y-m-d H:i:s]"
)
.
"
\r\n
Accessed:
{
$response
}
\r\n\r\n
"
,
"
{
$logTimeStamp
}
\r\n
{
$message
}
\r\n\r\n
"
,
VAL_INT_3
,
VAL_INT_3
,
"
{
$
this
->
accessLog
}
/Log_
{
$logDate
}
.log"
"
{
$
logDir
}
/Log_
{
$logDate
}
.log"
);
);
}
public
function
listen
(){
$response
=
print_r
(
$_POST
,
true
);
//log the access details
$this
->
logEvent
(
"Accessed:
{
$response
}
"
,
VAL_INT_1
);
if
(
$this
->
transactionNum
!=
NO_STRING
&&
$this
->
transactionKey
!=
NO_STRING
){
if
(
$this
->
transactionNum
!=
NO_STRING
&&
$this
->
transactionKey
!=
NO_STRING
){
$result
=
$this
->
getRowData
(
$this
->
accessSelect
(
'SELECT_WITHDRAW_H2P_TEMP'
,
array
(
$this
->
transactionNum
)));
$result
=
$this
->
getRowData
(
$this
->
accessSelect
(
'SELECT_WITHDRAW_H2P_TEMP'
,
array
(
$this
->
transactionNum
)));
if
(
$this
->
isLoopData
(
$result
)){
if
(
$this
->
isLoopData
(
$result
)){
$resultData
=
print_r
(
$result
,
true
);
$this
->
logEvent
(
"Withdrawal Transaction Data:
{
$resultData
}
"
,
VAL_INT_1
);
$memberCode
=
$this
->
getColumnData
(
$result
,
COLUMN_USER_ACCOUNT
);
$memberCode
=
$this
->
getColumnData
(
$result
,
COLUMN_USER_ACCOUNT
);
$bankCode
=
$this
->
getColumnData
(
$result
,
COLUMN_RECEIPT_BANK_NAME
);
$bankCode
=
$this
->
getColumnData
(
$result
,
COLUMN_RECEIPT_BANK_NAME
);
$language
=
$this
->
getColumnData
(
$result
,
COLUMN_LANGUAGE
);
$language
=
$this
->
getColumnData
(
$result
,
COLUMN_LANGUAGE
);
...
@@ -117,11 +140,7 @@ class H2PWithdrawalWebhook extends System {
...
@@ -117,11 +140,7 @@ class H2PWithdrawalWebhook extends System {
VAR_CS_MAIL_ADDRESS
VAR_CS_MAIL_ADDRESS
);
);
error_log
(
$this
->
logEvent
(
"success status:
\r\n\r\n
{
$response
}
"
,
VAL_INT_3
);
date
(
"[Y-m-d H:i:s]"
)
.
"
\r\n
success status:
\r\n\r\n
{
$response
}
\r\n\r\n
"
,
VAL_INT_3
,
"
{
$this
->
successLog
}
/Log_
{
$logDate
}
.log"
);
break
;
break
;
case
"001"
:
case
"001"
:
//update withdraw
//update withdraw
...
@@ -135,36 +154,20 @@ class H2PWithdrawalWebhook extends System {
...
@@ -135,36 +154,20 @@ class H2PWithdrawalWebhook extends System {
VAR_CS_MAIL_ADDRESS
VAR_CS_MAIL_ADDRESS
);
);
error_log
(
$this
->
logEvent
(
"nfail status:
\r\n\r\n
{
$response
}
"
,
VAL_INT_2
);
date
(
"[Y-m-d H:i:s]"
)
.
"
\r\n
fail status:
\r\n\r\n
{
$response
}
\r\n\r\n
"
,
VAL_INT_3
,
"
{
$this
->
errorLog
}
/Log_
{
$logDate
}
.log"
);
break
;
break
;
default
:
default
:
//error, status not valid
//error, status not valid
error_log
(
$this
->
logEvent
(
"Error status code invalid:
\r\n\r\n
{
$response
}
\r\n
{
$this
->
status
}
"
,
VAL_INT_2
);
date
(
"[Y-m-d H:i:s]"
)
.
"
\r\n
Error status code invalid:
\r\n\r\n
{
$response
}
\r\n\r\n
{
$this
->
status
}
\r\n\r\n
"
,
VAL_INT_3
,
"
{
$this
->
errorLog
}
/Log_
{
$logDate
}
.log"
);
break
;
break
;
}
}
}
else
{
}
else
{
//error, member code not valid
//error, member code not valid
error_log
(
$this
->
logEvent
(
"Error member code invalid:
{
$memberCode
}
"
,
VAL_INT_2
);
date
(
"[Y-m-d H:i:s]"
)
.
"
\r\n
Error member code invalid:
{
$memberCode
}
\r\n\r\n
"
,
VAL_INT_3
,
"
{
$this
->
errorLog
}
/Log_
{
$logDate
}
.log"
);
}
}
}
else
{
}
else
{
//error, status not valid
//error, status not valid
error_log
(
$this
->
logEvent
(
"Key invalid:
\r\n\r\n
{
$response
}
"
,
VAL_INT_2
);
date
(
"[Y-m-d H:i:s]"
)
.
"
\r\n
Key invalid:
\r\n\r\n
{
$response
}
\r\n\r\n
"
,
VAL_INT_3
,
"
{
$this
->
errorLog
}
/Log_
{
$logDate
}
.log"
);
}
}
}
}
}
}
...
...
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