Discarding your cards happens in the End of Turn step. You get back the full cost of the card as printed, even if you bought it at a discount.