コード例 #1
0
function completeOrderUser($order)
{
    $ret = array();
    $gatewaymodule = "bitshares";
    $GATEWAY = getGatewayVariables($gatewaymodule);
    # Checks invoice ID is a valid invoice number or ends processing
    $invoiceid = checkCbInvoiceID($order['order_id'], $GATEWAY["name"]);
    $transid = $order['trx_id'];
    checkCbTransID($transid);
    # Checks transaction number isn't already in the database and ends processing if it does
    # Successful
    $fee = 0;
    $amount = $order['amount'];
    // left blank, this will auto-fill as the full balance
    addInvoicePayment($invoiceid, $transid, $amount, $fee, $gatewaymodule);
    # Apply Payment to Invoice
    $ret['url'] = baseURL . 'viewinvoice.php?id=' . $order['order_id'];
    logTransaction($GATEWAY["name"], $order, $order['status']);
    return $ret;
}
コード例 #2
0
ファイル: 2checkout.php プロジェクト: billyprice1/whmcs
 * @ Website  : http://www.mtimer.cn
 *
 **/
require "../../../init.php";
$whmcs->load_function("gateway");
$whmcs->load_function("invoice");
$GATEWAY = getGatewayVariables("tco");
if (!$GATEWAY['type']) {
    exit("Module Not Activated");
}
if ($GATEWAY['secretword']) {
    $string_to_hash = $GATEWAY['secretword'] . $GATEWAY['vendornumber'] . $_REQUEST['x_trans_id'] . $_REQUEST['x_amount'];
    $check_key = strtoupper(md5($string_to_hash));
    if ($check_key != $_REQUEST['x_MD5_Hash']) {
        logTransaction($GATEWAY['name'], $_REQUEST, "MD5 Hash Failure");
        redirSystemURL("action=invoices", "clientarea.php");
    }
}
echo "<html>\n<head>\n<title>" . $CONFIG['CompanyName'] . "</title>\n</head>\n<body>\n<p>Payment Processing Completed. However it may take a while for 2CheckOut fraud verification to complete and the payment to be reflected on your account. Please wait while you are redirected back to the client area...</p>\n";
if ($_POST['x_response_code'] == "1") {
    $invoiceid = checkCbInvoiceID($_POST['x_invoice_num'], "2CheckOut");
    if ($GATEWAY['skipfraudcheck']) {
        echo "<meta http-equiv=\"refresh\" content=\"2;url=" . $CONFIG['SystemURL'] . "/viewinvoice.php?id=" . $invoiceid . "&paymentsuccess=true\">";
    } else {
        echo "<meta http-equiv=\"refresh\" content=\"2;url=" . $CONFIG['SystemURL'] . "/viewinvoice.php?id=" . $invoiceid . "&pendingreview=true\">";
    }
} else {
    logTransaction("2CheckOut", $_REQUEST, "Unsuccessful");
    echo "<meta http-equiv=\"refresh\" content=\"2;url=" . $CONFIG['SystemURL'] . "/clientarea.php?action=invoices\">";
}
echo "\n</body>\n</html>";
コード例 #3
0
# Checks gateway module is active before accepting callback
# Get Returned Variables - Adjust for Post Variable Names from your Gateway's Documentation
$MerchantID = $_POST["MerchantID"];
$PaymentDate = $_POST["PaymentDate"];
$RtnCode = $_POST["RtnCode"];
$RtnMsg = $_POST["RtnMsg"];
$PaymentNo = $_POST["MerchantTradeNo"];
$status = $_POST["RtnCode"];
$transid = $_POST["TradeNo"];
$amount = $_POST["TradeAmt"];
$fee = $_POST["PaymentTypeChargeFee"];
$invoiceid = $_POST["MerchantTradeNo"];
$invoiceid = str_replace($InvoicePrefix, "", $invoiceid);
$invoiceidtoken = explode("T", $invoiceid);
$invoiceid = $invoiceidtoken[0];
checkCbInvoiceID($invoiceid, $GATEWAY["name"]);
# Checks invoice ID is a valid invoice number or ends processing
$sql = "SELECT * FROM mod_allpay where MerchantTradeNo = '" . $InvoicePrefix . "{$invoiceid}'";
$result = mysql_query($sql);
$row = @mysql_fetch_row($result);
if ($row[14] == 1) {
    #Allpay回傳第二次相同付款訊息就不理他,直接回傳1|OK告知收到
    echo "1|OK";
} else {
    if ($status == "1") {
        # Successful
        $sql = "insert into mod_allpay (MerchantID, MerchantTradeNo, RtnCode, RtnMsg, TradeAmt, TradeDate, TradeNo, PaymentNo, ExpireDate, PaymentType, CheckMacValue, Paid) values ('{$MerchantID}', '" . $InvoicePrefix . "{$invoiceid}', '{$RtnCode}', '{$RtnMsg}', '{$amount}', '{$PaymentDate}', '{$transid}', '{$PaymentNo}', '{$PaymentDate}', 'Credit', '{$CheckMacValue}', 1)";
        if (mysql_query($sql)) {
            addInvoicePayment($invoiceid, $transid, $amount, $fee, $gatewaymodule);
            # Apply Payment to Invoice: invoiceid, transactionid, amount paid, fees, modulename
            logTransaction($GATEWAY["name"], $_POST, "Successful");
コード例 #4
0
ファイル: payoffline.php プロジェクト: billyprice1/whmcs
}
$amount = $_REQUEST['amt'];
$callbackvars2 = explode("&amp;", $callbackvars);
foreach ($callbackvars2 as $value) {
    $values[] = explode("=", $value);
}
if ($code == "5") {
    logTransaction("Pay Offline", $orgipn, "Pending");
    exit;
}
if ($transid) {
    checkCbTransID($transid);
}
if ($code == "0") {
    $invoiceid = $values[0][1];
    if ($invoiceid) {
        checkCbInvoiceID($invoiceid, "PayOffline");
        addInvoicePayment($invoiceid, $transid, $amount, "", "payoffline");
        logTransaction("Pay Offline", $_REQUEST, "Successful");
        return 1;
    }
    $userid = $values[2][1];
    $userid = get_query_val("tblclients", "id", array("id" => $userid));
    if (!$userid) {
        logTransaction("Pay Offline", $_REQUEST, "Invoice Not Found");
        return 1;
    }
    insert_query("tblcredit", array("clientid" => $userid, "date" => "now()", "description" => "Pay Offline Transaction ID " . $transid, "amount" => $amount));
    update_query("tblclients", array("credit" => "+=" . $amount), array("id" => $userid));
    logTransaction("Pay Offline", $_REQUEST, "Credit Added");
}
コード例 #5
0
    $checkout_parsed = simplexml_load_string($retorno_curl);
    if ($checkout_parsed->code) {
        $result = '<form action="https://pagseguro.uol.com.br/v2/checkout/payment.html" method="get">' . "\n";
        $result .= '    <input type="hidden" name="code" value="' . $checkout_parsed->code . '">' . "\n";
        $result .= '    <input type="submit" value="Pagar Agora">' . "\n";
        $result .= '</form>' . "\n";
    } else {
        $result = '<font style="color:red">Ocorreu um erro na comunicação com o PagSeguro</font>';
        logTransaction($params['name'], $retorno_curl . print_r($params, true) . ($checkout_parsed ? " / " . $checkout_parsed : ""), 'Unsuccessful');
    }
    return $result;
}
if (basename(__FILE__) == basename($_SERVER['SCRIPT_NAME'])) {
    if (!array_key_exists('notificationCode', $_POST) || !array_key_exists('notificationType', $_POST)) {
        header($_SERVER["SERVER_PROTOCOL"] . " 404 Not Found");
        die;
    }
    require '../../init.php';
    require '../../includes/invoicefunctions.php';
    require '../../includes/gatewayfunctions.php';
    $GATEWAY = getGatewayVariables('pagseguroapilite');
    $curl = curl_init('https://ws.pagseguro.uol.com.br/v3/transactions/notifications/' . $_POST['notificationCode'] . '?email=' . $GATEWAY['email'] . '&token=' . $GATEWAY['token']);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    $xml = simplexml_load_string(curl_exec($curl));
    logTransaction($GATEWAY['name'], print_r($_POST, true) . print_r($xml, true), 'Successful');
    $invoiceid = checkCbInvoiceID($xml->reference, $GATEWAY["name"]);
    checkCbTransID($xml->code);
    if ($xml->status == 3 || $xml->status == 4) {
        addInvoicePayment($invoiceid, $xml->code, (double) $xml->grossAmount, 0, 'pagseguroapilite');
    }
}
コード例 #6
0
ファイル: egold.php プロジェクト: billyprice1/whmcs
<?php

/**
 *
 * @ WHMCS FULL DECODED & NULLED
 *
 * @ Version  : 5.2.15
 * @ Author   : MTIMER
 * @ Release on : 2013-12-24
 * @ Website  : http://www.mtimer.cn
 *
 **/
require "../../../init.php";
$whmcs->load_function("gateway");
$whmcs->load_function("invoice");
$GATEWAY = getGatewayVariables("egold");
if (!$GATEWAY['type']) {
    exit("Module Not Activated");
}
$invoiceid = checkCbInvoiceID($invoiceid, "E-Gold");
checkCbTransID($_POST['PAYMENT_BATCH_NUM']);
addInvoicePayment($invoiceid, $_POST['PAYMENT_BATCH_NUM'], $_POST['PAYMENT_AMOUNT'], "", "egold");
logTransaction("E-Gold", $_REQUEST, "Successful");
header("HTTP/1.1 200 OK");
header("Status: 200 OK");
コード例 #7
0
ファイル: tco.php プロジェクト: billyprice1/whmcs
        checkCbTransID($transid);
        $amount = tcoconvertcurrency($amount, $currency, $invoiceid);
        addInvoicePayment($invoiceid, $transid, $amount, $fee, $gatewaymodule);
        return 1;
    }
    logTransaction($GATEWAY['name'], $_POST, "Fraud Status Fail");
    return 1;
}
if ($message_type == "ORDER_CREATED" && $GATEWAY['skipfraudcheck']) {
    if ($recurstatus && $serviceid) {
        $query = "SELECT tblinvoices.id FROM tblinvoiceitems INNER JOIN tblinvoices ON tblinvoices.id=tblinvoiceitems.invoiceid WHERE tblinvoiceitems.relid=" . (int) $serviceid . " AND tblinvoiceitems.type='Hosting' AND tblinvoices.status='Unpaid' ORDER BY tblinvoices.id ASC";
        $result = full_query($query);
        $data = mysql_fetch_array($result);
        $invoiceid = $data[0];
    }
    $invoiceid = checkCbInvoiceID($invoiceid, $GATEWAY['name']);
    logTransaction($GATEWAY['name'], $_POST, "Payment Success");
    checkCbTransID($transid);
    $amount = tcoconvertcurrency($amount, $currency, $invoiceid);
    addInvoicePayment($invoiceid, $transid, $amount, $fee, $gatewaymodule);
    return 1;
}
if ($message_type == "RECURRING_INSTALLMENT_SUCCESS") {
    $query = "SELECT tblinvoices.id FROM tblinvoiceitems INNER JOIN tblinvoices ON tblinvoices.id=tblinvoiceitems.invoiceid WHERE tblinvoiceitems.relid=" . (int) $serviceid . " AND tblinvoiceitems.type='Hosting' AND tblinvoices.status='Unpaid' ORDER BY tblinvoices.id ASC";
    $result = full_query($query);
    $data = mysql_fetch_array($result);
    $invoiceid = $data[0];
    if (!$invoiceid) {
        $query = "SELECT tblinvoices.id,tblinvoices.userid FROM tblinvoiceitems INNER JOIN tblinvoices ON tblinvoices.id=tblinvoiceitems.invoiceid WHERE tblinvoiceitems.relid=" . (int) $serviceid . " AND tblinvoiceitems.type='Hosting' AND tblinvoices.status='Paid' ORDER BY tblinvoices.id DESC";
        $result = full_query($query);
        $data = mysql_fetch_array($result);
コード例 #8
0
ファイル: moneybookers.php プロジェクト: billyprice1/whmcs
    }
}
$result = select_query("tblcurrencies", "id", array("code" => $currency));
$data = mysql_fetch_array($result);
$currencyid = $data['id'];
if (!$currencyid) {
    logTransaction("Moneybookers", $_REQUEST, "Unrecognised Currency");
    exit;
}
if ($GATEWAY['convertto']) {
    $result = select_query("tblinvoices", "userid,total", array("id" => $invoiceid));
    $data = mysql_fetch_array($result);
    $userid = $data['userid'];
    $total = $data['total'];
    $currency = getCurrency($userid);
    $amount = convertCurrency($amount, $currencyid, $currency['id']);
    if ($total < $amount + 1 && $amount - 1 < $total) {
        $amount = $total;
    }
}
if ($_POST['status'] == "2") {
    $invoiceid = checkCbInvoiceID($invoiceid, "Moneybookers");
    if ($invoiceid) {
        addInvoicePayment($invoiceid, $transid, $amount, "", "moneybookers");
        logTransaction("Moneybookers", $_REQUEST, "Successful");
        return 1;
    }
    logTransaction("Moneybookers", $_REQUEST, "Error");
    return 1;
}
logTransaction("Moneybookers", $_REQUEST, "Unsuccessful");
コード例 #9
0
} else {
    # failed to get resource ID and resource type, invalid request. Log transaction and ouput error message to client
    logTransaction($gateway['paymentmethod'], 'GoCardless Redirect Failed (No data provided) : ' . print_r($_GET, true), 'Unsuccessful');
    header('HTTP/1.1 400 Bad Request');
    exit('Your request could not be completed');
}
# split invoice data into invoiceID and invoiceAmount
list($invoiceID) = explode(':', $_GET['state']);
# check we have the invoiceID
if ($invoiceID) {
    # get the invoice amount and user ID by querying the invoice table
    $aResult = mysql_fetch_array(select_query('tblinvoices', 'userid,total', array('id' => $invoiceID)));
    $userID = $aResult['userid'];
    $invoiceAmount = $aResult['total'];
    # check this invoice exists (halt execution if it doesnt)
    checkCbInvoiceID($invoiceID, $gateway['paymentmethod']);
    # get user ID and gateway ID for use further down the script
    $gatewayID = mysql_result(select_query('tblclients', 'gatewayid', array('id' => $userID)), 0, 0);
    # if the user records gateway is blank, set it to gocardless
    if (empty($gatewayID)) {
        update_query('tblclients', array('gatewayid' => $gateway['paymentmethod']), array('id' => $userID));
    }
    # check if we are handling a preauth or a one time bill
    switch ($_GET['resource_type']) {
        case "pre_authorization":
            # get the confirmed resource (pre_auth) and created a referenced param $pre_auth
            $pre_auth =& $confirmed_resource;
            # check if we have a setup_fee
            $setup_id = false;
            $setup_amount = 0;
            if ($pre_auth->setup_fee > 0) {
コード例 #10
0
    $id_invoice = $_GET['TID'];
    $token = $_GET['token'];
    $id_user = $_GET['id_user'];
    $amount = number_format($_GET['PRICE'] / 100, 2, '.', '');
    $paymentmethod = $_GET['paymentmethod'];
    $id_transaction_mpay24 = $_GET['MPAYTID'];
    $status = $_GET['STATUS'];
    $description = urldecode($_GET['description']);
    $hashKeyExtension = !empty($gateway['hashKeyExtension']) ? $gateway['hashKeyExtension'] : '';
    $tokenGenerated = sha1($hashKeyExtension . md5($_SERVER['HTTP_HOST'] . sha1($id_user * 100 / 23.5) . md5($amount) . $description . $_SERVER['SERVER_ADDR'] . 'CC'));
    try {
        if ($token == $tokenGenerated) {
            if (!$gateway["type"]) {
                throw new Exception("Module Not Activated");
            }
            $invoiceid = checkCbInvoiceID($id_invoice, $gateway["name"]);
            checkCbTransID($id_transaction_mpay24);
            addInvoicePayment($id_invoice, $id_transaction_mpay24, $amount, 0, $gatewayModule);
            logTransaction($gatewayModule, $_GET, "Successful");
            sendMessage("Credit Card Payment Confirmation", $id_invoice);
            echo "OK: STATUS received; Invoice marked as paid";
            if (isset($gateway['emailNotification']) && 'on' == $gateway['emailNotification'] && !empty($gateway['notificationRecipients'])) {
                $subject = empty($gateway['notificationSubject']) ? 'WHMCS order notification' : $gateway['notificationSubject'];
                $senderName = empty($gateway['notificationSenderName']) ? 'WHMCS order notification' : $gateway['notificationSenderName'];
                $senderEmail = empty($gateway['notificationSenderEmail']) ? '*****@*****.**' : $gateway['notificationSenderEmail'];
                $tempRecipients = explode(',', $gateway['notificationRecipients']);
                $header = 'From: ' . $senderName . '' . "\r\n" . 'Reply-To: ' . $senderEmail . '' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
                $content = 'Order notification from Module ' . $gateway['paymentmethod'] . '
					
Invoice ID: ' . $id_invoice . '
コード例 #11
0
ファイル: pagseguro.php プロジェクト: billyprice1/whmcs
if (!tep_not_null($resp)) {
    curl_setopt($ch, CURLOPT_URL, "https://pagseguro.uol.com.br/Security/NPI/Default.aspx");
    $resp = curl_exec($ch);
}
curl_close($ch);
if (strcmp($resp, "VERIFICADO") == 0) {
    $VendedorEmail = addslashes($_POST['VendedorEmail']);
    $TransacaoID = addslashes($_POST['TransacaoID']);
    $Referencia = (int) $_POST['Referencia'];
    $StatusTransacao = addslashes($_POST['StatusTransacao']);
    $TipoPagamento = addslashes($_POST['TipoPagamento']);
    $CliNome = addslashes($_POST['CliNome']);
    $NumItens = addslashes($_POST['NumItens']);
    $ProdValor = number_format(str_replace(array(",", "."), ".", addslashes($_POST['ProdValor_1'])), 2, ".", "");
    $Taxa = 644;
    $invoiceid = checkCbInvoiceID($Referencia, "PagSeguro");
    switch ($TipoPagamento) {
        case "Boleto":
        case "Pagamento":
            break;
        case "Pagamento Online":
            $Taxa = $ProdValor * 2.9 / 100 + 0.4;
            break;
        case "Cartro de Crndito":
            $Taxa = $ProdValor * 6.4 / 100 + 0.4;
    }
    $result = select_query("tblinvoices", "userid,status", array("id" => $invoiceid));
    $payments = mysql_fetch_array($result);
    $userid = $payments['userid'];
    $status = $payments['status'];
    if ($GATEWAY['convertto']) {
コード例 #12
0
ファイル: paymate.php プロジェクト: billyprice1/whmcs
<?php

/**
 *
 * @ WHMCS FULL DECODED & NULLED
 *
 * @ Version  : 5.2.15
 * @ Author   : MTIMER
 * @ Release on : 2013-12-24
 * @ Website  : http://www.mtimer.cn
 *
 **/
require "../../../init.php";
$whmcs->load_function("gateway");
$whmcs->load_function("invoice");
$GATEWAY = getGatewayVariables("paymateau");
if (!$GATEWAY['type']) {
    $GATEWAY = getGatewayVariables("paymatenz");
}
if (!$GATEWAY['type']) {
    exit("Module Not Activated");
}
$invoiceid = checkCbInvoiceID($_POST['ref'], "Paymate");
if ($_POST['responseCode'] == "PA" && $invoiceid) {
    addInvoicePayment($invoiceid, $_POST['transactionID'], "", "", "paymate");
    logTransaction("Paymate", $_REQUEST, "Successful");
    redirSystemURL("id=" . $invoiceid . "&paymentsuccess=true", "viewinvoice.php");
    return 1;
}
logTransaction("Paymate", $_REQUEST, "Error");
redirSystemURL("id=" . $invoiceid . "&paymentfailed=true", "viewinvoice.php");
コード例 #13
0
 }
 // Get user and transaction currencies
 $userCurrency = getCurrency($transaction['userid']);
 $transactionCurrency = select_query('tblcurrencies', '', array('id' => $transaction['currencyid']));
 $transactionCurrency = mysql_fetch_assoc($transactionCurrency);
 // Check payment
 $mollie = new Mollie_API_Client();
 $mollie->setApiKey($_GATEWAY['key']);
 $payment = $mollie->payments->get($_POST['id']);
 if ($payment->isPaid()) {
     // Add conversion, when there is need to. WHMCS only supports currencies per user. WHY?!
     if ($transactionCurrency['id'] != $userCurrency['id']) {
         $transaction['amount'] = convertCurrency($transaction['amount'], $transaction['currencyid'], $userCurrency['id']);
     }
     // Check invoice
     $invoiceid = checkCbInvoiceID($transaction['invoiceid'], $_GATEWAY['paymentmethod']);
     checkCbTransID($transaction['paymentid']);
     // Add invoice
     addInvoicePayment($invoiceid, $transaction['paymentid'], $transaction['amount'], '', $_GATEWAY['paymentmethod']);
     update_query('gateway_mollie', array('status' => 'paid', 'updated' => date('Y-m-d H:i:s', time())), array('id' => $transaction['id']));
     logTransaction($_GATEWAY['paymentmethod'], array_merge($transaction, $_POST), 'Callback - Successful (Paid)');
     header('HTTP/1.1 200 OK');
     exit;
 } else {
     if ($payment->isOpen() == FALSE) {
         update_query('gateway_mollie', array('status' => 'closed', 'updated' => date('Y-m-d H:i:s', time())), array('id' => $transaction['id']));
         logTransaction($_GATEWAY['paymentmethod'], array_merge($transaction, $_POST), 'Callback - Successful (Closed)');
         header('HTTP/1.1 200 OK');
         exit;
     } else {
         logTransaction($_GATEWAY['paymentmethod'], array_merge($transaction, $_POST), 'Callback - Failure 1 (Payment not open or paid)');
コード例 #14
0
<?php

include "../../../dbconnect.php";
include "../../../includes/functions.php";
include "../../../includes/gatewayfunctions.php";
include "../../../includes/invoicefunctions.php";
require_once dirname(__FILE__) . '/../paytm-sdk/encdec_paytm.php';
$gatewaymodule = "paytm";
$GATEWAY = getGatewayVariables($gatewaymodule);
$response = array();
$response = $_POST;
if (isset($response['ORDERID']) && isset($response['STATUS']) && isset($response['RESPCODE']) && $response['RESPCODE'] != 325) {
    $txnid = $response['ORDERID'];
    $txnid = checkCbInvoiceID($txnid, 'paytm');
    $status = $response['STATUS'];
    $paytm_trans_id = $response['TXNID'];
    $checksum_recv = '';
    $amount = $response['TXNAMOUNT'];
    if (isset($response['CHECKSUMHASH'])) {
        $checksum_recv = $response['CHECKSUMHASH'];
    }
    checkCbTransID($paytm_trans_id);
    $checksum_status = verifychecksum_e($response, html_entity_decode($GATEWAY['merchant_key']), $checksum_recv);
    if ($status == 'TXN_SUCCESS' && $checksum_status == "TRUE") {
        $gatewayresult = "success";
        addInvoicePayment($txnid, $paytm_trans_id, $amount, $gatewaymodule);
        logTransaction($GATEWAY["name"], $response, $response['RESPMSG']);
    } elseif ($status == "TXN_SUCCESS" && $checksum_status != "TRUE") {
        logTransaction($GATEWAY["name"], $response, "Checksum Mismatch");
    } else {
        logTransaction($GATEWAY["name"], $response, $response['RESPMSG']);
コード例 #15
0
ファイル: paymentwall.php プロジェクト: fanytest/module-whmcs
<?php

# Required File Includes
include "../../../init.php";
$whmcs->load_function('gateway');
$whmcs->load_function('invoice');
define('PW_WHMCS_ITEM_TYPE_HOSTING', 'Hosting');
require_once ROOTDIR . "/includes/api/paymentwall_api/lib/paymentwall.php";
$gateway = getGatewayVariables("paymentwall");
if (!$gateway["type"]) {
    die("Module Not Activated");
}
Paymentwall_Config::getInstance()->set(array('api_type' => Paymentwall_Config::API_GOODS, 'public_key' => $gateway['appKey'], 'private_key' => $gateway['secretKey']));
$pingback = new Paymentwall_Pingback($_GET, $_SERVER['REMOTE_ADDR']);
$invoiceid = checkCbInvoiceID($pingback->getProductId(), $gateway["name"]);
if ($invoiceid && $pingback->validate()) {
    $orderData = mysql_fetch_assoc(select_query('tblorders', 'userid,id', array("invoiceid" => $invoiceid)));
    $userData = mysql_fetch_assoc(select_query('tblclients', 'email, firstname, lastname, country, address1, state, phonenumber, postcode, city, id', array("id" => $orderData['userid'])));
    if ($pingback->isDeliverable()) {
        processDeliverable($invoiceid, $pingback, $gateway, $userData, $orderData);
    } elseif ($pingback->isCancelable()) {
        // WHMCS not supported
        logTransaction($gateway["name"], $_GET, "Not Supported");
        die("Not Supported");
    } else {
        switch ($pingback->getType()) {
            /*
            case Paymentwall_Pingback::PINGBACK_TYPE_SUBSCRIPTION_EXPIRED:
            case Paymentwall_Pingback::PINGBACK_TYPE_SUBSCRIPTION_PAYMENT_FAILED:
                // Do not process transaction
                break;
コード例 #16
0
ファイル: ccbill.php プロジェクト: mcprohosting/ccbill
<?php

// Required File Includes. Because WHMCS says so.
include "../../../dbconnect.php";
include "../../../includes/functions.php";
include "../../../includes/gatewayfunctions.php";
include "../../../includes/invoicefunctions.php";
$name = 'ccbill';
$gateway = getGatewayVariables($name);
if (!$gateway['type']) {
    die('Module Not Activated');
}
// Extract and verify the invoice ID
$invoice = array_key_exists('invoiceId', $_POST) ? $_POST['invoiceId'] : '';
checkCbInvoiceID($invoiceid, $gateway['name']);
$digest = md5($_POST['subscriptionId'] . '1' . $gateway['salt']);
// If the hash verifies as successful, add the payment
if ($digest === $_POST['responseDigest']) {
    addInvoicePayment($invoice, $_POST['subscription_id'], $_POST['initialPrice'], $_POST['initialPrice'] - $_POST['accountingAmount'], $name);
    logTransaction($name, $_POST, 'Successful');
} else {
    logTransaction($name, $_POST, 'Unsuccessful');
}
コード例 #17
0
 * @ Release on : 2013-12-24
 * @ Website  : http://www.mtimer.cn
 *
 **/
require "../../../init.php";
$whmcs->load_function("gateway");
$whmcs->load_function("invoice");
$whmcs->load_function("clientarea");
$GATEWAY = getGatewayVariables("worldpayfuturepay");
if (!$GATEWAY['type']) {
    exit("Module Not Activated");
}
$invoiceid = mysql_real_escape_string($_POST['cartId']);
$futurepayid = mysql_real_escape_string($_POST['futurePayId']);
$transid = mysql_real_escape_string($_POST['transId']);
$invoiceid = checkCbInvoiceID($invoiceid, "WorldPay FuturePay");
initialiseClientArea($_LANG['ordercheckout'], "", $_LANG['ordercheckout']);
echo processSingleTemplate("/templates/" . $whmcs->get_sys_tpl_name() . "/header.tpl", $smarty->_tpl_vars);
echo "<WPDISPLAY ITEM=\"banner\">";
$result = select_query("tblinvoices", "", array("id" => $invoiceid));
$data = mysql_fetch_array($result);
$userid = $data['userid'];
if ($_POST['transStatus'] == "Y") {
    logTransaction("WorldPay FuturePay", $_POST, "Successful");
    update_query("tblclients", array("gatewayid" => $futurepayid), array("id" => $userid));
    addInvoicePayment($invoiceid, $transid, "", "", "worldpayfuturepay");
    echo "<p align=\"center\"><a href=\"" . $CONFIG['SystemURL'] . "/viewinvoice.php?id=" . $invoiceid . "&paymentsuccess=true\">Click here to return to " . $CONFIG['CompanyName'] . "</a></p>";
} else {
    logTransaction("WorldPay FuturePay", $_POST, "Unsuccessful");
    echo "<p align=\"center\"><a href=\"" . $CONFIG['SystemURL'] . "/viewinvoice.php?id=" . $invoiceid . "&paymentfailed=true\">Click here to return to " . $CONFIG['CompanyName'] . "</a></p>";
}
コード例 #18
0
ファイル: cashu.php プロジェクト: billyprice1/whmcs
 *
 * @ Version  : 5.2.15
 * @ Author   : MTIMER
 * @ Release on : 2013-12-24
 * @ Website  : http://www.mtimer.cn
 *
 **/
require "../../../init.php";
$whmcs->load_function("invoice");
$whmcs->load_function("gateway");
$GATEWAY = getGatewayVariables("cashu");
if (!$GATEWAY['type']) {
    exit("Module Not Activated");
}
$amount = $_REQUEST['amount'];
$currency = $_REQUEST['currency'];
$trn_id = $_REQUEST['trn_id'];
$session_id = (int) $_REQUEST['session_id'];
$verificationString = $_REQUEST['verificationString'];
$verstr = array(strtolower($GATEWAY['merchantid']), strtolower($trn_id), $GATEWAY['encryptionkeyword']);
$verstr = implode(":", $verstr);
$verstr = sha1($verstr);
$invoiceid = checkCbInvoiceID($session_id, "CashU");
if ($verstr == $verificationString) {
    addInvoicePayment($invoiceid, $trn_id, $amount, "0", "cashu");
    logTransaction("CashU", $debugdata, "Successful");
    redirSystemURL("id=" . $invoiceid . "&paymentsuccess=true", "viewinvoice.php");
    return 1;
}
logTransaction("CashU", $_REQUEST, "Invalid Hash");
redirSystemURL("id=" . $invoiceid . "&paymentfailed=true", "viewinvoice.php");
コード例 #19
0
$secretKey = $gatewayParams['secretKey'];
if ($hash != md5($secretKey . $invoiceId . $transactionId . $paymentAmount)) {
    $transactionStatus = 'Hash Verification Failure';
    $success = false;
}
/**
 * Validate Callback Invoice ID.
 *
 * Checks invoice ID is a valid invoice number. Note it will count an
 * invoice in any status as valid.
 *
 * Performs a die upon encountering an invalid Invoice ID.
 *
 * Returns a normalised invoice ID.
 */
$invoiceId = checkCbInvoiceID($invoiceId, $gatewayParams['name']);
/**
 * Check Callback Transaction ID.
 *
 * Performs a check for any existing transactions with the same given
 * transaction number.
 *
 * Performs a die upon encountering a duplicate.
 */
checkCbTransID($transactionId);
/**
 * Log Transaction.
 *
 * Add an entry to the Gateway Log for debugging purposes.
 *
 * The debug data can be a string or an array. In the case of an
コード例 #20
0
ファイル: gate2shop.php プロジェクト: billyprice1/whmcs
 *
 * @ Version  : 5.2.15
 * @ Author   : MTIMER
 * @ Release on : 2013-12-24
 * @ Website  : http://www.mtimer.cn
 *
 **/
require "../../../init.php";
$whmcs->load_function("gateway");
$whmcs->load_function("invoice");
$GATEWAY = getGatewayVariables("gate2shop");
if (!$GATEWAY['type']) {
    exit("Module Not Activated");
}
$cId = $_REQUEST['customField1'];
$invoiceid = checkCbInvoiceID($cId, "Gate2Shop");
if (isset($_REQUEST['TransactionID'])) {
    $trId = $_REQUEST['TransactionID'];
}
if (isset($_REQUEST['ErrCode'])) {
    $errCode = $_REQUEST['ErrCode'];
}
if (isset($_REQUEST['ExErrCode'])) {
    $exErrCode = $_REQUEST['ExErrCode'];
}
if (isset($_REQUEST['Status'])) {
    $status = $_REQUEST['Status'];
}
if (isset($_REQUEST['responsechecksum'])) {
    $responsechecksum = $_REQUEST['responsechecksum'];
}
コード例 #21
0
ファイル: razorpay.php プロジェクト: kdclabs/razorpay-whmcs
include "../../../includes/functions.php";
include "../../../includes/gatewayfunctions.php";
include "../../../includes/invoicefunctions.php";
$gatewaymodule = "razorpay";
$GATEWAY = getGatewayVariables($gatewaymodule);
# Checks gateway module is active before accepting callback
if (!$GATEWAY["type"]) {
    die("Module Not Activated");
}
$key_id = $GATEWAY["KeyId"];
$key_secret = $GATEWAY["KeySecret"];
# Get Returned Variables
$merchant_order_id = $_POST["merchant_order_id"];
$razorpay_payment_id = $_POST["razorpay_payment_id"];
# Checks invoice ID is a valid invoice number or ends processing
$merchant_order_id = checkCbInvoiceID($merchant_order_id, $GATEWAY["name"]);
# Checks transaction number isn't already in the database and ends processing if it does
checkCbTransID($razorpay_payment_id);
# Fetch invoice to get the amount
$result = mysql_fetch_assoc(select_query('tblinvoices', 'total', array("id" => $merchant_order_id)));
$amount = $result['total'];
# Check if amount is INR, convert if not.
$currency = getCurrency();
if ($currency['code'] !== 'INR') {
    $result = mysql_fetch_array(select_query("tblcurrencies", "id", array("code" => 'INR')));
    $inr_id = $result['id'];
    $converted_amount = convertCurrency($amount, $currency['id'], $inr_id);
} else {
    $converted_amount = $amount;
}
# Amount in Paisa
コード例 #22
0
ファイル: payson.php プロジェクト: billyprice1/whmcs
 *
 * @ WHMCS FULL DECODED & NULLED
 *
 * @ Version  : 5.2.15
 * @ Author   : MTIMER
 * @ Release on : 2013-12-24
 * @ Website  : http://www.mtimer.cn
 *
 **/
require "../../../init.php";
$whmcs->load_function("gateway");
$whmcs->load_function("invoice");
$GATEWAY = getGatewayVariables("payson");
if (!$GATEWAY['type']) {
    exit("Module Not Activated");
}
$strYourSecretKey = $GATEWAY['key'];
$strOkURL = $_GET['OkURL'];
$strRefNr = $_GET['RefNr'];
$strPaysonRef = $_GET['Paysonref'];
$strTestMD5String = $strOkUrl . $strPaysonRef . $strYourSecretKey;
$strMD5Hash = md5($strTestMD5String);
if ($strMD5Hash = $_GET['MD5']) {
    $invoiceid = checkCbInvoiceID($_REQUEST['RefNr'], "PaySon");
    addInvoicePayment($_GET['RefNr'], $strPaysonRef, "", "", "payson");
    logTransaction("Payson", $_REQUEST, "Successful");
    redirSystemURL("id=" . $invoiceid . "&paymentsuccess=true", "viewinvoice.php");
    return 1;
}
logTransaction("Payson", $_REQUEST, "Unsuccessful");
redirSystemURL("action=invoices", "clientarea.php");
コード例 #23
0
    exit("Module Not Activated");
}
$invoiceid = $_REQUEST['ID'];
$transid = $_REQUEST['transID'];
$transresult = $_REQUEST['trans_result'];
$amount = $_REQUEST['amount'];
$md5_hash = $_REQUEST['md5_hash'];
checkCbTransID($transid);
$ourhash = md5($GATEWAY['md5hash'] . $GATEWAY['loginid'] . $transid . $amount);
if ($ourhash != $md5_hash) {
    logTransaction("Quantum Gateway", $_REQUEST, "MD5 Hash Failure");
    echo "Hash Failure. Please Contact Support.";
    exit;
}
$callbacksuccess = false;
$invoiceid = checkCbInvoiceID($invoiceid, "Quantum Gateway");
if ($GATEWAY['convertto']) {
    $result = select_query("tblinvoices", "userid,total", array("id" => $invoiceid));
    $data = mysql_fetch_array($result);
    $userid = $data['userid'];
    $total = $data['total'];
    $currency = getCurrency($userid);
    $amount = convertCurrency($amount, $GATEWAY['convertto'], $currency['id']);
    if ($total < $amount + 1 && $amount - 1 < $total) {
        $amount = $total;
    }
}
if ($transresult == "APPROVED") {
    addInvoicePayment($invoiceid, $transid, $amount, "", "quantumgateway", "on");
    logTransaction("Quantum Gateway", $_REQUEST, "Approved");
    sendMessage("Credit Card Payment Confirmation", $invoiceid);
コード例 #24
0
ファイル: nochex.php プロジェクト: billyprice1/whmcs
if (!$GATEWAY['type']) {
    exit("Module Not Activated");
}
if (!isset($_POST)) {
    $_POST =& $HTTP_POST_VARS;
}
foreach ($_POST as $key => $value) {
    $values[] = $key . "=" . urlencode($value);
}
$work_string = @implode("&", $values);
$url = "https://www.nochex.com/nochex.dll/apc/apc";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDSIZE, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, $work_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_SSLVERSION, 3);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$output = curl_exec($ch);
curl_close($ch);
$response = preg_replace("'Content-type: text/plain'si", "", $output);
if ($response == "AUTHORISED") {
    $invoiceid = checkCbInvoiceID($_POST['order_id'], "NoChex");
    addInvoicePayment($invoiceid, $_POST['transaction_id'], "", "", "nochex");
    logTransaction("NoChex", $_REQUEST, "Successful");
    return 1;
}
logTransaction("NoChex", $_REQUEST, "Invalid");
コード例 #25
0
ファイル: paymex.php プロジェクト: billyprice1/whmcs
 * @ WHMCS FULL DECODED & NULLED
 *
 * @ Version  : 5.2.15
 * @ Author   : MTIMER
 * @ Release on : 2013-12-24
 * @ Website  : http://www.mtimer.cn
 *
 **/
require "../../../init.php";
$whmcs->load_function("gateway");
$whmcs->load_function("invoice");
$GATEWAY = getGatewayVariables("paymex");
if (!$GATEWAY['type']) {
    exit("Module Not Activated");
}
$invoiceid = checkCbInvoiceID($_GET['xinv'], "Paymex");
if ($_GET['xresp'] == "1") {
    $result = select_query("tblinvoices", "total", array("id" => $invoiceid));
    $data = mysql_fetch_array($result);
    $total = $data['total'];
    $fee = $total * 0.0295 + 0.55;
    $pos = strpos($fee, ".");
    $pos = $pos + 3;
    $fee = substr($fee, 0, $pos);
    addInvoicePayment($invoiceid, $invoiceid, "", $fee, "paymex");
    logTransaction("Paymex", $_REQUEST, "Successful");
    redirSystemURL("id=" . $invoiceid . "&paymentsuccess=true", "viewinvoice.php");
    return 1;
}
logTransaction("Paymex", $_REQUEST, "Unsuccessful");
redirSystemURL("id=" . $invoiceid . "&paymentfailed=true", "viewinvoice.php");
コード例 #26
0
ファイル: payza.php プロジェクト: billyprice1/whmcs
 $response = urldecode($response);
 $aps = explode("&", $response);
 foreach ($aps as $ap) {
     $ele = explode("=", $ap);
     $info[$ele[0]] = $ele[1];
 }
 $result = select_query("tblcurrencies", "", array("code" => $info['ap_currency']));
 $data = mysql_fetch_array($result);
 $currencyid = $data['id'];
 if (!$currencyid) {
     logTransaction("Payza", $response, "Unrecognised Currency");
     exit;
 }
 if ($info['ap_status'] == "Success") {
     $_REQUEST = $info;
     $id = checkCbInvoiceID($info['apc_1'], "Payza");
     checkCbTransID($info['ap_referencenumber']);
     $amount = $info['ap_totalamount'];
     $fees = $info['ap_feeamount'];
     $result = select_query("tblinvoices", "userid,total", array("id" => $id));
     $data = mysql_fetch_array($result);
     $userid = $data['userid'];
     $total = $data['total'];
     $currency = getCurrency($userid);
     if ($currencyid != $currency['id']) {
         $amount = convertCurrency($amount, $currencyid, $currency['id']);
         $fees = convertCurrency($fees, $currencyid, $currency['id']);
         if ($total < $amount + 1 && $amount - 1 < $total) {
             $amount = $total;
         }
     }
コード例 #27
0
OrderID : ' . $cevap->Order->OrderID . '
Transaction Bilgileri :
Source : ' . $cevap->Transaction->Response->Source . '
Code : ' . $cevap->Transaction->Response->Code . '
ReasonCode : ' . $cevap->Transaction->Response->ReasonCode . '
Mesaj : ' . $cevap->Transaction->Response->Message . '
Sistem Hata Mesajı : ' . $cevap->Transaction->Response->SysErrMsg . '
RetrefNum : ' . $cevap->Transaction->RetrefNum . '
BatchNum : ' . $cevap->Transaction->BatchNum . '
SequenceNum : ' . $cevap->Transaction->SequenceNum . '
ProvDate : ' . $cevap->Transaction->ProvDate . '
CardNumberMasked : ' . $cevap->Transaction->CardNumberMasked . '
CardHolderName : ' . $cevap->Transaction->CardHolderName . '
CardType : ' . $cevap->Transaction->CardType . '
HashData : ' . $cevap->Transaction->HashData . '
XML : ' . $results;
    $ReasonCode = $cevap->Transaction->Response->ReasonCode;
    $invoiceid = checkCbInvoiceID($strOrderID, $GATEWAY["name"]);
    checkCbTransID($transid);
    if (00 == (int) $ReasonCode) {
        addInvoicePayment($strOrderID, $authcode, $StrAmount, "0", $gatewaymodule);
        logTransaction($GATEWAY["name"], $kayit, "Successful");
        echo "<script>alert('Ödeme Tamamlandı');</script>";
        callback3DSecureRedirect($strOrderID, true);
    } else {
        logTransaction($GATEWAY["name"], $kayit, "Unsuccessful");
        echo "Ödeme işlemi tamamlanamadı<br/>";
        echo 'Hata : ' . $cevap->Transaction->Response->ErrorMsg . ' - ' . $cevap->Transaction->Response->SysErrMsg;
        callback3DSecureRedirect($strOrderID, false);
    }
}
コード例 #28
0
ファイル: quantumvault.php プロジェクト: billyprice1/whmcs
 * @ WHMCS FULL DECODED & NULLED
 *
 * @ Version  : 5.2.15
 * @ Author   : MTIMER
 * @ Release on : 2013-12-24
 * @ Website  : http://www.mtimer.cn
 *
 **/
require "../../../init.php";
$whmcs->load_function("gateway");
$whmcs->load_function("invoice");
$GATEWAY = getGatewayVariables("quantumvault");
if (!$GATEWAY['type']) {
    exit("Module Not Activated");
}
$invoiceid = checkCbInvoiceID($_REQUEST['ID'], "Quantum Vault");
$transid = $_REQUEST['transID'];
$transresult = $_REQUEST['trans_result'];
$amount = $_REQUEST['amount'];
$md5_hash = $_REQUEST['md5_hash'];
$vaultid = $_REQUEST['cust_id'];
checkCbTransID($transid);
$ourhash = md5($GATEWAY['md5hash'] . $GATEWAY['loginid'] . $transid . $amount);
if ($ourhash != $md5_hash) {
    logTransaction("Quantum Vault", $_REQUEST, "MD5 Hash Failure");
    echo "Hash Failure. Please Contact Support.";
    exit;
}
if ($GATEWAY['convertto']) {
    $result = select_query("tblinvoices", "userid,total", array("id" => $invoiceid));
    $data = mysql_fetch_array($result);
コード例 #29
0
 */
$sqlquery = "SELECT data FROM tblgatewaylog WHERE result = '" . $transactionId . "'";
$result = mysql_query($sqlquery) or die("No associated transaction found");
$qry = mysql_fetch_assoc($result);
/**
 * de-serialize the data read from tblgatewaylog
 */
$base = json_decode(base64_decode($qry['data']), true);
/**
 * Validate Callback Invoice ID.
 * Checks invoice ID is a valid invoice number. Note it will count an
 * invoice in any status as valid.
 * Performs a die upon encountering an invalid Invoice ID.
 * Returns a normalised invoice ID.
 */
$invoiceId = checkCbInvoiceID($base['invoice_id'], $gatewayParams['name']);
/**
 * Check Callback Transaction ID.
 * Performs a check for any existing transactions with the same given
 * transaction number.
 * Performs a die upon encountering a duplicate.
 */
checkCbTransID($transactionId);
switch ($sec_status) {
    case "1":
        $transactionStatus = "Valid transaction, pending state";
        break;
    case "2":
        $transactionStatus = "Failed transaction";
        break;
    case "3":
コード例 #30
0
ファイル: worldpay.php プロジェクト: billyprice1/whmcs
 *
 **/
require "../../../init.php";
$whmcs->load_function("gateway");
$whmcs->load_function("invoice");
$GATEWAY = getGatewayVariables("worldpay");
if (!$GATEWAY['type']) {
    exit("Module Not Activated");
}
if ($GATEWAY['prpassword']) {
    if ($GATEWAY['prpassword'] != $_REQUEST['callbackPW']) {
        logTransaction($GATEWAY['name'], $_REQUEST, "Payment Response Password Mismatch");
        exit;
    }
}
$invoiceid = checkCbInvoiceID($_POST['cartId'], "WorldPay");
echo "<WPDISPLAY ITEM=\"banner\">";
if ($_POST['transStatus'] == "Y") {
    if ($invoiceid) {
        checkCbTransID($_POST['transId']);
        addInvoicePayment($invoiceid, $_POST['transId'], "", "", "worldpay");
        logTransaction("WorldPay", $_POST, "Successful");
        echo "<p align=\"center\"><a href=\"" . $CONFIG['SystemURL'] . "/viewinvoice.php?id=" . $invoiceid . "&paymentsuccess=true\">Click here to return to " . $CONFIG['CompanyName'] . "</a></p>";
        exit;
    } else {
        logTransaction("WorldPay", $_POST, "Error");
    }
} else {
    logTransaction("WorldPay", $_POST, "Unsuccessful");
}
echo "<p align=\"center\"><a href=\"" . $CONFIG['SystemURL'] . "/viewinvoice.php?id=" . $invoiceid . "&paymentfailed=true\">Click here to return to " . $CONFIG['CompanyName'] . "</a></p>";