Design Payment Gateway like Razorpay.
MediumImagine building a payment gateway, much like Razorpay or Stripe, from scratch. This isn't about scaling to millions of transactions or handling complex network infrastructure (that's HLD). Instead, it's about the core object-oriented design: modeling payments, handling different payment methods, processing transactions, and managing webhooks. We'll focus on designing a robust and extensible system that can easily adapt to new payment methods and evolving business rules. The system needs to handle creating payments, processing them via different payment providers, handling asynchronous notifications (webhooks) from those providers, and updating payment statuses accordingly. We will avoid any real third-party integration and focus on simulating the interactions.
Requirements
Think like an Architect
Before revealing the requirements, imagine you're in the interview right now."How would you clarify the scope with your interviewer?"