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.
Is it possible to have a paypal recurring payment based on a calculated field?Asked by Seastride on October 16, 2014 at 11:42 PM
The form pulls values from checkboxes, that add up to a total.
This total should then be billed as recurring in paypal. (similar to a subscription)
Yet, subscription only lets you do a fixed amount, not a calculated field. Help?
Unfortunately, it's not possible. Maybe, the source codes method and altering the properties of the recurring payment items. However, I haven't tried it yet.
Would it be possible, in lieue of using the payment wizard, to implement the raw source for a paypal button (see below) and then pass the CALCULATED field value to the AMOUNT variable in the paypal source? (right now you'll see the amount variable is a text field set to $5)
unhosted paypal code:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" >
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="U2ZRWJ4HXPV76">
<input type="hidden" name="lc" value="CA">
<input type="hidden" name="item_name" value="test">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="src" value="1">
<input type="hidden" name="a3" value="100.00">
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="W">
<input type="hidden" name="currency_code" value="CAD">
Amount: $<input type="text" maxlength="200" style="width:50px;" name="a3" value="5.00"> CAD<br />
<input type="hidden" name="bn" value="PP-SubscriptionsBF:btn_subscribeCC_LG.gif:NonHosted">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_subscribeCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
Yes, I think that's possible. We can use the Send Post method for that: http://www.jotform.com/help/213-Send-POST-Data-From-JotForm-Using-PHP-in-Custom-Thank-You-Page.
So...I think there are two redirects;
1. The form will be submitted with the calculation values on it pass to the thank you page with the Paypal codes in it.
2. Thank you page redirects to Paypal recurring payment page.
Let me try to create an example. Please stay tune :)
Ok! I have a success here.
1. I changed the form structure - using Calculation widget for the total: http://www.jotformpro.com/form/42894831323963.
2. Enabled Send Post Method to capture the Total calculation and forward it to the Paypal hosted subscription button:
3. Modified the Paypal button source and add some scripts to it: https://shots.jotform.com/welvin/php/paypal-recurring.txt
4. Uploaded this PHP file to our repository and use it as Thank You URL for the form: https://www.jotform.com/help/38-Redirecting-Users-to-a-Different-Page.
a. The form will be submitted - you will receive it via email and to your form submissions page.
b. The form will be redirected to the PHP page where Paypal source is there and post data script to capture the total amount from the form.
c. Then the Thank you PHP page redirects to Paypal for Payment.
Please submit to the form above to see the output. Let me know if you have any further questions.
PS. The scripts are ready so you can use it if you want to.
This worked! By the way, there are countless requests in the forums here to have a CUSTOM FIELD or INPUT FIELD associate with SUBSCRIPTIONS via the payment wizard.
This workaround addresses this issue and allows users to dynamically create the amount on their forms, then forward to paypal accordingly.
Outstanding support Welvin, thank you!
In my colleagues name, you are welcome. I am glad to hear that you have liked the solution provided by my colleague and I am sure that we will all be using it in the future where needed.
Do let us know if you have any further questions.