X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FPayment.php;h=f54e61d254205c268c288a24c48445af0cdb475d;hb=b7801a459edcc9c5570df3469e93f8da56340de4;hp=13f506bcd118e2627c14e1fe5cb51e63362b139b;hpb=5630f7ad3700d234833cf390b3e6b9c6579438dc;p=civicrm-core.git diff --git a/CRM/Core/Payment.php b/CRM/Core/Payment.php index 13f506bcd1..f54e61d254 100644 --- a/CRM/Core/Payment.php +++ b/CRM/Core/Payment.php @@ -375,6 +375,18 @@ abstract class CRM_Core_Payment { return FALSE; } + /** + * Does this processor support updating billing info for recurring contributions through code. + * + * If the processor returns true then it must be possible to update billing info from within CiviCRM + * that will be updated at the payment processor. + * + * @return bool + */ + protected function supportsUpdateSubscriptionBillingInfo() { + return method_exists(CRM_Utils_System::getClassName($this), 'updateSubscriptionBillingInfo'); + } + /** * Can recurring contributions be set against pledges. * @@ -590,7 +602,7 @@ abstract class CRM_Core_Payment { * @return array */ public function getEditableRecurringScheduleFields() { - if (method_exists($this, 'changeSubscriptionAmount')) { + if ($this->supports('changeSubscriptionAmount')) { return array('amount'); } } @@ -689,6 +701,7 @@ abstract class CRM_Core_Payment { 'class' => 'creditcard', ), 'is_required' => TRUE, + // 'description' => '16 digit card number', // If you enable a description field it will be shown below the field on the form ), 'cvv2' => array( 'htmlType' => 'text', @@ -1380,6 +1393,9 @@ abstract class CRM_Core_Payment { $extension_instance_found = TRUE; } + // Call IPN postIPNProcess hook to allow for custom processing of IPN data. + $IPNParams = array_merge($_GET, $_REQUEST); + CRM_Utils_Hook::postIPNProcess($IPNParams); if (!$extension_instance_found) { $message = "No extension instances of the '%1' payment processor were found.
" . "%2 method is unsupported in legacy payment processors."; @@ -1453,7 +1469,7 @@ abstract class CRM_Core_Payment { case 'billing': //in notify mode don't return the update billing url - if (!$this->isSupported('updateSubscriptionBillingInfo')) { + if (!$this->supports('updateSubscriptionBillingInfo')) { return NULL; } $url = 'civicrm/contribute/updatebilling'; @@ -1504,7 +1520,7 @@ INNER JOIN civicrm_contribution con ON ( con.contribution_recur_id = rec.id ) } // Else login URL - if ($this->isSupported('accountLoginURL')) { + if ($this->supports('accountLoginURL')) { return $this->accountLoginURL(); } @@ -1550,6 +1566,18 @@ INNER JOIN civicrm_contribution con ON ( con.contribution_recur_id = rec.id ) return FALSE; } + /** + * Does this processor support changing the amount for recurring contributions through code. + * + * If the processor returns true then it must be possible to update the amount from within CiviCRM + * that will be updated at the payment processor. + * + * @return bool + */ + protected function supportsChangeSubscriptionAmount() { + return method_exists(CRM_Utils_System::getClassName($this), 'changeSubscriptionAmount'); + } + /** * Checks if payment processor supports recurring contributions * @@ -1562,6 +1590,17 @@ INNER JOIN civicrm_contribution con ON ( con.contribution_recur_id = rec.id ) return FALSE; } + /** + * Checks if payment processor supports an account login URL + * TODO: This is checked by self::subscriptionURL but is only used if no entityID is found. + * TODO: It is implemented by AuthorizeNET, any others? + * + * @return bool + */ + protected function supportsAccountLoginURL() { + return method_exists(CRM_Utils_System::getClassName($this), 'accountLoginURL'); + } + /** * Should a receipt be sent out for a pending payment. *