You are almost correct, what Mr. Trump's administration did was two fold
[1] toss big chunks of money at companies who said that they were going to do research (and could produce really neat looking presentations) WITHOUT any assurance that the US government would benefit in the least from tossing that money at the companies;
and
[2] enter into contracts wherein they agreed to purchase UP TO a certain number of doses of vaccine at a specific price. Those contracts, like all US government supply contracts, have clauses that allow the government to STOP purchasing at any point and, thereafter, to be free of any requirement to purchase any more. The pharmaceutical companies then used those contracts as collateral in order to borrow the funds needed for their research and production capacity (or, as in Pfizer's case, to expand production capacity since Pfizer didn't actually do any research). The pharmaceutical companies didn't receive a dime unless they actually delivered the vaccine.