How do I handle webhooks?

I have created a webhook alert on ‘payment succesful’ within Paddle.
The webhook is directed to my remote wappler site, I just get the contents of the page returned to the paddle webhook testing api??

I have created an api under webhook server actions
To be honest I don’t have a clue as to how to process the posted webhook.

Any help would be gratefully recieved

I’m only familiar with the pre-made webhooks components for stripe made by wappler so I’m not sure I can help you out here but have you looked at the below post? The webhook “manual” setup is well explained.

1 Like

Webhooks are very specific to the service that calls them.

We currently support Stripe webhooks only officially.

I use webhooks with Postmark. I made them before Wappler had webhooks.

I just created a server action with a username/password protection and gave the path to the server action and the login details to Postmark. It then randomly calls the server action when it has something to tell my app, and

:tada: Hey Presto :tada:

My app processes that information.

Works like a dream!

1 Like

Hi George,
Thanks for you reply…
I have read the post Fred_K suggested, which describes how a webhook from stripe is handled.

The problem with Stripe is that it calculates the tax due for SaaS but expects you to register and pay tax due to all the different countries/states etc… Don’t know about you but I would be out of business in weeks if I had to adminster that.

That’s why I and many other developers use Paddle. Paddle calculates the tax due in every country/state you sell to, adds the relevant tax and pays it to the relevant tax authority…
All I have to do is concentrate on my business and not act as an unpaid tax collector.

So now I’ve stated the case for the value and addition of Paddle webhooks I will get to the point :slight_smile:

  1. I have created global variables (not whether sure this is specific to Stripe only):
    image

  2. I have created the endpoint:

  3. Using the Paddle sandbox (I get the error message ‘No action found for handler’):

I so hope you or someone can give a solution to this, thank you.

This provokes a follow-up question… “What is the difference between API and Webhooks in Server Connect?”

Webhooks are called with specific signed payload that can only be read by provider secret key.

That to ensure that your webhook is really called by the service and not a hacker with fake post.

Further the principles and the technology are the same as with API endpoints. With the API you are only self responsible for security.

Thanks @George. What about Custom Webhooks?

In the test url add an api endpoint from wappler.

i.e. https://mywebsite.com/api/paddle/test

Then create a server workflow(aka server connect action) named test in a folder named paddle.

Then do whatever you need to do. The data sent by paddle will be available in the $_POST variable.

1 Like

I’ve pretty much finished setting up something quite similar with Stripe Connect. VAT taxes won’t be our responsibility, each stripe account connected to our platform will have to handle their proceeds, including tax. The only detail that may differ with Paddle is that Stripe does not do the tax payout automatically I believe but it looks like it does some reporting, including to the tax authority of the relevant countries… provided the stripe connected account has a VAT number.

Apologies JonL, I don’t understand what you mean, could explain in a bit more detail?
Thanks

Yeah. No problem. But what exactly do you not understand?

I am on vacation away from my computer so I am limited to my mobile phone. I can’t send screenshots or anything.

HI jonL. Hope your enjoying your holiday, :sunglasses:

really embarassed to say, as a new-comer to wappler, I didn’t understand in practical terms what any of it meant.

Screen shots of the server side and client side structure would be helpful when you get back from your holidays…In the mean time have a great time… Really appreciate your help so far Jon, thankyou

So I think @jonl was suggesting the following:

Set up a server action (API) folder called paddle and add an action file to test with:


accessible at (this is what you would give Paddle as the webhook address - obviously use your domain)

You can use this API file, like you would receiving form data from your own site, accessing the $_POST variables. You will need to know the data structure that Paddle send but you can access items really easily

e.g. if they send in item called ‘transaction_id’ you would access it as $_POST.transaction_id in DB insert/update queries or other server action steps. If the item has a space in the name, just use square bracket referencing instead i.e. if the transaction ID data item was called ‘transaction id’ you would use $_POST[‘transaction id’]

I hope this helps

3 Likes

That’s great thanks bpj all working fine…really appreciate your help guys…

1 Like

@jonl can get on with enjoying his holiday

3 Likes