function paypalpaymentsproref_3dsecure($params)
 {
     if ($params['sandbox']) {
         $mapurl = "https://centineltest.cardinalcommerce.com/maps/txns.asp";
     } else {
         $mapurl = "https://paypal.cardinalcommerce.com/maps/txns.asp";
     }
     $currency = "";
     if ($params['currency'] == "USD") {
         $currency = "840";
     }
     if ($params['currency'] == "GBP") {
         $currency = "826";
     }
     if ($params['currency'] == "EUR") {
         $currency = "978";
     }
     if ($params['currency'] == "CAD") {
         $currency = "124";
     }
     $postfields = array();
     $postfields['MsgType'] = "cmpi_lookup";
     $postfields['Version'] = "1.7";
     $postfields['ProcessorId'] = $params['processorid'];
     $postfields['MerchantId'] = $params['merchantid'];
     $postfields['TransactionPwd'] = $params['transpw'];
     $postfields['UserAgent'] = $_SERVER['HTTP_USER_AGENT'];
     $postfields['BrowserHeader'] = $_SERVER['HTTP_ACCEPT'];
     $postfields['TransactionType'] = "C";
     $postfields['Amount'] = $params['amount'] * 100;
     $postfields['ShippingAmount'] = "0";
     $postfields['TaxAmount'] = "0";
     $postfields['CurrencyCode'] = $currency;
     $postfields['OrderNumber'] = $params['invoiceid'];
     $postfields['OrderDescription'] = $params['description'];
     $postfields['EMail'] = $params['clientdetails']['email'];
     $postfields['BillingFirstName'] = $params['clientdetails']['firstname'];
     $postfields['BillingLastName'] = $params['clientdetails']['lastname'];
     $postfields['BillingAddress1'] = $params['clientdetails']['address1'];
     $postfields['BillingAddress2'] = $params['clientdetails']['address2'];
     $postfields['BillingCity'] = $params['clientdetails']['city'];
     $postfields['BillingState'] = $params['clientdetails']['state'];
     $postfields['BillingPostalCode'] = $params['clientdetails']['postcode'];
     $postfields['BillingCountryCode'] = $params['clientdetails']['country'];
     $postfields['BillingPhone'] = $params['clientdetails']['phonenumber'];
     $postfields['ShippingFirstName'] = $params['clientdetails']['firstname'];
     $postfields['ShippingLastName'] = $params['clientdetails']['lastname'];
     $postfields['ShippingAddress1'] = $params['clientdetails']['address1'];
     $postfields['ShippingAddress2'] = $params['clientdetails']['address2'];
     $postfields['ShippingCity'] = $params['clientdetails']['city'];
     $postfields['ShippingState'] = $params['clientdetails']['state'];
     $postfields['ShippingPostalCode'] = $params['clientdetails']['postcode'];
     $postfields['ShippingCountryCode'] = $params['clientdetails']['country'];
     $postfields['ShippingPhone'] = $params['clientdetails']['phonenumber'];
     $postfields['CardNumber'] = $params['cardnum'];
     $postfields['CardExpMonth'] = substr($params['cardexp'], 0, 2);
     $postfields['CardExpYear'] = "20" . substr($params['cardexp'], 2, 2);
     $queryString = "<CardinalMPI>\n";
     foreach ($postfields as $name => $value) {
         $queryString .= "<" . $name . ">" . $value . "</" . $name . ">\n";
     }
     $queryString .= "</CardinalMPI>";
     $data = "cmpi_msg=" . urlencode($queryString);
     $response = curlCall($mapurl, $data);
     $xmlarray = XMLtoArray($response);
     $xmlarray = $xmlarray['CARDINALMPI'];
     $errorno = $xmlarray['ERRORNO'];
     $enrolled = $xmlarray['ENROLLED'];
     $eciflag = $xmlarray['ECIFLAG'];
     $transid = $xmlarray['TRANSACTIONID'];
     $acsurl = $xmlarray['ACSURL'];
     $pareq = $xmlarray['PAYLOAD'];
     $orderid = $xmlarray['ORDERID'];
     $_SESSION['Centinel_OrderId'] = $orderid;
     $_SESSION['Centinel_TransactionId'] = $transid;
     if ($errorno == 0) {
         if ($enrolled == "Y") {
             logTransaction("PayPal Pro Reference", $xmlarray, "3D Auth");
             $_SESSION['Centinel_Details'] = array("cardtype" => $params['cardtype'], "cardnum" => $params['cardnum'], "cardexp" => $params['cardexp'], "cccvv" => $params['cccvv'], "cardstart" => $params['cardstart'], "cardissuenum" => $params['cardissuenum']);
             $code = "<form method=\"POST\" action=\"" . $acsurl . "\">\n                <input type=hidden name=\"PaReq\" value=\"" . $pareq . "\">\n                <input type=hidden name=\"TermUrl\" value=\"" . $params['systemurl'] . "/modules/gateways/callback/paypalpaymentsproref.php\">\n                <input type=hidden name=\"MD\" value=\"" . $params['invoiceid'] . "\">\n                <noscript>\n                <center>\n                    <font color=\"red\">\n                        <h2>Processing your Payer Authentication Transaction</h2>\n                        <h3>JavaScript is currently disabled or is not supported by your browser.<br></h3>\n                        <h4>Please click Submit to continue the processing of your transaction.</h4>\n                    </font>\n                <input type=\"submit\" value=\"Submit\">\n                </center>\n                </noscript>\n            </form>";
             return $code;
         }
         $result = paypalpaymentsproref_capture($params);
         if ($result['status'] == "success") {
             logTransaction("PayPal Pro References 3D Capture", $result['rawdata'], "Successful");
             addInvoicePayment($params['invoiceid'], $result['transid'], "", "", "paypalpaymentsproref", "on");
             sendMessage("Credit Card Payment Confirmation", $params['invoiceid']);
             redirSystemURL("id=" . $params['invoiceid'] . "&paymentsuccess=true", "viewinvoice.php");
         } else {
             logTransaction("PayPal Pro References 3D Capture", $result['rawdata'], "Failed");
         }
     } else {
         logTransaction("PayPal Pro References 3D Secure", $xmlarray, "No 3D Auth");
     }
     return "declined";
 }
