Esempio n. 1
0
function subscription_cancel($sub_id, $user_id, $sub_notes = "", $sub_status_text = "")
{
    requre_once('../transaction.class.php');
    $trans = new transaction_class(false);
    $trans->pull_subscription($sub_id, 'ss.ss_subscription_id');
    $status = $trans->process_cancel_request(array("actor" => 'System', 'notes' => $sub_notes, 'verifyuserId' => $user_id));
    if (!$status) {
        return false;
    }
    return $status['ss_cancel_id'];
}
Esempio n. 2
0
    $assoc = array();
    $data = explode('|', $data1);
    foreach ($keys as $row => $key) {
        $assoc[trim($key)] = trim($data[$row]);
    }
}
print_r($assoc);
die;
require_once "../includes/subFunctions/banks.ipaygate.php";
$processor = new iPayGate_Client($bankInfo);
$sql = "SELECT ss_ID\r\nFROM cs_subscription where ss_billing_type in ('Check');\r\n";
$cnt = 0;
$result = mysql_query($sql) or dieLog(mysql_errno() . ": " . mysql_error() . "<BR>");
while ($cs_subscription = mysql_fetch_assoc($result)) {
    $subs = new transaction_class(false);
    $subs->pull_subscription($cs_subscription['ss_ID']);
    $transInfo['ss_billing_check_routing'] = $subs->etelDecSalted($subs->row['subscriptionTable']['ss_billing_check_routing']);
    $transInfo['ss_billing_check_account'] = $subs->etelDecSalted($subs->row['subscriptionTable']['ss_billing_check_account']);
    if (!is_numeric($transInfo['ss_billing_check_routing'])) {
        $transInfo['ss_billing_check_routing'] = etelDec($subs->row['transactionTable']['bankroutingcode']);
        if (is_numeric($transInfo['ss_billing_check_routing'])) {
            echo "update cs_subscription set ss_billing_check_routing = '" . $subs->etelEncSalted($transInfo['ss_billing_check_routing']) . "' \r\n\t\t\t\r\n\t\t\twhere ss_ID = '" . $cs_subscription['ss_ID'] . "';<br>";
        } else {
            echo $cs_subscription['ss_ID'] . ' PROBLEM ' . $transInfo['ss_billing_check_account'] . '<BR>';
        }
    } else {
    }
    flush();
}
die($sqlchange);
$sql = "select * from  `cs_subscription` left join cs_transactiondetails on ss_transaction_id = transactionId where ss_bank_id in (15,28,29)";
Esempio n. 3
0
 function rebill_subscriptions($sub_ids)
 {
     dieLog('Not using this anymore.');
     $count = array();
     $logged = "<table>";
     $processor = new transaction_class(false);
     foreach ($sub_ids as $sub_id) {
         $processor->pull_subscription($sub_id);
         if (!isset($count[$sub_id])) {
             $count[$sub_id] = 1;
             $res = $processor->processRebill();
             $logged .= "\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td>{$id}</td><td></td>\n\t\t\t\t\t<td>" . $count[$sub_id] . "</td><td></td>\n\t\t\t\t\t<td>" . $res['success'] . "</td><td></td>\n\t\t\t\t\t<td>" . $res['errormsg'] . "</td><td></td>\n\t\t\t\t\t<td>" . $res['status'] . "</td><td></td>\n\t\t\t\t\t<td>" . $res['transactionId'] . "</td><td></td>\n\t\t\t\t\t</tr>\n\t\t\t\t";
         }
     }
     return $logged . "</table>";
 }
