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
e9039541
Commit
e9039541
authored
Oct 04, 2021
by
Antonio.Suerte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Setting Centralization
parent
52f8966d
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
56 additions
and
182 deletions
+56
-182
Flat3Webhook.php
api/flat3/Flat3Webhook.php
+1
-8
help2PayAPI.php
api/help2PayAPI.php
+2
-4
Settle.php
api/mids/Settle.php
+2
-17
EasyPaymentLinkAPI.php
logic/deposit/ext/EasyPaymentLinkAPI.php
+2
-17
model.php
logic/deposit/model.php
+3
-26
model.php
logic/middleware/model.php
+1
-16
EasyPaymentLink.php
logic/middleware/purposes/EasyPaymentLink.php
+1
-22
PaymentAPI.php
logic/middleware/purposes/PaymentAPI.php
+2
-20
model.php
logic/settlement/model.php
+2
-20
DevComponents.php
system/api/dev/DevComponents.php
+1
-1
checker.php
system/lib/checker.php
+3
-4
common.php
system/lib/common.php
+25
-5
test_curl_h2p_payout.php
test/help2pay/test_curl_h2p_payout.php
+2
-4
test_deposit.php
test/help2pay/test_deposit.php
+3
-5
FrameworkTest.php
test/lib/FrameworkTest.php
+6
-13
No files found.
api/flat3/Flat3Webhook.php
View file @
e9039541
...
...
@@ -75,14 +75,7 @@ class Flat3Webhook extends System {
$this
->
transLog
=
"../Logs/SAPAY"
;
$this
->
errorLog
=
"../Logs/SAPAY/Error"
;
$this
->
devSetting
=
$this
->
getRowData
(
$this
->
accessSelect
(
"SELECT_DEV_SETTING"
,
[
"flat3_webhook"
]));
if
(
$this
->
isLoopData
(
$this
->
devSetting
)){
$this
->
devSettingEnabled
=
$this
->
getColumnData
(
$this
->
devSetting
,
"dev_setting_enabled"
);
if
(
$this
->
checkJSONString
(
$this
->
getColumnData
(
$this
->
devSetting
,
"dev_setting_value"
)))
$this
->
devSetting
=
json_decode
(
$this
->
getColumnData
(
$this
->
devSetting
,
"dev_setting_value"
));
}
$this
->
devSetting
=
$this
->
getSettingConfiguration
(
"flat3_webhook"
);
}
private
function
requestDetails
(){
...
...
api/help2PayAPI.php
View file @
e9039541
...
...
@@ -16,11 +16,9 @@ class help2PayAPI extends System {
}
private
function
fillCredentials
(){
$h2pSettings
=
$this
->
getRowData
(
$this
->
accessSelect
(
"SELECT_DEV_SETTING"
,
[
"help2pay_conf"
]));
if
(
$this
->
isLoopData
(
$h2pSettings
)){
$h2pSettings
=
json_decode
(
$this
->
getColumnData
(
$h2pSettings
,
"dev_setting_value"
));
$h2pSettings
=
$this
->
getSettingConfiguration
(
"help2pay_conf"
);
if
(
$h2pSettings
){
$this
->
payoutUrl
=
$h2pSettings
->
payout_url
;
$this
->
ip
=
$h2pSettings
->
ip_address
;
$this
->
merchant_code
=
$h2pSettings
->
merchant_code
;
...
...
api/mids/Settle.php
View file @
e9039541
...
...
@@ -150,21 +150,6 @@ class Settle extends System {
}
}
private
function
getConfiguration
(
$settingId
){
$devSetting
=
$this
->
getRowData
(
$this
->
accessSelect
(
"SELECT_DEV_SETTING"
,
[
$settingId
]));
if
(
$this
->
isLoopData
(
$devSetting
)){
$enabled
=
$this
->
getColumnData
(
$devSetting
,
"dev_setting_enabled"
);
if
(
!
$enabled
)
return
false
;
if
(
$this
->
checkJSONString
(
$this
->
getColumnData
(
$devSetting
,
"dev_setting_value"
)))
return
json_decode
(
$this
->
getColumnData
(
$devSetting
,
"dev_setting_value"
));
}
else
return
false
;
}
private
function
validation
(){
$accessArray
=
[
"IP_Address"
=>
$this
->
getColumnData
(
$_SERVER
,
"REMOTE_ADDR"
),
...
...
@@ -289,8 +274,8 @@ class Settle extends System {
$this
->
getColumnData
(
$_SERVER
,
"HTTP_REFERER"
),
"[SERVER_TO_SERVER]
{
$this
->
payload
}
"
));
$middlewareSettings
=
$this
->
getConfiguration
(
"middleware_conf"
);
$settlementSettings
=
$this
->
getConfiguration
(
"payment_api_conf"
);
$middlewareSettings
=
$this
->
get
Setting
Configuration
(
"middleware_conf"
);
$settlementSettings
=
$this
->
get
Setting
Configuration
(
"payment_api_conf"
);
$jwtPayload
=
[
"purpose"
=>
"PaymentAPI"
,
...
...
logic/deposit/ext/EasyPaymentLinkAPI.php
View file @
e9039541
...
...
@@ -84,8 +84,8 @@ class EasyPaymentLinkAPI extends System {
}
private
function
setParameter
(){
$this
->
eplconf
=
$this
->
getConfiguration
(
"easy_payment_link"
);
$this
->
midconf
=
$this
->
getConfiguration
(
"middleware_conf"
);
$this
->
eplconf
=
$this
->
get
Setting
Configuration
(
"easy_payment_link"
);
$this
->
midconf
=
$this
->
get
Setting
Configuration
(
"middleware_conf"
);
}
private
function
validation
(){
...
...
@@ -103,21 +103,6 @@ class EasyPaymentLinkAPI extends System {
throw
new
Exception
(
print_r
(
$invalid
,
true
));
}
private
function
getConfiguration
(
$settingId
){
$devSetting
=
$this
->
getRowData
(
$this
->
accessSelect
(
"SELECT_DEV_SETTING"
,
[
$settingId
]));
if
(
$this
->
isLoopData
(
$devSetting
)){
$enabled
=
$this
->
getColumnData
(
$devSetting
,
"dev_setting_enabled"
);
if
(
!
$enabled
)
return
false
;
if
(
$this
->
checkJSONString
(
$this
->
getColumnData
(
$devSetting
,
"dev_setting_value"
)))
return
json_decode
(
$this
->
getColumnData
(
$devSetting
,
"dev_setting_value"
));
}
else
return
false
;
}
private
function
logDetails
(
$content
){
$timestamp
=
date
(
"Y-m-d H:i:s"
);
...
...
logic/deposit/model.php
View file @
e9039541
...
...
@@ -2454,7 +2454,7 @@ class DepositModelClass extends ModelClassEx {
$this
->
popUpSessionMessage
(
ERROR
,
'E_REQUIRED_HELP2PAY_NOTAGGREE_OTHER'
,
array
());
$this
->
setType
(
TYPE_H2P_CONFIRM
);
}
else
{
$h2pSettings
=
$this
->
getConfiguration
(
"help2pay_conf"
);
$h2pSettings
=
$this
->
get
Setting
Configuration
(
"help2pay_conf"
);
$this
->
h2pTransferUrl
=
$h2pSettings
->
transfer_url
;
$this
->
h2pSecurityCode
=
$h2pSettings
->
security_code
;
...
...
@@ -2800,8 +2800,8 @@ class DepositModelClass extends ModelClassEx {
$this
->
getType
()
==
TYPE_CCD_SUCCESS
||
$this
->
getType
()
==
TYPE_CCD_FAIL
){
$this
->
eplconf
=
$this
->
getConfiguration
(
"easy_payment_link"
);
$midconf
=
$this
->
getConfiguration
(
"middleware_conf"
);
$this
->
eplconf
=
$this
->
get
Setting
Configuration
(
"easy_payment_link"
);
$midconf
=
$this
->
get
Setting
Configuration
(
"middleware_conf"
);
if
(
!
$this
->
getUserBypassValue
(
PARAM_DEPOSIT
,
VAL_STR_CCDEPOSIT_METHOD
,
$this
->
getUserData
(
PARAM_USER_ACCOUNT
))){
$this
->
popUpSessionMessage
(
ERROR
,
'E_ERROR_OPTION_NOT_AVAILABLE'
,
array
());
...
...
@@ -2900,29 +2900,6 @@ class DepositModelClass extends ModelClassEx {
return
true
;
}
/**
*
* @param string $settingId
* @return boolean|mixed|array|unknown
*/
private
function
getConfiguration
(
$settingId
){
$devSetting
=
$this
->
getRowData
(
$this
->
accessSelect
(
"SELECT_DEV_SETTING"
,
[
$settingId
]));
if
(
$this
->
isLoopData
(
$devSetting
)){
$enabled
=
$this
->
getColumnData
(
$devSetting
,
"dev_setting_enabled"
);
if
(
!
$enabled
)
return
false
;
if
(
$this
->
checkJSONString
(
$this
->
getColumnData
(
$devSetting
,
"dev_setting_value"
))){
$devSetting
=
json_decode
(
$this
->
getColumnData
(
$devSetting
,
"dev_setting_value"
));
return
$devSetting
;
}
}
return
false
;
}
/**
*
* @param unknown $paramName
...
...
logic/middleware/model.php
View file @
e9039541
...
...
@@ -54,22 +54,7 @@ class MiddlewareModelClass extends ModelClassEx {
private
function
setParameter
()
{
$this
->
token
=
$this
->
getDataGet
(
"token"
);
$this
->
midconf
=
$this
->
getConfiguration
();
}
private
function
getConfiguration
(){
$devSetting
=
$this
->
getRowData
(
$this
->
accessSelect
(
"SELECT_DEV_SETTING"
,
[
"middleware_conf"
]));
if
(
$this
->
isLoopData
(
$devSetting
)){
$enabled
=
$this
->
getColumnData
(
$devSetting
,
"dev_setting_enabled"
);
if
(
!
$enabled
)
return
false
;
if
(
$this
->
checkJSONString
(
$this
->
getColumnData
(
$devSetting
,
"dev_setting_value"
)))
return
json_decode
(
$this
->
getColumnData
(
$devSetting
,
"dev_setting_value"
));
}
else
return
false
;
$this
->
midconf
=
$this
->
getSettingConfiguration
(
"middleware_conf"
);
}
private
function
decodeToken
(){
...
...
logic/middleware/purposes/EasyPaymentLink.php
View file @
e9039541
...
...
@@ -66,7 +66,7 @@ class EasyPaymentLink extends System {
*/
public
function
__construct
(){
parent
::
__construct
();
$this
->
eplconf
=
$this
->
get
Configuration
(
);
$this
->
eplconf
=
$this
->
get
SettingConfiguration
(
"easy_payment_link"
);
$this
->
eplTransactionId
=
$this
->
getDataGet
(
"transaction_id"
);
}
...
...
@@ -108,27 +108,6 @@ class EasyPaymentLink extends System {
$purpose
->
redirection
();
}
/**
*
* 開発者の設定
*
* @return boolean|mixed
*/
private
function
getConfiguration
(){
$devSetting
=
$this
->
getRowData
(
$this
->
accessSelect
(
"SELECT_DEV_SETTING"
,
[
"easy_payment_link"
]));
if
(
$this
->
isLoopData
(
$devSetting
)){
$enabled
=
$this
->
getColumnData
(
$devSetting
,
"dev_setting_enabled"
);
if
(
!
$enabled
)
return
false
;
if
(
$this
->
checkJSONString
(
$this
->
getColumnData
(
$devSetting
,
"dev_setting_value"
)))
return
json_decode
(
$this
->
getColumnData
(
$devSetting
,
"dev_setting_value"
));
}
else
return
false
;
}
/**
*
* 取引の処理
...
...
logic/middleware/purposes/PaymentAPI.php
View file @
e9039541
...
...
@@ -57,8 +57,8 @@ class PaymentAPI extends System {
}
private
function
initSettings
(){
$this
->
paymentAPIconf
=
$this
->
getConfiguration
(
"payment_api_conf"
);
$this
->
midconf
=
$this
->
getConfiguration
(
"middleware_conf"
);
$this
->
paymentAPIconf
=
$this
->
get
Setting
Configuration
(
"payment_api_conf"
);
$this
->
midconf
=
$this
->
get
Setting
Configuration
(
"middleware_conf"
);
if
(
isset
(
$this
->
paymentAPIconf
->
middleware_sig_passphrase
)){
$replacements
=
[
...
...
@@ -142,24 +142,6 @@ class PaymentAPI extends System {
$this
->
data
=
$data
;
}
/**
*
* 開発者の設定
*
* @return boolean|mixed
*/
private
function
getConfiguration
(
$settingId
){
$devSetting
=
$this
->
getRowData
(
$this
->
accessSelect
(
"SELECT_DEV_SETTING"
,
[
$settingId
]));
if
(
$this
->
isLoopData
(
$devSetting
)){
if
(
$this
->
checkJSONString
(
$this
->
getColumnData
(
$devSetting
,
"dev_setting_value"
))){
$settingsValue
=
json_decode
(
$this
->
getColumnData
(
$devSetting
,
"dev_setting_value"
));
return
$settingsValue
;
}
}
else
return
false
;
}
/**
*
* 確認の結果設定
...
...
logic/settlement/model.php
View file @
e9039541
...
...
@@ -132,8 +132,8 @@ class SettlementModelClass extends ModelClassEx {
}
private
function
initSettings
(){
$this
->
midconf
=
$this
->
getConfiguration
(
"middleware_conf"
);
$this
->
paymentAPIConf
=
$this
->
getConfiguration
(
"payment_api_conf"
);
$this
->
midconf
=
$this
->
get
Setting
Configuration
(
"middleware_conf"
);
$this
->
paymentAPIConf
=
$this
->
get
Setting
Configuration
(
"payment_api_conf"
);
if
(
isset
(
$this
->
paymentAPIConf
->
middleware_sig_passphrase
)){
$replacements
=
[
...
...
@@ -153,24 +153,6 @@ class SettlementModelClass extends ModelClassEx {
$this
->
setType
(
TYPE_SETTLEMENT_EXPRESS_FORM
);
}
/**
*
* 開発者の設定
*
* @return boolean|mixed
*/
private
function
getConfiguration
(
$settingId
){
$devSetting
=
$this
->
getRowData
(
$this
->
accessSelect
(
"SELECT_DEV_SETTING"
,
[
$settingId
]));
if
(
$this
->
isLoopData
(
$devSetting
)){
if
(
$this
->
checkJSONString
(
$this
->
getColumnData
(
$devSetting
,
"dev_setting_value"
))){
$settingsValue
=
json_decode
(
$this
->
getColumnData
(
$devSetting
,
"dev_setting_value"
));
return
$settingsValue
;
}
}
else
return
false
;
}
/**
*
* @param unknown $formName
...
...
system/api/dev/DevComponents.php
View file @
e9039541
...
...
@@ -27,7 +27,7 @@ class DevComponents extends System {
* @return array
*/
public
function
getDevSetting
(
$devSettingId
){
return
$this
->
get
RowData
(
$this
->
accessSelect
(
"SELECT_DEV_SETTING"
,
[
$devSettingId
]),
NO_COUNT
);
return
$this
->
get
SettingConfiguration
(
$devSettingId
);
}
/**
...
...
system/lib/checker.php
View file @
e9039541
...
...
@@ -399,14 +399,13 @@ class Checker extends Chiket {
}
}
$
res
=
$this
->
getRowData
(
$this
->
accessSelect
(
"SELECT_DEV_SETTING"
,
[
"maintenance_mode_
{
$location
}
"
])
);
$
maintenanceMode
=
$this
->
getSettingConfiguration
(
"maintenance_mode_
{
$location
}
"
);
if
(
$this
->
isLoopData
(
$res
)){
$maintenanceMode
=
json_decode
(
$res
[
"dev_setting_value"
]);
if
(
$maintenanceMode
){
$whitelistedIpAddress
=
explode
(
","
,
$maintenanceMode
->
exceptIpAddress
);
if
(
$maintenanceMode
->
enabled
){
if
(
!
in_array
(
$
_SERVER
[
"REMOTE_ADDR"
]
,
$whitelistedIpAddress
)){
if
(
!
in_array
(
$
this
->
getColumnData
(
$_SERVER
,
"REMOTE_ADDR"
)
,
$whitelistedIpAddress
)){
if
(
$callback
!=
null
)
$callback
();
...
...
system/lib/common.php
View file @
e9039541
...
...
@@ -439,12 +439,10 @@ class Common extends HtmlBuilder {
* @return : 配列
-------------------------------------------------------------------------*/
private
function
grantDepositSolution
(){
$
result
=
$this
->
getRowData
(
$this
->
accessSelect
(
"SELECT_DEV_SETTING"
,
[
"grant_deposit_solution"
])
);
$
grant
=
$this
->
getSettingConfiguration
(
"grant_deposit_solution"
);
if
(
$this
->
isLoopData
(
$result
)){
if
(
$result
[
"dev_setting_enabled"
]
==
VAL_INT_1
)
return
$result
[
"dev_setting_value"
];
}
if
(
$grant
)
return
$grant
;
return
NO_STRING
;
}
...
...
@@ -485,6 +483,28 @@ class Common extends HtmlBuilder {
return
$rtn
;
}
/*-------------------------------------------------------------------------
* @function_name: 設定コンフィグレーション
* @parameter : 設定ID
* @return : 物
-------------------------------------------------------------------------*/
public
function
getSettingConfiguration
(
$settingId
){
$result
=
$this
->
getRowData
(
$this
->
accessSelect
(
"SELECT_DEV_SETTING"
,
[
$settingId
]));
if
(
$this
->
isLoopData
(
$result
)){
$enabled
=
$this
->
getColumnData
(
$result
,
"dev_setting_enabled"
);
if
(
$enabled
){
$confData
=
$this
->
getColumnData
(
$result
,
"dev_setting_value"
);
if
(
$this
->
checkJSONString
(
$confData
))
return
json_decode
(
$confData
);
}
}
return
null
;
}
/*-------------------------------------------------------------------------
* @function_name: ユーザデータを取得する
* @parameter : なし
...
...
test/help2pay/test_curl_h2p_payout.php
View file @
e9039541
...
...
@@ -97,11 +97,9 @@ class H2PPayoutTesting extends FrameworkTest{
private
function
setParameter
(){
date_default_timezone_set
(
'Asia/Manila'
);
$h2pSettings
=
$this
->
getRowData
(
$this
->
accessSelect
(
"SELECT_DEV_SETTING"
,
[
"help2pay_conf"
]));
if
(
$this
->
isLoopData
(
$h2pSettings
)){
$h2pSettings
=
json_decode
(
$this
->
getColumnData
(
$h2pSettings
,
"dev_setting_value"
));
$h2pSettings
=
$this
->
getSettingConfiguration
(
"help2pay_conf"
);
if
(
$h2pSettings
){
$this
->
merchantCode
=
$h2pSettings
->
merchant_code
;
$this
->
payoutURL
=
str_replace
(
"
{
merchantcode
}
"
,
$this
->
merchantCode
,
$h2pSettings
->
payout_url
);
$this
->
ipAddress
=
$h2pSettings
->
ip_address
;
...
...
test/help2pay/test_deposit.php
View file @
e9039541
...
...
@@ -124,14 +124,12 @@ class TestDeposit extends FrameworkTest {
}
private
function
setParameter
(){
$h2pSettings
=
$this
->
getRowData
(
$this
->
accessSelect
(
"SELECT_DEV_SETTING"
,
[
"help2pay_conf"
]));
if
(
$this
->
isLoopData
(
$h2pSettings
)){
$h2pSettings
=
json_decode
(
$this
->
getColumnData
(
$h2pSettings
,
"dev_setting_value"
));
$h2pSettings
=
$this
->
getSettingConfiguration
(
"help2pay_conf"
);
if
(
$h2pSettings
){
$this
->
merchantCode
=
$h2pSettings
->
merchant_code
;
$this
->
transferURL
=
$h2pSettings
->
transfer_url
;
$this
->
ipAddress
=
$
_SERVER
[
"REMOTE_ADDR"
]
;
$this
->
ipAddress
=
$
this
->
getColumnData
(
$_SERVER
,
"REMOTE_ADDR"
)
;
$this
->
securityCode
=
$h2pSettings
->
security_code
;
}
...
...
test/lib/FrameworkTest.php
View file @
e9039541
...
...
@@ -7,22 +7,15 @@ class FrameworkTest extends System {
}
public
function
checkRemoteAddress
(){
$devSetting
=
$this
->
getRowData
(
$this
->
accessSelect
(
"SELECT_DEV_SETTING"
,
[
"tester_tool_conf"
]));
if
(
$this
->
isLoopData
(
$devSetting
)){
if
(
!
$this
->
getColumnData
(
$devSetting
,
"dev_setting_enabled"
))
return
true
;
if
(
$this
->
checkJSONString
(
$this
->
getColumnData
(
$devSetting
,
"dev_setting_value"
))){
$devSetting
=
json_decode
(
$this
->
getColumnData
(
$devSetting
,
"dev_setting_value"
));
$devSetting
=
$this
->
getSettingConfiguration
(
"tester_tool_conf"
);
if
(
$devSetting
){
$ipAddresses
=
explode
(
","
,
$devSetting
->
ip_address
);
$remoteAddress
=
$this
->
getColumnData
(
$_SERVER
,
"REMOTE_ADDR"
);
if
(
in_array
(
$remoteAddress
,
$ipAddresses
))
return
true
;
}
}
return
false
;
}
...
...
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