I’m busy setting up a sign-up form with payment (using a third-party payment provider), and I have installed the webhook api - the problem I am having is that the webhook is triggering when the form is passed through to the payment processor (in this case payfast - wanting to later move to Stripe).
Is there some magic I can use to delay the webhook until after successful payment?
Currently, the system fires off the webhook before payment, sending the information to integrately.com (something like Zapier), which then creates a user account on our portal. We only want user accounts created who have paid their subscription fee.
Is there some fancy code I can slip into function.php that will do this for me? Or is there maybe a third-party Webhook Add-On that can do this?
Failing that - an entrepreneuring dev who wants to create a plugin that does that?
We are using GravityForms to take the order, with Payfast.co.za’s gravityforms payment plugin (developed by them).
Person completes the form
Person clicks next and is taken to PayFast
Person makes payment
Person is returned to gravityforms
Gravityforms then updates payment details
Gravityforms sends person to thank you page
The problem I am having is that the GravityForms Webhooks API is firing after Step 1, sending the data to our server to create a user account. We only want it to do that once we receive payment confirmation (i.e. after Step 5).
We just don’t know how to do that.
We are looking at shifting over to Stripe, but would possibly face the same problem. We only want Webhooks and Notifications to fire after payment confirmation.
Whether you make that switch or not, I would encourage you to look at how Gravity Flow could make your workflow easy to setup and consistent to execute in the order you are hoping for. Gravity Flow workflow hooks in after the confirmation screen and any pre-configured feeds are executed. So by moving to an Gravity Flow outgoing webhook step you can ensure it runs after successfully processing Stripe feed or any post-submit feed. We also have an extension that works with the Gravity Flow Stripe add-on to allow for stripe payment actions to happen within the workflow if that makes more sense for your use case.
If you aren’t ready to switch to Stripe, our workflow step framework docs might be ones you (or Payfast) want to look at to be able to provide a custom step type for similar workflow-based execution.