What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    How to calculate a total amount using the Driving Distance widget and Stripe Integration?

    Asked by TBSE on January 04, 2017 at 02:42 PM

    Hello,

    On my website - www.tbsportsentertainment.com/ride, you will see a Jotform which has a "Schedule Your Ride" section. This is the Driving Distance widget.

    My developer and I wanted some tips on integrating that widget within JotForm to STRIPE payments, based on location miles.

    What I want to do is to auto-populate a STRIPE button with a payment amount, based on the number of miles it takes to travel from distance A to B (Distances and locations entered into the Driving Distance widget by the user).

    For instance, we will use $2 / mile.

    When a user enters two destinations within the Driving Distance widget, the miles for that distance come out to be 10 miles (Or $20 per the calculations).

    What would you recommend as to how my developer can integrate Stripe for payment and include the Driving Distance widget, based on the use location selections and the miles presented?

     

    Thanks for your help and I will forward the information to my developer.

     

    George

    Page URL:
    https://tbsportsentertainment.com/ride

  • Profile Image
    JotForm Support

    Answered by Kevin_G on January 04, 2017 at 04:51 PM

    This is possible to do since the driving distance widget will return the distance as a value that can be used in calculations, you could get it and then process it as you need. To get more info about calculations, please check this guide: How-to-Perform-Form-Calculation-Using-a-Widget

    Once you have the calculation you will need to change the current payment type you're using in Stripe and switch to collect custom amounts, the custom amount will then be captured from the calculation widget that you will add. Here's  also a guide about how to pass a calculated value to the payment field: How-to-Pass-a-Calculation-to-a-Payment-Field

    If you still would need to have the current options you have in your payment section "Prime ($21.99 for each month.) and Platinum ($34.99 for each month.)" then you could add them with a drop down and assign calculations values to each option that will be the equivalent to the price. 

    This guide will help you to add a calculation value to options in a field: How-to-Assign-Calculation-Value

    If you have any question, please let us know.