Req : checkout_id, user_info, payment_details
Resp: status - success/failure
Req: order_id, payment_details, amount
Resp: status
Req: user_id, amount, transact_type: credit/debit
Resp :
Req: seller_id, amount, transact_type: credit/debit
Resp: status
Payment_event:
Payment_order:
Ledger:
Wallet:
Defined in the diagram.
But due to time constraint I will cover the core services first and touch upon the other services at the high level.
Payment service:
Order Service:
Ledger Service:
Eg: user A - Debit $1
User B - Credit $1
This talks to ledger_db
Wallet Service:
Relational database would be a best option.
Ensuring Scalability:
Avoid Double Payment and ensuring reliability:
Available retry mechanism are
What are some future improvements you would make? How would you mitigate the failure scenario(s) you described above?