Earlier this year, the alcoholic beverage giant Diageo gave its supply chain a nasty yank. The company told vendors it was extending to 90 days payment terms on new contracts because it had “significant investment projects underway” and needed to improve cash flow. Suppliers were expected to understand. After all, it’s not like they needed cash themselves for new projects or, say, to stay alive.

Under public pressure, Diageo backtracked. But its actions-;and similar actions taken by many other companies-;remind us about the vulnerability of B-to-B vendors. Not all large customers that pay late or stretch terms to 90 or even 120 days are opportunistic. Many just want to ensure their own financial stability. But delaying payment hurts small businesses and damages vendor-customer relationships. Much as large and small companies say they want to be partners, that’s tough to achieve when the power imbalance is great.

One partial solution is dynamic discounting: a 10-year-old good idea that improving technology has made better. In this model, customers that pay sooner pay a little less, with the savings determined by dates of payment. Last year, the White House persuaded Apple, Coca-Cola, and 24 other corporations to accelerate their payment rates as part of an initiative called SupplierPay. Taulia and C2FO are among the companies active in this space.

The newest entrant, fresh out of Y-Combinator, is Philadelphia-based Tesorio, which recently raised money from investors like First Round Capital and Funders Club. The company’s founder and CEO is Panamanian-born Carlos Vega, 34, who met his Cuban-born co-founder, Fabio Fleitas, 21, at Wharton in 2013.

The model is fairly simple. Once the large customer approves an invoice, it is sent automatically to Tesorio, which notifies the supplier. The supplier has the option to click a button if it wants to be paid immediately at a discount. Discounts are calculated to be lower than the borrowing cost of the supplier (a rate determined algorithmically) and above the cost of capital of the buyer (a rate determined when new customers are brought onboard). “They split the difference,” says Vega, and “everyone is a little more motivated to participate.” Tesorio takes a percentage of the customer’s savings.

One nice thing about Tesorio is its attention to the supplier side. “While we do develop a lot of tools for the large companies, really, if the small companies don’t play, no one wins,” says Vega. “So we are very focused on designing things so they are helpful to the suppliers.”

Vega hopes that suppliers who like the system will, in turn, implement it with their own vendors. Thus dynamic discounting may promote the creation of a virtuous supply chain, in which all links-;no matter their size-;are financially stable and pulling together.