Example #2
0
 *
 * @ 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");
Example #3
0
    $lastName = $results['LASTNAME'];
    $suffix = $results['SUFFIX'];
    $cntryCode = $results['COUNTRYCODE'];
    $business = $results['BUSINESS'];
    $shipToName = $results['PAYMENTREQUEST_0_SHIPTONAME'];
    $shipToStreet = $results['PAYMENTREQUEST_0_SHIPTOSTREET'];
    $shipToStreet2 = $results['PAYMENTREQUEST_0_SHIPTOSTREET2'];
    $shipToCity = $results['PAYMENTREQUEST_0_SHIPTOCITY'];
    $shipToState = $results['PAYMENTREQUEST_0_SHIPTOSTATE'];
    $shipToCntryCode = $results['PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE'];
    $shipToZip = $results['PAYMENTREQUEST_0_SHIPTOZIP'];
    $addressStatus = $results['ADDRESSSTATUS'];
    $invoiceNumber = $results['INVNUM'];
    $phonNumber = $results['PHONENUM'];
    $_SESSION['paypalexpress']['payerid'] = $payerId;
    if ($_SESSION['uid']) {
        redirSystemURL("a=checkout", "cart.php");
    }
    $is_registered = get_query_val("tblclients", "id", array("email" => $email));
    if ($is_registered) {
        $_SESSION['adminid'] = true;
        validateClientLogin($email, "");
        unset($_SESSION['adminid']);
        redirSystemURL("a=checkout", "cart.php");
    }
    $_SESSION['cart']['user'] = array("firstname" => $firstName, "lastname" => $lastName, "companyname" => $business, "email" => $email, "address1" => $shipToStreet, "address2" => $shipToStreet2, "city" => $shipToCity, "state" => $shipToState, "postcode" => $shipToZip, "country" => $shipToCntryCode, "phonenumber" => $phonNumber);
    redirSystemURL("a=checkout", "cart.php");
    return 1;
}
logTransaction("PayPal Express Callback", $results, "Error");
echo "An Error Occurred. Please contact support.";
Example #4
0
 * @ 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");
Example #5
0
<?php

