X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FPayment.php;h=2b665249af241e9c7c5d3ecfbc5b87835724720b;hb=49692d2f70966661298e0d755b282b53f28391e5;hp=8a21c0298bbb99730362368b1053a238bcf2957e;hpb=e9b0c2a705c021d2a96ee331e97048bb9cad5db5;p=civicrm-core.git diff --git a/CRM/Core/Payment.php b/CRM/Core/Payment.php index 8a21c0298b..2b665249af 100644 --- a/CRM/Core/Payment.php +++ b/CRM/Core/Payment.php @@ -3,7 +3,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 4.6 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2014 | + | Copyright CiviCRM LLC (c) 2004-2015 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -206,6 +206,27 @@ abstract class CRM_Core_Payment { } } + /** + * Getter for the payment processor. + * + * The payment processor array is based on the civicrm_payment_processor table entry. + * + * @return array + * Payment processor array. + */ + public function getPaymentProcessor() { + return $this->_paymentProcessor; + } + + /** + * Setter for the payment processor. + * + * @param array $processor + */ + public function setPaymentProcessor($processor) { + $this->_paymentProcessor = $processor; + } + /** * Setter for the payment form that wants to use the processor. * @@ -229,7 +250,9 @@ abstract class CRM_Core_Payment { /** * Getter for accessing member vars. + * * @todo believe this is unused + * * @param string $name * * @return null @@ -318,6 +341,7 @@ abstract class CRM_Core_Payment { 'size' => 20, 'maxlength' => 20, 'autocomplete' => 'off', + 'class' => 'creditcard', ), 'is_required' => TRUE, ), @@ -452,8 +476,10 @@ abstract class CRM_Core_Payment { abstract protected function doDirectPayment(&$params); /** - * Process payment - this function wraps around both doTransferPayment and doDirectPayment - * it ensures an exception is thrown & moves some of this logic out of the form layer and makes the forms more agnostic + * Process payment - this function wraps around both doTransferPayment and doDirectPayment. + * + * The function ensures an exception is thrown & moves some of this logic out of the form layer and makes the forms + * more agnostic. * * @param array $params * @@ -486,8 +512,12 @@ abstract class CRM_Core_Payment { abstract protected function checkConfig(); /** + * Redirect for paypal. + * + * @todo move to paypal class or remove + * * @param $paymentProcessor - * @todo move to paypal class or remover + * * @return bool */ public static function paypalRedirect(&$paymentProcessor) { @@ -507,6 +537,10 @@ abstract class CRM_Core_Payment { } /** + * Handle incoming payment notification. + * + * IPNs, also called silent posts are notifications of payment outcomes or activity on an external site. + * * @todo move to0 \Civi\Payment\System factory method * Page callback for civicrm/payment/ipn */ @@ -556,7 +590,10 @@ abstract class CRM_Core_Payment { else { // This is called when processor_name is passed - passing processor_id instead is recommended. $sql .= " WHERE ppt.name = %2 AND pp.is_test = %1"; - $args[1] = array((CRM_Utils_Array::value('mode', $params) == 'test') ? 1 : 0, 'Integer'); + $args[1] = array( + (CRM_Utils_Array::value('mode', $params) == 'test') ? 1 : 0, + 'Integer', + ); $args[2] = array($params['processor_name'], 'String'); $notFound = "No active instances of the '{$params['processor_name']}' payment processor were found."; }