本文整理汇总了PHP中addInvoicePayment函数的典型用法代码示例。如果您正苦于以下问题:PHP addInvoicePayment函数的具体用法?PHP addInvoicePayment怎么用?PHP addInvoicePayment使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了addInvoicePayment函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: optimalpayments_3dsecure
function optimalpayments_3dsecure($params)
{
$cardtype = optimalpayments_cardtype($params['cardtype']);
$xml = "<ccEnrollmentLookupRequestV1\nxmlns=\"http://www.optimalpayments.com/creditcard/xmlschema/v1\"\nxmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\nxsi:schemaLocation=\"http://www.optimalpayments.com/creditcard/xmlschema/v1\">\n<merchantAccount>\n<accountNum>" . $params['accountnumber'] . "</accountNum>\n<storeID>" . $params['merchantid'] . "</storeID>\n<storePwd>" . $params['merchantpw'] . "</storePwd>\n</merchantAccount>\n<merchantRefNum>" . $params['invoiceid'] . "</merchantRefNum>\n<amount>" . $params['amount'] . "</amount>\n<card>\n<cardNum>" . $params['cardnum'] . "</cardNum>\n<cardExpiry>\n<month>" . substr($params['cardexp'], 0, 2) . "</month>\n<year>20" . substr($params['cardexp'], 2, 2) . "</year>\n</cardExpiry>\n<cardType>" . $cardtype . "</cardType>\n</card>\n</ccEnrollmentLookupRequestV1>";
$url = "https://webservices.optimalpayments.com/creditcardWS/CreditCardServlet/v1";
if ($params['testmode']) {
$url = "https://webservices.test.optimalpayments.com/creditcardWS/CreditCardServlet/v1";
}
$query_str = "txnMode=ccTDSLookup&txnRequest=" . urlencode($xml);
$data = curlCall($url, $query_str);
$xmldata = XMLtoArray($data);
$xmldata = $xmldata['CCTXNRESPONSEV1'];
if ($xmldata['CODE'] == "0") {
logTransaction("Optimal Payments 3D Auth", $data, "Lookup Successful");
$_SESSION['optimalpaymentsconfirmationnumber'] = $xmldata['CONFIRMATIONNUMBER'];
if ($xmldata['TDSRESPONSE']['ENROLLMENTSTATUS'] == "Y") {
$code = "<form method=\"post\" action=\"" . $xmldata['TDSRESPONSE']['ACSURL'] . "\">\n<input type=hidden name=\"PaReq\" value=\"" . $xmldata['TDSRESPONSE']['PAYMENTREQUEST'] . "\">\n<input type=hidden name=\"TermUrl\" value=\"" . $params['systemurl'] . "/modules/gateways/callback/optimalpayments.php\">\n<input type=hidden name=\"MD\" value=\"" . $params['invoiceid'] . "\">\n<noscript>\n<div class=\"errorbox\"><b>JavaScript is currently disabled or is not supported by your browser.</b><br />Please click the continue button to proceed with the processing of your transaction.</div>\n<p align=\"center\"><input type=\"submit\" value=\"Continue >>\" /></p>\n</noscript>\n</form>";
return $code;
}
$captureresult = optimalpayments_capture($params);
if ($captureresult['status'] == "success") {
addInvoicePayment($params['invoiceid'], $captureresult['transid'], "", "", "optimalpayments", "on");
sendMessage("Credit Card Payment Confirmation", $invoiceid);
}
logTransaction("Optimal Payments Non 3d Processed", $captureresult['rawdata'], ucfirst($captureresult['status']));
return $captureresult['status'];
}
logTransaction("Optimal Payments 3D Auth", $data, "Failed");
}
示例2: processDeliverable
/**
* @param $invoiceid
* @param $pingback
* @param $gateway
* @param $userData
* @param $orderData
*/
function processDeliverable($invoiceid, $pingback, $gateway, $userData, $orderData)
{
addInvoicePayment($invoiceid, $pingback->getReferenceId(), null, null, 'paymentwall');
$invoiceItems = select_query('tblinvoiceitems', '*', array("invoiceid" => $invoiceid));
$hosting = false;
if ($hostId = getHostId($invoiceItems)) {
$hosting = mysql_fetch_assoc(select_query('tblhosting', 'tblhosting.id,tblhosting.username,tblproducts.autosetup,tblhosting.packageid', array("tblhosting.id" => $hostId), false, false, 1, "tblproducts ON tblhosting.packageid=tblproducts.id"));
}
// Update subscription id
if ($hosting) {
updateSubscriptionId($pingback->getReferenceId(), array('id' => $hosting['id']));
}
// Check enable delivery request
if (isset($gateway['enableDeliveryApi']) && $gateway['enableDeliveryApi'] && $hosting) {
sendDeliveryApiRequest($invoiceid, $hosting, $userData, $orderData, $pingback);
}
logTransaction($gateway['name'], $_GET, "Successful");
}
示例3: 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;
}
示例4: gocardless_capture
/**
** WHMCS method to capture payments
** This method is triggered by WHMCS in an attempt to capture a PreAuth payment
**
** @param array $params Array of paramaters parsed by WHMCS
**/
function gocardless_capture($params)
{
# create GoCardless DB if it hasn't already been created
gocardless_createdb();
# grab the gateway information from WHMCS
$gateway = getGatewayVariables('gocardless');
# Send the relevant API information to the GoCardless class for future processing
gocardless_set_account_details($params);
# check against the database if the bill relevant to this invoice has already been created
$existing_payment_query = select_query('mod_gocardless', 'resource_id', array('invoiceid' => $params['invoiceid']));
$existing_payment = mysql_fetch_assoc($existing_payment_query);
# check if any rows have been returned or if the returned result is empty.
# If no rows were returned, the bill has not already been made for this invoice
# If a row was returned but the resource ID is empty, the bill has not been completed
# we have already raised a bill with GoCardless (in theory)
if (!mysql_num_rows($existing_payment_query) || empty($existing_payment['resource_id'])) {
#MOD-START
#Use PreAuth table
$userid_query = select_query('tblinvoices', 'userid', array('id' => $params['invoiceid']));
$userid_result = mysql_fetch_array($userid_query);
if (!empty($userid_result['userid'])) {
$userid = $userid_result['userid'];
$preauth_query = select_query('mod_gocardless_preauth', 'subscriptionid', array('userid' => $userid));
$preauth_result = mysql_fetch_array($preauth_query);
if (!empty($preauth_result['subscriptionid'])) {
$preauthid = $preauth_result['subscriptionid'];
}
}
#MOD-END
# now we are out of the loop, check if we have been able to get the PreAuth ID
if (isset($preauthid)) {
# we have found the PreAuth ID, so get it from GoCardless and process a new bill
$pre_auth = GoCardless_PreAuthorization::find($preauthid);
# check the preauth returned something
if ($pre_auth) {
# Create a bill with the $pre_auth object
try {
$bill = $pre_auth->create_bill(array('amount' => $params['amount'], 'name' => "Invoice #" . $params['invoiceid']));
} catch (Exception $e) {
# we failed to create a new bill, lets update mod_gocardless to alert the admin why payment hasnt been received,
# log this in the transaction log and exit out
update_query('mod_gocardless', array('payment_failed' => 1), array('invoiceid' => $params['invoiceid']));
logTransaction($params['paymentmethod'], "Failed to create GoCardless bill against pre-authorization " . $preauthid . " for invoice " . $params['invoiceid'] . ": " . print_r($e, true) . print_r($bill, true), 'Failed');
return array('status' => 'error', 'rawdata' => $e);
}
# check that the bill has been created
if ($bill->id) {
# check if the bill already exists in the database, if it does we will just update the record
# if not, we will create a new record and record the transaction
if (!mysql_num_rows($existing_payment_query)) {
# Add the bill ID to the table and mark the transaction as pending
insert_query('mod_gocardless', array('invoiceid' => $params['invoiceid'], 'billcreated' => 1, 'resource_id' => $bill->id, 'preauth_id' => $pre_auth->id));
if ($gateway['instantpaid'] == on) {
# The Instant Activation option is on, so add to the Gateway Log and log a transaction on the invoice
addInvoicePayment($params['invoiceid'], $bill->id, $bill->amount, $bill->gocardless_fees, $gateway['paymentmethod']);
logTransaction($gateway['paymentmethod'], 'Bill of ' . $bill->amount . ' raised and logged for invoice ' . $params['invoiceid'] . ' with GoCardless ID ' . $bill->id, 'Successful');
return array('status' => 'success', 'rawdata' => print_r($bill, true));
} else {
# Instant Activation is off, so just add to the gateway log and wait before marking as paid until web hook arrives
logTransaction($gateway['paymentmethod'], 'Bill of ' . $bill->amount . ' raised for invoice ' . $params['invoiceid'] . ' with GoCardless ID ' . $bill->id, 'Successful');
return array('status' => 'pending', 'rawdata' => print_r($bill, true));
}
} else {
# update the table with the bill ID
update_query('mod_gocardless', array('billcreated' => 1, 'resource_id' => $bill->id), array('invoiceid' => $params['invoiceid']));
}
}
} else {
# PreAuth could not be verified
logTransaction($gateway['paymentmethod'], 'The pre-authorization specified for invoice ' . $params['invoiceid'] . ' (' . $preauthid . ') does not seem to exist - something has gone wrong, or the customer needs to set up their Direct Debit again.', 'Incomplete');
return array('status' => 'error', 'rawdata' => array('message' => 'The pre-authorization ID was found for invoice ' . $params['invoiceid'] . ' but it could not be fetched.'));
}
} else {
# we couldn't find the PreAuthID meaning at this point all we can do is give up!
# the client will have to setup a new preauth to begin recurring payments again
# or pay using an alternative method
logTransaction($gateway['paymentmethod'], 'No pre-authorization found when trying to raise payment for invoice ' . $params['invoiceid'] . ' - something has gone wrong, or the customer needs to set up their Direct Debit again.', 'Incomplete');
return array('status' => 'error', 'rawdata' => array('message' => 'No pre-authorisation ID found in WHMCS for invoice ' . $params['invoiceid']));
}
} else {
# WHMCS is trying to collect the bill but one has already been created - this happens because the bill is not mark as 'paid'
# until a web hook is received by default, so WHMCS thinks it still needs to collect.
# logTransaction('GoCardless', 'Bill already created - awaiting update via web hook...' . "\nBill ID: " . $existing_payment['resource_id'], 'Pending');
# return array('status' => 'Bill already created - awaiting update via web hook...', 'rawdata' =>
# array('message' => 'Bill already created - awaiting update via web hook...'));
return array('status' => 'pending', 'rawdata' => array('message' => 'The bill has already been created for invoice ' . $params['invoiceid']));
}
}
示例5: str_replace
$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");
# Save to Gateway Log: name, data array, status
echo "1|OK";
} else {
echo "0|ErrorMessage";
}
} else {
# Unsuccessful
logTransaction($GATEWAY["name"], $_POST, "Unsuccessful");
# Save to Gateway Log: name, data array, status
echo "0|ErrorMessage";
}
}
示例6: curl_init
$url = "https://secure.worldpay.com/jsp/merchant/xml/paymentService.jsp";
}
$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);
示例7: explode
}
$amount = $_REQUEST['amt'];
$callbackvars2 = explode("&", $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");
}
示例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: getGatewayVariables
<?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");
示例10: switch
if (!preg_match('/(^|,)(' . $arrIP[0] . '|\\*{1})(\\.)' . '(' . $arrIP[1] . '|\\*{1})(\\.)' . '(' . $arrIP[2] . '|\\*{1})(\\.)' . '(' . $arrIP[3] . '|\\*{1})($|,)/', $sIP)) {
$valid_ip = false;
}
}
if (!$valid_ip) {
$message .= " - IP-адрес сервера не является доверенным\n" . " доверенные IP: " . $sIP . "\n" . " IP текущего сервера: " . $_SERVER['REMOTE_ADDR'] . "\n";
$err = true;
}
if ($_POST["m_sign"] != $sign_hash) {
$message .= " - не совпадают цифровые подписи\n";
$err = true;
}
if (!$err) {
switch ($_POST['m_status']) {
case 'success':
addInvoicePayment($_POST['m_orderid'], $_POST["m_operation_id"], $payed, '', $gatewaymodule);
logTransaction($GATEWAY['name'], $_POST, 'Successful');
break;
default:
$message .= " - статус платежа не является success\n";
logTransaction($GATEWAY["name"], $event, "Unsuccessful");
$err = true;
break;
}
}
if ($err) {
$to = $GATEWAY['payeer_email_error'];
if (!empty($to)) {
$message = "Не удалось провести платёж через систему Payeer по следующим причинам:\n\n" . $message . "\n" . $log_text;
$headers = "From: no-reply@" . $_SERVER['HTTP_HOST'] . "\r\n" . "Content-type: text/plain; charset=utf-8 \r\n";
mail($to, 'Ошибка оплаты', $message, $headers);
示例11: WHMCS_Admin
$aInt = new WHMCS_Admin($reqperm);
$aInt->inClientsProfile = true;
$aInt->requiredFiles(array("gatewayfunctions", "invoicefunctions"));
$aInt->valUserID($userid);
if ($sub == "add") {
check_token("WHMCS.admin.default");
if ($invoiceid) {
$transuserid = get_query_val("tblinvoices", "userid", array("id" => $invoiceid));
if (!$transuserid) {
redir("error=invalidinvid");
} else {
if ($transuserid != $userid) {
redir("error=wronguser");
}
}
addInvoicePayment($invoiceid, $transid, $amountin, $fees, $paymentmethod, "", $date);
} else {
addTransaction($userid, 0, $description, $amountin, $fees, $amountout, $paymentmethod, $transid, $invoiceid, $date);
}
if ($addcredit) {
if ($transid) {
$description .= " (Trans ID: " . $transid . ")";
}
insert_query("tblcredit", array("clientid" => $userid, "date" => toMySQLDate($date), "description" => $description, "amount" => $amountin));
update_query("tblclients", array("credit" => "+=" . $amountin), array("id" => (int) $userid));
}
redir("userid=" . $userid);
exit;
}
if ($sub == "save") {
check_token("WHMCS.admin.default");
示例12: checkCbTransID
$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);
$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);
示例13: logTransaction
$invoiceid = $data['id'];
$userid = $data['userid'];
if ($invoiceid) {
logTransaction("PayPal", $orgipn, "Successful");
$currency = getCurrency($userid);
if ($paypalcurrencyid != $currency['id']) {
$mc_gross = convertCurrency($mc_gross, $paypalcurrencyid, $currency['id']);
$mc_fee = convertCurrency($mc_fee, $paypalcurrencyid, $currency['id']);
$result = select_query("tblinvoices", "total", array("id" => $invoiceid));
$data = mysql_fetch_array($result);
$total = $data['total'];
if ($total < $mc_gross + 1 && $mc_gross - 1 < $total) {
$mc_gross = $total;
}
}
addInvoicePayment($invoiceid, $txn_id, $mc_gross, $mc_fee, "paypal");
$result = select_query("tblinvoiceitems", "", array("invoiceid" => $invoiceid, "type" => "Hosting"));
$data = mysql_fetch_array($result);
$relid = $data['relid'];
update_query("tblhosting", array("subscriptionid" => $subscr_id), array("id" => $relid));
exit;
}
if ($txn_type == "subscr_payment") {
$result = select_query("tblhosting", "userid", array("subscriptionid" => $subscr_id));
$data = mysql_fetch_array($result);
$userid = $data['userid'];
if ($userid) {
$orgipn .= "User ID Found from Subscription ID Match: User ID => " . $userid . "\r\n";
insert_query("tblaccounts", array("userid" => $userid, "currency" => $paypalcurrencyid, "gateway" => "paypal", "date" => "now()", "description" => "PayPal Subscription Payment", "amountin" => $mc_gross, "fees" => $mc_fee, "rate" => $currencyconvrate, "transid" => $txn_id));
insert_query("tblcredit", array("clientid" => $userid, "date" => "now()", "description" => "PayPal Subscription Transaction ID " . $txn_id, "amount" => $mc_gross));
update_query("tblclients", array("credit" => "+=" . $mc_gross), array("id" => (int) $userid));
示例14: checkCbInvoiceID
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");
logTransaction("Payza", $response, "Successful");
exit;
return 1;
}
logTransaction("Payza", $response, "Unsuccessful");
exit;
return 1;
}
logTransaction("Payza", $response, "No response received from Payza");
exit;
示例15: checkPermission
$aInt->requiredFiles(array("gatewayfunctions", "invoicefunctions", "processinvoices"));
$aInt->inClientsProfile = true;
if ($delete || $massdelete) {
checkPermission("Delete Invoice");
}
if ($markpaid || $markunpaid || $markcancelled) {
checkPermission("Manage Invoice");
}
$aInt->valUserID($userid);
if ($markpaid) {
check_token("WHMCS.admin.default");
foreach ($selectedinvoices as $invid) {
$result2 = select_query("tblinvoices", "paymentmethod", array("id" => $invid));
$data = mysql_fetch_array($result2);
$paymentmethod = $data['paymentmethod'];
addInvoicePayment($invid, "", "", "", $paymentmethod);
run_hook("InvoicePaid", array("invoiceid" => $invoiceid));
}
if ($page) {
$userid .= "&page=" . $page;
}
redir("userid=" . $userid . "&filter=1");
}
if ($markunpaid) {
check_token("WHMCS.admin.default");
foreach ($selectedinvoices as $invid) {
update_query("tblinvoices", array("status" => "Unpaid", "datepaid" => "0000-00-00 00:00:00"), array("id" => $invid));
logActivity("Reactivated Invoice - Invoice ID: " . $invid, $userid);
run_hook("InvoiceUnpaid", array("invoiceid" => $invid));
}
if ($page) {