The receipt proves that someone bought a donut but it doesn't prove that you bought the donut.
Imagine a scenario where someone buys a donut then heads across town. They commit a crime while their accomplice buys another donut. Then they swap receipts. They now have "proof" that they were at the donut shop at the time of the crime and may even be able to get the cashier to testify that they did indeed sell that person a donut that day.
The receipt proves that someone bought a donut but it doesn't prove that you bought the donut.
Imagine a scenario where someone buys a donut then heads across town. They commit a crime while their accomplice buys another donut. Then they swap receipts. They now have "proof" that they were at the donut shop at the time of the crime and may even be able to get the cashier to testify that they did indeed sell that person a donut that day.
Most receipts have the card number printed on them one way or another. So unless it was a cash transaction they could still prove it was you.
So just swap cards too?