8

I've seen other systems that allow the donor to check a box to cover processing costs, similar to this:

Cover processing fees

In researching whether something like this was possible with CiviCRM, this thread is the closest I've found. The solution there is to simply put a flat rate additional amount.

I'd love some guidance on how this could be implemented more dynamically (so the amount of the fee changes based on the size of the donation) as either a default contribution page, or a Webform-CiviCRM implementation. Anyone have an idea?

4
  • My organization would also be interested in such a feature. We use Joomla, so I'd be sad if it were implemented using drupal webforms. Aug 10, 2015 at 4:51
  • I do have sites where we do this with Webform CiviCRM module -> in D7WFC you’ll need Webform Calculator module (ask me for about a slightly improved fork if you’re thinking of this); in D8WFC -> Webform D8 has native computed Twig Elements so you can do calculations + conditional logic to compute the value of such an element. Aug 8, 2020 at 4:35
  • I'd be interested to see the improved fork -- is it on Github?
    – Laryn
    Aug 8, 2020 at 19:32
  • 1
    Sorry - no notification on SE... Yes it’s in my GitHub KarinG - should be public. If you can’t find it ping me on Mattermost Aug 9, 2020 at 15:25

4 Answers 4

8

It's pretty late to be answering this, but the Percentage Price Field extension supports something very much like this.

This extension allows you to add an "Additional Percentage" field to any price set, which will automatically calculate and add an additional amount to a transaction, as a configurable percentage of other selected price set options.

Want to ask donors to give an extra 3% to cover credit card processing fees? Or to give an additional 10% of their membership fee to support a special project? Then you're in the right place.

Because it's a price set field, this option will appear as a line item in contribution records and receipts, allow configuration of financial type, label, help text, and other standard price field options, and work equally well for contributions, memberships, events -- anywhere you can use a price set.

https://civicrm.org/extensions/percentage-price-field

[Disclosure: I'm the author of this extension.]

2
6

Price set options that change are doable, but in order to make the totaling work, you've got to rewrite that bit of code, because it adds and subtracts the single item amount you check or uncheck.

Let's say the fee price option is pegged at 3%. You select $50, the fee option goes up to $1.50 and the total goes to $50. Now, you check the cover-my-fee box, bringing the total to $51.50. You decide to be more generous and select $100. The fee option goes up to $3, but it won't appear to take effect because the totaling only counts the change from $50 to $100. Your total will say $101.50. Now, you decide that if you're donating all that money, the least the organization can do is cover the fee. Uncheck the fee option, and the total goes to $98.50. It subtracts the option amount regardless of whether that's in the total.

The solution to this is to rewrite that javascript to total the entire thing each time something changes.

Hook_civicrm_buildAmount will take care of the amounts on the confirmation page since by that point, you'll know what options are selected.

4
  • Thanks for this, Andrew! I'll put it in my "rainy day" list of things to experiment with. Do you know off-hand whether post-processing on a webform_civicrm form would work?
    – Laryn
    Mar 25, 2015 at 15:47
  • Ooh--haven't tried that. I bet it would work, but I don't know what you'd be changing on the webform vs. anything in CiviCRM.
    – Andie Hunt
    Mar 25, 2015 at 16:06
  • I'd like to try to implement this, but I'm not seeing how to "peg" a price option to a percentage. Is that an admin-accessible option, or is it only code-able?Also, would there be a way to implement CiviDiscount to handle this sort of thing? For instance, create a negative discount applicable only to Contributions, and instead of having the "apply discount" field at the top of the contribution page, have it as a check box right above the "Total Amount." (I'm open to moving this to a new question, if that makes more sense. I'm not sure.) Jul 11, 2016 at 16:39
  • It would be in custom code. Price options out-of-the-box are only fixed prices.
    – Andie Hunt
    Jul 11, 2016 at 18:57
1

The best way to achieve this would be to use price-sets and add the priceset item with the amount of the processing fees. When you have multiple donation amount options, it could be issue, but I think can be achieved via hook alter.

1
  • Yes, but I believe the op is looking to calculate a percentage. This will work if fixed. Also, you must make it a required option. Jun 30, 2015 at 2:08
0

Another extension to consider with a slightly different approach from Percentage Price Field is Fuzion's Extra Fee extension.

This extension allows for a credit card fee and optional processing fee for the CC payment to be added to the total to be paid via any payment processor that uses Credit Cards or other payment gateways. It does not get applied for Pay Later transactions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.