Is it possible to set Quantity Limits/Max Quantity on Payments or Payment links?

I have this same question. I sell seats in a course, and I need to cap the attendance for each training--however, I cannot guarantee that one person won’t buy multiple seats and max it out before I can see that we need to close registration.

Is there a conditional statement somewhere that we can implement that states, “if x quantity is purchased, the link is disabled and x message will be shown”?