X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FPayment%2FDummy.php;h=1d68efe868121367667d198e7dc61121f02b5830;hb=762e3fc83142fd773e32909051236f645c5a5465;hp=f4e54d6c45f47ce50c3915260ca92f1ce1279547;hpb=787f988595ffd7ff1f3e810f5c0598061cc561e3;p=civicrm-core.git diff --git a/CRM/Core/Payment/Dummy.php b/CRM/Core/Payment/Dummy.php index f4e54d6c45..1d68efe868 100644 --- a/CRM/Core/Payment/Dummy.php +++ b/CRM/Core/Payment/Dummy.php @@ -80,7 +80,9 @@ class CRM_Core_Payment_Dummy extends CRM_Core_Payment { // the back-end's canonical set of parameters. But if a processor // does this, it needs to invoke this hook after it has done translation, // but before it actually starts talking to its proprietary back-end. - + if (!empty($params['is_recur'])) { + $throwAnENoticeIfNotSetAsTheseAreRequired = $params['frequency_interval'] . $params['frequency_unit']; + } // no translation in Dummy processor $cookedParams = $params; CRM_Utils_Hook::alterPaymentProcessorParams($this, @@ -125,7 +127,10 @@ class CRM_Core_Payment_Dummy extends CRM_Core_Payment { } /** - * Are back office payments supported - e.g paypal standard won't permit you to enter a credit card associated with someone else's login + * Are back office payments supported. + * + * E.g paypal standard won't permit you to enter a credit card associated with someone else's login. + * * @return bool */ protected function supportsLiveMode() { @@ -164,4 +169,33 @@ class CRM_Core_Payment_Dummy extends CRM_Core_Payment { return NULL; } + /** + * Get an array of the fields that can be edited on the recurring contribution. + * + * Some payment processors support editing the amount and other scheduling details of recurring payments, especially + * those which use tokens. Others are fixed. This function allows the processor to return an array of the fields that + * can be updated from the contribution recur edit screen. + * + * The fields are likely to be a subset of these + * - 'amount', + * - 'installments', + * - 'frequency_interval', + * - 'frequency_unit', + * - 'cycle_day', + * - 'next_sched_contribution_date', + * - 'end_date', + * - 'failure_retry_day', + * + * The form does not restrict which fields from the contribution_recur table can be added (although if the html_type + * metadata is not defined in the xml for the field it will cause an error. + * + * Open question - would it make sense to return membership_id in this - which is sometimes editable and is on that + * form (UpdateSubscription). + * + * @return array + */ + public function getEditableRecurringScheduleFields() { + return array('amount', 'next_sched_contribution_date'); + } + }