From 6c786a9b1984c32f9f4278240150c5c1a8ed3b01 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Sat, 24 May 2014 14:51:35 +1200 Subject: [PATCH] CRM/Core/Payment add missing code blocks (autogenerated) --- CRM/Core/Payment/AuthorizeNet.php | 30 ++++++++++++++ CRM/Core/Payment/AuthorizeNetIPN.php | 34 ++++++++++++++++ CRM/Core/Payment/BaseIPN.php | 51 ++++++++++++++++++++++++ CRM/Core/Payment/Dummy.php | 6 +++ CRM/Core/Payment/Elavon.php | 16 ++++++++ CRM/Core/Payment/Google.php | 29 ++++++++++++++ CRM/Core/Payment/GoogleIPN.php | 20 ++++++++++ CRM/Core/Payment/IATS.php | 16 ++++++++ CRM/Core/Payment/Moneris.php | 15 +++++++ CRM/Core/Payment/PayJunction.php | 15 +++++++ CRM/Core/Payment/PayPalIPN.php | 25 ++++++++++++ CRM/Core/Payment/PayPalImpl.php | 36 +++++++++++++++++ CRM/Core/Payment/PayPalProIPN.php | 13 ++++++ CRM/Core/Payment/PayflowPro.php | 33 +++++++++++++++ CRM/Core/Payment/PaymentExpress.php | 15 +++++++ CRM/Core/Payment/PaymentExpressIPN.php | 8 ++++ CRM/Core/Payment/PaymentExpressUtils.php | 24 +++++++++++ CRM/Core/Payment/ProcessorForm.php | 10 +++++ CRM/Core/Payment/Realex.php | 32 +++++++++++++++ CRM/Core/Payment/eWAY.php | 7 ++++ 20 files changed, 435 insertions(+) diff --git a/CRM/Core/Payment/AuthorizeNet.php b/CRM/Core/Payment/AuthorizeNet.php index dc891f1f67..e789983266 100644 --- a/CRM/Core/Payment/AuthorizeNet.php +++ b/CRM/Core/Payment/AuthorizeNet.php @@ -337,6 +337,9 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { } } + /** + * @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?? @@ -564,6 +567,12 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { return $value; } + /** + * @param null $errorCode + * @param null $errorMessage + * + * @return object + */ function &error($errorCode = NULL, $errorMessage = NULL) { $e = CRM_Core_Error::singleton(); if ($errorCode) { @@ -617,10 +626,19 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { } } + /** + * @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(); @@ -663,6 +681,12 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { return TRUE; } + /** + * @param string $message + * @param array $params + * + * @return bool|object + */ function updateSubscriptionBillingInfo(&$message = '', $params = array( )) { $template = CRM_Core_Smarty::singleton(); @@ -717,6 +741,12 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { return TRUE; } + /** + * @param string $message + * @param array $params + * + * @return bool|object + */ function changeSubscriptionAmount(&$message = '', $params = array( )) { $template = CRM_Core_Smarty::singleton(); diff --git a/CRM/Core/Payment/AuthorizeNetIPN.php b/CRM/Core/Payment/AuthorizeNetIPN.php index d3e5f59376..dcbff70044 100644 --- a/CRM/Core/Payment/AuthorizeNetIPN.php +++ b/CRM/Core/Payment/AuthorizeNetIPN.php @@ -40,6 +40,11 @@ class CRM_Core_Payment_AuthorizeNetIPN extends CRM_Core_Payment_BaseIPN { 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. @@ -77,6 +82,12 @@ class CRM_Core_Payment_AuthorizeNetIPN extends CRM_Core_Payment_BaseIPN { } } + /** + * @param $input + * @param $ids + * @param $objects + * @param $first + */ function recur(&$input, &$ids, &$objects, $first) { $recur = &$objects['contributionRecur']; @@ -201,6 +212,10 @@ class CRM_Core_Payment_AuthorizeNetIPN extends CRM_Core_Payment_BaseIPN { } } + /** + * @param $input + * @param $ids + */ function getInput(&$input, &$ids) { $input['amount'] = self::retrieve('x_amount', 'String'); $input['subscription_id'] = self::retrieve('x_subscription_id', 'Integer'); @@ -239,6 +254,10 @@ class CRM_Core_Payment_AuthorizeNetIPN extends CRM_Core_Payment_BaseIPN { } } + /** + * @param $ids + * @param $input + */ function getIDs(&$ids, &$input) { $ids['contact'] = self::retrieve('x_cust_id', 'Integer'); $ids['contribution'] = self::retrieve('x_invoice_num', 'Integer'); @@ -293,6 +312,15 @@ INNER JOIN civicrm_membership_payment mp ON m.id = mp.membership_id AND mp.contr } } + /** + * @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, @@ -308,6 +336,12 @@ INNER JOIN civicrm_membership_payment mp ON m.id = mp.membership_id AND mp.contr 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' diff --git a/CRM/Core/Payment/BaseIPN.php b/CRM/Core/Payment/BaseIPN.php index 747f8f0d29..ca212e394b 100644 --- a/CRM/Core/Payment/BaseIPN.php +++ b/CRM/Core/Payment/BaseIPN.php @@ -248,6 +248,13 @@ class CRM_Core_Payment_BaseIPN { return TRUE; } + /** + * @param $objects + * @param $transaction + * @param array $input + * + * @return bool + */ function cancelled(&$objects, &$transaction, $input = array()) { $contribution = &$objects['contribution']; $memberships = &$objects['membership']; @@ -305,6 +312,12 @@ class CRM_Core_Payment_BaseIPN { return TRUE; } + /** + * @param $objects + * @param $transaction + * + * @return bool + */ function unhandled(&$objects, &$transaction) { $transaction->rollback(); // we dont handle this as yet @@ -313,6 +326,13 @@ class CRM_Core_Payment_BaseIPN { 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']; @@ -621,6 +641,11 @@ LIMIT 1;"; 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'); @@ -646,6 +671,16 @@ LIMIT 1;"; * @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; @@ -785,6 +820,9 @@ LIMIT 1;"; * 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(); @@ -845,6 +883,11 @@ LIMIT 1;"; ); } + /** + * @param $recurId + * @param $contributionId + * @param $input + */ function addrecurLineItems($recurId, $contributionId, &$input) { $lineSets = $lineItems = array(); @@ -871,6 +914,10 @@ LIMIT 1;"; // 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 @@ -912,6 +959,10 @@ LIMIT 1;"; // 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'); diff --git a/CRM/Core/Payment/Dummy.php b/CRM/Core/Payment/Dummy.php index ac58928aa9..2dca05ea83 100644 --- a/CRM/Core/Payment/Dummy.php +++ b/CRM/Core/Payment/Dummy.php @@ -112,6 +112,12 @@ class CRM_Core_Payment_Dummy extends CRM_Core_Payment { return $params; } + /** + * @param null $errorCode + * @param null $errorMessage + * + * @return object + */ function &error($errorCode = NULL, $errorMessage = NULL) { $e = CRM_Core_Error::singleton(); if ($errorCode) { diff --git a/CRM/Core/Payment/Elavon.php b/CRM/Core/Payment/Elavon.php index 55ded8b3e6..72e041207b 100644 --- a/CRM/Core/Payment/Elavon.php +++ b/CRM/Core/Payment/Elavon.php @@ -374,6 +374,11 @@ class CRM_Core_Payment_Elavon extends CRM_Core_Payment { } } //end check config + /** + * @param $requestFields + * + * @return string + */ function buildXML($requestFields) { $xmlFieldLength['ssl_first_name'] = 15; // credit card name @@ -413,6 +418,12 @@ class CRM_Core_Payment_Elavon extends CRM_Core_Payment { 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 @@ -453,6 +464,11 @@ class CRM_Core_Payment_Elavon extends CRM_Core_Payment { return ($return); } + /** + * @param $Xml + * + * @return mixed + */ function decodeXMLresponse($Xml) { /** diff --git a/CRM/Core/Payment/Google.php b/CRM/Core/Payment/Google.php index ca2d49e708..17708bb0af 100644 --- a/CRM/Core/Payment/Google.php +++ b/CRM/Core/Payment/Google.php @@ -165,6 +165,10 @@ class CRM_Core_Payment_Google extends CRM_Core_Payment { $this->submitPostParams($params, $component, $cart); } + /** + * @param $params + * @param $component + */ function doRecurCheckout(&$params, $component) { $intervalUnit = CRM_Utils_Array::value('frequency_unit', $params); if ($intervalUnit == 'week') { @@ -349,6 +353,11 @@ class CRM_Core_Payment_Google extends CRM_Core_Payment { return self::getArrayFromXML($xmlResponse); } + /** + * @param $searchParams + * + * @return string + */ static function buildXMLQuery($searchParams) { $xml = ' '; @@ -382,6 +391,11 @@ class CRM_Core_Payment_Google extends CRM_Core_Payment { return $xml; } + /** + * @param $xmlData + * + * @return array + */ static function getArrayFromXML($xmlData) { require_once 'Google/library/xml-processing/gc_xmlparser.php'; $xmlParser = new gc_XmlParser($xmlData); @@ -391,6 +405,12 @@ class CRM_Core_Payment_Google extends CRM_Core_Payment { 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) { @@ -402,10 +422,19 @@ class CRM_Core_Payment_Google extends CRM_Core_Payment { 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); diff --git a/CRM/Core/Payment/GoogleIPN.php b/CRM/Core/Payment/GoogleIPN.php index 8045763362..4dd6ed4241 100644 --- a/CRM/Core/Payment/GoogleIPN.php +++ b/CRM/Core/Payment/GoogleIPN.php @@ -57,6 +57,14 @@ class CRM_Core_Payment_GoogleIPN extends CRM_Core_Payment_BaseIPN { */ 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) { @@ -332,6 +340,11 @@ class CRM_Core_Payment_GoogleIPN extends CRM_Core_Payment_BaseIPN { $this->completeRecur($input, $ids, $objects); } + /** + * @param $input + * @param $ids + * @param $objects + */ function completeRecur($input, $ids, $objects) { if ($ids['contributionRecur']) { $recur = &$objects['contributionRecur']; @@ -636,6 +649,13 @@ WHERE contribution_recur_id = {$ids['contributionRecur']} } } + /** + * @param $input + * @param $ids + * @param $dataRoot + * + * @return bool + */ function getInput(&$input, &$ids, $dataRoot) { if (!$this->getBillingID($ids)) { return FALSE; diff --git a/CRM/Core/Payment/IATS.php b/CRM/Core/Payment/IATS.php index a59884a75a..a6e8d4595f 100644 --- a/CRM/Core/Payment/IATS.php +++ b/CRM/Core/Payment/IATS.php @@ -74,6 +74,12 @@ class CRM_Core_Payment_IATS extends CRM_Core_Payment { } } + /** + * @param string $mode + * @param array $paymentProcessor + * + * @return mixed + */ static function &singleton($mode, &$paymentProcessor) { $processorName = $paymentProcessor['name']; if (self::$_singleton[$processorName] === NULL) { @@ -255,6 +261,11 @@ class CRM_Core_Payment_IATS extends CRM_Core_Payment { } } + /** + * @param null $error + * + * @return object + */ function &error($error = NULL) { $e = CRM_Core_Error::singleton(); if (is_object($error)) { @@ -281,6 +292,11 @@ class CRM_Core_Payment_IATS extends CRM_Core_Payment { 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.', diff --git a/CRM/Core/Payment/Moneris.php b/CRM/Core/Payment/Moneris.php index d8c34a644f..7bd198d9df 100644 --- a/CRM/Core/Payment/Moneris.php +++ b/CRM/Core/Payment/Moneris.php @@ -249,6 +249,11 @@ class CRM_Core_Payment_Moneris extends CRM_Core_Payment { return $params; } + /** + * @param $response + * + * @return bool + */ function isError(&$response) { $responseCode = $response->getResponseCode(); if (is_null($responseCode)) { @@ -264,6 +269,11 @@ class CRM_Core_Payment_Moneris extends CRM_Core_Payment { } // ignore for now, more elaborate error handling later. + /** + * @param $response + * + * @return object + */ function &checkResult(&$response) { return $response; @@ -290,6 +300,11 @@ class CRM_Core_Payment_Moneris extends CRM_Core_Payment { return $e; } + /** + * @param null $error + * + * @return object + */ function &error($error = NULL) { $e = CRM_Core_Error::singleton(); if (is_object($error)) { diff --git a/CRM/Core/Payment/PayJunction.php b/CRM/Core/Payment/PayJunction.php index 8487ab6896..68dcb81422 100644 --- a/CRM/Core/Payment/PayJunction.php +++ b/CRM/Core/Payment/PayJunction.php @@ -199,6 +199,11 @@ class CRM_Core_Payment_PayJunction extends CRM_Core_Payment { /* * This function checks the PayJunction response code */ + /** + * @param $response + * + * @return bool + */ function isError(&$response) { $responseCode = $response['dc_response_code']; @@ -212,6 +217,11 @@ class CRM_Core_Payment_PayJunction extends CRM_Core_Payment { // ignore for now, more elaborate error handling later. + /** + * @param $response + * + * @return mixed + */ function &checkResult(&$response) { return $response; } @@ -233,6 +243,11 @@ class CRM_Core_Payment_PayJunction extends CRM_Core_Payment { } } + /** + * @param null $error + * + * @return object + */ function &error($error = NULL) { $e = CRM_Core_Error::singleton(); if ($error) { diff --git a/CRM/Core/Payment/PayPalIPN.php b/CRM/Core/Payment/PayPalIPN.php index 99274206c1..694f30374b 100644 --- a/CRM/Core/Payment/PayPalIPN.php +++ b/CRM/Core/Payment/PayPalIPN.php @@ -43,6 +43,14 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN { 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, @@ -56,6 +64,12 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN { 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"); @@ -205,6 +219,13 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN { ); } + /** + * @param $input + * @param $ids + * @param $objects + * @param bool $recur + * @param bool $first + */ function single(&$input, &$ids, &$objects, $recur = FALSE, $first = FALSE @@ -319,6 +340,10 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN { } } + /** + * @param $input + * @param $ids + */ function getInput(&$input, &$ids) { if (!$this->getBillingID($ids)) { return FALSE; diff --git a/CRM/Core/Payment/PayPalImpl.php b/CRM/Core/Payment/PayPalImpl.php index bb2b3d1ae4..1f6563af5e 100644 --- a/CRM/Core/Payment/PayPalImpl.php +++ b/CRM/Core/Payment/PayPalImpl.php @@ -224,6 +224,11 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { } //LCD add new function for handling recurring payments for PayPal Express + /** + * @param $params + * + * @return mixed + */ function createRecurringPayments(&$params) { $args = array(); @@ -277,6 +282,10 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { return $params; } //LCD end + /** + * @param $args + * @param $method + */ function initialize(&$args, $method) { $args['user'] = $this->_paymentProcessor['user_name']; $args['pwd'] = $this->_paymentProcessor['password']; @@ -403,6 +412,9 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { } } + /** + * @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']); @@ -429,6 +441,12 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { 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') { @@ -449,6 +467,12 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { return FALSE; } + /** + * @param string $message + * @param array $params + * + * @return array|bool|object + */ function updateSubscriptionBillingInfo(&$message = '', $params = array( )) { if ($this->_paymentProcessor['payment_processor_type'] == 'PayPal') { @@ -482,6 +506,12 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { 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(); @@ -504,6 +534,12 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { return FALSE; } + /** + * @param $params + * @param string $component + * + * @throws Exception + */ function doTransferCheckout(&$params, $component = 'contribute') { $config = CRM_Core_Config::singleton(); diff --git a/CRM/Core/Payment/PayPalProIPN.php b/CRM/Core/Payment/PayPalProIPN.php index f31851b58b..98d86395d1 100644 --- a/CRM/Core/Payment/PayPalProIPN.php +++ b/CRM/Core/Payment/PayPalProIPN.php @@ -293,6 +293,13 @@ class CRM_Core_Payment_PayPalProIPN extends CRM_Core_Payment_BaseIPN { ); } + /** + * @param $input + * @param $ids + * @param $objects + * @param bool $recur + * @param bool $first + */ function single(&$input, &$ids, &$objects, $recur = FALSE, $first = FALSE) { $contribution = &$objects['contribution']; @@ -433,6 +440,12 @@ INNER JOIN civicrm_membership_payment mp ON m.id = mp.membership_id AND mp.contr } } + /** + * @param $input + * @param $ids + * + * @throws CRM_Core_Exception + */ function getInput(&$input, &$ids) { if (!$this->getBillingID($ids)) { diff --git a/CRM/Core/Payment/PayflowPro.php b/CRM/Core/Payment/PayflowPro.php index 0b3957f021..181871d023 100644 --- a/CRM/Core/Payment/PayflowPro.php +++ b/CRM/Core/Payment/PayflowPro.php @@ -33,6 +33,10 @@ class CRM_Core_Payment_PayflowPro extends CRM_Core_Payment { * * @return void */ + /** + * @param $mode + * @param $paymentProcessor + */ function __construct($mode, &$paymentProcessor) { // live or test $this->_mode = $mode; @@ -379,6 +383,12 @@ class CRM_Core_Payment_PayflowPro extends CRM_Core_Payment { /* * 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) { @@ -394,6 +404,12 @@ class CRM_Core_Payment_PayflowPro extends CRM_Core_Payment { /* * NOTE: 'doTransferCheckout' not implemented */ + /** + * @param $params + * @param $component + * + * @throws Exception + */ function doTransferCheckout(&$params, $component) { CRM_Core_Error::fatal(ts('This function is not implemented')); } @@ -443,6 +459,11 @@ class CRM_Core_Payment_PayflowPro extends CRM_Core_Payment { /* * 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; @@ -458,6 +479,12 @@ class CRM_Core_Payment_PayflowPro extends CRM_Core_Payment { * @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 @@ -598,6 +625,12 @@ class CRM_Core_Payment_PayflowPro extends CRM_Core_Payment { } //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')); diff --git a/CRM/Core/Payment/PaymentExpress.php b/CRM/Core/Payment/PaymentExpress.php index 767bd728ab..4e1a006ea2 100644 --- a/CRM/Core/Payment/PaymentExpress.php +++ b/CRM/Core/Payment/PaymentExpress.php @@ -115,14 +115,29 @@ class CRM_Core_Payment_PaymentExpress extends CRM_Core_Payment { } } + /** + * @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')); } diff --git a/CRM/Core/Payment/PaymentExpressIPN.php b/CRM/Core/Payment/PaymentExpressIPN.php index 5cc135389f..2402515d91 100644 --- a/CRM/Core/Payment/PaymentExpressIPN.php +++ b/CRM/Core/Payment/PaymentExpressIPN.php @@ -54,6 +54,14 @@ class CRM_Core_Payment_PaymentExpressIPN extends CRM_Core_Payment_BaseIPN { */ 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) { diff --git a/CRM/Core/Payment/PaymentExpressUtils.php b/CRM/Core/Payment/PaymentExpressUtils.php index ca37097e98..8b513af143 100644 --- a/CRM/Core/Payment/PaymentExpressUtils.php +++ b/CRM/Core/Payment/PaymentExpressUtils.php @@ -38,6 +38,12 @@ */ class CRM_Core_Payment_PaymentExpressUtils { + /** + * @param $element + * @param null $value + * + * @return string + */ static function _valueXml($element, $value = NULL) { $nl = "\n"; @@ -51,16 +57,34 @@ class CRM_Core_Payment_PaymentExpressUtils { return "<" . $element . ">" . $value . "" . $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(); diff --git a/CRM/Core/Payment/ProcessorForm.php b/CRM/Core/Payment/ProcessorForm.php index 3fa23d7e1c..d823029a7b 100644 --- a/CRM/Core/Payment/ProcessorForm.php +++ b/CRM/Core/Payment/ProcessorForm.php @@ -38,6 +38,13 @@ */ 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; @@ -100,6 +107,9 @@ class CRM_Core_Payment_ProcessorForm { } } + /** + * @param $form + */ static function buildQuickform(&$form) { $form->addElement('hidden', 'hidden_processor', 1); diff --git a/CRM/Core/Payment/Realex.php b/CRM/Core/Payment/Realex.php index 01413de977..2122c6ad79 100644 --- a/CRM/Core/Payment/Realex.php +++ b/CRM/Core/Payment/Realex.php @@ -95,18 +95,38 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment { 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')); } @@ -296,6 +316,12 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment { } // 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(); @@ -467,6 +493,12 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment { } } + /** + * @param null $errorCode + * @param null $errorMessage + * + * @return object + */ function &error($errorCode = NULL, $errorMessage = NULL) { $e = CRM_Core_Error::singleton(); diff --git a/CRM/Core/Payment/eWAY.php b/CRM/Core/Payment/eWAY.php index cbf81ec2bc..f8ecb80018 100644 --- a/CRM/Core/Payment/eWAY.php +++ b/CRM/Core/Payment/eWAY.php @@ -507,6 +507,13 @@ class CRM_Core_Payment_eWAY extends CRM_Core_Payment { } } + /** + * @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); -- 2.25.1