}
}
+ /**
+ * @return array
+ */
function _getAuthorizeNetFields() {
$amount = $this->_getParam('total_amount');//Total amount is from the form contribution field
if(empty($amount)){//CRM-9894 would this ever be the case??
return $value;
}
+ /**
+ * @param null $errorCode
+ * @param null $errorMessage
+ *
+ * @return object
+ */
function &error($errorCode = NULL, $errorMessage = NULL) {
$e = CRM_Core_Error::singleton();
if ($errorCode) {
}
}
+ /**
+ * @return string
+ */
function accountLoginURL() {
return ($this->_mode == 'test') ? 'https://test.authorize.net' : 'https://authorize.net';
}
+ /**
+ * @param string $message
+ * @param array $params
+ *
+ * @return bool|object
+ */
function cancelSubscription(&$message = '', $params = array(
)) {
$template = CRM_Core_Smarty::singleton();
return TRUE;
}
+ /**
+ * @param string $message
+ * @param array $params
+ *
+ * @return bool|object
+ */
function updateSubscriptionBillingInfo(&$message = '', $params = array(
)) {
$template = CRM_Core_Smarty::singleton();
return TRUE;
}
+ /**
+ * @param string $message
+ * @param array $params
+ *
+ * @return bool|object
+ */
function changeSubscriptionAmount(&$message = '', $params = array(
)) {
$template = CRM_Core_Smarty::singleton();
parent::__construct();
}
+ /**
+ * @param string $component
+ *
+ * @return bool|void
+ */
function main($component = 'contribute') {
//we only get invoice num as a key player from payment gateway response.
}
}
+ /**
+ * @param $input
+ * @param $ids
+ * @param $objects
+ * @param $first
+ */
function recur(&$input, &$ids, &$objects, $first) {
$recur = &$objects['contributionRecur'];
}
}
+ /**
+ * @param $input
+ * @param $ids
+ */
function getInput(&$input, &$ids) {
$input['amount'] = self::retrieve('x_amount', 'String');
$input['subscription_id'] = self::retrieve('x_subscription_id', 'Integer');
}
}
+ /**
+ * @param $ids
+ * @param $input
+ */
function getIDs(&$ids, &$input) {
$ids['contact'] = self::retrieve('x_cust_id', 'Integer');
$ids['contribution'] = self::retrieve('x_invoice_num', 'Integer');
}
}
+ /**
+ * @param $name
+ * @param $type
+ * @param bool $abort
+ * @param null $default
+ * @param string $location
+ *
+ * @return mixed
+ */
static function retrieve($name, $type, $abort = TRUE, $default = NULL, $location = 'POST') {
static $store = NULL;
$value = CRM_Utils_Request::retrieve($name, $type, $store,
return $value;
}
+ /**
+ * @param $ids
+ * @param $input
+ *
+ * @return bool
+ */
function checkMD5($ids, $input) {
$paymentProcessor = CRM_Financial_BAO_PaymentProcessor::getPayment($ids['paymentProcessor'],
$input['is_test'] ? 'test' : 'live'
return TRUE;
}
+ /**
+ * @param $objects
+ * @param $transaction
+ * @param array $input
+ *
+ * @return bool
+ */
function cancelled(&$objects, &$transaction, $input = array()) {
$contribution = &$objects['contribution'];
$memberships = &$objects['membership'];
return TRUE;
}
+ /**
+ * @param $objects
+ * @param $transaction
+ *
+ * @return bool
+ */
function unhandled(&$objects, &$transaction) {
$transaction->rollback();
// we dont handle this as yet
return FALSE;
}
+ /**
+ * @param $input
+ * @param $ids
+ * @param $objects
+ * @param $transaction
+ * @param bool $recur
+ */
function completeTransaction(&$input, &$ids, &$objects, &$transaction, $recur = FALSE) {
$contribution = &$objects['contribution'];
$memberships = &$objects['membership'];
CRM_Core_Error::debug_log_message("Success: Database updated");
}
+ /**
+ * @param $ids
+ *
+ * @return bool
+ */
function getBillingID(&$ids) {
// get the billing location type
$locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id', array(), 'validate');
* @params bool $returnMessageText Should text be returned instead of sent. This
* is because the function is also used to generate pdfs
*/
+ /**
+ * @param $input
+ * @param $ids
+ * @param $objects
+ * @param $values
+ * @param bool $recur
+ * @param bool $returnMessageText
+ *
+ * @return mixed
+ */
function sendMail(&$input, &$ids, &$objects, &$values, $recur = FALSE, $returnMessageText = FALSE) {
$contribution = &$objects['contribution'];
$input['is_recur'] = $recur;
* The pledge payment record should already exist & will need to be updated with the new contribution ID.
* If not the contribution will also need to be linked to the pledge
*/
+ /**
+ * @param $contribution
+ */
function updateRecurLinkedPledge(&$contribution) {
$returnProperties = array('id', 'pledge_id');
$paymentDetails = $paymentIDs = array();
);
}
+ /**
+ * @param $recurId
+ * @param $contributionId
+ * @param $input
+ */
function addrecurLineItems($recurId, $contributionId, &$input) {
$lineSets = $lineItems = array();
// function to copy custom data of the
// initial contribution into its recurring contributions
+ /**
+ * @param $recurId
+ * @param $targetContributionId
+ */
function copyCustomValues($recurId, $targetContributionId) {
if ($recurId && $targetContributionId) {
// get the initial contribution id of recur id
// function to copy soft credit record of first recurring contribution
// and add new soft credit against $targetContributionId
+ /**
+ * @param $recurId
+ * @param $targetContributionId
+ */
function addrecurSoftCredit($recurId, $targetContributionId) {
$contriID = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_Contribution', $recurId, 'id', 'contribution_recur_id');
return $params;
}
+ /**
+ * @param null $errorCode
+ * @param null $errorMessage
+ *
+ * @return object
+ */
function &error($errorCode = NULL, $errorMessage = NULL) {
$e = CRM_Core_Error::singleton();
if ($errorCode) {
}
}
//end check config
+ /**
+ * @param $requestFields
+ *
+ * @return string
+ */
function buildXML($requestFields) {
$xmlFieldLength['ssl_first_name'] = 15;
// credit card name
return $xml;
}
+ /**
+ * @param $value
+ * @param $fieldlength
+ *
+ * @return string
+ */
function tidyStringforXML($value, $fieldlength) {
// the xml is posted to a url so must not contain spaces etc. It also needs to be cut off at a certain
// length to match the processor's field length. The cut needs to be made after spaces etc are
return ($return);
}
+ /**
+ * @param $Xml
+ *
+ * @return mixed
+ */
function decodeXMLresponse($Xml) {
/**
$this->submitPostParams($params, $component, $cart);
}
+ /**
+ * @param $params
+ * @param $component
+ */
function doRecurCheckout(&$params, $component) {
$intervalUnit = CRM_Utils_Array::value('frequency_unit', $params);
if ($intervalUnit == 'week') {
return self::getArrayFromXML($xmlResponse);
}
+ /**
+ * @param $searchParams
+ *
+ * @return string
+ */
static function buildXMLQuery($searchParams) {
$xml = '<?xml version="1.0" encoding="UTF-8"?>
<notification-history-request xmlns="http://checkout.google.com/schema/2">';
return $xml;
}
+ /**
+ * @param $xmlData
+ *
+ * @return array
+ */
static function getArrayFromXML($xmlData) {
require_once 'Google/library/xml-processing/gc_xmlparser.php';
$xmlParser = new gc_XmlParser($xmlData);
return array($root, $data);
}
+ /**
+ * @param null $errorCode
+ * @param null $errorMessage
+ *
+ * @return object
+ */
function &error($errorCode = NULL, $errorMessage = NULL) {
$e = &CRM_Core_Error::singleton();
if ($errorCode) {
return $e;
}
+ /**
+ * @return string
+ */
function accountLoginURL() {
return ($this->_mode == 'test') ? 'https://sandbox.google.com/checkout/sell' : 'https://checkout.google.com/';
}
+ /**
+ * @param string $message
+ * @param array $params
+ *
+ * @return bool|object
+ */
function cancelSubscription(&$message = '', $params = array(
)) {
$orderNo = CRM_Utils_Array::value('subscriptionId', $params);
*/
protected $_mode = NULL;
+ /**
+ * @param $name
+ * @param $type
+ * @param $object
+ * @param bool $abort
+ *
+ * @return mixed
+ */
static function retrieve($name, $type, $object, $abort = TRUE) {
$value = CRM_Utils_Array::value($name, $object);
if ($abort && $value === NULL) {
$this->completeRecur($input, $ids, $objects);
}
+ /**
+ * @param $input
+ * @param $ids
+ * @param $objects
+ */
function completeRecur($input, $ids, $objects) {
if ($ids['contributionRecur']) {
$recur = &$objects['contributionRecur'];
}
}
+ /**
+ * @param $input
+ * @param $ids
+ * @param $dataRoot
+ *
+ * @return bool
+ */
function getInput(&$input, &$ids, $dataRoot) {
if (!$this->getBillingID($ids)) {
return FALSE;
}
}
+ /**
+ * @param string $mode
+ * @param array $paymentProcessor
+ *
+ * @return mixed
+ */
static function &singleton($mode, &$paymentProcessor) {
$processorName = $paymentProcessor['name'];
if (self::$_singleton[$processorName] === NULL) {
}
}
+ /**
+ * @param null $error
+ *
+ * @return object
+ */
function &error($error = NULL) {
$e = CRM_Core_Error::singleton();
if (is_object($error)) {
return $e;
}
+ /**
+ * @param $error_id
+ *
+ * @return string
+ */
function errorString($error_id) {
$errors = array(
1 => 'Agent Code has not been set up on the authorization system.',
return $params;
}
+ /**
+ * @param $response
+ *
+ * @return bool
+ */
function isError(&$response) {
$responseCode = $response->getResponseCode();
if (is_null($responseCode)) {
}
// ignore for now, more elaborate error handling later.
+ /**
+ * @param $response
+ *
+ * @return object
+ */
function &checkResult(&$response) {
return $response;
return $e;
}
+ /**
+ * @param null $error
+ *
+ * @return object
+ */
function &error($error = NULL) {
$e = CRM_Core_Error::singleton();
if (is_object($error)) {
/*
* This function checks the PayJunction response code
*/
+ /**
+ * @param $response
+ *
+ * @return bool
+ */
function isError(&$response) {
$responseCode = $response['dc_response_code'];
// ignore for now, more elaborate error handling later.
+ /**
+ * @param $response
+ *
+ * @return mixed
+ */
function &checkResult(&$response) {
return $response;
}
}
}
+ /**
+ * @param null $error
+ *
+ * @return object
+ */
function &error($error = NULL) {
$e = CRM_Core_Error::singleton();
if ($error) {
parent::__construct();
}
+ /**
+ * @param $name
+ * @param $type
+ * @param string $location
+ * @param bool $abort
+ *
+ * @return mixed
+ */
static function retrieve($name, $type, $location = 'POST', $abort = TRUE) {
static $store = NULL;
$value = CRM_Utils_Request::retrieve($name, $type, $store,
return $value;
}
+ /**
+ * @param $input
+ * @param $ids
+ * @param $objects
+ * @param $first
+ */
function recur(&$input, &$ids, &$objects, $first) {
if (!isset($input['txnType'])) {
CRM_Core_Error::debug_log_message("Could not find txn_type in input request");
);
}
+ /**
+ * @param $input
+ * @param $ids
+ * @param $objects
+ * @param bool $recur
+ * @param bool $first
+ */
function single(&$input, &$ids, &$objects,
$recur = FALSE,
$first = FALSE
}
}
+ /**
+ * @param $input
+ * @param $ids
+ */
function getInput(&$input, &$ids) {
if (!$this->getBillingID($ids)) {
return FALSE;
}
//LCD add new function for handling recurring payments for PayPal Express
+ /**
+ * @param $params
+ *
+ * @return mixed
+ */
function createRecurringPayments(&$params) {
$args = array();
return $params;
}
//LCD end
+ /**
+ * @param $args
+ * @param $method
+ */
function initialize(&$args, $method) {
$args['user'] = $this->_paymentProcessor['user_name'];
$args['pwd'] = $this->_paymentProcessor['password'];
}
}
+ /**
+ * @return null|string
+ */
function cancelSubscriptionURL() {
if ($this->_paymentProcessor['payment_processor_type'] == 'PayPal_Standard') {
return "{$this->_paymentProcessor['url_site']}cgi-bin/webscr?cmd=_subscr-find&alias=" . urlencode($this->_paymentProcessor['user_name']);
return parent::isSupported($method);
}
+ /**
+ * @param string $message
+ * @param array $params
+ *
+ * @return array|bool|object
+ */
function cancelSubscription(&$message = '', $params = array(
)) {
if ($this->_paymentProcessor['payment_processor_type'] == 'PayPal') {
return FALSE;
}
+ /**
+ * @param string $message
+ * @param array $params
+ *
+ * @return array|bool|object
+ */
function updateSubscriptionBillingInfo(&$message = '', $params = array(
)) {
if ($this->_paymentProcessor['payment_processor_type'] == 'PayPal') {
return FALSE;
}
+ /**
+ * @param string $message
+ * @param array $params
+ *
+ * @return array|bool|object
+ */
function changeSubscriptionAmount(&$message = '', $params = array()) {
if ($this->_paymentProcessor['payment_processor_type'] == 'PayPal') {
$config = CRM_Core_Config::singleton();
return FALSE;
}
+ /**
+ * @param $params
+ * @param string $component
+ *
+ * @throws Exception
+ */
function doTransferCheckout(&$params, $component = 'contribute') {
$config = CRM_Core_Config::singleton();
);
}
+ /**
+ * @param $input
+ * @param $ids
+ * @param $objects
+ * @param bool $recur
+ * @param bool $first
+ */
function single(&$input, &$ids, &$objects, $recur = FALSE, $first = FALSE) {
$contribution = &$objects['contribution'];
}
}
+ /**
+ * @param $input
+ * @param $ids
+ *
+ * @throws CRM_Core_Exception
+ */
function getInput(&$input, &$ids) {
if (!$this->getBillingID($ids)) {
*
* @return void
*/
+ /**
+ * @param $mode
+ * @param $paymentProcessor
+ */
function __construct($mode, &$paymentProcessor) {
// live or test
$this->_mode = $mode;
/*
* Produces error message and returns from class
*/
+ /**
+ * @param null $errorCode
+ * @param null $errorMessage
+ *
+ * @return object
+ */
function &errorExit($errorCode = NULL, $errorMessage = NULL) {
$e = CRM_Core_Error::singleton();
if ($errorCode) {
/*
* NOTE: 'doTransferCheckout' not implemented
*/
+ /**
+ * @param $params
+ * @param $component
+ *
+ * @throws Exception
+ */
function doTransferCheckout(&$params, $component) {
CRM_Core_Error::fatal(ts('This function is not implemented'));
}
/*
* convert to a name/value pair (nvp) string
*/
+ /**
+ * @param $payflow_query_array
+ *
+ * @return array|string
+ */
function convert_to_nvp($payflow_query_array) {
foreach ($payflow_query_array as $key => $value) {
$payflow_query[] = $key . '[' . strlen($value) . ']=' . $value;
* @payflow_query value string to be posted
*
*/
+ /**
+ * @param $submiturl
+ * @param $payflow_query
+ *
+ * @return mixed|object
+ */
function submit_transaction($submiturl, $payflow_query) {
/*
* Submit transaction using CuRL
}
//end submit_transaction
+ /**
+ * @param $recurringProfileID
+ * @param $processorID
+ *
+ * @throws Exception
+ */
function getRecurringTransactionStatus($recurringProfileID, $processorID) {
if (!defined('CURLOPT_SSLCERT')) {
CRM_Core_Error::fatal(ts('PayFlowPro requires curl with SSL support'));
}
}
+ /**
+ * @param $params
+ *
+ * @throws Exception
+ */
function setExpressCheckOut(&$params) {
CRM_Core_Error::fatal(ts('This function is not implemented'));
}
+ /**
+ * @param $token
+ *
+ * @throws Exception
+ */
function getExpressCheckoutDetails($token) {
CRM_Core_Error::fatal(ts('This function is not implemented'));
}
+ /**
+ * @param $params
+ *
+ * @throws Exception
+ */
function doExpressCheckout(&$params) {
CRM_Core_Error::fatal(ts('This function is not implemented'));
}
*/
protected $_mode = NULL;
+ /**
+ * @param $name
+ * @param $type
+ * @param $object
+ * @param bool $abort
+ *
+ * @return mixed
+ */
static function retrieve($name, $type, $object, $abort = TRUE) {
$value = CRM_Utils_Array::value($name, $object);
if ($abort && $value === NULL) {
*/
class CRM_Core_Payment_PaymentExpressUtils {
+ /**
+ * @param $element
+ * @param null $value
+ *
+ * @return string
+ */
static function _valueXml($element, $value = NULL) {
$nl = "\n";
return "<" . $element . ">" . $value . "</" . $element . ">" . $nl;
}
+ /**
+ * @param $xml
+ * @param $name
+ *
+ * @return mixed
+ */
static function _xmlElement($xml, $name) {
$value = preg_replace('/.*<' . $name . '[^>]*>(.*)<\/' . $name . '>.*/', '\1', $xml);
return $value;
}
+ /**
+ * @param $xml
+ * @param $name
+ *
+ * @return mixed|null
+ */
static function _xmlAttribute($xml, $name) {
$value = preg_replace('/<.*' . $name . '="([^"]*)".*>/', '\1', $xml);
return $value != $xml ? $value : NULL;
}
+ /**
+ * @param $query
+ * @param $url
+ *
+ * @return resource
+ */
static function &_initCURL($query, $url) {
$curl = curl_init();
*/
class CRM_Core_Payment_ProcessorForm {
+ /**
+ * @param $form
+ * @param null $type
+ * @param null $mode
+ *
+ * @throws Exception
+ */
static function preProcess(&$form, $type = NULL, $mode = NULL ) {
if ($type) {
$form->_type = $type;
}
}
+ /**
+ * @param $form
+ */
static function buildQuickform(&$form) {
$form->addElement('hidden', 'hidden_processor', 1);
return self::$_singleton[$processorName];
}
+ /**
+ * @param $params
+ *
+ * @throws Exception
+ */
function setExpressCheckOut(&$params) {
CRM_Core_Error::fatal(ts('This function is not implemented'));
}
+ /**
+ * @param $token
+ *
+ * @throws Exception
+ */
function getExpressCheckoutDetails($token) {
CRM_Core_Error::fatal(ts('This function is not implemented'));
}
+ /**
+ * @param $params
+ *
+ * @throws Exception
+ */
function doExpressCheckout(&$params) {
CRM_Core_Error::fatal(ts('This function is not implemented'));
}
+ /**
+ * @param $params
+ *
+ * @throws Exception
+ */
function doTransferCheckout(&$params) {
CRM_Core_Error::fatal(ts('This function is not implemented'));
}
}
// private helper for xml_parse_into_assoc, to recusively parsing the result
+ /**
+ * @param $input
+ * @param int $depth
+ *
+ * @return array
+ */
function _xml_parse($input, $depth = 1) {
$output = array();
$children = array();
}
}
+ /**
+ * @param null $errorCode
+ * @param null $errorMessage
+ *
+ * @return object
+ */
function &error($errorCode = NULL, $errorMessage = NULL) {
$e = CRM_Core_Error::singleton();
}
}
+ /**
+ * @param $p_eWAY_tran_num
+ * @param $p_trxn_out
+ * @param $p_trxn_back
+ * @param $p_request
+ * @param $p_response
+ */
function send_alert_email($p_eWAY_tran_num, $p_trxn_out, $p_trxn_back, $p_request, $p_response) {
// Initialization call is required to use CiviCRM APIs.
civicrm_initialize(TRUE);