I'm a developer. I have a custom online store, with code I wrote myself, where I sell products in fiat money. I plan to introduce payments in bitcoin.
Issue: the customer may try to gain the system by taking advantage of the fact that bitcoin price always fluctuates.
For instance: on Monday BTC, or any abstract coin, costs $100, and on Tuesday it will $75.
A customer makes an order of $500 on Monday, with an intention to pay in BTC. The shop will generate price for thim: $500 => 5 BTC. But a customer waits a day ("may be tomorrow BTC will decline? Let's see") and sends those 5 BTC on Tuesday but claims that he really sent bitcoins on Monday.
That is, he should've sent me 6.66.... BTC (rate of Tuesday, $500 = 6.66 BTC) instead of 5 BTC (rate of Monday, $500 = 5 BTC). I end up loosing 6.66 - 5 BTC = 1.66 BTC as of Tuesday.
How to deal with such situations? How would I know that a customer sent me coins on Monday, when BTC was more expensive, and not on Tuesday?
At this point I don't want to run a full node, because I want to keep things simple. It's for now. I'm using Electrum and I think its API will do. Or at least semi-manual checking for bitcoin payment will work because I don't expect tons of orders, let alone in bitcoin.
I don't consider third-party payment processors or software to resolve this issue. I may use some public API of those, but I don't want to sign with them, go through KYC, pay them fees... Electrum the wallet is ok at this stage, something similar will do to.
The question is about an algorithm and isn't about software or payment service.