[{"data":1,"prerenderedAt":396},["ShallowReactive",2],{"blog-post-after-the-webhook-arrives-en":3},{"post":4,"related":128,"latest":193,"adjacent":194},{"id":5,"title":6,"authorImage":7,"authorLink":8,"authorName":9,"body":10,"cta":111,"date":116,"description":117,"draft":118,"excerpt":7,"extension":119,"image":7,"meta":120,"navigation":121,"path":122,"seo":123,"startHere":118,"stem":124,"tags":125,"__hash__":127},"posts\u002Fblog\u002Fafter-the-webhook-arrives.md","After the webhook arrives",null,"\u002Fabout","A. Lee",{"type":11,"value":12,"toc":101},"minimark",[13,22,25,30,33,39,43,46,49,55,59,62,65,68,72,75,78,81,85,88,91,95,98],[14,15,16,17,21],"p",{},"Most payment tutorials end in the same place: the provider posts an event, the application returns ",[18,19,20],"code",{},"200",", and a success message appears. That is a good first afternoon. It is not the part that keeps a store running.",[14,23,24],{},"The webhook is the easy part. Everything after it is the product.",[26,27,29],"h2",{"id":28},"the-happy-path-is-one-branch","The happy path is one branch",[14,31,32],{},"A payment integration has more events than the one in the tutorial. There are pending payments, failed payments, expired sessions, refunds, partial refunds, disputes, and events that arrive out of order.",[14,34,35,36,38],{},"Write down every event the provider can send before you write the handler. Then decide what your application should do with each one. For events you do not care about, log them and return ",[18,37,20],{}," deliberately. Do not let an unknown event crash the endpoint, because the provider will retry it.",[26,40,42],{"id":41},"duplicate-events-are-normal","Duplicate events are normal",[14,44,45],{},"Providers retry. Networks drop responses. A process can write the order and die before it acknowledges the event. The same payment can therefore arrive two or three times, and that is normal operation.",[14,47,48],{},"Store the provider's event ID with a unique constraint. Process the event once. Make the side effects idempotent as well: sending a receipt twice is still a bad customer experience, even if the database row is correct.",[14,50,51,52,54],{},"Return success only after the work is durable. A ",[18,53,20],{}," before the write is a promise you have not kept.",[26,56,58],{"id":57},"refunds-move-backwards","Refunds move backwards",[14,60,61],{},"A refund is not the absence of a payment. It is a new event with its own rules.",[14,63,64],{},"Decide what happens to access after a refund. Does the buyer keep the files? Does a course enrollment close? What about a partial refund, or a dispute that is later resolved in your favour? The answers are business decisions, but the code must make them explicit.",[14,66,67],{},"Record the reason and the provider reference. Future you will need both.",[26,69,71],{"id":70},"delivery-can-fail-after-payment","Delivery can fail after payment",[14,73,74],{},"A paid order can still fail to deliver. Email bounces. A storage link expires. A background worker runs out of retries.",[14,76,77],{},"Keep payment state and delivery state separate. \"Paid\" and \"delivered\" are different facts, and an order can be one without the other. Give delivery its own retry policy, its own failure reason, and a view that shows paid orders that have not reached the buyer.",[14,79,80],{},"The worst outcome is not a failed payment. It is a successful payment that nobody notices failed to deliver.",[26,82,84],{"id":83},"replay-the-last-month","Replay the last month",[14,86,87],{},"Build a way to replay events before you need it. Start with a dry run that reports what would change. Add an audit log that records who replayed what, and when.",[14,89,90],{},"Then test with real old events, not only fresh ones from the sandbox. Production traffic contains the odd ordering, the duplicate delivery, and the customer who paid twice that no test fixture predicted.",[26,92,94],{"id":93},"monitor-the-customer-outcome","Monitor the customer outcome",[14,96,97],{},"Dashboards full of CPU graphs will not tell you whether buyers are getting their files. Track the things a customer would notice: unfulfilled paid orders, failed deliveries, signature failures, and the age of the oldest unprocessed event.",[14,99,100],{},"Alert on those. The infrastructure can be healthy while the store is quietly broken.",{"title":102,"searchDepth":103,"depth":103,"links":104},"",2,[105,106,107,108,109,110],{"id":28,"depth":103,"text":29},{"id":41,"depth":103,"text":42},{"id":57,"depth":103,"text":58},{"id":70,"depth":103,"text":71},{"id":83,"depth":103,"text":84},{"id":93,"depth":103,"text":94},{"title":112,"description":113,"label":114,"sku":115},"Start from a billing seam that is already wired.","SubSaver ships Supabase auth, the database migration, and optional Stripe billing in a Next.js project.","Get SubSaver source — USD 49","templates-app-subsaver-source-usd","2026-11-21","Why webhook handling needs idempotency, refund paths, delivery retries, replay tools, and monitoring after the first successful payment.",false,"md",{},true,"\u002Fblog\u002Fafter-the-webhook-arrives",{"title":6,"description":117},"blog\u002Fafter-the-webhook-arrives",[126],"shipping and owning it","HXgtb5HVLuM_HpenPbAqkoFfD_IFVh9BQ8Knt8M8kkM",[129],{"id":130,"title":131,"authorImage":7,"authorLink":8,"authorName":9,"body":132,"cta":180,"date":185,"description":186,"draft":118,"excerpt":7,"extension":119,"image":7,"meta":187,"navigation":121,"path":188,"seo":189,"startHere":118,"stem":190,"tags":191,"__hash__":192},"posts\u002Fblog\u002Ffiles-not-subscriptions.md","The files you ship should be yours",{"type":11,"value":133,"toc":174},[134,137,141,144,147,151,154,157,161,164,167,171],[14,135,136],{},"Hand a client a site that depends on your monthly plan and you have handed them\na bill they cannot cancel. The code exists, but the permission to run it lives\nsomewhere else. Buying source once breaks that link.",[26,138,140],{"id":139},"what-one-payment-buys-you","What one payment buys you",[14,142,143],{},"The files arrive by email, and the same purchase stays available in the payment\nprovider's customer portal. If the laptop dies in three years, the download link\ncan be recovered without asking anyone for a favour.",[14,145,146],{},"There is no renewal date to remember and no account to create before checkout.\nOne invoice, one delivery, one folder on disk.",[26,148,150],{"id":149},"what-you-give-up","What you give up",[14,152,153],{},"You get the version you paid for, not a stream of updates. If the project\nchanges shape later, you either adapt it yourself or buy the newer release. That\nis the trade: a lower bill and full control, in exchange for owning the\nmaintenance.",[14,155,156],{},"Support does not disappear, but it is narrower. Broken files and a description\nthat does not match the delivery are covered by the refund window. A custom\nfeature request is not.",[26,158,160],{"id":159},"why-delivery-does-not-need-an-account","Why delivery does not need an account",[14,162,163],{},"Accounts make sense when a product has to check entitlement: a course that\nunlocks lessons, a licence that expires, updates tied to a purchase. A folder of\nsource does not need any of that. The download either worked or it did not.",[14,165,166],{},"When a product does need entitlement, the account should belong to that product,\nnot sit as a gate in front of the catalogue. Prices, file lists, and licence\nterms stay readable without signing in.",[26,168,170],{"id":169},"what-this-means-at-handover","What this means at handover",[14,172,173],{},"The client receives a deployable project, not a login on your card. You can\nchange the code, move it to their hosting, and stop paying for anything. That is\na smaller promise than a managed platform makes, and it is one the files can\nkeep.",{"title":102,"searchDepth":103,"depth":103,"links":175},[176,177,178,179],{"id":139,"depth":103,"text":140},{"id":149,"depth":103,"text":150},{"id":159,"depth":103,"text":160},{"id":169,"depth":103,"text":170},{"title":181,"description":182,"label":183,"sku":184},"Pay once. Keep the files.","Tokenmotion is one payment for the GSAP source. It arrives by email and stays available in the customer portal.","Get Tokenmotion source — USD 79","templates-kit-tokenmotion-source-usd","2026-11-09","What one-time purchase gives the buyer, what it gives up, and why delivery does not need an account.",{},"\u002Fblog\u002Ffiles-not-subscriptions",{"title":131,"description":186},"blog\u002Ffiles-not-subscriptions",[126],"2VjyAHtwyWYgg28zqHbLCApZtzT9uMkC1C0wzW9WWws",[],{"previous":195,"next":291},{"id":196,"title":197,"authorImage":7,"authorLink":8,"authorName":9,"body":198,"cta":277,"date":282,"description":283,"draft":118,"excerpt":7,"extension":119,"image":7,"meta":284,"navigation":121,"path":285,"seo":286,"startHere":118,"stem":287,"tags":288,"__hash__":290},"posts\u002Fblog\u002Fwhat-a-source-licence-keeps.md","What a source licence lets you keep",{"type":11,"value":199,"toc":269},[200,203,206,210,213,216,220,223,226,229,233,236,239,243,246,249,253,256,259,263,266],[14,201,202],{},"A source licence is easy to skip. The price is visible, the screenshots are visible, and the licence is a text file at the bottom of the repository. Then a client asks who owns the app, or a friend asks for a copy, and the text file becomes the most important part of the purchase.",[14,204,205],{},"Here is how to read one in practice. This is a guide, not the licence itself. The licence file in the repository is the binding text, and it wins over any summary on a sales page.",[26,207,209],{"id":208},"personal-and-client-work","Personal and client work",[14,211,212],{},"The first question is who may use the code. A typical source licence allows personal projects and work done for clients. That sounds broad until you ask the follow-up questions.",[14,214,215],{},"Can one purchase cover several clients, or one project per client? Can a teammate open the repository? Can a contractor edit it on your behalf? Read the answers before you plan the work, not after the invoice.",[26,217,219],{"id":218},"edits-and-deployment","Edits and deployment",[14,221,222],{},"A source licence should let you change the code and deploy the result. That is the point of buying source instead of a compiled app.",[14,224,225],{},"Check whether the licence asks you to keep a copyright notice, and where that notice needs to appear. Check whether deployment has limits: one production domain, one app, or one organisation. If the terms are silent, ask.",[14,227,228],{},"The ability to edit is not the same as the ability to relicense. You can change the code without claiming that you wrote the original.",[26,230,232],{"id":231},"what-resale-excludes","What resale excludes",[14,234,235],{},"\"No resale or redistribution\" usually means you cannot sell the source itself, publish it as a template, or hand it to another developer as a starting point.",[14,237,238],{},"It normally does not stop you from selling an application you built with it. The distinction is between the source as a product and the product you make from the source. If your plan depends on that line, get it in writing.",[26,240,242],{"id":241},"handover-without-ambiguity","Handover without ambiguity",[14,244,245],{},"Client work makes this concrete. If you build a site for a client and deploy it, the client receives the running product. If the client asks for the repository, you are now talking about redistributing source.",[14,247,248],{},"Read the licence before you promise that handover. A licence for client work does not automatically mean the client may keep and reuse the source. Put the answer in your own contract so nobody discovers the limit at the end of the project.",[26,250,252],{"id":251},"updates-and-support","Updates and support",[14,254,255],{},"A one-time purchase is not a subscription. You get the version you bought, and you can usually re-download the current version from the payment provider.",[14,257,258],{},"That is different from a promise of future updates, new framework versions, or custom development. Check what the maker commits to. A changelog and a support address are worth more than a vague promise of \"lifetime updates\".",[26,260,262],{"id":261},"keep-the-record","Keep the record",[14,264,265],{},"Save the licence file, the purchase receipt, the version you downloaded, and the date. If you hand the project to a client or a colleague, pass the licence terms with it.",[14,267,268],{},"A licence is not paperwork around the work. It is part of what you bought, and it is the part that lets you keep using the work with a clear conscience.",{"title":102,"searchDepth":103,"depth":103,"links":270},[271,272,273,274,275,276],{"id":208,"depth":103,"text":209},{"id":218,"depth":103,"text":219},{"id":231,"depth":103,"text":232},{"id":241,"depth":103,"text":242},{"id":251,"depth":103,"text":252},{"id":261,"depth":103,"text":262},{"title":278,"description":279,"label":280,"sku":281},"Know the licence before you buy.","Klimt Layers includes the same plain-language licence as every source project: personal and client projects, edit and deploy, no resale.","Get Klimt Layers source — USD 79","templates-kit-klimtlayer-source-usd","2026-11-20","How to read a source licence in practice: personal and client work, edits and deployment, resale limits, handover, updates, and the record you should keep.",{},"\u002Fblog\u002Fwhat-a-source-licence-keeps",{"title":197,"description":283},"blog\u002Fwhat-a-source-licence-keeps",[289],"choosing a codebase","-f9ZcTnjLr1rGCgu-auFclh2UhFYcPq9Cvc5FI9FW-g",{"id":292,"title":293,"authorImage":7,"authorLink":8,"authorName":9,"body":294,"cta":382,"date":387,"description":388,"draft":118,"excerpt":7,"extension":119,"image":7,"meta":389,"navigation":121,"path":390,"seo":391,"startHere":118,"stem":392,"tags":393,"__hash__":395},"posts\u002Fblog\u002Freading-order-for-inherited-code.md","A reading order for inherited code",{"type":11,"value":295,"toc":374},[296,299,302,306,309,312,315,319,322,325,328,332,335,338,341,345,348,351,354,358,361,364,368,371],[14,297,298],{},"Inheriting a codebase feels like being handed a novel with the first hundred pages missing. The instinct is to start reading from the beginning and hope the plot returns. That rarely works.",[14,300,301],{},"A better approach is to read for structure first. The goal is not to know every file. The goal is to build a map good enough to make one safe change, then another.",[26,303,305],{"id":304},"run-it-before-you-read-it","Run it before you read it",[14,307,308],{},"Get the application running before you form an opinion about the code. Follow the setup notes, or write them if they are missing. Open every screen. Click the main flow. Watch the logs while you do it.",[14,310,311],{},"Runtime behaviour narrows the search space. If the export button calls a queue, you know where to look. If the settings page never writes anything, you have found a question worth asking before you touch the settings code.",[14,313,314],{},"Write down every step that failed. Those failures are the first entries in your map.",[26,316,318],{"id":317},"follow-one-request","Follow one request",[14,320,321],{},"Choose one user action: sign in, save a record, start a checkout, load a report. Follow it from the click to the database and back.",[14,323,324],{},"At each boundary, write down the name of the function, the module, or the service that hands work to the next layer. You do not need to understand the implementation yet. You need the shape of the path.",[14,326,327],{},"When the path is clear, repeat it once. Two paths that share a boundary tell you where the application's real seams are.",[26,329,331],{"id":330},"find-where-money-moves","Find where money moves",[14,333,334],{},"In a commercial product, the money path deserves its own reading. Find the checkout, the payment provider call, the webhook handler, and the code that grants access after payment.",[14,336,337],{},"Then read the failure branches. What happens when the provider times out? When the same event arrives twice? When a refund lands after the file was delivered? These paths are usually shorter than the feature code and far more expensive to get wrong.",[14,339,340],{},"If you cannot find the money path, stop and find it before you change anything else.",[26,342,344],{"id":343},"read-the-tests-that-fail","Read the tests that fail",[14,346,347],{},"Do not read the whole test suite. Run it. Failures show you where the repository's assumptions and its current behaviour have drifted apart.",[14,349,350],{},"Then read a few tests that pass. A test that asserts a real outcome is documentation you can trust. A test that only checks that a function was called is a rumour.",[14,352,353],{},"If the suite is green but the application is broken, the tests are measuring the wrong thing. That is a finding, not a nuisance.",[26,355,357],{"id":356},"make-a-deletion-list","Make a deletion list",[14,359,360],{},"Before you add anything, list what can go: dead feature flags, unused dependencies, duplicate helpers, commented-out code, screens nobody can reach.",[14,362,363],{},"Deleting is the cheapest way to understand a system. Every removed path is one less thing to keep in your head. Keep the list visible and remove one item at a time, with a test or a manual check after each change.",[26,365,367],{"id":366},"write-the-map-you-wish-you-had","Write the map you wish you had",[14,369,370],{},"Keep one page in the repository: entry points, background jobs, external services, data stores, scheduled tasks, and the person or team that owns each one. Add the commands that actually work.",[14,372,373],{},"The next person may be you in a year. A good map is the kindest thing you can leave behind.",{"title":102,"searchDepth":103,"depth":103,"links":375},[376,377,378,379,380,381],{"id":304,"depth":103,"text":305},{"id":317,"depth":103,"text":318},{"id":330,"depth":103,"text":331},{"id":343,"depth":103,"text":344},{"id":356,"depth":103,"text":357},{"id":366,"depth":103,"text":367},{"title":383,"description":384,"label":385,"sku":386},"Practise on a codebase you can keep.","GutSync's source is free: a Flutter app with local storage, food data, and platform shells. Read it end to end.","Get GutSync source — free","templates-app-gutsynced-source-usd","2026-11-22","A practical sequence for taking over an unfamiliar codebase: run it, follow one request, trace the money, read the failing tests, and make a deletion list.",{},"\u002Fblog\u002Freading-order-for-inherited-code",{"title":293,"description":388},"blog\u002Freading-order-for-inherited-code",[394],"taking over code","E3HlHd-76fp_VImkKVshJVhgfPshE7KCxrk4GD8wQik",1795791709968]