Hydra
Bug library · server · flow

500 on pay

The pay endpoint JSON-parses the coupon code, which throws for any real code and returns HTTP 500.

Breaks: main, holdout · expected from Kane: caught · Paying with a coupon fails, so the confirmation page never appears.

The diff

app/api/pay/route.ts
- couponCode: quote.couponCode,
+ couponCode: quote.couponCode ? (JSON.parse(str(body.coupon)) as { code: string }).code : null,

Matches

No recorded match has planted this bug yet.