When you cut the cord, you can use a continuity checker or ohmmeter to see which pin of the plug is connected to which wire and go from there.
It should generally be wired thusly (but best to verify):
Green to ground
White to neutral
Black and whatever else (probably red) to the two hots, which are interchangeable.
Take care that you don't wire anything up such that the male plug (with the pins sticking out) can ever be live when it is unplugged. This basically means not having any cables or adapters with a male on each end.