Joe Winter

  • About Me

Blog Topics

  • Career
  • Code
  • Meta
  • Potpourri

© 2015–2025 Joe Winter

Pass along credit card service fees in Gravity Forms

November 30, 2015 By Joe Winter 10 Comments

If you’re using Gravity Forms for payments or donations, you can offer your customers or donors the option of covering the merchant fee that is otherwise normally charged to you. Whether you use PayPal, Stripe, or any other gateway, the same options apply.

Why make it an option? In some cases, your company may be restricted from passing along those fees, based on state laws and service agreements. In addition, it’s simply a better practice to make it an option rather than a requirement. Donors in particular want to know that the money they donate is going toward the organization’s pursuit of its mission. And if you’re not sure whether it’s a bad idea to charge a “convenience fee” no matter what, just think of Ticketmaster and the fees they charge.

Gravity Forms CheckboxSo… you want an option. This is a pretty simple task in Gravity Forms. First, add a checkbox field with no title and only one option: “I would like to cover the cost of the merchant service fee.”

You can also click the “Advanced” field and give this checkbox an “Admin field label,” such as “Charge Merchant Fee.” That will make the field easier to find when you’re configuring other options for your form.

If you don’t already have a donation field in your form, add a product field, preferably with “User Defined Price” as your Field Type. It is common for donation forms to offer a predefined set of giving levels on their forms, with an “other amount” available if the donor wants to give a specific amount. That is possible in Gravity Forms, but I’ll cover how to do that in a separate blog post later.

For the merchant fee, add another product field. But this time, the Field Type should be “Calculated.” PayPal and Stripe both charge a fee of 2.9% + 30¢ per transaction for most transactions. (Note: If your organization has 501(c)(3) nonprofit status, your organization may qualify for a discounted rate through PayPal.) The basic formula to add on the merchant fee is: (( d + 0.3 ) / ( 1 - 0.029 ))  - d where d is the donation amount. The numbers 0.3 (for 30¢) and 0.029 (for 2.9%) may differ, based on your fee structure. The basic idea is that if a donor gives $100 and chooses to add on the merchant fee, then the full $100 will go to your organization, rather than $96.80.

To apply this formula in the product field, you will want to use the interface provided by Gravity Forms to construct your formula. Use the “Insert Merge Tag” dropdown box to insert the field into your formula. The result should look something like this:

Merchant FeeBe sure to also click the “Advanced” tab and check the option “Enable Conditional Logic.” Then, choose “Show this field if All of the following match: Charge Merchant Fee is I would like to cover the cost of the merchant service fee.”

Save your changes, and your form is now ready to go!

Share this:

  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on X (Opens in new window) X
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to email a link to a friend (Opens in new window) Email
  • Click to print (Opens in new window) Print

Like this:

Like Loading...

Related

Filed Under: Code

Comments

  1. Kate says

    May 2, 2016 at 10:11 pm

    Thanks for your article Joe.

    I noticed though that Stripe doesn’t recognise the additional cost as their “Merchant Fee” and charge the percentage on the whole amount.

    Is there a way to get Stripe to not charge interest on the “Merchant Fee”?

    Kate

    Reply
    • Joe Winter says

      May 2, 2016 at 10:26 pm

      Hi Kate —

      Thanks for your comment. The formula is actually designed to make sure the total cost after the service fee is the exact amount. In the $100 example, if someone checks the box, they should be charged $103.30. Stripe will then take $3.30 as their service fee, which would leave $100 as the total remaining.

      There’s no way to get around Stripe charging their merchant service fee. This is simply a way of giving the donor the option to pay a little extra to make sure the fee is covered and to make sure the organization can take advantage of the full donation amount.

      Joe

      Reply
      • Kate says

        May 3, 2016 at 12:18 am

        Many thanks for responding so quickly Joe.

        My apologies if I didn’t explain myself very well. Please let me clarify…

        I understand the calculation part and how to create it. The credit card is charged the example of $103.30 ($100 + Stripe Fee), but when you look in your Stripe account you’ll find that Stripe has calculated the fee on their end based on the total $103.30 amount and not the $100 donation.

        How do you tell Stripe to treat the extra $3.30 charge as a service fee? Otherwise, you will still be out of pocket the extra 2.9% charged on the $3.30.

        I hope that clears up my query.

        Thanks again!

        Reply
        • Joe Winter says

          May 3, 2016 at 1:14 am

          Think of it as reverse-engineering the service fee so that after the service fee, the organization receives $100. The service fee is based on a transaction of $103.30. From an accounting standpoint (and, to be sure, I am not an accountant, so it’s worth verifying this before taking action), the total donation is $103.30.

          Reply
  2. Georgia Gibbs says

    January 8, 2019 at 4:27 pm

    Hi Joe. This is fantastic. I have been fighting with this for two days. One addition I made, since I am using user entered amounts, is to use the Subtotal Merge Tag from https://gravitywiz.com/subtotal-merge-tag-for-calculations/ This replaced your (d) figure. In my other research, no one made mention of including subtraction of the amount and so I was always at double the intended donation. It was both an ‘aha’ and a ‘duh’ moment for me but this is how we learn. Again – Thank you!

    Reply
    • Georgia Gibbs says

      January 8, 2019 at 5:42 pm

      An issue when I went live with the subtotal. Ignore that element 🙂

      Reply
  3. Karen says

    November 24, 2020 at 8:10 am

    So, would there be any way to do this WITHOUT using a User Defined amount? We used to let the user define the amount of the donation, but that led to criminals using our form to test stolen credit card numbers with small purchases. So then we changed it to set amounts with the smallest being $25, and that seems to have deterred them. Yet we would like to offer users the option to cover the fees. Hmmmm. Would love to hear any ideas.

    Reply
    • Joe Winter says

      November 24, 2020 at 8:24 am

      Hi Karen — I would definitely recommend including a CAPTCHA field on your form, just for starters.

      Someone else mentioned Gravity Wiz earlier. If you have that or willing to purchase it, they have a Limit Submissions add-on that also works really well.

      Reply
      • Karen says

        November 24, 2020 at 8:32 am

        Yeah, we already had CAPTCHA in place. Not sure Limit Submissions would be that useful? (since they continually change their IPs and use a different email address each time). I think we have to stick with having set amounts (not user defined) for the donations. Just trying to figure out if there’s a way to still do the calculation. I’ll send in a Priority Support ticket to Gravity Forms and see what they say!

        Reply

Trackbacks

  1. How to Pass Transaction Fees to the Customer with Gravity Forms says:
    March 7, 2017 at 11:13 pm

    […] the comments section, someone asked me if this was possible. She had found the answer in Joe Winter’s Gravity Forms blog post before I had a chance to answer, but I’m posting an answer of my own anyway. To make the […]

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Subscribe to Joe's Blog

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Find Me Elsewhere

  • View joeventures’s profile on Facebook
  • View joeventures’s profile on Twitter
  • View nine.eye.joe’s profile on Instagram
  • View joeventures’s profile on LinkedIn
  • View Joeventures’s profile on GitHub
%d