You are trying to replace a hardwired fixture with one that was
designed to be plugged in.
While there are safe ways to do this, the actuality is that to do it
properly you will spend more on that then the fixture cost you.
If you are set on having halogen lighting, take the ones you bought
back to where you bought them, and buy under counter lights that are
designed to be hard wired.
FYI: I installed hardwired under counter halogen lights under all my
cabinets a few years ago. While I prefer their light over flourescent -
they do generate a GREAT amount of heat. Enough heat to make guests
uncomfortably warm if I have em all fired up.
Also, they have a high and low setting..... the low setting generates a
lot of flicker.
I'd look for other options, were I to do it all over again.