Recording a real response, including the ugly ones

Hand-written fixtures encode what you believe the provider returns, and providers return things nobody believes.

// recorded from the sandbox, verbatim, including:
//   a 502 with an HTML body from their load balancer
//   a 200 with { "error": ... } — success at the HTTP
//     level, failure in the payload
//   a response with an unexpected extra field
//   a timestamp with an offset instead of Z

Http::fake([
    'api.example/*' => Http::sequence()
        ->push($this->recorded('502-html.txt'), 502)
        ->push($this->recorded('200-ok.json'), 200),
]);

The 502 with an HTML body is the one that reaches production, because a client parsing JSON unconditionally throws a parse error rather than a useful one. Recording from the sandbox is a five-minute job that produces fixtures nobody would have written. They go stale, so re-recording periodically — or a contract test against the live sandbox on a schedule — is the maintenance this needs.