Backups Created:
/home/japatmex/public_html/wp-content/edit-wolf.php
Savvy
W
olf -
MANAGER
Edit File: srvrorder.php
<?php $quantity = ''; $email = ''; $accountId = ''; foreach($row->CustomFields as $customField) { if($customField->UseAsQuantity == 1) { $quantity = $customField->FieldValue; } elseif(strpos("email", strtolower($customField->FieldName)) !== FALSE) { $email = $customField->FieldValue; } else { $accountId = $customField->FieldValue; } } if(!empty($email) && !empty($accountId) && $quantity > 0) { //define('UFIC_API_EMAIL', "order@gsmsalman.com"); //define('UFIC_API_KEY', "SB-UFIC-A1-hZMnuIQdDKNBypfX67NK6snG"); function apiCall($path, $server_key = null, $payload = null) { $optArray = array( CURLOPT_URL => $path, CURLOPT_CONNECTTIMEOUT => 5, CURLOPT_TIMEOUT => 10, CURLOPT_SSL_VERIFYHOST => false, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_RETURNTRANSFER => true, CURLOPT_FRESH_CONNECT => true, ); $ch = curl_init(); curl_setopt_array($ch, $optArray); curl_setopt($ch, CURLOPT_VERBOSE, true); $header = array(); $header[] = "User-Agent: " . "UFIC-API-Client/1.0"; $header[] = "Cache-Control: no-cache"; if (isset($server_key) && isset($server_key->token)) { $header[] = "X-Token: {$server_key->token}"; } curl_setopt($ch, CURLOPT_POST, true); if ($payload != null) { $post_data = base64_encode(json_encode($payload)); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); } curl_setopt($ch, CURLOPT_HTTPHEADER, $header); $response = curl_exec($ch); curl_close($ch); return json_decode($response); } $my_account = array('email' => $row->AccountId, 'api_key' => $MY_API_KEY); $d = apiCall($row->ServerURL."/auth", null, $my_account); if (isset($d->status) && $d->status === 200) { $server_key = $d->data; if (isset($server_key)) { /** * @apiName Transfer Credit to User * @api {post} /transfer * * @apiParam {email} User account email * @apiParam {account_id} User account id * @apiParam {balance} amount of credit balance to transfer */ $user = array('email' => $email, 'account_id' => $accountId, 'balance' => $quantity); $d = apiCall($row->ServerURL."/transfer", $server_key, $user); if (isset($d->status) && $d->status === 200) { if($d->data->code == 0) { $ifCodeSentToServer = 1; $codeVal = $d->data->message; } else { if(serverOrderRefunded($row->LogRequestId, $objDBCD14) == '0') { $dec_points = refundServerCredits($row->UserId, $row->LogRequestId, addslashes(stripslashes($row->PackageTitle)), $currDtTm, $row->Credits, '0', $objDBCD14, $crypt); $strDeduct = ", Refunded = '1' "; } $REJECTED = 1; $CODE = $d->data->message; } } } } } else { $ifCodeSentToServer = 0; $msgFromServer = 'Invalid Username or email or quantity!'; } ?>