switch ($params['frequency_unit']) {
case '1 week':
- $params['next_sched_contribution'] = mktime(0, 0, 0, date("m"), date("d") + 7,
+ $params['next_sched_contribution_date'] = mktime(0, 0, 0, date("m"), date("d") + 7,
date("Y")
);
$params['end_date'] = mktime(0, 0, 0, date("m"), date("d") + (7 * $payflow_query_array['TERM']),
date("Y")
);
- $payflow_query_array['START'] = date('mdY', $params['next_sched_contribution']);
+ $payflow_query_array['START'] = date('mdY', $params['next_sched_contribution_date']);
$payflow_query_array['PAYPERIOD'] = "WEEK";
$params['frequency_unit'] = "week";
$params['frequency_interval'] = 1;
break;
case '2 weeks':
- $params['next_sched_contribution'] = mktime(0, 0, 0, date("m"), date("d") + 14, date("Y"));
+ $params['next_sched_contribution_date'] = mktime(0, 0, 0, date("m"), date("d") + 14, date("Y"));
$params['end_date'] = mktime(0, 0, 0, date("m"), date("d") + (14 * $payflow_query_array['TERM'])
, date("Y ")
);
- $payflow_query_array['START'] = date('mdY', $params['next_sched_contribution']);
+ $payflow_query_array['START'] = date('mdY', $params['next_sched_contribution_date']);
$payflow_query_array['PAYPERIOD'] = "BIWK";
$params['frequency_unit'] = "week";
$params['frequency_interval'] = 2;
break;
case '4 weeks':
- $params['next_sched_contribution'] = mktime(0, 0, 0, date("m"), date("d") + 28, date("Y")
+ $params['next_sched_contribution_date'] = mktime(0, 0, 0, date("m"), date("d") + 28, date("Y")
);
$params['end_date'] = mktime(0, 0, 0, date("m"), date("d") + (28 * $payflow_query_array['TERM'])
, date("Y")
);
- $payflow_query_array['START'] = date('mdY', $params['next_sched_contribution']);
+ $payflow_query_array['START'] = date('mdY', $params['next_sched_contribution_date']);
$payflow_query_array['PAYPERIOD'] = "FRWK";
$params['frequency_unit'] = "week";
$params['frequency_interval'] = 4;
break;
case '1 month':
- $params['next_sched_contribution'] = mktime(0, 0, 0, date("m") + 1,
+ $params['next_sched_contribution_date'] = mktime(0, 0, 0, date("m") + 1,
date("d"), date("Y")
);
$params['end_date'] = mktime(0, 0, 0, date("m") +
(1 * $payflow_query_array['TERM']),
date("d"), date("Y")
);
- $payflow_query_array['START'] = date('mdY', $params['next_sched_contribution']);
+ $payflow_query_array['START'] = date('mdY', $params['next_sched_contribution_date']);
$payflow_query_array['PAYPERIOD'] = "MONT";
$params['frequency_unit'] = "month";
$params['frequency_interval'] = 1;
break;
case '3 months':
- $params['next_sched_contribution'] = mktime(0, 0, 0, date("m") + 3, date("d")
+ $params['next_sched_contribution_date'] = mktime(0, 0, 0, date("m") + 3, date("d")
, date("Y")
);
$params['end_date'] = mktime(0, 0, 0, date("m") +
(3 * $payflow_query_array['TERM']),
date("d"), date("Y")
);
- $payflow_query_array['START'] = date('mdY', $params['next_sched_contribution']);
+ $payflow_query_array['START'] = date('mdY', $params['next_sched_contribution_date']);
$payflow_query_array['PAYPERIOD'] = "QTER";
$params['frequency_unit'] = "month";
$params['frequency_interval'] = 3;
break;
case '6 months':
- $params['next_sched_contribution'] = mktime(0, 0, 0, date("m") + 6, date("d"),
+ $params['next_sched_contribution_date'] = mktime(0, 0, 0, date("m") + 6, date("d"),
date("Y")
);
$params['end_date'] = mktime(0, 0, 0, date("m") +
(6 * $payflow_query_array['TERM']),
date("d"), date("Y")
);
- $payflow_query_array['START'] = date('mdY', $params['next_sched_contribution'
+ $payflow_query_array['START'] = date('mdY', $params['next_sched_contribution_date'
]
);
$payflow_query_array['PAYPERIOD'] = "SMYR";
break;
case '1 year':
- $params['next_sched_contribution'] = mktime(0, 0, 0, date("m"), date("d"),
+ $params['next_sched_contribution_date'] = mktime(0, 0, 0, date("m"), date("d"),
date("Y") + 1
);
$params['end_date'] = mktime(0, 0, 0, date("m"), date("d"),
date("Y") +
(1 * $payflow_query_array['TEM'])
);
- $payflow_query_array['START'] = date('mdY', $params['next_sched_contribution']);
+ $payflow_query_array['START'] = date('mdY', $params['next_sched_contribution_date']);
$payflow_query_array['PAYPERIOD'] = "YEAR";
$params['frequency_unit'] = "year";
$params['frequency_interval'] = 1;
<log>true</log>
<field>
<name>id</name>
+ <title>Recurring Contribution ID</title>
<type>int unsigned</type>
<required>true</required>
<comment>Contribution Recur ID</comment>
</primaryKey>
<field>
<name>contact_id</name>
+ <title>Contact ID</title>
<type>int unsigned</type>
<required>true</required>
<comment>Foreign key to civicrm_contact.id .</comment>
</foreignKey>
<field>
<name>amount</name>
+ <title>Amount</title>
<type>decimal</type>
<required>true</required>
<comment>Amount to be contributed or charged each recurrence.</comment>
</field>
<field>
<name>currency</name>
+ <title>Currency</title>
<type>varchar</type>
<length>3</length>
<default>NULL</default>
</field>
<field>
<name>frequency_unit</name>
+ <title>Frequency Unit</title>
<type>enum</type>
<values>day,week,month,year</values>
<default>'month'</default>
</field>
<field>
<name>frequency_interval</name>
+ <title>Interval (number of units)</title>
<type>int unsigned</type>
<required>true</required>
<comment>Number of time units for recurrence of payment.</comment>
</field>
<field>
<name>installments</name>
+ <title>Number of Installments</title>
<type>int unsigned</type>
<comment>Total number of payments to be made. Set this to 0 if this is an open-ended commitment i.e. no set end date.</comment>
<add>1.6</add>
</field>
<field>
<name>start_date</name>
+ <title>Recurring Contribution Started Date</title>
<type>datetime</type>
<required>true</required>
<comment>The date the first scheduled recurring contribution occurs.</comment>
</field>
<field>
<name>create_date</name>
+ <title>Recurring Contribution Created Date</title>
<type>datetime</type>
<required>true</required>
<comment>When this recurring contribution record was created.</comment>
</field>
<field>
<name>modified_date</name>
+ <title>Recurring Contribution Modified Date</title>
<type>datetime</type>
<comment>Last updated date for this record. mostly the last time a payment was received</comment>
<add>1.6</add>
</field>
<field>
<name>cancel_date</name>
+ <title>Recurring Contribution Cancel Date</title>
<type>datetime</type>
<comment>Date this recurring contribution was cancelled by contributor- if we can get access to it</comment>
<add>1.6</add>
</field>
<field>
<name>end_date</name>
+ <title>Recurring Contribution End Date</title>
<type>datetime</type>
<comment>Date this recurring contribution finished successfully</comment>
<add>1.6</add>
</field>
<field>
<name>processor_id</name>
+ <title>Payment Processor</title>
<type>varchar</type>
<length>255</length>
<comment>Possibly needed to store a unique identifier for this recurring payment order - if this is available from the processor??</comment>
</field>
<field>
<name>cycle_day</name>
+ <title>Number of Cycle Day</title>
<type>int unsigned</type>
<default>1</default>
<required>true</required>
<type>datetime</type>
<comment>At Groundspring this was used by the cron job which triggered payments. If we\'re not doing that but we know about payments, it might still be useful to store for display to org andor contributors.</comment>
<add>1.6</add>
+ <drop>4.4</drop>
+ </field>
+ <field>
+ <name>next_sched_contribution_date</name>
+ <title>Next Scheduled Contribution Date</title>
+ <type>datetime</type>
+ <comment>Next scheduled date</comment>
+ <add>4.4</add>
</field>
<field>
<name>failure_count</name>
+ <title>Number of Failures</title>
<type>int unsigned</type>
<default>0</default>
<comment>Number of failed charge attempts since last success. Business rule could be set to deactivate on more than x failures.</comment>
<field>
<name>failure_retry_date</name>
<type>datetime</type>
- <comment>At Groundspring we set a business rule to retry failed payments every 7 days - and stored the next scheduled attempt date there.</comment>
+ <title>Retry Failed Attempt Date</title>
+ <comment>Date to retry failed attempt</comment>
<add>1.6</add>
</field>
<field>
<name>auto_renew</name>
+ <title>Auto Renew</title>
<type>boolean</type>
<required>true</required>
<default>0</default>
</field>
<field>
<name>payment_processor_id</name>
+ <title>Payment Processor</title>
<type>int unsigned</type>
<comment>Foreign key to civicrm_payment_processor.id</comment>
<add>3.3</add>
</foreignKey>
<field>
<name>is_email_receipt</name>
+ <title>Send email Receipt?</title>
<type>boolean</type>
<comment>if true, receipt is automatically emailed to contact on each successful payment</comment>
<default>1</default>