PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Pass data from form to external URL via a Web Service call

  1. daniebroz
    Member

    I need to create a form that collects data and then will pass it on to this Web Service
    https://weblogin.newbenefits.com/WLAuthNET/WLAuthNET.asmx (only using the CreditCharge call)

    I have started creating the form http://www.fundraisingmidwest.com/?gf_page=preview&id=9
    but need to figure out how to pass the data.

    I am still new to web service calls and have been researching, it seems that it can be accomplished using Gravity Forms but the best approach is where I am stuck.

    I came across this post http://www.gravityhelp.com/forums/topic/cant-find-any-instructions-to-post-form-data-to-external-url which is helpful but I am still learning all of this and have some questions:

    I think I will need to create additional PHP to POST the data. But I might be making it more complicated. Would it be possible to just use the Confirmation redirect?

    I have also read another post on using a before Submission Hook. It will be collecting credit card information which I really do not want them stored on my site I would rather it just be passed through.

    Thoughts? Your help is greatly appreciated!

    Posted 11 years ago on Tuesday November 6, 2012 | Permalink
  2. David Peralty

    Have you had a look at the following?
    http://www.gravityhelp.com/documentation/page/Gform_after_submission

    This might help you pass details to your script.

    Posted 11 years ago on Tuesday November 6, 2012 | Permalink
  3. daniebroz
    Member

    Yes, I did look at that post also. So if I am understanding it correctly it would look like:

    'first_name' => $entry['1.3'], - the 1.3 is the input name of the field on the form?

    Would I replace this:
    $response = $request->post($post_url, array('body' => $body));

    with: $response = $request->post($post_url, array('CreditCharge' => $body));

    Posted 11 years ago on Tuesday November 6, 2012 | Permalink
  4. daniebroz
    Member

    Also do I place this code in my themes functions.php?

    Posted 11 years ago on Tuesday November 6, 2012 | Permalink
  5. daniebroz
    Member

    this is what I created to test http://pastie.org/5336518.js

    when I inserted into my functions.php, I get an error

    Posted 11 years ago on Tuesday November 6, 2012 | Permalink
  6. David Peralty

    It does go into your theme's functions.php file, and what error are you getting when you use this?

    Posted 11 years ago on Tuesday November 6, 2012 | Permalink
  7. daniebroz
    Member

    It is working now, thanks.

    How would I add the entry ID to this code to send as a unique invoice number. After reading some post on creating unique number is seems that would be easiest.

    Posted 11 years ago on Tuesday November 6, 2012 | Permalink
  8. daniebroz
    Member

    I figured out the unique numbering by using this post
    http://www.gravityhelp.com/forums/topic/guid-entry-id#post-1491

    I am writing the code for the gform_after_submission
    I have a product field that uses radio button options, how can I pull the chosen options Price into my
    $body = array (
    'Amount' => $entry{}

    It seems I need a if...else statement. Will this accomplish what I need? http://pastie.org/5337585

    Posted 11 years ago on Tuesday November 6, 2012 | Permalink
  9. daniebroz
    Member

    I figured out another way to approach this by using the product fielid instead. Thanks for your hellp!

    Posted 11 years ago on Wednesday November 7, 2012 | Permalink

This topic has been resolved and has been closed to new replies.