I just finished adding Paddle for subscription billing on my product page... The actual api part 1/ create subscription, 2/ charge customer almost took maybe 30+ min. docs were decent .. not bad, standard REST, using claude it helped me..nothing crazy.
Then I got to webhooks/async and everything fell apart lol.. :)
first thing, their signature verification needs raw body. but my express app already parsing it to json by the time my webhook route gets it. so the signature never matches. I spent like 3 hours thinking my secret key was wrong before i realized the body was getting modified by middleware. I had to add that preserveRawBody thing on the json parser which only works for application/json content type btw
then event ordering hit me. The customer buys subscription, you expect subscription.created first right? nope. sometimes subscription.activated shows up before .created. My handler was doing a db insert on .created and update on .activated ..…