Esempio n. 4
0
 function angel_cancel_subscription()
 {
     foreach ($this->page_map as $index => $value) {
         ${$value} = $index;
     }
     $this->cancel_reason = $this->working_vars['cancel_reason'];
     switch ($cancel_reason) {
         case 1:
             $cancel_reason_decoded = "Cant get in touch with Merchant (Angel cancel)";
             break;
         case 2:
             $cancel_reason_decoded = "Changed Mind (Angel cancel)";
             break;
         default:
             $cancel_reason_decoded = "Angel Cancel";
             break;
     }
     $lookup = new lookup_class();
     $trans = $this->working_vars['transactions'];
     $curr = $this->working_vars['current_trans'] - 1;
     if (!isset($trans[$curr])) {
         return $this->angel_404("error message: 1000");
     }
     $etel_debug_mode = 1;
     if ($trans[$curr]['ss_subscription_ID'] == 0) {
         return $this->angel_process_transaction();
     }
     $ss_subscription_ID = $trans[$curr]['ss_subscription_ID'];
     $trans = new transaction_class(false);
     $trans->pull_subscription($ss_subscription_ID, 'ss_subscription_ID');
     $refinfo = $trans->process_cancel_request(array("actor" => 'Angel', 'notes' => $cancel_reason_decoded));
     $refid = $refinfo['ss_cancel_id'];
     if (!$refinfo) {
         //angel_transfer_callcenter
         return "\n\t\t<ANGELXML>\n\t\t\t<MESSAGE>\n\t\t\t\t<PLAY>\n\t\t\t\t\t<PROMPT type=\"text\">\n\t\t\t\t\t\tThere was an error cancelling your subscription. It may have already been canceled.\n\t\t\t\t\t</PROMPT>\n\t\t\t\t</PLAY>\n\t\t\t\t<GOTO destination=\"/{$angel_transfer_callcenter}\" />\n\t\t\t</MESSAGE>\n\t\t</ANGELXML>\n\t\t\t";
     }
     $temp = "";
     $m = strlen($refid);
     for ($j = 0; $j < $m; $j++) {
         $temp .= $refid[$j] . ", ";
     }
     $refid = $temp;
     return "\n\t\t<ANGELXML>\n\t\t\t<MESSAGE>\n\t\t\t\t<PLAY>\n\t\t\t\t\t<PROMPT type=\"text\">\n\t\t\t\t\t\tYour subscription has been cancelled. \n\t\t\t\t\t\t\n\t\t\t\t\t\tThe cancelation reference number, for this cancellation, is, {$refid}\n\t\t\t\t\t\t\n\t\t\t\t\t\tAgain, that reference number is, {$refid}\n\t\t\t\t\t\t\n\t\t\t\t\t\tThank you for calling " . $this->template[$this->template_sel]['name'] . " support.\n\t\t\t\t\t</PROMPT>\n\t\t\t\t</PLAY>\n\t\t\t\t\t<ACTION type=\"hangup\"/>\n\t\t\t</MESSAGE>\n\t\t</ANGELXML>\t\t\n\t\t";
 }
