What tools or approaches would you use to simulate simultaneous requests?
You're testing a payment gateway API responsible for handling financial transactions. Its primary function is to ensure that funds are transferred only when the account balance of the user is sufficient. In the test cycle, the following scenario was observed.
Two simultaneous requests from two different devices for the same transaction-drawing money, for example, ₹10,000-an API processes both requests, deducting ₹20,000 from the account while it holds only ₹15,000.