require "../../../init.php";
$whmcs->load_function('gateway');
$whmcs->load_function('client');
$GATEWAY = getGatewayVariables("boleto");
if (!$GATEWAY["type"]) {
    die("Module Not Activated");
}
if (!isset($_SESSION["uid"]) && !isset($_SESSION['adminid'])) {
    redirSystemURL("", "clientarea.php");
}
$GATEWAY = array();
$gwresult = select_query("tblpaymentgateways", "", array("gateway" => "boleto"));
while ($data = mysql_fetch_array($gwresult)) {
    $gVgwsetting = $data["setting"];
    $gVgwvalue = $data["value"];
    $GATEWAY[$gVgwsetting] = $gVgwvalue;
}
if (!in_array($GATEWAY['banco'], array('banestes', 'bb', 'bradesco', 'cef', 'hsbc', 'itau', 'nossacaixa', 'real', 'unibanco'))) {
    exit;
}
$result = select_query("tblinvoices", "", array("id" => (int) $invoiceid));
$data = mysql_fetch_array($result);
$id = $data["id"];
$userid = $data["userid"];
$date = $data["date"];
$duedate = $data["duedate"];
$subtotal = $data["subtotal"];
$credit = $data["credit"];
$tax = $data["tax"];
Example #6
0
function imsp_3dsecure($params)
{
    global $remote_ip;
    $currency = "978";
    $amount = str_pad($params['amount'] * 100, 12, "0", STR_PAD_LEFT);
    $signature = $params['passcode'] . $params['merchantid'] . $params['terminalid'] . $params['invoiceid'] . $params['passcode'] . $amount;
    $signature = sha1($signature);
    $postfields = array();
    $postfields['merchantid'] = $params['merchantid'];
    $postfields['terminalid'] = $params['terminalid'];
    $postfields['trxntype'] = "Sale";
    $postfields['cardnumber'] = $params['cardnum'];
    $postfields['expirydate'] = $params['cardexp'];
    if ($params['cccvv']) {
        $postfields['cardvervalue'] = $params['cccvv'];
    }
    $postfields['amount'] = $amount;
    $postfields['currency'] = $currency;
    $postfields['batchnumber'] = $params['invoiceid'];
    $postfields['invoicenumber'] = $params['invoiceid'];
    $postfields['ipaddress'] = $remote_ip;
    $postfields['signature'] = $signature;
    $postfields['responseurl'] = $params['systemurl'] . "/modules/gateways/callback/imsp.php";
    $data = curlCall($url, $postfields);
    $resultstemp = explode(";", $data);
    $results = array();
    foreach ($resultstemp as $v) {
        $v = explode("|", $v);
        if ($v[0]) {
            $results[$v[0]] = $v[1];
            continue;
        }
    }
    print_r($results);
    $responsecode = $results['responsecode'];
    $responsereasoncode = $results['responsereasoncode'];
    $trxnid = $results['trxnid'];
    $url = "https://test.imsp.com/staging/Request3DS.aspx";
    $acsurl = "";
    $pareq = "";
    $termurl = "";
    $Md = "";
    if ($responsecode == "5" && $responsereasoncode == "18") {
        logTransaction("IMSP 3D Secure", $results, "3D Auth Forward");
        $code = "<form method=\"POST\" action=\"" . $acsurl . "\">\n                <input type=hidden name=\"PaReq\" value=\"" . $pareq . "\">\n                <input type=hidden name=\"TermUrl\" value=\"" . $termurl . "\">\n                <input type=hidden name=\"MD\" value=\"" . $Md . "\">\n                <noscript>\n                <center>\n                    <font color=\"red\">\n                        <h2>Processing your Payer Authentication Transaction</h2>\n                        <h3>JavaScript is currently disabled or is not supported by your browser.<br></h3>\n                        <h4>Please click Submit to continue the processing of your transaction.</h4>\n                    </font>\n                <input type=\"submit\" value=\"Continue\">\n                </center>\n                </noscript>\n            </form>";
        return $code;
    }
    if ($responsecode == "1") {
        logTransaction("IMSP 3D Secure", $results, "Successful");
        addInvoicePayment($params['invoiceid'], $trxnid, "", "", "imsp", "on");
        sendMessage("Credit Card Payment Confirmation", $params['invoiceid']);
        redirSystemURL("id=" . $params['invoiceid'] . "&paymentsuccess=true", "viewinvoice.php");
    } else {
        if ($responsecode == "2") {
            logTransaction("IMSP 3D Secure", $results, "Declined");
        } else {
            if ($responsecode == "3") {
                logTransaction("IMSP 3D Secure", $results, "Parse Error");
            } else {
                logTransaction("IMSP 3D Secure", $results, "System Error");
            }
        }
    }
    return "declined";
}
Example #7
0
function worldpayfuturepay_link($params)
{
    global $_LANG;
    $code = "";
    $futurepayid = get_query_val("tblclients", "gatewayid", array("id" => $params['clientdetails']['userid']));
    if (!$futurepayid) {
        $query2 = "SELECT * FROM tblcustomfieldsvalues WHERE fieldid=(SELECT id FROM tblcustomfields WHERE type='client' AND fieldname='FuturePay ID') AND relid=" . (int) $params['clientdetails']['userid'];
        $result2 = full_query($query2);
        $data2 = mysql_fetch_array($result2);
        $value = $data2['value'];
        if (trim($value)) {
            $futurepayid = $value;
        }
    }
    $testmode = $params['testmode'] ? "100" : "";
    if ($_GET['fpcharge'] && $futurepayid) {
        unset($_GET['fpcharge']);
        if ($params['testmode']) {
            $url = "https://secure-test.worldpay.com/wcc/iadmin";
        } else {
            $url = "https://secure.worldpay.com/wcc/iadmin";
        }
        $qrystring = "instId=" . $params['installationidcharges'];
        $qrystring .= "&authPW=" . $params['authpw'];
        $qrystring .= "&futurePayId=" . $futurepayid;
        $qrystring .= "&amount=" . $params['amount'];
        $qrystring .= "&op-paymentLFP=";
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_TIMEOUT, 30);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $qrystring);
        $gatewayresult = curl_exec($ch);
        curl_close($ch);
        if (substr($gatewayresult, 0, 1) == "Y") {
            $returndata = explode(",", $gatewayresult);
            addInvoicePayment($params['invoiceid'], $returndata[1], "", "", "worldpayfuturepay");
            logTransaction("WorldPay FuturePay", $gatewayresult, "Successful");
            redirSystemURL("id=" . $params['invoiceid'] . "&paymentsuccess=true", "viewinvoice.php");
        } else {
            logTransaction("WorldPay FuturePay", $gatewayresult, "Error");
            if ($_LANG['worldpayfuturepaycapturefailed']) {
                $code = $_LANG['worldpayfuturepaycapturefailed'] . "<br>";
            } else {
                $code = "Payment Attempt Failed. You can setup a new agreement using the button below.<br>";
            }
            $futurepayid = "";
        }
    }
    if ($futurepayid) {
        $code .= "We have your details on record and will charge your card on the invoice due date<br /><input type=\"button\" value=\"Click here to Pay Now\" onclick=\"window.location='" . $params['systemurl'] . "/viewinvoice.php?id=" . $params['invoiceid'] . "&fpcharge=true'\" />";
    } else {
        $code .= "\n<form action=\"https://secure.worldpay.com/wcc/purchase\" method=\"post\">\n<INPUT TYPE=\"hidden\" NAME=\"instId\" VALUE=\"" . $params['installationid'] . "\">\n<INPUT TYPE=\"hidden\" NAME=\"cartId\" VALUE=\"" . $params['invoiceid'] . "\">\n<INPUT TYPE=\"hidden\" NAME=\"desc\" VALUE=\"" . $params['description'] . "\">\n<INPUT TYPE=\"hidden\" NAME=\"currency\" VALUE=\"" . $params['currency'] . "\">\n<INPUT TYPE=\"hidden\" NAME=\"amount\" VALUE=\"" . $params['amount'] . "\">\n<INPUT TYPE=\"hidden\" NAME=\"TestMode\" VALUE=\"" . $testmode . "\">\n<INPUT TYPE=\"hidden\" NAME=\"futurePayType\" VALUE=\"limited\">\n<INPUT TYPE=\"hidden\" NAME=\"noOfPayments\" VALUE=\"0\">\n<INPUT TYPE=\"hidden\" NAME=\"amountLimit\" VALUE=\"0.00\">\n<INPUT TYPE=\"hidden\" NAME=\"option\" VALUE=\"0\">\n<input type=\"hidden\" name=\"name\" value=\"" . $params['clientdetails']['firstname'] . " " . $params['clientdetails']['lastname'] . "\">\n<input type=\"hidden\" name=\"email\" value=\"" . $params['clientdetails']['email'] . "\">\n<input type=\"hidden\" name=\"address\" value=\"" . $params['clientdetails']['address1'] . "\r\n" . $params['clientdetails']['city'] . "\r\n" . $params['clientdetails']['state'] . "\">\n<input type=\"hidden\" name=\"postcode\" value=\"" . $params['clientdetails']['postcode'] . "\">\n<input type=\"hidden\" name=\"country\" value=\"" . $params['clientdetails']['country'] . "\">\n<input type=\"hidden\" name=\"tel\" value=\"" . $params['clientdetails']['phonenumber'] . "\">\n<input type=\"hidden\" name=\"hideCurrency\" value=\"true\">\n<INPUT TYPE=\"hidden\" NAME=\"MC_callback\" VALUE=\"" . $params['systemurl'] . "/modules/gateways/callback/worldpayfuturepay.php\">\n<INPUT TYPE=\"hidden\" NAME=\"successURL\" VALUE=\"" . $params['systemurl'] . "/viewinvoice.php?id=" . $params['invoiceid'] . "&paymentsuccess=true\">\n<INPUT TYPE=\"hidden\" NAME=\"failureURL\" VALUE=\"" . $params['systemurl'] . "/viewinvoice.php?id=" . $params['invoiceid'] . "&paymentfailed=true\">";
        if ($params['authmode'] == "on") {
            $code .= "\n<input type=\"hidden\" name=\"authMode\" value=\"A\">";
        }
        $code .= "\n<input type=\"submit\" value=\"" . $params['langpaynow'] . "\">\n</FORM>\n\t\t";
    }
    return $code;
}