Over here they sell (for the same price) the factory tow bar (not from Hyundai dealer) with the loom that is a simple plug in job. You remove the left hand side rear grommet, run the new harness through, pop in the grommet already fitted to the harness, disconnect the tail light plugs on both sides, connect the loom in, reconnect the tail lights and fit your tow plug. 5 minute job.
If you don't have this harness, you need to meter out which wire is which on each side and splice in to match the tow plug pinout.