Refunds are pretty easy - if you provide a full refund, any licenses awarded will automatically be revoked (soft-deleted with a deletion notice saying "Order #X reversed / refunded.")
As for physical items, that would depend on how you send the items, eCommerce does not integrate with any shipping service so it's 100% on you to ensure the item is sent back.
All refunds must be processed on the payment processor's site, you cannot initiate a refund within eCommerce.