Paying with cash is painful — and that’s a good thing, according to new research.

When people pay for items using cold, hard cash rather than by card or online, they feel more of a sting and therefore assign more value to the purchase, according to Avni M. Shah, an assistant marketing professor at the University of Toronto Scarborough. Her findings were born of personal experience: One day she forgot her debit card, so she paid for a latte with physical dollars — and felt her drink tasted better that day. Could her method of payment have been the reason?

She tested her theory two years ago, when she was a doctoral student at Duke University. She decided to sell discounted mugs with the Duke University logo on them to school staff and faculty in their offices. She asked one group to pay $2 for the mugs with cash. The other group had to pay with a card.

Then Professor Shah returned to each purchaser two hours later and said she needed to buy the mug back. To soften the blow, she asked the buyers to name their price. The people who had paid for the mug with a card asked for an average of $3.83 back, while those who had paid with cash asked, on average, for $6.71.

“Some of the cash folks literally blocked their hand over the mug and said, ‘You can’t take this back,’” Professor Shah said.