Although it doesn’t mention the transaction in many historical sources, the payment for the Gadsden Purchase was approved by Santa Ana and accepted on his behalf by a proxy, most likely an aide or other bureaucrat.
The Gadsden Purchase was negotiated following the Mexican-American War. When Franklin Pierce entered office, he quickly adopted a pro-expansion policy and began casting his eyes toward the Mesilla Valley, part of present day New Mexico. Although the territorial governor of New Mexico swore the territory was contested, it was pretty obviously part of Mexico passed on the Treaty of Guadalupe-Hidalgo and the surveying that occurred shortly after. Pierce however decided to try and negotiate for it because it provided a perfect route for the future Santa Fe Railroad.
James Gadsden, who was leading the U.S negotiation effort, learned that Santa Ana desperately needed money to rebuild his army, and figured the time was right to make an offer.
Santa Ana rejected the first proposal, which would have bought most of Baja California as well as the desired railroad route for $50 million. Instead, he agreed to a smaller purchase of what became known as the Gadsden Purchase for $10 million. Santa Ana resisted, hoping to enlist the help of Britain in the negotiation process, when the English turned them down, Santa Ana reluctantly agreed.
The actual payment was exchanged in New York. Below is part of the actual treaty which explains how it would occur.
In consideration of the foregoing stipulations, the Government of the United States agrees to pay to the government of Mexico, in the city of New York, the sum of ten millions of dollars, of which seven millions shall be paid immediately upon the exchange of the ratifications of this treaty, and the remaining three millions as soon as the boundary line shall be surveyed, marked, and established.
I found a document that suggests that they payment was made in gold specie to an assistant to the ambassador of Mexico.