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

Parsing through XML Response #14

Closed ghost closed 9 years ago

ghost commented 10 years ago

Hello. I am using your plugin to connect to this API function: https://support.getcake.com/hc/en-us/articles/200705640--Signup-Affiliate-V4-Admin

The response after form submission is an XML response (Error or Successful). Towards the bottom they have an example of a successful XML response.

How would I go about not submitting the form if response has an error and return back to the form but if successful go to confirmation page. I was reading the hook functions but was confused how to go about it. Thanks Zaus.

zaus commented 10 years ago

To determine success/failure, you would add something from the success response to the "Success Condition" field -- namely, Affiliate Added Successfully.

To prevent form submission you would need to hook to Forms3rdPartyIntegration_remote_failure and return a modified $form object, depending on whether you're using CF7 or GF. You can see how I hook there for GF, for example to get an idea.

zaus commented 10 years ago

Did this work for you?

zaus commented 9 years ago

Assuming complete.