Adding Payment Processing Fee to Gravity Forms Checkout

  |  by Chris Eggleston

THIS POST MAY CONTAIN AFFILIATE LINKS. PLEASE READ OUR DISCLAIMER FOR MORE INFO.

If you are using Gravity Forms to collect payment for a service or to sell a product, or collect donations, you know that the payment processors, such as Stripe, Square, and PayPal, all charge a fee. That fee is usually somewhere around 2.9% +.30.

Unfortunately, we can’t make the fees go away, but if you’d like to pass that fee on to your customer or donator, you can do so with a product field and a simple formula.

Setting up Your Form

The first step is to add another product field to your form. However, this field needs to be set to the Calculation field type:

Once the field is ready, you will need to add the formula below to the product field:

( {Product Field:ID} + .3 ) / (1 - .029) - {Product Field:ID}

You will need to switch out the {Product Field:ID} merge tag with your actual product field price merge tag:

Once the form is setup and saved, you will be able to pass the processing fee along to the customer.

The best part about using this specific formula is that the outcome is a perfect price split, your original product price and the processing fee, as shown in the Stripe payment details below:

FAQs

What if you have multiple products?

You can add multiple products to the processing fee calculation formula. As demonstrated here:

What if you have Products with Quantity Fields?

You can still make this work; you will need to get a little more complex with the formula.

Let’s say you have two products with a quantity field; the formula would look like this:

( ({Product 1(Price):1.2}*{Product 1(Quantity):1.3}) + ({Product 2(Price):2.2}*{Product 2(Quantity):2.3}) + .3 ) / (1 - .029) - ( ({Product 1(Price):1.2}*{Product 1(Quantity):1.3}) + ({Product 2(Price):2.2}*{Product 2(Quantity):2.3}) )

In this calculation, you multiply the product price by the quantity and then add the total of those two fields together. The rest of the formula is the same.

I recommend you use the merge tag selector when creating your formula so that you can get the right field element. You probably noticed that the ID looks different than if you had just a standard product field.

Can you give the user the option to cover the processing fee?

Sure! If you add a radio button field to the form asking the user if they want to cover the fees and add conditional logic to the processing fee product to show/hide it depending on the users selection.

Shown here:

Need More Help?

If you still need help, feel free to use the comments or chat options below.

If you have an active Gravity Forms license, you can also open a support ticket here.

Photo of author
About the Author
Chris Eggleston
Chris is not just a Gravity Forms enthusiast; he's a dedicated father and loving husband. As the proud owner of WP Mantis, he's on a mission to simplify the WordPress experience for site owners. He brings a unique perspective to the Gravity Forms community.

Advertisement

0 0 votes
Article Rating
Subscribe
Notify of
guest

18 Comments
Inline Feedbacks
View all comments
Bekee
12 days ago

Thank you so much for this article! i was not sure how to accomplish this and it helped a lot. Cheers!

Charles
Charles
26 days ago

Hi, I would like to deduct an amount from the sub total if the sub total is above a minimum amount, I kind of understand how the calculations part works but how do I affect the changes to the stripe payment?

Bruce
Bruce
6 months ago

If you add the fee onto the donation amount, wouldn’t PayPal just charge a fee on the increased amount?

Last edited 6 months ago by Bruce
N D
N D
1 year ago

I am using this for an event registration. It is possible for certain users to select options that would reduce their price to 0, letting them register for free. In this case, their subtotal is $0 but, due to the processing fee calculation that is added on, it still charges them a fee of $0.31. How can I remedy this? I thought the answer may lie in conditional logic somehow, but can’t figure it out since I can only select one “total” field for the payment amount in the Stripe feed setup.

N D
N D
Reply to  Chris Eggleston
1 year ago

I appreciate your response. I will export and email the file. Thank you!

Tom
Tom
1 year ago

Hi Chris,

I wondered how you handle the two types of Stripe fees? For us in AU and I think elsewhere Stripe has the below:

1.75% + A$0.30 for Domestic cards
2.9% + A$0.30 for International cards

I can see from your calcs. above it looks like you only do one calculation?

Any response would be greatly appreciated!

James P
Reply to  Chris Eggleston
1 year ago

Cheers I used this on a project today Chris!

Having the same issue as Tom, though being in Australia.

I wonder if you can block international cards in Stripe?

Most people use Visa or Mastercard in Australia for small business so if you can reject other cards that would work.

I think the fees are less for normal debt cards vs credit cards? which needs to be taken into account if so.

Probably have to ask the customer directly what card do you have with a drop down. A lot of logic but doable. If anyone has a work around keen to hear.

Last edited 1 year ago by James P
Steve
1 year ago

Can the Quantity: field on a Product be figured into the total? On my form, the page is letting parents order a year book — or a few year books, depending on whether they have a couple of kids in that school. It shows only the $1.35 for a single purchase — nothing changes when the Quantity is increased — I’d imagine there would be a “times” component added to the snippet?

Hannah
Hannah
1 year ago

Hey, do you think this fee recovery solution would work with recurring donations?

And doesn’t it require 2 different Stripe feeds, one with fees and one without?

Referencing “How to Pass Payment Transaction Fees to the Customer” by mr. technique

Hannah
Hannah
Reply to  Chris Eggleston
1 year ago

Thank you for the fast reply! Much appreciated.

ren
ren
2 years ago

Hi there, how do you do this when you have multiple products? There’s no way I can find to do the calculation off a total field…