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
0b5c6f3c
Commit
0b5c6f3c
authored
Jul 22, 2022
by
Antonio.Suerte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merchant Balance API: Enabler and Enhancements
parent
6133c69e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
12 deletions
+38
-12
MerchantBalance.php
api/MerchantBalance.php
+31
-11
literals.php
system/lib/core/literals.php
+1
-0
literals_en.php
system/lib/core/literals_en.php
+1
-0
model.php
system/logic/api_signature/model.php
+5
-1
No files found.
api/MerchantBalance.php
View file @
0b5c6f3c
...
...
@@ -94,18 +94,29 @@ class MerchantBalance extends System {
$registPassword
=
$this
->
getColumnData
(
$macc
,
COLUMN_PASSWORD
);
if
(
$this
->
password
==
$registPassword
){
$wIpAddresses
=
$this
->
getColumnData
(
$macc
,
COLUMN_IP_ADDRESS
);
$wIpAddresses
=
explode
(
DELIMIT_COMMA
,
$wIpAddresses
);
$wlistSettings
=
$this
->
getColumnData
(
$macc
,
COLUMN_WHITELIST_SETTING
);
if
(
in_array
(
$this
->
remoteAddress
,
$wIpAddresse
s
)){
$
this
->
userAccount
=
$this
->
getAccountCommon
(
$this
->
getColumnData
(
$macc
,
COLUMN_USER_ACCOUNT
)
);
if
(
$this
->
checkJSONString
(
$wlistSetting
s
)){
$
wlistSettings
=
json_decode
(
$wlistSettings
);
if
(
$this
->
isLoopData
(
$this
->
userAccount
)){
$this
->
userAccount
=
$this
->
getRowData
(
$this
->
userAccount
);
if
(
isset
(
$wlistSettings
->
allow_merchant_balance
)
&&
$wlistSettings
->
allow_merchant_balance
){
$wIpAddresses
=
$this
->
getColumnData
(
$macc
,
COLUMN_IP_ADDRESS
);
$wIpAddresses
=
explode
(
DELIMIT_COMMA
,
$wIpAddresses
);
if
(
in_array
(
$this
->
remoteAddress
,
$wIpAddresses
)){
$this
->
userAccount
=
$this
->
getAccountCommon
(
$this
->
getColumnData
(
$macc
,
COLUMN_USER_ACCOUNT
));
if
(
$this
->
isLoopData
(
$this
->
userAccount
)){
$this
->
userAccount
=
$this
->
getRowData
(
$this
->
userAccount
);
}
else
$invalid
[]
=
"Account for pnum
{
$this
->
pnum
}
doesn't exist."
;
}
else
$invalid
[]
=
"Invalid IP Address: {{$this -> remoteAddress}}"
;
}
else
$invalid
[]
=
"
Account for pnum
{
$this
->
pnum
}
doesn't exist.
"
;
$invalid
[]
=
"
Balance API isn't enabled to pnum {{$this -> pnum}}
"
;
}
else
$invalid
[]
=
"In
valid IP Address
"
;
$invalid
[]
=
"In
ternal Error Occurred
"
;
}
else
$invalid
[]
=
"Incorrect Password"
;
}
...
...
@@ -137,9 +148,18 @@ class MerchantBalance extends System {
foreach
(
$balances
as
&
$balance
){
unset
(
$balance
[
COLUMN_USER_ACCOUNT
]);
$balance
[
COLUMN_BALANCE
]
=
$this
->
intToCurrency
(
$balance
[
COLUMN_BALANCE
],
$balance
[
COLUMN_CURRENCY
]);
$props
=
[
COLUMN_BALANCE
,
COLUMN_WITHDRAW_AMOUNT
,
COLUMN_DEPOSIT_AMOUNT
];
foreach
(
$props
as
$prop
){
if
(
is_numeric
(
$balance
[
$prop
])){
$currency
=
$balance
[
COLUMN_CURRENCY
];
$balance
[
$prop
]
=
$this
->
intToCurrency
(
$balance
[
$prop
],
$currency
);
}
}
}
echo
json_encode
(
$balances
);
...
...
system/lib/core/literals.php
View file @
0b5c6f3c
...
...
@@ -123,6 +123,7 @@ define('VAL_STR_TARGET_COUNTRY', 'サービス主要対象国');
define
(
'VAL_STR_URL'
,
'URL'
);
define
(
'VAL_STR_IP_ADDRESS_VALIDATION'
,
'IPアドレス確認'
);
define
(
'VAL_STR_DOMAIN_NAME_VALIDATION'
,
'ドメイン名の確認'
);
define
(
'VAL_STR_ENABLE_BALANCE_API'
,
'法人残高APIを有効にする'
);
define
(
'VAL_STR_ALLOW_SERVER_TO_SERVER'
,
'ウェブサービスの許可'
);
define
(
'VAL_STR_SITE_URL'
,
'サイトURL'
);
define
(
'VAL_STR_MANAGER_NAME'
,
'口座取引責任者氏名'
);
...
...
system/lib/core/literals_en.php
View file @
0b5c6f3c
...
...
@@ -125,6 +125,7 @@ define('VAL_STR_TARGET_COUNTRY', 'Targeted country');
define
(
'VAL_STR_URL'
,
'URL'
);
define
(
'VAL_STR_IP_ADDRESS_VALIDATION'
,
'IP Address Validation'
);
define
(
'VAL_STR_DOMAIN_NAME_VALIDATION'
,
'Domain Name Validation'
);
define
(
'VAL_STR_ENABLE_BALANCE_API'
,
'Enable Balance API'
);
define
(
'VAL_STR_ALLOW_SERVER_TO_SERVER'
,
'Allow Server-to-Server'
);
define
(
'VAL_STR_SITE_URL'
,
'Website URL'
);
define
(
'VAL_STR_MANAGER_NAME'
,
'Name of personal in charge of account'
);
...
...
system/logic/api_signature/model.php
View file @
0b5c6f3c
...
...
@@ -299,7 +299,8 @@ class ApiSignatureModelClass extends ModelClassEx {
"allow_domain_in_payment"
=>
false
,
"allow_curl_in_payment"
=>
false
,
"allow_ip_in_remittance"
=>
false
,
"allow_domain_in_remittance"
=>
false
"allow_domain_in_remittance"
=>
false
,
"allow_merchant_balance"
=>
false
];
foreach
(
array_keys
(
$whitelistSetting
)
as
$key
){
...
...
@@ -485,6 +486,9 @@ class ApiSignatureModelClass extends ModelClassEx {
"Remittance API"
=>
[
VAL_STR_IP_ADDRESS_VALIDATION
=>
"allow_ip_in_remittance"
,
VAL_STR_DOMAIN_NAME_VALIDATION
=>
"allow_domain_in_remittance"
],
"Merchant Balance API"
=>
[
VAL_STR_ENABLE_BALANCE_API
=>
"allow_merchant_balance"
]
];
...
...
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