paypal-doctor
Source

Finds PayPal integration bugs, writes the fix, and proves it against the sandbox.

A patch only counts if the bug shows up in a scripted checkout before it, and is gone after it. Here are all 11 bugs from one run.

Before the patch 11 of 11 bugs showed up

After the patch 11 of 11 gone

This page is a read-only recording of one real run, from November 5, 2026, on a demo shop with bugs seeded on purpose. Nothing runs here. Each square is one bug: point at one, or tap it, to see what was measured.

Checked:
Before: After:

Three of the 11, up close

These are the recorded values from this run: the same scripted checkout, before the patch and after it.

The one-cent cart

The shop added up its total from the prices the browser sent, so anyone could edit a price and pay a cent.

See this proof in the results

What the shop asked PayPal to charge, when the browser priced a $18.00 mug at $0.01

Before the patch$0.01The price the browser sent
After the patch$18.00The price in the shop's own catalog

The forged webhook

The shop believed any JSON posted to its webhook URL. A fake payment event was enough to mark an order paid.

See this proof in the results

The order status after a forged payment event

Before the patchpaidThe webhook answered HTTP 200
After the patchcreatedThe webhook answered HTTP 400, after PayPal's sandbox answered FAILURE

A correctly signed event is still accepted. Only PayPal can sign one, so that part of the check runs on a local mock.

The lost capture response

PayPal takes the money, the response gets lost on the way back, and the buyer retries. The tool drops that response on purpose to test this.

See this proof in the results

The HTTP status PayPal answered the retry with

Before the patch422ORDER_ALREADY_CAPTURED, and the shop's order stays created, unpaid
After the patch200The retry gets the original capture back, and the shop's order says paid

How it gets there

  1. Find

    Detectors read the structure of the code for 9 rules, each tied to a PayPal doc, and Claude reviews what they missed. On this shop: 9 findings from the detectors and 2 from Claude.

  2. Fix

    Claude writes a small patch for each finding, on top of the ones before it, so each can be tested on its own. With the review, that took 12 Claude calls and cost $0.51.

  3. Prove

    The app runs a scripted checkout before and after each patch, with no browser. 162 calls went to PayPal's sandbox. Then every check ran again with all the patches in, and 11 of 11 passed.

It didn't work the first time

The first real run verified 3 of 11 patches, because of a fault in the tool. It only showed Claude the file with the bug, so one patch guessed at a field it couldn't see and broke checkout, and the next seven failed on top of it. After that was fixed, each patch had to pass before the next was written.

First real run 3 of 11 verified

Second real run 11 of 11 verified

What this doesn't show

  • This is one shop with bugs seeded on purpose, and the tool was fixed after seeing it fail here. 11 of 11 says the loop works on this shop, not that patches will pass on your app.
  • 9 of the 11 proofs used PayPal's sandbox. The other 2 ran on a local mock, because only PayPal can sign a webhook event, and fake credentials shouldn't be sent to it.
  • The pending capture is injected. The sandbox won't produce one on demand, so the check rewrites a real response, and the results label it.
  • On 20 public repos it had never seen, 23 of 27 of the static scan's findings were correct. Claude's patches and the sandbox checks haven't been run on those.

Every check and every PayPal call from this run

Recorded on November 5, 2026. Pick a finding to see its code, its patch and its checks before and after. Both grids are AG Grid Community, so you can sort, filter and export them.

no report yet

Findings