| Server IP : 10.200.247.200 / Your IP : 216.73.217.19 Web Server : Apache System : Linux synergy-usa-sites 6.8.0-138-generic #138-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 31 22:41:49 UTC 2026 x86_64 User : jeremy ( 1001) PHP Version : 8.4.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/usa_sites/pcisecureform.com/lcapi/ |
Upload File : |
<?php
$return = array();
if(!empty($_POST['site_code']) && !empty($_POST['cc_num'])) {
require_once($_SERVER['DOCUMENT_ROOT'].'/php/db_config_lc_user.php');
$db = connect_lc2user_new('lc2'.$_POST['site_code'].'_lc');
require_once($_SERVER['DOCUMENT_ROOT'].'/lcapi/inc/Crypto.class.php');
$crypto = new phpCrypto();
$res = $db->get_results("SELECT `user`,`password` FROM lc_reseller WHERE id='".$db->clean($_POST['client_id'])."'");
if(empty($res)) {
$return['error'] = 'There was a problem. Please contact customer support. 1';
} else {
$db->query("UPDATE lc_reseller
SET
cc_num='".$db->clean($crypto->encrypt($_POST['cc_num']))."'
,cardholder_name='".$db->clean($_POST['name_on_card'])."'
,cc_exp_month='".$db->clean($_POST['cc_exp_month'])."'
,cc_exp_year='".$db->clean($_POST['cc_exp_year'])."'
,cc_first_four='".$db->clean(substr($_POST['cc_num'],0,4))."'
,cc_last_four='".$db->clean(substr($_POST['cc_num'],-4))."'
,active=1
,cardInvalid=0
,cc_failed_message=''
,failures=0
,date_inactive='0000-00-00'
,next_bill_date='".date('Y-m-d',strtotime('+30 day'))."'
WHERE id='".$db->clean($_POST['client_id'])."'
");
$db->query("UPDATE lc_clients_subscriptions
SET
active=1
,next_bill_date='".date('Y-m-d',strtotime('+30 day'))."'
,declines=0
WHERE
reseller_id='".$db->clean($_POST['client_id'])."'
AND subscription_id<>1");
$post = array('site'=>$_POST['site_code'],'client_id'=>$_POST['client_id'],'cvv'=>$_POST['cc_cvv']);
$response = PostFields('https://learningcentersupport.com/lcapi/ChargeUser.php',$post);
if($response=='Success') {
$db->query("UPDATE lc2admin.cancel_reactivations
SET
updated_card_info=NOW()
WHERE id='".$db->clean($_POST['rid'])."'");
$return['username'] = $res[0]->user;
$return['password'] = $res[0]->password;
} else {
$decline_reason = str_replace('Error: ','',$response);
$db->query("UPDATE lc_reseller
SET
active=0
,cardInvalid=1
,cc_failed_message='".$db->clean($decline_reason)."'
,next_bill_date='".date('Y-m-d',strtotime('+1 day'))."'
WHERE id='".$db->clean($_POST['client_id'])."'
");
$db->query("UPDATE lc_clients_subscriptions
SET
active=0
WHERE
reseller_id='".$db->clean($_POST['client_id'])."'
AND subscription_id<>1");
$return['error'] .= 'Your card was declined. Decline Message: '.$decline_reason;
}
}
} else {
$return['error'] = 'There was a problem. Please contact customer support. 2';
}
die(json_encode($return));
function PostFields($url,$fields)
{
$fields = http_build_query($fields);
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_REFERER, $_SERVER["HTTP_HOST"] . $_SERVER['REQUEST_URI']);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_USERAGENT, "LCAPI cUrl Agent");
curl_setopt($ch, CURLOPT_VERBOSE, true);
ob_start();
$data = curl_exec ($ch);
ob_end_clean();
curl_close ($ch);
return $data;
}
?>