From 10df056e9fadc1a759d1afa004ced77f60c8f663 Mon Sep 17 00:00:00 2001 From: eileenmcnaughton Date: Thu, 21 Jan 2016 02:00:13 +0000 Subject: [PATCH] CRM-17850 implement getEditableRecurringScheduleFields for Dummy processor This is purely to give visibility of the option to enable appropriate fields for editing --- CRM/Core/Payment/Dummy.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/CRM/Core/Payment/Dummy.php b/CRM/Core/Payment/Dummy.php index b42d00f5e7..1d68efe868 100644 --- a/CRM/Core/Payment/Dummy.php +++ b/CRM/Core/Payment/Dummy.php @@ -169,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'); + } + } -- 2.25.1