Is it possible to have a paypal recurring payment based on a calculated field?

  • Seastride
    Asked 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?

  • Welvin Support Team Lead
    Replied on October 17, 2014 at 8:28 AM

    Hi,

    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.

    Thank you!

  • Seastride
    Replied on October 17, 2014 at 11:28 AM

    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" target="_top">
    <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!0">
    <img alt="Is it possible to have a paypal recurring payment based on a calculated field? Image-1" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
    </form>

  • Welvin Support Team Lead
    Replied on October 17, 2014 at 11:51 AM

    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 :)

    Thank you!

  • Welvin Support Team Lead
    Replied on October 17, 2014 at 12:23 PM

    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:

    Is it possible to have a paypal recurring payment based on a calculated field? Image 1 Screenshot 30

     

    3. Modified the Paypal button source and add some scripts to it: https://shots.jotform.com/welvin/php/paypal-recurring.txt 

    Is it possible to have a paypal recurring payment based on a calculated field? Image 2 Screenshot 41

    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.

     

    So...

    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. 

    Thank you!

  • Seastride
    Replied on October 17, 2014 at 12:41 PM

    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!

  • Ben
    Replied on October 17, 2014 at 1:48 PM

    Hi,

    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.

    Best Regards,
    Ben

  • clonlaraJenn
    Replied on February 20, 2017 at 10:42 AM

    Hello,

    I see the original form was disabled. Could someone make a demo for me to see how this worked?

  • AIDAN
    Replied on February 20, 2017 at 12:12 PM

    I believe you have sent this request in a separate thread here: https://www.jotform.com/answers/1069634

    Thank you.

  • mitchellb
    Replied on April 14, 2017 at 10:50 AM

    Hello Valued JotForm Support Staff,

    Am really becoming fund of this service

    I see the original form was disabled. Could someone make a demo for me to see how this worked?

  • Support_Management Jotform Support
    Replied on April 14, 2017 at 12:12 PM

    @mitchellb - To give way to the OP, I moved your post to a separate thread https://www.jotform.com/answers/1119580 

    We'll have it addressed there shortly.