All you need to do is take a soldering iron to the solder for the battery tray. Thats pretty common and an easy fix. If you do buy a new one from the dealer, the part runs about about $100 and they will also charge you another $100 to reprogram your car to recognize the new transmitter.
I would try reseating the tray first. It works 90% of the time. Then you wont have to worry about programming.