Ejemplo n.º 1
0
    curl_setopt($ch, CURLOPT_CAINFO, realpath(dirname(__FILE__) . "/cacert.pem"));
    $return = curl_exec($ch);
    curl_close($ch);
    return $return;
}
# Ensure that the module is active before attempting to run any code
$gateway = new Gateway();
if (!$gateway->isActiveGateway($gatewaymodule) || !$gateway->load($gatewaymodule)) {
    Terminus::getInstance()->doDie('Module not Active');
}
$pdo = Capsule::connection()->getPdo();
# Process and store transaction
if (isset($_REQUEST['id']) && !empty($_REQUEST['id'])) {
    $ca = new WHMCS_ClientArea();
    # Check login status
    if ($ca->isLoggedIn()) {
        $invoice_id = (int) $_REQUEST['id'];
        $store_token = $_REQUEST['token'];
        $currency = $_REQUEST['currency'];
        $amount = (int) $_REQUEST['amount'];
        if (preg_match("#^[A-Z]{3}\$#", $currency) && preg_match("#^[a-zA-Z 0-9\\_\\-]*\$#", $store_token)) {
            //Get invoice details
            $sql = "SELECT * FROM tblinvoices WHERE id = '{$invoice_id}'";
            $result = $pdo->query($sql);
            $row = $result->fetch(PDO::FETCH_ASSOC);
            $invoice_num = $row['invoicenum'];
            if ($invoice_num == NULL) {
                $invoice_num = $invoice_id;
            }
            //Create Capture request
            $capture = json_decode(stripecx_capture($amount, $currency, $token, $invoice_num));
Ejemplo n.º 2
0
<?php

define("CLIENTAREA", true);
require "init.php";
$ca = new WHMCS_ClientArea();
$settings = sirportly_settings();
$ca->setPageTitle($whmcs->get_lang('supportticketsviewticket'));
$ca->initPage();
global $CONFIG;
if (!sirportly_enabled()) {
    die('Sirportly module not enabled.');
}
if ($CONFIG['RequireLoginforClientTickets'] == 'on' && !$ca->isLoggedIn()) {
    header('Location: login.php');
}
## Close ticket
if ($settings['close_ticket'] && $_GET['closeticket']) {
    $close = curl('/api/v2/tickets/update', array('ticket' => $_GET['tid'], 'status' => $settings['closed_status']));
    if ($close['status'] != 200) {
        $ca->assign('errormessage', "Unable to close ticket, please contact support.");
    } else {
        header('Location: viewticket.php?tid=' . $_GET['tid'] . '&c=' . $_GET['c']);
    }
}
$ticket = curl('/api/v2/tickets/ticket', array('reference' => $_GET['tid']));
if ($ticket['results']['id'] != $_GET['c']) {
    header('Location: supporttickets.php');
}
## An update has been posted
if ($_POST) {
    foreach ($_POST as $key => $value) {
Ejemplo n.º 3
0
<?php

define("CLIENTAREA", true);
require "init.php";
$ca = new WHMCS_ClientArea();
$ca->initPage();
$ca->setPageTitle($whmcs->get_lang('supportticketssubmitticket'));
$settings = sirportly_settings();
if (!sirportly_enabled()) {
    die('Sirportly module not enabled.');
}
## Logged in?
if ($ca->isLoggedIn()) {
    $result = mysql_query("SELECT CONCAT_WS(' ', firstname, lastname) as full_name, email FROM tblclients WHERE id=" . $ca->getUserID());
    $client = mysql_fetch_array($result, MYSQL_ASSOC);
    $ca->assign('email', $client['email']);
    $ca->assign('clientname', $client['full_name']);
}
switch ($_GET['step']) {
    case '2':
        ## Default department, priority
        $ca->assign('deptid', $_GET['deptid']);
        $ca->assign('priorityid', $settings['priority']);
        if ($_POST) {
            ## Submitted new ticket
            foreach ($_POST as $key => $value) {
                $ca->assign($key, $value);
            }
            if (!$_POST['message']) {
                $ca->assign('errormessage', $whmcs->get_lang('supportticketserrornomessage'));
            } elseif ($contact = sirportly_contact()) {