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
a6c692cb
Commit
a6c692cb
authored
Dec 14, 2021
by
Antonio.Suerte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Monthly Maintenance Fee API Enhancement
parent
ee443502
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
9 deletions
+45
-9
MonthlyCharge.php
system/api/MonthlyCharge.php
+45
-9
No files found.
system/api/MonthlyCharge.php
View file @
a6c692cb
...
@@ -33,6 +33,12 @@ class MonthlyCharge extends System {
...
@@ -33,6 +33,12 @@ class MonthlyCharge extends System {
*/
*/
private
$requestMethod
;
private
$requestMethod
;
/**
*
* @var array
*/
private
$collatedTransactions
=
[];
/**
/**
*
*
* コンストラクタ
* コンストラクタ
...
@@ -96,11 +102,19 @@ class MonthlyCharge extends System {
...
@@ -96,11 +102,19 @@ class MonthlyCharge extends System {
* @param double $amount
* @param double $amount
*/
*/
private
function
executeWithdraw
(
$account
,
$currency
,
$amount
){
private
function
executeWithdraw
(
$account
,
$currency
,
$amount
){
if
(
$amount
<=
NO_COUNT
)
return
;
$params
=
$this
->
transactionParams
(
$account
,
$currency
,
$amount
);
if
(
$this
->
forTest
)
{
if
(
$this
->
forTest
)
{
$simulatedAmount
=
$this
->
intToCurrency
(
$amount
,
$currency
);
$params
[]
=
"test-only"
;
echo
"Simulation: Charged For
{
$currency
}
{
$simulatedAmount
}
\n
"
;
}
else
}
else
$this
->
monthlyWithdraw
(
$account
,
$currency
,
$amount
);
$this
->
monthlyWithdraw
(
$params
);
$params
[
VAL_INT_2
]
=
$this
->
intToCurrency
(
$amount
,
$currency
);
$this
->
collatedTransactions
[]
=
$params
;
}
}
/**
/**
...
@@ -109,12 +123,32 @@ class MonthlyCharge extends System {
...
@@ -109,12 +123,32 @@ class MonthlyCharge extends System {
* @param string $currency
* @param string $currency
* @param double $amount
* @param double $amount
*/
*/
private
function
monthlyWithdraw
(
$account
,
$currency
,
$amount
)
{
private
function
monthlyWithdraw
(
$params
)
{
$this
->
registFeeCommon
(
$account
,
// データを登録する
$currency
,
return
$this
->
accessModify
(
'INSERT_WITHDRAW_FEE'
,
$params
);
$this
->
intToCurrency
(
$amount
,
$currency
),
}
'Monthly Maintenance'
,
VAL_INT_2
);
/**
*
* @param unknown $account
* @param unknown $currency
* @param unknown $amount
* @return string[]
*/
private
function
transactionParams
(
$account
,
$currency
,
$amount
){
$params
=
[];
$feeInt
=
$amount
;
// パラメータの作成
$params
[]
=
$account
;
$params
[]
=
$currency
;
$params
[]
=
$feeInt
;
$params
[]
=
VAR_WITHDRAW_TYPE_FEE
;
$params
[]
=
$this
->
getTransactionNumberCommon
(
VAR_TRANSACTION_MONTHLY_FEE
);
$params
[]
=
"Monthly Maintenance"
;
$params
[]
=
VAL_INT_2
;
return
$params
;
}
}
/**
/**
...
@@ -195,6 +229,8 @@ class MonthlyCharge extends System {
...
@@ -195,6 +229,8 @@ class MonthlyCharge extends System {
*/
*/
public
function
listen
(){
public
function
listen
(){
$this
->
charge
();
$this
->
charge
();
echo
json_encode
(
$this
->
collatedTransactions
);
}
}
}
}
...
...
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