zaus / forms-3rdparty-integration

Wordpress Plugin - Forms 3rdparty Integration - a plugin to help integrate 3rdparty services with common WP Forms plugins like Contact Form 7 and Gravity Forms
http://wordpress.org/plugins/forms-3rdparty-integration/
47 stars 14 forks source link

pardot form handler error (too many redirects) #78

Closed emanuedh closed 7 years ago

emanuedh commented 7 years ago

i am using 3rd party services plug in for wordpress to link contact form 7 forms to pardot via form handler. I have gotten the form handler to accept the information successfully when i am only mapping the email field in 3rd party services over to pardot (pardot form handler has more than one field mapped), but when I start trying to map multiple fields over in 3rd party services (using the correct id tags for both cf7 and pardot), i get the debugger message saying "array: too many redirects". what is the root of this issue and how do i solve it?

Sample debugger error message below:

here was an error when trying to integrate with the 3rd party service {Pardot (NADA)} (http://www2.pearlsolutions.com/l/62072/2017-01-19/3cklld).

FORM Title: NADA 2017 Landing Page Form Intended Recipient: hillis@pearlsolutions.com Source: http://pearlsolutions.staging.wpengine.com/nada2017/

SUBMISSION Array ( [timeout] => 10 [body] => Array ( [email] => b@bu.com [first_name] => Bruce [last_name] => Thom [job_title] => GT [company] => bruce gt [Cell_Number] => 222 222 1111 )

)

RAW RESPONSE Array ( [safe_message] => error object [object] => WP_Error Object ( [errors] => Array ( [http_request_failed] => Array ( [0] => Too many redirects )

           )

       [error_data] => Array
           (
           )

   )

)

wmlsummers commented 7 years ago

I have the same issue but I cannot even connect just "email". Were you able to fix this issue? I would love the help.

zaus commented 7 years ago

Duplicate of #73, but more detail here.

I can't reproduce as I don't have a Pardot to test against (or time, for that matter). I think I commented more about this in the WP forum too...

zaus commented 7 years ago

Also reported here: https://wordpress.org/support/topic/form-being-submitted-multiple-times/ https://wordpress.org/support/topic/repeated-results-in-pardot/

zaus commented 7 years ago

May be similar to #69?

mawint commented 7 years ago

I was able to solve this with doing a normal cURL post instead of using wp_remote_post.

Updated in forms-3rdparty-integration.php on about line 600. I know this breaks some of the applying of filters for the functions.php file though but in our case we weren't using them.

I would love to see an update to the plugin that solves this problem. Here is what I updated the function with.

$curl_opts = array( CURLOPT_URL => $service['url'].'/?'.http_build_query($post_args['body']), CURLOPT_CONNECTTIMEOUT => 5, CURLOPT_TIMEOUT => $post_args['timeout'], CURLOPT_POST => 1, //CURLOPT_PROTOCOLS => CURLPROTO_HTTPS, CURLOPT_SSL_VERIFYHOST => 2, CURLOPT_RETURNTRANSFER => 1 );

$ch = curl_init(); curl_setopt_array($ch, $curl_opts); $response = curl_exec($ch); curl_close($ch);

zaus commented 7 years ago

I've come across some posts saying wp_remote_post (the HTTP api) is kind of buggy, so good to know cURL works.

But you shouldn't edit my plugin code, but instead use the "more appropriate" bypass hook mentioned in the readme: https://github.com/zaus/forms-3rdparty-integration#how-do-i-make-a-get-request-instead-of-post . You'd put your curl code there instead of the wp_remote_get in the example, and set the bypass to the $response.

zaus commented 7 years ago

I'm closing this as it sounds like weird WP/hosting issue rather than a problem with the plugin.

leendertvb commented 7 years ago

I managed to resolve this issue by matching all (required) fields in the 3rd-party-plugin with the fields as defined in the form handler of Pardot. If there is a mismatch, it will throw the error of “too many redirects”.

Hope this helps anyone.

hirewebsolutions commented 6 years ago

Hello,

You can see bellow form integration with pardot add-ons:

Contact Form 7 - Pardot Integration: https://codecanyon.net/item/contact-form-7-pardot-integration/22240057

Gravity Forms - Pardot Integration: https://codecanyon.net/item/gravity-forms-pardot-integration/22240088

Ninja Forms - Pardot Integration: https://codecanyon.net/item/ninja-forms-pardot-integration/22241224

WPForms - Pardot Integration: https://codecanyon.net/item/wpforms-pardot-integration/22241369

Let us know if any concerns! Thanks

zaus commented 5 years ago

Hello,

You can see bellow form integration with pardot add-ons: ... Let us know if any concerns! Thanks

@hirewebsolutions are you the author/seller of those plugins? because it's kind of rude to do that on someone else's plugin, especially one that does it for free. if you were linking your plugins because they offer development assistance (like, a working example we can pattern after) then it'd be different.