We UC
Back to blog
·7 min read·We UC Team

Can someone audit code written with Cursor or Claude before I take payments through it?

Yes. Five things a payment audit of AI-written code checks before real money flows: keys, webhook signatures, duplicate events, prices and the switch from test to live.

Can someone audit code written with Cursor or Claude before I take payments through it?

Yes, a developer who did not write the code can audit it before you take payments, and the best time to do it is before the first live card, not after the first dispute. For an app written with Cursor, Claude Code or a similar tool, the audit reads the code and the hosting settings and checks five things: where the payment keys are kept, whether payment messages are verified, whether the same message can be processed twice, whether the price is decided on the server, and whether the switch from test to live was done properly. At We UC this is the payments part of our Rescue audit, which is £2,500 + VAT, fixed.

Why does payment code need its own check?

Payment code needs its own check because it can look finished in testing and still be wrong in ways that only appear with real money. In test mode nothing is charged and nobody is trying to cheat the app, so a flow that skips a safety step works perfectly. A checkout that completes on screen tells you little about the steps that never show on screen, such as verifying who sent a message, and those are the steps worth reading the code for. That says nothing about the tool being poor. The same gap appears in code written by hand, which is why payment providers publish checklists for it.

Where should the payment keys be kept?

The secret keys should live in your host's secret settings, on the server, and never in the code or in files sent to the browser. Stripe's API keys guide says only publishable keys (the ones starting pk_) are safe to expose, and that you should not put keys "in source code or configuration files checked into version control." A secret key (starting sk_) has, in Stripe's words, "unrestricted permissions on all Stripe APIs", and Stripe recommends restricted keys (starting rk_) for server code so that a leaked key can do less damage.

The check is practical. Search the repository, including its history, for strings starting sk_live_, and look at what the browser downloads. If a secret key was ever committed, treat it as exposed and rotate it, because deleting the file does not remove it from the history.

Does the app confirm that payment messages really come from the provider?

Your app should check that every payment message really comes from Stripe before it acts on it, and this is the first thing we would look at. When a customer pays, Stripe tells your app by sending a webhook, which is an automatic message to a web address on your server. Stripe's webhook documentation says that without verification "an attacker could send fake webhook events to your endpoint to trigger actions like fulfilling orders, granting account access, or modifying records." Every event carries a signature in a Stripe-Signature header, and your server should check it against the endpoint's signing secret before acting. The signing secret is a separate thing from your API keys, so it needs to be stored with the same care.

Ask your developer one question: "Do we verify the signature on every webhook?" If the answer is a pause, the audit should start there.

Can the same payment be processed twice?

The same payment can be processed twice unless the code records which Stripe events it has already handled. Stripe's documentation says that "webhook endpoints might occasionally receive the same event more than once", and that you can guard against this "by logging the event IDs you've processed, and then not processing already-logged events." It also warns that Stripe "doesn't guarantee the delivery of events in the order that they're generated." For a business that means a customer could be sent two confirmation emails, two licence keys or two bookings for one payment, and an app that assumes events arrive once and in order will eventually do something wrong with real traffic. An audit looks for a record of processed event IDs and for logic that does not depend on arrival order.

Is the price decided on the server?

The price of an order should be decided on your server, because anything the browser sends can be changed by the person using it. If the checkout page tells the server "charge £10" and the server believes it, a customer who edits the request can pay what they like. The safer design is for the browser to send only which product was chosen and for the server to look up the price. This is our reading of how a safe checkout works rather than a rule from one provider's page, and it is quick to confirm in the code: find where the amount is set and see where it comes from.

Was the switch from test to live done properly?

Moving a payment integration from test to live needs more than swapping one key, because test and live mode are separate worlds. Stripe's keys guide says each mode has its own keys, that objects in one mode are not accessible from the other, and that webhook endpoints need their new signing secret when you go live. It adds that switching keys "is only one step" and points to its own go-live checklist. One leftover to look for is a live key in the app and a test-mode signing secret on the webhook, so payments are taken and the app never hears about them.

What does the audit actually produce?

The Rescue audit produces a written report and a priced plan, followed by a walkthrough call. Our Rescue audit covers security, data, hosting, code, payments and integrations, and running costs. We need read access to the code and hosting, and we change nothing while we audit. The fee is deducted from the first phase if you go ahead with us on the fix, and the report is yours either way, so you can hand it to another team. Fixes are done in fixed-price phases with urgent items first, and an engineer reviews every change before it ships. We run Olatti, Quenta and Scheduler in production ourselves, so we work this way on software that has paying customers. For the wider security picture, our guide on how to tell whether a vibe-coded app is secure covers access, secrets, backups and logging, and what a code audit costs for an AI-built app explains the price.

Common questions

Do I need an audit if I use Stripe Checkout and never touch card numbers?

Card numbers staying with the provider is a real protection, and it does not remove the checks above. The keys, the webhook signature, the duplicate events and the live switch all still sit in your code.

Is it too late if I am already taking payments?

No. The audit works on a live app, and it changes nothing while it runs. If a key was exposed it can be rotated, and the other gaps can be closed in order of urgency.

Will you tell me to throw the app away?

Usually a lot more can be kept than people fear. The report sets out what to fix, what to rebuild and what to leave, and our article on fixing or rebuilding a vibe-coded app explains how we weigh it.

If real customers are about to pay through something Cursor or Claude helped you build, you can book a Rescue audit, or tell us what you have and we'll say whether an audit is the right first step.