require_once "includes/calendar.class.php";
require_once "includes/rebill.class.php";
$sessionlogin = $companyInfo['userId'];
$companyId = $companyInfo['userId'];
/**************
Define functions to process form
**************/
$rebills = new rebill_class();
$rebills->set_user($sessionlogin);
/****************
Process Form
****************/
if ($_POST['frm_cancel_rebills'] == "1") {
    foreach ($_POST['frm_cancel_ids'] as $id) {
        $trans = new transaction_class(false);
        $trans->pull_subscription($id, 'ss_subscription_id');
        $status = $trans->process_cancel_request(array("actor" => 'Merchant', 'verifyuserId' => $companyInfo['userId']));
    }
    unset($_REQUEST['frm_cancel_ids']);
    unset($_REQUEST['frm_cancel_rebills']);
    //$params = $rebills->request_params("frm_");
    //header("Location: rebillSummary_smart.php?$params");
    //exit();
}
$rebill_info = $rebills->get_rebill_info();
/**************
Define pairs
**************/
$my_sql['pairs']['SubAccounts'] = array();
$my_sql['pairs']['SubAccounts'][] = array("display" => "All", "value" => "");
foreach ($rebill_info as $info) {
$row = 2;
$access['Data']['Breakdown']['RowDisplay'] = 'Wide';
$access['Data']['Breakdown']['Input'] = '';
$access['Data']['Breakdown']['disable'] = true;
$smarty->assign("Profit", $profit);
$access['Data']['Breakdown']['AddHtml'] = $smarty->fetch('cp_profitreport.tpl');
if ($_POST['submit_access'] == 'Submit') {
    $result = processAccessForm(&$access);
    if ($result) {
        $msg .= "Company Updated Successfully (" . $result['cnt'] . " Field(s))<BR>";
    } else {
        $msg .= "No Updates Detected<BR>";
    }
    if ($_POST['update_manager']) {
        $subscription = new transaction_class(false);
        $subscription->pull_subscription($ss_subscription_ID, 'ss.ss_subscription_ID');
        $res = $subscription->update_account_status();
        $submsg = '';
        if ($res[0]['succeeded']) {
            $submsg .= " postNotify:" . htmlentities(substr($res[0]['response']['body'], 0, 20));
        }
        if ($res[1]['succeeded']) {
            $submsg .= " htaccess:" . htmlentities(substr($res[1]['response']['body'], 0, 20));
        }
        if ($res) {
            $msg .= "Account Status Updated Successfully ( {$submsg})<BR>";
        }
        $access['Data']['ss_account_status']['Value'] = $subscription->row['subscriptionTable']['ss_account_status'];
        $access['Data']['ss_account_notes']['Value'] = $subscription->row['subscriptionTable']['ss_account_notes'];
    }
}
}
if (sizeof($query) < 2) {
    beginTable();
    echo "Insufficient Information. Please try again.";
    endTable('Insufficient Information', "lookup.php?{$link_info}", false, true);
    die;
}
$access = getAccessInfo("\nss_ID,\n\n'Account Information' as access_header,\n\tss_subscription_ID as Subscription_ID,\n\tDate_Format(ss_account_start_date,'%W %b %D %Y %H:%i:%s') as Account_Started,\n\tss_productdescription,\n\tss_cust_username,\n\tss_cust_password,\n\tss_account_status,\n\tss_account_expire_date,\n\tcs.cs_name as Website,\n\tcs.cs_member_url as WebsiteURL,\n\t\n'Customer Information' as access_header,\n\tCONCAT(ss_billing_lastname,', ',ss_billing_mi,' ',ss_billing_firstname) as Full_Name,\n\tss_cust_email as Email,\n\t\n'Billing Information' as access_header,\n\tss_billing_type,\n\tss_billing_card,\n\tss_billing_check_account,   \t  \n\tss_billing_check_routing,\n\tDate_Format(ss_rebill_next_date,'%W %b %D %Y %H:%i:%s') as Next_Rebill_Date,\n\tss_rebill_amount,\n\tss_rebill_status,\n\tDate_Format(ss_last_rebill,'%W %b %D %Y %H:%i:%s') as Last_Rebill_Date,\n\treference_number as Last_Transaction,\n\t\n\n'Account Notes' as access_header,\n\tss_account_notes,\n\n'Cancel Subscription' as access_header,\n\tss_cancel_id,\n\t'' as cancel_subscription_select,\n\t'' as cancel_subscription_reason,\n\t'' as cancel_subscription\n", "cs_subscription\nleft join cs_transactiondetails on transactionID = ss_transaction_id\nleft join cs_rebillingdetails as rd on rd_subaccount = ss_rebill_ID\nleft join cs_company_sites as cs on cs_ID = ss_site_ID\n", "{$sql_where}", array('disable' => true, 'HideIfEmpty' => true));
if ($access == -1) {
    beginTable();
    echo "Transaction Information was not found. Please try again.";
    endTable('Transaction Not Found', "lookup.php?{$link_info}", false, true);
    die;
}
$subscription = new transaction_class(false);
$subscription->pull_subscription($access['Data']['ss_ID']['Value']);
$access['Data']['ss_rebill_amount']['Value'] = '$' . formatMoney($access['Data']['ss_rebill_amount']['Value']);
$access['Data']['ss_rebill_amount']['DisplayName'] = 'Next Rebill Amount';
if ($_POST['cancel_rebill'] && $access['Data']['ss_rebill_status']['Value'] == 'active') {
    if ($_POST['ss_rebill_status_text']) {
        $notes = quote_smart($_POST['ss_rebill_status_text'] . " - " . $_POST['cancel_subscription_reason']);
        $status = $subscription->process_cancel_request(array("actor" => '.NET', 'notes' => $notes));
        if ($status) {
            $msg = "Subscription ID " . $subscription->row['subscriptionTable']['ss_subscription_ID'] . " cancelled (Ref ID: " . $status['ss_cancel_id'] . ")";
        } else {
            $msg = "Subscription ID " . $subscription->row['subscriptionTable']['ss_subscription_ID'] . " failed to cancel.";
        }
        $access['Data']['ss_rebill_status']['Value'] = $subscription->row['subscriptionTable']['ss_rebill_status'];
        $access['Data']['ss_account_notes']['Value'] = $subscription->row['subscriptionTable']['ss_account_notes'];
        $access['Data']['ss_cancel_id']['Value'] = $subscription->row['subscriptionTable']['ss_cancel_id'];
    } else {