My Chinese sister in law, and lots of other Chinese people, uses them to pay for things.
Take a picture if the code.
Phone does it's abracadabra.
A screen is generated, I presume it includes the bil.
You press something, an agreement to pay?
Money is taken from your linked bank account.
Looks like magic to me.
People use it to pay their bill in a restaurant, thus not having to find a waiter. The code is on your table. Something (magic) links your order to the code on your table.
People use it to buy goods from vending machines.
When I go to the gym I can take a picture of the code on my machine and something (Bluetooth?) means the machine recognises it's me and records my workout.