But how is a system able to recognize this particular payment was done?
The system must be programmed to keep track of your wallet's transactions. Each time someone wants to buy something, he'll get a unique address and your system will save in its database that this address corresponds to that purchase. It will recognize that the payment was done if your server runs a Bitcoin node and verifies it or by trusting another node for delivering this information.
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.