I have two questions that are similar. One is that I purchased a shake at an ice cream store recently. The shake was prepared for me, but when I went to take my wallet out of my bag, it wasn’t there. I didn’t return to the merchant since. Do I need to go to them and pay them for a drink that I never enjoyed?
Similarly, I went to purchase a set of books. At the checkout, my credit card was declined. The price was around 300 NIS. Do I have any obligation to go and purchase something from the store at that same value?
The answer to your two question are not the same. In the first case, where you made the merchant make you a shake, which he might not be able to resell, then you caused him a loss by backing out of the sale, and you would have to pay him for his loss, (loss of ingredients that were in the shake, work). However if he would be able to resell it to someone else, i.e. there was someone else there at that time that would want to buy it, while it is still fresh, then you wouldn’t have to pay for it.
In the second case, you can simply return the seforim to their shelf and no loss was incurred so you would not have to reimburse the merchant anything, and you also do not have to buy anything else from the store, as you didn’t cause him any loss.