本文整理汇总了PHP中getGatewayVariables函数的典型用法代码示例。如果您正苦于以下问题:PHP getGatewayVariables函数的具体用法?PHP getGatewayVariables怎么用?PHP getGatewayVariables使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getGatewayVariables函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: paypalexpress_link
function paypalexpress_link($params)
{
$paypalvars = getGatewayVariables("paypal");
$params = array_merge($params, $paypalvars);
$params['returnurl'] = $params['systemurl'] . "/viewinvoice.php?id=" . $params['invoiceid'];
return paypal_link($params);
}
示例2: get_invoice_status
/**
*
* @ WHMCS FULL DECODED & NULLED
*
* @ Version : 5.2.15
* @ Author : MTIMER
* @ Release on : 2013-12-24
* @ Website : http://www.mtimer.cn
*
**/
function get_invoice_status($pars)
{
$GATEWAY = getGatewayVariables("inpay");
$calc_md5 = calc_inpay_invoice_status_md5key(array("invoice_ref" => $pars['invoice_reference'], "merchant_id" => $GATEWAY['username'], "secret_key" => $GATEWAY['secretkey']));
$q = http_build_query(array("merchant_id" => $GATEWAY['username'], "invoice_ref" => $pars['invoice_reference'], "checksum" => $calc_md5), "", "&");
$fsocket = false;
$curl = false;
$result = false;
$fp = false;
$server = "secure.inpay.com";
if ($GATEWAY['testmode'] == "on") {
$server = "test-secure.inpay.com";
}
if (4.3 <= PHP_VERSION && ($fp = @fsockopen("ssl://" . $server, 443, $errno, $errstr, 30))) {
$fsocket = true;
} else {
if (function_exists("curl_exec")) {
$curl = true;
}
}
if ($fsocket == true) {
$header = "POST /api/get_invoice_status HTTP/1.1" . "\r\n" . "Host: " . $server . "\r\n" . "Content-Type: application/x-www-form-urlencoded" . "\r\n" . "Content-Length: " . strlen($q) . "\r\n" . "Connection: close" . "\r\n\r\n";
@fputs($fp, $header . $q);
$str = "";
while (!@feof($fp)) {
$res = @fgets($fp, 1024);
$str .= (bool) $res;
}
@fclose($fp);
$result = $str;
$result = preg_split('/^\\r?$/m', $result, 2);
$result = trim($result[1]);
$result = preg_split('/\\n/m', $result);
if (1 < count($result)) {
$result = trim($result[1]);
} else {
$result = trim($result[0]);
}
} else {
if ($curl == true) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://" . $server . "/api/get_invoice_status");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $q);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$result = curl_exec($ch);
curl_close($ch);
}
}
return (bool) $result;
}
示例3: afterSetupProductEventListener
function afterSetupProductEventListener($vars)
{
$gateway = getGatewayVariables("paymentwall");
if (!isset($gateway['enableDeliveryApi']) || $gateway['enableDeliveryApi'] == '') {
return;
}
if ($vars['params']['packageid'] && ($product = mysql_fetch_assoc(select_query('tblproducts', '*', array('id' => $vars['params']['packageid']))))) {
// Get hosting data
$hosting = mysql_fetch_assoc(select_query('tblhosting', 'orderid, paymentmethod', array('username' => $vars['params']['username'])));
if (!$hosting || $hosting['paymentmethod'] != 'paymentwall') {
return;
}
handleProductAutoSetup($vars, $hosting, $gateway);
}
}
示例4: 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;
}
示例5: 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']));
}
}
示例6: getGatewayVariables
# Required File Includes
if (file_exists("../../../init.php")) {
// For new version
include "../../../init.php";
$whmcs->load_function('gateway');
$whmcs->load_function('invoice');
} else {
include "../../../dbconnect.php";
include "../../../includes/functions.php";
include "../../../includes/gatewayfunctions.php";
include "../../../includes/invoicefunctions.php";
}
$gatewaymodule = "allpaycredit";
# Enter your gateway module name here replacing template
$InvoicePrefix = "CRE";
$GATEWAY = getGatewayVariables($gatewaymodule);
if (!$GATEWAY["type"]) {
die("Module Not Activated");
}
# 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"];
示例7: 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("payoffline");
if (!$GATEWAY['type']) {
exit("Module Not Activated");
}
if (!$_REQUEST['code'] && !$_REQUEST['callbackvars']) {
header("Status: 404 Not Found");
exit;
} else {
header("Status: 200 OK");
}
$amount = $_REQUEST['amt'];
$callbackvars2 = explode("&", $callbackvars);
foreach ($callbackvars2 as $value) {
$values[] = explode("=", $value);
}
if ($code == "5") {
示例8: 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("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");
示例9: 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');
}
}
示例10: 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");
示例11: paypal_email_trim
* @ WHMCS FULL DECODED & NULLED
*
* @ Version : 5.2.15
* @ Author : MTIMER
* @ Release on : 2013-12-24
* @ Website : http://www.mtimer.cn
*
**/
function paypal_email_trim($value)
{
$value = trim($value);
}
require "../../../init.php";
$whmcs->load_function("gateway");
$whmcs->load_function("invoice");
$GATEWAY = getGatewayVariables("paypal");
if (!$GATEWAY['type']) {
exit("Module Not Activated");
}
$postipn = "cmd=_notify-validate";
$orgipn = "";
foreach ($_POST as $key => $value) {
$orgipn .= "" . $key . " => " . $value . "\r\n";
$postipn .= "&" . $key . "=" . urlencode(html_entity_decode($value, ENT_QUOTES));
}
$reply = curlCall("https://www.paypal.com/cgi-bin/webscr", $postipn);
if (!strcmp($reply, "VERIFIED")) {
} else {
if (!strcmp($reply, "INVALID")) {
logTransaction("PayPal", $orgipn, "IPN Handshake Invalid");
header("HTTP/1.0 406 Not Acceptable");
示例12: 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("payza");
if (!$GATEWAY['type']) {
exit("Module Not Activated");
}
if ($GATEWAY['type'] == "on") {
$ipnv2handlerurl = "https://sandbox.payza.com/sandbox/ipn2.ashx";
} else {
$ipnv2handlerurl = "https://secure.payza.com/ipn2.ashx";
}
$token = "token=" . urlencode($_POST['token']);
$response = "";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $ipnv2handlerurl);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $token);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
示例13: addInvoicePayment
addInvoicePayment($invoiceid, $resultsarray["Transaction ID"], "", "", "authorizeecheck");
logTransaction("Authorize.net Echeck", $debugreport, "Successful");
echo "<p align=\"center\"><a href=\"#\" onclick=\"window.opener.refresh();window.close();\">Click here to close the window</a></p>\n<script language=\"javascript\">\nwindow.opener.refresh();\nwindow.close();\n</script>";
return null;
}
$errormessage .= "<li>The echeck payment attempt was declined. Please check the supplied details";
logTransaction("Authorize.net Echeck", $debugreport, "Failed");
}
$GATEWAYMODULE['authorizeecheckname'] = "authorizeecheck";
$GATEWAYMODULE['authorizeecheckvisiblename'] = "Authorize.net Echeck";
$GATEWAYMODULE['authorizeechecktype'] = "Invoices";
if (isset($_GET['invoiceid'])) {
require "../../init.php";
$whmcs->load_function("gateway");
$whmcs->load_function("invoice");
$GATEWAY = getGatewayVariables("authorizeecheck");
if (!$GATEWAY['type']) {
exit("Module Not Activated");
}
$where = array("id" => (int) $_GET['invoiceid'], "paymentmethod" => "authorizeecheck");
if (!isset($_SESSION['adminid'])) {
$where['userid'] = $_SESSION['uid'];
}
$invoiceid = get_query_val("tblinvoices", "id", $where);
if (!$invoiceid) {
exit("Access Denied");
}
echo "<html>\n<head>\n<title>Echeck Payment</title>\n";
echo "<s";
echo "tyle>\nbody,td,input {\n font-family: Tahoma;\n font-size: 11px;\n}\nh1 {\n font-family: Tahoma;\n font-weight: normal;\n font-size: 18px;\n color: #000066;\n}\n</style>\n</head>\n<body>\n\n<h1>Echeck Payment</h1>\n\n";
if ($submit) {
示例14: 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("paypalexpress");
if (!$GATEWAY['type']) {
exit("Module Not Activated");
}
$token = "";
if (isset($_REQUEST['token'])) {
$token = $_REQUEST['token'];
}
if (!$token) {
logTransaction("PayPal Express Callback", $_REQUEST, "Missing Token");
exit;
}
$postfields = array();
$postfields['TOKEN'] = $token;
$results = paypalexpress_api_call($GATEWAY, "GetExpressCheckoutDetails", $postfields);
$ack = strtoupper($results['ACK']);
示例15: 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("nochex");
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);