I was thinking about implementing a crypto payment gateway in my e-commerce website.
You might want to use existing solution which is easy to use such as Coinbase Commerce and Mycelium Gear.
What if someone else just bought the same product and sent amount to this wallet?
Each customer gets a unique address. This is how you'll categorize them.
I think you meant each transaction, a customer could buy same product twice.
Bitpay is probably the most popular in the last decade but custom payment processors seem to be taking over as of recent as people are wising up that they can cut the middle man out and make their own. Depending on your needs it might be worth considering that option.
People move from Bitpay mainly because it's anti-Bitcoin practice. See
https://debitpay.directory/anti-bitcoin/.