How to identify the sender from crypto payments
As RedGrittyBrick suggested in a comment: Give each user a different deposit address.
Think of your process as the users purchasing credits in exchange for a Bitcoin payment. You respond to each purchase request with an offer. The offer includes an invoice address. Each new offer should have a new address, so you can identify which user took what offer. Since the address is unique, you'll know which user to credit how much when you receive the corresponding payment to an address.