Updated that script for you:
- I want to have a beer!
- ok, scan this QR, and accept the transaction
- there you go!
- thank you, here are your 5 beers
- oh, did I just pay for 5? I wanted 1! can you refund me and take these back?
- sure! can I see your QR code?
- there you go!
- thank you, here is your 1 beer and refund
Note that I'm totally burnt on bitcoin for practical reasons, but your example is just silly.