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
1d2a781f
Commit
1d2a781f
authored
Jun 28, 2021
by
Anthony.Suerte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CCD Solution [Failed Payment Filter]
parent
93304414
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
112 additions
and
12 deletions
+112
-12
APNWebhook.php
api/APNWebhook.php
+58
-11
deposit_ccd_fail.xml
system/documents/mail_template/deposit_ccd_fail.xml
+53
-0
sql.xml
system/lib/sql.xml
+1
-1
No files found.
api/APNWebhook.php
View file @
1d2a781f
...
...
@@ -69,6 +69,13 @@ class APNWebHook extends System{
}
}
private
function
updateTempCCDepositTransaction
(
$tempDepositData
){
$this
->
accessModify
(
"UPDATE_TEMP_CCDEPOSIT"
,
[
"(')
{
$tempDepositData
[
"invoice_num"
]
}
(')"
,
$tempDepositData
[
"credited"
]
],
false
);
}
private
function
creditTransaction
(
$tempDepositData
){
$comment
=
"[APN Reference No.]
\\
n
{
$tempDepositData
[
"invoice_num"
]
}
"
;
...
...
@@ -93,8 +100,6 @@ class APNWebHook extends System{
NO_COUNT
,
$tempDepositData
[
COLUMN_MESSAGE
],
],
false
);
$this
->
accessModify
(
"UPDATE_TEMP_CCDEPOSIT"
,
[
"(')
{
$tempDepositData
[
"invoice_num"
]
}
(')"
],
false
);
}
private
function
sendTransactionCompleteNotice
(
$txn
){
...
...
@@ -117,6 +122,26 @@ class APNWebHook extends System{
,
VAR_CS_MAIL_ADDRESS
);
}
private
function
sendTransactionFailedNotice
(
$txn
){
$member
=
$this
->
getRowData
(
$this
->
getAccountCommon
(
$txn
[
COLUMN_USER_ACCOUNT
]));
$params
=
[
$member
[
COLUMN_USER_ACCOUNT
],
$this
->
getNameCommon
(
$member
[
COLUMN_USER_ACCOUNT
]),
$txn
[
COLUMN_TRANSACTION_NUMBER
],
date
(
"Y-m-d H:i:s"
),
$txn
[
"currency"
],
$this
->
intToCurrency
(
$txn
[
COLUMN_AMOUNT
]
+
$txn
[
COLUMN_FEE
],
$txn
[
COLUMN_CURRENCY
]),
$txn
[
"currency"
],
$this
->
intToCurrency
(
$txn
[
COLUMN_AMOUNT
],
$txn
[
COLUMN_CURRENCY
])
];
$this
->
sendMailByTmp
(
'deposit_ccd_fail.xml'
,
$params
,
$this
->
getColumnData
(
$member
,
COLUMN_MAIL
)
,
VAR_CS_MAIL_ADDRESS
);
}
private
function
isJSON
(
$string
){
return
is_string
(
$string
)
&&
is_array
(
json_decode
(
$string
,
true
))
...
...
@@ -154,19 +179,41 @@ class APNWebHook extends System{
$tempDepositData
=
$this
->
apnIntegration
->
getTempDepositDataBy
(
'invoice_num'
,
$decpload
->
reference
);
if
(
$tempDepositData
){
if
(
!
$tempDepositData
[
"credited"
]
){
$t
his
->
creditTransaction
(
$tempDepositData
);
if
(
$tempDepositData
[
"credited"
]
==
0
){
$t
empDepositData
[
"deposit_date"
]
=
date
(
"Y-m-d H:i:s"
);
switch
(
$decpload
->
status
){
case
"PAID"
:
{
$tempDepositData
[
"credited"
]
=
1
;
$tempDepositData
[
"deposit_date"
]
=
date
(
"Y-m-d H:i:s"
);
$this
->
creditTransaction
(
$tempDepositData
);
$this
->
updateTempCCDepositTransaction
(
$tempDepositData
);
$this
->
sendTransactionCompleteNotice
(
$tempDepositData
);
break
;
}
$message
=
print_r
(
$tempDepositData
,
true
);
case
"FAILED"
:
{
$tempDepositData
[
"credited"
]
=
2
;
$this
->
updateTempCCDepositTransaction
(
$tempDepositData
);
$this
->
sendTransactionFailedNotice
(
$tempDepositData
);
break
;
}
}
$this
->
sendTransactionCompleteNotice
(
$tempDepositData
);
$tempDepositData
[
"amount"
]
=
$this
->
intToCurrency
(
$tempDepositData
[
"amount"
],
$tempDepositData
[
"currency"
]);
$tempDepositData
[
"fee"
]
=
$this
->
intToCurrency
(
$tempDepositData
[
"fee"
],
$tempDepositData
[
"currency"
]);
$message
=
print_r
(
$tempDepositData
,
true
);
error_log
(
"[
$msgtime
]
\n
{
$message
}
\n\n
"
,
3
,
"Logs/APN/
{
$fileName
}
"
);
}
else
}
else
{
switch
(
$tempDepositData
[
"credited"
]){
case
1
:
error_log
(
"[
$msgtime
]
\n
Invoice Already Credited:
{
$decpload
->
reference
}
\n\n
"
,
3
,
"Logs/APN/
{
$fileName
}
"
);
break
;
case
2
:
error_log
(
"[
$msgtime
]
\n
Failed Invoice:
{
$decpload
->
reference
}
\n\n
"
,
3
,
"Logs/APN/
{
$fileName
}
"
);
break
;
}
}
}
else
error_log
(
"[
$msgtime
]
\n
Reference num doesn't exist:
{
$decpload
->
reference
}
\n\n
"
,
3
,
"Logs/APN/
{
$fileName
}
"
);
}
else
{
...
...
system/documents/mail_template/deposit_ccd_fail.xml
0 → 100644
View file @
1d2a781f
<?xml version="1.0" encoding="UTF-8"?>
<MAIL>
<title>
【iWallet】クレジットカード入金が失敗しました/Failed Deposit via Credit Card Deposit Solution
</title>
<body>
__ELEMENT01__ __ELEMENT02__ 様
平素よりiWalletをご利用いただき、誠にありがとうございます。
クレジットカード決済が失敗しました。
日時:__ELEMENT04__(GMT +8)
お支払い金額: __ELEMENT05__ __ELEMENT06__
カード決済失敗の原因は、下記が考えられます。
・間違ったカード情報の詳細
・残高不足
・ご申請額はご入金限度額の範囲外となります。
別のご入金方法をご利用ください。
ご質問やご不明な点などございましたら、いつでもお気軽にお問合せ下さいませ。
今後ともiWalletを何卒宜しくお願い申し上げます。
__ELEMENT01__ Mr./Ms. __ELEMENT02__
Thank you for using iWallet.
Your credit card deposit request failed.
Transaction time/date : __ELEMENT04__(GMT +8)
Payment amount :__ELEMENT05__ __ELEMENT06__
The possible causes of the transaction failing are as follows:
· Wrong card information details
· Insufficient Funds
· The amount you are trying to deposit is outside the payment limit
Please try again or use another card once you have confirmed the above reasons. You may also use another deposit method to complete your transaction.
If you have any questions or inquiries, please do not hesitate to contact us.
We are committed to providing our customers with the highest quality of service.
━━━━━━━━━━━━━━━━━━
iWallet Customer Support
URL:https://secure.iwl.world/
Email:cs@iwl.world
━━━━━━━━━━━━━━━━━━
</body>
</MAIL>
system/lib/sql.xml
View file @
1d2a781f
...
...
@@ -11736,7 +11736,7 @@ WHERE
<UPDATE_TEMP_CCDEPOSIT>
UPDATE t_deposit_credit_card_temporary
SET credited = '
1
' where invoice_num = __ELEMENT01__
SET credited = '
__ELEMENT02__
' where invoice_num = __ELEMENT01__
</UPDATE_TEMP_CCDEPOSIT>
<INSERT_TRANSACTION_TOKEN>
...
...
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