/** * Stages the contribution parameters * @param array $params Key-value pairs of the contribution parameters we * want to pass in. * @return array Staged key-value pairs ready to be saved as a contribution. */ static function stage_contribution($params) { //change the posted names to match the db where necessary ContributionTrackingProcessor::rekey($params, 'comment', 'note'); ContributionTrackingProcessor::rekey_invert_boolean($params, 'comment-option', 'anonymous'); ContributionTrackingProcessor::rekey_invert_boolean($params, 'email-opt', 'optout'); $tracked_contribution = ContributionTrackingProcessor::mergeArrayDefaults($params, ContributionTrackingProcessor::getContributionDefaults(), true); return $tracked_contribution; }