コード例 #1
0
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_USERPWD, $merchantCode . ":" . $password);
curl_setopt($ch, CURLOPT_COOKIEFILE, "" . $cookiestore . $invoiceID . ".cookie");
curl_setopt($ch, CURLOPT_TIMEOUT, 240);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result_tmp = curl_exec($ch);
$xml .= "<echoData>" . $echoData . "</echoData>";
curl_close($ch);
$result_arr = XMLtoArray($result_tmp);
$lastevent = $result_arr['PAYMENTSERVICE']['REPLY']['ORDERSTATUS']['PAYMENT']['LASTEVENT'];
$callbacksuccess = false;
if ($lastevent == "AUTHORISED") {
    addInvoicePayment($invoiceID, $orderCode, $raworderAmount, "", "worldpayinvisiblexml", "on");
    logTransaction("WorldPay Invisible XML Callback", $result_tmp, "Successful");
    sendMessage("Credit Card Payment Confirmation", $invoiceid);
    $callbacksuccess = true;
} else {
    logTransaction("WorldPay Invisible XML Callback", $result_tmp, "Declined");
    sendMessage("Credit Card Payment Failed", $invoiceid);
}
unlink("" . $cookiestore . $invoiceID . ".cookie");
callback3DSecureRedirect($invoiceid, $callbacksuccess);
コード例 #2
0
 * @param string|array $debugData    Data to log
 * @param string $transactionStatus  Status
 */
logTransaction($gatewayParams['name'], $_POST, $transactionStatus);
$paymentSuccess = false;
if ($success) {
    /**
     * Add Invoice Payment.
     *
     * Applies a payment transaction entry to the given invoice ID.
     *
     * @param int $invoiceId         Invoice ID
     * @param string $transactionId  Transaction ID
     * @param float $paymentAmount   Amount paid (defaults to full balance)
     * @param float $paymentFee      Payment fee (optional)
     * @param string $gatewayModule  Gateway module name
     */
    addInvoicePayment($invoiceId, $transactionId, $paymentAmount, $paymentFee, $gatewayModuleName);
    $paymentSuccess = true;
}
/**
 * Redirect to invoice.
 *
 * Performs redirect back to the invoice upon completion of the 3D Secure
 * process displaying the transaction result along with the invoice.
 *
 * @param int $invoiceId        Invoice ID
 * @param bool $paymentSuccess  Payment status
 */
callback3DSecureRedirect($invoiceId, $paymentSuccess);
コード例 #3
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);
    }
}
コード例 #4
0
ファイル: quantumvault.php プロジェクト: billyprice1/whmcs
$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);
    $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") {
    update_query("tblclients", array("gatewayid" => $vaultid), array("id" => $vaultid));
    addInvoicePayment($invoiceid, $transid, $amount, "", "quantumvault", "on");
    logTransaction("Quantum Vault", $_REQUEST, "Approved");
    sendMessage("Credit Card Payment Confirmation", $invoiceid);
    callback3DSecureRedirect($invoiceid, true);
}
logTransaction("Quantum Vault", $_REQUEST, "Declined");
sendMessage("Credit Card Payment Failed", $invoiceid);
callback3DSecureRedirect($invoiceid, false);