Lyft's payment platform needed to test complex failure scenarios that standard processor test cards could not represent.
Without realistic failures, retry and fallback logic could not be validated, increasing risk and slowing development.
The team solved it by: 👉 Implemented a Fake Provider behind the existing provider interface. 👉 Encoded scenario behavior in the low-value token used by simulated users. 👉 Defined scenarios as dictionaries mapping actions to success, delay, and error specs.
The parts that matter: 1️⃣ Fake Payment Provider - Returns configured outcomes instead of calling a real processor 2️⃣ Low Value Token (LVT) - Carries the scenario name through the entire payment flow
Engineers can now load-test and validate any payment flow, including partial failures, without contacting real processors.
The fake only tests logic after the provider layer; it does not exercise request construction, response parsing, or error mapping that still rely on real processor sandboxes. Maintaining the scenario dictionary adds a small operational overhead and requires code review for new scenarios.
How do you balance the need for realistic failure injection with the effort of keeping fake scenarios in sync with real processor behavior?