First of all, this question was asked before here: Accepting ERC-20 Tokens as payment but I want to see if a better way has been developed to accept ERC-20 for payment, so I'm asking again. To summarize the previous post, you change the payment slightly to make it unique. If I am forced to implement it this way, I would probably keep an incrementing variable "order id", and for each sale, increment the variable and add that amount of wei to the token amount. Then to match a sale to a payment, I just find the transaction with the last n significant digits that match that order id.
This is undesirable because 1. it messes with bookkeeping and 2. it's a kludge. There has to be a better way.
The other possibility I have come up with is, my ERC-20 token also implements EIP-1363 and has an approveAndCall(address callee, uint256 amount,bytes extradata)
method that approves an amount and calls onApprovalReceived(address owner, uint256 value, bytes memory extradata)
on a contract that could then, transfer the tokens to itself, and record the extradata bytes into storage along with the amount, which would serve as proof the order id was paid.
My questions are 1. in the last two years has a better way of accepting ERC-20 been come up with than the previous post's solution? 2. Or is my proposed solution sane?