Herald from Dominion Guilds says that you can over pay for it and if you do, you may put X Action cards from your discard on top of your deck, where X is the amount you overpaid.
Can you place Herald on top of your deck if you overpay?
(Note: This question comes down to a matter of timing. Does the "when you buy this" clause occur before or after you place Hearld in the discard pile)