Can a non profit deduct tranaction fees from my gift?

I give to many charities via credit card and PayPal?  Usually, what I gift, I get a receipt from that charity for the full amount of the gift.  Last year I had a charity that I gifted $5000 via Paypal deduct the transaction fees from my gift and gave me a receipt for that deducted amount, rather than the full $5k.  Can they do that?