Commit b9dc972e authored by Antonio.Suerte's avatar Antonio.Suerte

Help2Pay Migration [Tester Withdrawal Data]

parent 17958994
<?php <?php
include_once "../../system/lib/config.php"; include_once "../lib/FrameworkTest.php";
class ConnectSite extends System { class ConnectSite extends FrameworkTest {
/** /**
* *
...@@ -91,22 +91,11 @@ class ConnectSite extends System { ...@@ -91,22 +91,11 @@ class ConnectSite extends System {
]); ]);
} }
$devSetting = $this -> getRowData($this -> accessSelect("SELECT_DEV_SETTING", ["tester_tool_conf"])); if(!$this -> checkRemoteAddress()){
$validationRemarks[] = json_encode([
if($this -> isLoopData($devSetting)){ "code" => "005",
if($this -> checkJSONString($this -> getColumnData($devSetting, "dev_setting_value"))){ "message" => "Invalid IP Address: {$this -> getColumnData($_SERVER, "REMOTE_ADDR")}"
$devSetting = json_decode($this -> getColumnData($devSetting, "dev_setting_value")); ]);
$ipAddresses = explode(",", $devSetting -> ip_address);
$remoteAddress = $this -> getColumnData($_SERVER, "REMOTE_ADDR");
if(!in_array($remoteAddress, $ipAddresses)){
$validationRemarks[] = json_encode([
"code" => "005",
"message" => "Invalid IP Address: {$remoteAddress}"
]);
}
}
} }
if($this -> isLoopData($validationRemarks)){ if($this -> isLoopData($validationRemarks)){
......
<?php <?php
include_once '../../system/lib/config.php'; include_once '../lib/FrameworkTest.php';
class TestDepositStatus extends System { class TestDepositStatus extends FrameworkTest {
/** /**
* *
...@@ -86,6 +86,13 @@ class TestDepositStatus extends System { ...@@ -86,6 +86,13 @@ class TestDepositStatus extends System {
} }
} }
if(!$this -> checkRemoteAddress()){
$validationRemarks[] = json_encode([
"code" => "04",
"message" => "Invalid IP Address: {$this -> getColumnData($_SERVER, "REMOTE_ADDR")}"
]);
}
if($this -> isLoopData($validationRemarks)){ if($this -> isLoopData($validationRemarks)){
echo "<pre>"; echo "<pre>";
die(print_r($validationRemarks, true)); die(print_r($validationRemarks, true));
......
<?php <?php
include '../../system/lib/config.php'; include_once "../lib/FrameworkTest.php";
class H2PPayoutTesting extends System{ class H2PPayoutTesting extends FrameworkTest{
/** /**
* *
* @var string * @var string
...@@ -129,22 +129,36 @@ class H2PPayoutTesting extends System{ ...@@ -129,22 +129,36 @@ class H2PPayoutTesting extends System{
$memberAccount = $this -> getRowData($this -> getAccountCommon($this -> memberCode)); $memberAccount = $this -> getRowData($this -> getAccountCommon($this -> memberCode));
if(!$this -> getColumnData($memberAccount, COLUMN_TEST_ACCOUNT_FLG)){ if($this -> isLoopData($memberAccount)){
if(!$this -> getColumnData($memberAccount, COLUMN_TEST_ACCOUNT_FLG)){
$validationRemarks[] = json_encode([
"code" => "01",
"message" => "Member Code ({$this -> memberCode}) is not under tester category."
]);
}
$fullName = "{$this -> getColumnData($memberAccount, COLUMN_FIRST_NAME)} {$this -> getColumnData($memberAccount, COLUMN_LAST_NAME)}";
if(strcmp($this -> bankAccountName, $fullName) !== 0){
$validationRemarks[] = json_encode([
"code" => "02",
"message" => "Member Name ({$this -> bankAccountName}) is not correct."
]);
}
}else{
$validationRemarks[] = json_encode([ $validationRemarks[] = json_encode([
"code" => "01", "code" => "03",
"message" => "Member Code ({$this -> memberCode}) is not under tester category." "message" => "Member Code ({$this -> memberCode}) doesn't exist."
]); ]);
} }
$fullName = "{$this -> getColumnData($memberAccount, COLUMN_FIRST_NAME)} {$this -> getColumnData($memberAccount, COLUMN_LAST_NAME)}"; if(!$this -> checkRemoteAddress()){
if(strcmp($this -> bankAccountName, $fullName) !== 0){
$validationRemarks[] = json_encode([ $validationRemarks[] = json_encode([
"code" => "02", "code" => "04",
"message" => "Member Name ({$this -> bankAccountName}) is not correct." "message" => "Invalid IP Address: {$this -> getColumnData($_SERVER, "REMOTE_ADDR")}"
]); ]);
} }
if($this -> isLoopData($validationRemarks)) if($this -> isLoopData($validationRemarks))
die(print_r($validationRemarks, true)); die(print_r($validationRemarks, true));
...@@ -205,7 +219,7 @@ class H2PPayoutTesting extends System{ ...@@ -205,7 +219,7 @@ class H2PPayoutTesting extends System{
$this -> setFeeEx(round($exchange[PARAM_AMOUNT] * 0.02, VAL_INT_2)); $this -> setFeeEx(round($exchange[PARAM_AMOUNT] * 0.02, VAL_INT_2));
} }
private function storeToTemporaryTable(){ private function withdrawalProcessingData(){
$rtn = []; $rtn = [];
$rtn[] = $this -> memberCode; // account number(1) $rtn[] = $this -> memberCode; // account number(1)
...@@ -240,7 +254,15 @@ class H2PPayoutTesting extends System{ ...@@ -240,7 +254,15 @@ class H2PPayoutTesting extends System{
$rtn[] = NO_STRING; // Receiving bank branch code(30) $rtn[] = NO_STRING; // Receiving bank branch code(30)
$rtn[] = VAL_STR_H2P_METHOD; // withdraw solution (31) $rtn[] = VAL_STR_H2P_METHOD; // withdraw solution (31)
$this->accessModify('INSERT_WITHDRAW_H2P_TEMP', $rtn, false); return $rtn;
}
private function storeToTemporaryTable(){
$this -> accessModify("INSERT_WITHDRAW_H2P_TEMP", $this -> withdrawalProcessingData(), false);
}
private function insertWithdrawalTransaction(){
$this -> accessModify("INSERT_WITHDRAW", $this -> withdrawalProcessingData(), false);
} }
private function processPayout(){ private function processPayout(){
...@@ -293,6 +315,7 @@ class H2PPayoutTesting extends System{ ...@@ -293,6 +315,7 @@ class H2PPayoutTesting extends System{
case "000": case "000":
echo "\nSuccessful\n"; echo "\nSuccessful\n";
echo "Result: {$xmlResult -> message}"; echo "Result: {$xmlResult -> message}";
$this -> insertWithdrawalTransaction();
break; break;
default: default:
echo "Result: {$xmlResult -> message}"; echo "Result: {$xmlResult -> message}";
......
<?php <?php
include_once '../../system/lib/config.php'; include_once '../lib/FrameworkTest.php';
class TestDeposit extends System { class TestDeposit extends FrameworkTest {
/** /**
* *
...@@ -177,6 +177,13 @@ class TestDeposit extends System { ...@@ -177,6 +177,13 @@ class TestDeposit extends System {
]); ]);
} }
if(!$this -> checkRemoteAddress()){
$validationRemarks[] = json_encode([
"code" => "04",
"message" => "Invalid IP Address: {$this -> getColumnData($_SERVER, "REMOTE_ADDR")}"
]);
}
if($this -> isLoopData($validationRemarks)){ if($this -> isLoopData($validationRemarks)){
echo "<pre>"; echo "<pre>";
die(print_r($validationRemarks, true)); die(print_r($validationRemarks, true));
......
<?php
include "../../system/lib/config.php";
class FrameworkTest extends System {
public function __construct(){
parent::__construct();
}
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"));
$ipAddresses = explode(",", $devSetting -> ip_address);
$remoteAddress = $this -> getColumnData($_SERVER, "REMOTE_ADDR");
if(in_array($remoteAddress, $ipAddresses))
return true;
}
}
return false;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment