Trigger Webhooks *after* payment

Hi there,

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?

Help!

Hi @DianaHeuser. Can you explain how the payment flow works? Something like

  • form submitted
  • entry created
  • user redirected to third party payment site
  • after transaction is complete, redirect back to website
  • (at the same time maybe) payment status is updated on the entry

With an understanding of how the payment add-on works, we may be able to come up with something that is possible in Gravity Forms. Thank you.

Hi Chris,

We are using GravityForms to take the order, with Payfast.co.za’s gravityforms payment plugin (developed by them).

  1. Person completes the form

  2. Person clicks next and is taken to PayFast

  3. Person makes payment

  4. Person is returned to gravityforms

  5. Gravityforms then updates payment details

  6. 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.

Di

How is the payment gateway updating the payment status on the site? It seems that is a key to making this work.

When you load the gateway, it just asks for your merchant ID, Merchant Key, and Passphrase …

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.

Hope that helps,
Jamie