本文整理汇总了PHP中checkCbTransID函数的典型用法代码示例。如果您正苦于以下问题:PHP checkCbTransID函数的具体用法?PHP checkCbTransID怎么用?PHP checkCbTransID使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了checkCbTransID函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: completeOrderUser
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: db_escape_string
}
if (!$invoiceid) {
$query = "SELECT tblinvoices.id,tblinvoices.userid FROM tblinvoiceitems INNER JOIN tblinvoices ON tblinvoices.id=tblinvoiceitems.invoiceid INNER JOIN tblhosting ON tblhosting.id=tblinvoiceitems.relid WHERE tblhosting.subscriptionid='" . db_escape_string($transid) . "' 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];
$userid = $data[1];
}
if (!$invoiceid) {
$query = "SELECT tblinvoices.id,tblinvoices.userid FROM tblinvoiceitems INNER JOIN tblinvoices ON tblinvoices.id=tblinvoiceitems.invoiceid INNER JOIN tblhosting ON tblhosting.id=tblinvoiceitems.relid WHERE tblhosting.subscriptionid='" . db_escape_string($transid) . "' AND tblinvoiceitems.type='Hosting' AND tblinvoices.status='Paid' ORDER BY tblinvoices.id DESC";
$result = full_query($query);
$data = mysql_fetch_array($result);
$invoiceid = $data[0];
$userid = $data[1];
}
checkCbTransID($recurringtransid);
if (!$invoiceid && !$serviceid) {
logTransaction($GATEWAY['name'], array_merge(array("InvoiceLookup" => "No Service ID Found in Callback"), $_POST), "Recurring Error");
}
if (!$invoiceid) {
logTransaction($GATEWAY['name'], array_merge(array("InvoiceLookup" => "No invoice match found for Service ID " . $serviceid . " or Subscription ID"), $_POST), "Recurring Error");
}
logTransaction($GATEWAY['name'], $_POST, "Recurring Success");
$amount = tcoconvertcurrency($amount, $currency, $invoiceid);
addInvoicePayment($invoiceid, $recurringtransid, $amount, $fee, $gatewaymodule);
if ($serviceid && $transid) {
update_query("tblhosting", array("subscriptionid" => $transid), array("id" => $serviceid));
return 1;
}
} else {
if ($message_type == "RECURRING_INSTALLMENT_FAILED") {
示例3: getGatewayVariables
$GATEWAY = getGatewayVariables("moneybookers");
if (!$GATEWAY['type']) {
exit("Module Not Activated");
}
header("HTTP/1.1 200 OK");
$_POST['transaction_id'];
$transid = $_POST['mb_transaction_id'];
$merchant_id = $_POST['merchant_id'];
$mb_amount = $_POST['mb_amount'];
$amount = $_POST['amount'];
$mb_currency = $_POST['mb_currency'];
$currency = $_POST['currency'];
$invoiceid = $_POST['md5sig'];
$md5sig = header("Status: 200 OK");
$status = $_POST['status'];
checkCbTransID($_POST['mb_transaction_id']);
if ($GATEWAY['secretword']) {
if (strtoupper(md5($merchant_id . $invoiceid . strtoupper(md5($GATEWAY['secretword'])) . $mb_amount . $mb_currency . $status)) != $md5sig) {
logTransaction("Moneybookers", $_REQUEST, "MD5 Signature Failure");
exit;
}
}
$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));
示例4: explode
$mc_gross = $_POST['mc_gross'];
$mc_fee = $_POST['mc_fee'];
$idnumber = $_POST['custom'];
$paypalcurrency = $_REQUEST['mc_currency'];
$paypalemails = explode(",", strtolower($GATEWAY['email']));
array_walk($paypalemails, "paypal_email_trim");
if (!in_array(strtolower($paypalemail), $paypalemails)) {
logTransaction("PayPal", $orgipn, "Invalid Receiver Email");
exit;
}
if ($payment_status == "Pending") {
logTransaction("PayPal", $orgipn, "Pending");
exit;
}
if ($txn_id) {
checkCbTransID($txn_id);
}
if (!is_numeric($idnumber)) {
$idnumber = "";
}
if ($txn_type == "web_accept" && $_POST['invoice'] && $payment_status == "Completed") {
update_query("tblaccounts", array("fees" => $mc_fee), array("transid" => $txn_id));
}
$result = select_query("tblcurrencies", "", array("code" => $paypalcurrency));
$data = mysql_fetch_array($result);
$paypalcurrencyid = $data['id'];
$currencyconvrate = $data['rate'];
if (!$paypalcurrencyid) {
logTransaction("PayPal", $orgipn, "Unrecognised Currency");
exit;
}
示例5: explode
$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;
}
}
addInvoicePayment($info['apc_1'], $info['ap_referencenumber'], $amount, $fees, "Payza");
示例6: getGatewayVariables
$gatewayParams = getGatewayVariables("paymentwallbrick");
// Die if module is not active.
if (!$gatewayParams['type']) {
die("Module Not Activated");
}
if (!class_exists("Paymentwall_Config")) {
require_once dirname(__FILE__) . "/lib/paymentwall.php";
}
if ($gatewayParams["test_mode"] == "on") {
Paymentwall_Config::getInstance()->set(array('api_type' => Paymentwall_Config::API_GOODS, 'public_key' => $gatewayParams['test_public_key'], 'private_key' => $gatewayParams['test_private_key']));
} else {
Paymentwall_Config::getInstance()->set(array('api_type' => Paymentwall_Config::API_GOODS, 'public_key' => $gatewayParams['public_key'], 'private_key' => $gatewayParams['private_key']));
}
$charge_id = $_GET["ref"];
$invoice_id = $_GET["goodsid"];
$status = $_GET['type'];
$charge = new Paymentwall_Charge($_GET["ref"]);
logTransaction($gatewayParams["name"], $_GET, "PingBack");
$charge->get();
if ($status == 201 && $charge->isCaptured()) {
$invoiceId = checkCbInvoiceID($invoice_id, $gatewayParams['name']);
checkCbTransID($charge_id);
logTransaction($gatewayParams["name"], var_export($charge, true), "Charge Approved via PingBack");
addInvoicePayment($invoiceId, $charge_id, null, null, "paymentwallbrick");
} elseif ($status == 202) {
$invoiceId = checkCbInvoiceID($invoice_id, $gatewayParams['name']);
checkCbTransID($charge_id);
logTransaction($gatewayParams["name"], var_export($charge, true), "Charge Declined via PingBack");
sendMessage("Credit Card Payment Failed", $invoiceId);
}
echo "OK";
示例7: number_format
$order = $json->order;
$id = $order->id;
$completed_at = $order->completed_at;
$status = $order->status;
$total_btc_cents = $order->total_btc->cents;
$total_btc_currency = $order->total_btc->currency_iso;
$total_native_cents = $order->total_native->cents;
$total_native_currency = $order->total_native->currency_iso;
$invoice_id = $order->custom;
$trans_id = $order->transaction->hash;
$confirmation = $order->transaction->confirmation;
$fee = '0.00';
$amount = number_format($total_native_cents / 100, 2, '.', '');
$invoice_id = checkCbInvoiceID($invoice_id, $GATEWAY["name"]);
# Checks invoice ID is a valid invoice number or ends processing
checkCbTransID($trans_id);
# Checks transaction number isn't already in the database and ends processing if it does
if ($status == "completed") {
# Successful
# http://docs.whmcs.com/API:Update_Invoice - add BTC currency conversion in invoice notes
$command = "updateinvoice";
$values["invoiceid"] = $invoice_id;
#changeme
$values["notes"] = "BTC:{$total_btc_cents};USD:{$total_native_cents};";
#changeme
$results = localAPI($command, $values, $adminuser);
//addInvoicePayment($invoice_id,$trans_id,$amount,$fee,$gatewaymodule); # Apply Payment to Invoice: invoiceid, transactionid, amount paid, fees, modulename
$command = "addinvoicepayment";
$values["invoiceid"] = $invoice_id;
$values["transid"] = $trans_id;
$values["amount"] = $amount;
示例8: simplexml_load_string
$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');
}
}
示例9: getCurrency
// 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)');
header('HTTP/1.1 500 Payment not open or paid');
示例10: dirname
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']);
}
$protocol = 'http://';
$host = '';
if (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == '1')) {
$protocol = 'https://';
}
示例11: getGatewayVariables
*
**/
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>";
示例12: empty
$transactionMessage = !empty($chargeId) && empty($redirectUrl) ? ", transaction id - {$chargeId}" : '';
logTransaction($GATEWAY["name"], "Your payment was not completed. Response is invalid for trackId - {$invoiceId}{$transactionMessage}. Action - authorize. Try again or contact customer support.", "Unsuccessful");
$_SESSION['checkout_error'] = true;
$_SESSION['checkout_error_message'] = 'Please check you card details and try again. Thank you';
header("Location:" . $returnUrl);
exit;
}
if ($redirectUrl) {
$_SESSION['checkout_payment_token']['invoice_id'] = $invoiceId;
$_SESSION['checkout_payment_token']['token'] = $respondCharge->getId();
header("Location:" . $redirectUrl);
exit;
}
$cardId = $respondCharge->getCard()->getId();
$amount = $Api->decimalToValue($respondCharge->getValue(), $currency);
$invoiceId = checkCbInvoiceID($invoiceId, $GATEWAY["name"]);
# Checks invoice ID is a valid invoice number or ends processing
checkCbTransID($chargeId);
# Checks transaction number isn't already in the database and ends processing if it does
addInvoicePayment($invoiceId, $chargeId, $amount, '', $gatewaymodule);
$sql = "update `tblclients` set `gatewayid` ='" . $cardId . "' where `id`=" . $ClientID;
if ($ClientID != '' && $cardId != '') {
mysql_query($sql);
}
$message = 'Your payment was completed. ChargeId: ' . $chargeId . ' Invoice Id : ' . $invoiceId;
if ($respondCharge->getResponseCode() == 10000) {
logTransaction($GATEWAY["name"], $message, "Successful");
} elseif ($respondCharge->getResponseCode() == 10100) {
logTransaction($GATEWAY["name"], $message, "Flagged");
}
header("Location:" . $returnUrl);
示例13: sagepaytokens_call
$url = "https://test.sagepay.com/gateway/service/direct3dcallback.vsp";
} else {
$url = "https://live.sagepay.com/gateway/service/direct3dcallback.vsp";
}
}
$response = sagepaytokens_call($url, $_POST);
$baseStatus = $response['Status'];
$invoiceid = $_REQUEST['invoiceid'];
if (!$invoiceid && isset($_SESSION['sagepaytokensinvoiceid'])) {
$invoiceid = $_SESSION['sagepaytokensinvoiceid'];
}
$invoiceid = checkCbInvoiceID($invoiceid, "SagePay Tokens 3DAuth");
$callbacksuccess = false;
switch ($response['Status']) {
case "OK":
checkCbTransID($response['VPSTxId']);
addInvoicePayment($invoiceid, $response['VPSTxId'], "", "", "sagepaytokens", "on");
logTransaction("SagePay Tokens 3DAuth", $response, "Successful");
sendMessage("Credit Card Payment Confirmation", $invoiceid);
$callbacksuccess = true;
break;
case "NOTAUTHED":
logTransaction("SagePay Tokens 3DAuth", $response, "Not Authed");
sendMessage("Credit Card Payment Failed", $invoiceid);
update_query("tblclients", array("cardtype" => "", "cardlastfour" => "", "cardnum" => "", "expdate" => "", "issuenumber" => ""), array("id" => $userid));
break;
case "REJECTED":
logTransaction("SagePay Tokens 3DAuth", $response, "Rejected");
sendMessage("Credit Card Payment Failed", $invoiceid);
update_query("tblclients", array("cardtype" => "", "cardlastfour" => "", "cardnum" => "", "expdate" => "", "issuenumber" => ""), array("id" => $userid));
break;
示例14: checkCbInvoiceID
}
/**
* 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($responseData['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($responseData['ep_id']);
/**
* Start the payment response logic process
*
* in two cases, payment may be approved directly,
* but in one case, paymeny may be manually verified (yet not rejected)
*
*/
if ($HashIsOK) {
// if hash verification confirms data integrity
if (0 == intval($responseData['action'])) {
// if action is "0", meaning bank approved transaction
switch ($responseData['sec_status']) {
case "1":
$message = "Valid transaction, pending state";
break;
示例15: getGatewayVariables
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
$converted_amount = 100 * $converted_amount;
$success = true;