“Our market is to appeal to a very irrational customer,” he said. “Respectfully, you kind of get that out of the far left and the far right. So that stuff sold really well.”

And it’s all completely legal under campaign rules.

“There is nothing under federal campaign-finance law and agency regulations that speaks to the issue of a contributor selling campaign merchandise received as a result of making a contribution to a federal candidate's campaign committee,” an FEC spokesman, Christian Helland, said. “Where contributions are concerned, the Commission is responsible for ensuring that individuals and political committees comply with contribution limitations and source prohibitions of federal campaign-finance law.”

The campaign-finance system obviously isn’t intended to facilitate get-rich schemes for donors (at least, not directly). But Treibel is taking advantage—unwittingly, he says—of the lax enforcement of contribution limits to federal campaigns. Buying campaign merchandise counts as a donation, and donations to presidential candidates are capped at $2,700 for the primary and an additional $2,700 for the general election. In the era of online fund-raising where campaigns ask their supporters for repeat contributions, donors unaware of these limits frequently blow right by them. That has been true to an unprecedented extent for the Sanders campaign, which has collected excess contributions from more than 1,500 donors.

The FEC only requires that campaigns refund excess contributions after they are given; it doesn’t force them to reject them in the first place. This loophole allows Treibel to make an even bigger killing than he imagined. Although he shelled out nearly $25,000 for the merchandise initially, he will get all but $8,100 back in refunds from the campaigns. (Though both the Trump and Sanders campaigns have reported issuing thousands of dollars in refunds to Treibel, he said he initially only received a partial one from Trump and nothing from Sanders. After the publication of this article, Treibel said he received his refund from the Sanders campaign.)

Treibel said he didn’t even know that buying the goods counted as a donation and acknowledged that with the refunds, “essentially we’d be getting free stuff, which is a little bit awkward.”

“That was not the intent,” he told me. “The intent was simply to profit in a purely ethical and legal manner. But what it turns out is, if they comply with FEC law, I may get 90, 95 percent of my investment back on top of what I profited.”

“That sounds dirty, but that wasn’t the intent,” Treibel added. “It’s like bank error in your favor almost, if that makes sense.”

For their part, the campaigns appear too busy trying to keep up with their donations and refunds to demand that he return any merchandise. Neither would comment on Treibel’s profiteering. The Trump campaign, however, eventually caught on to what Treibel was doing. He said he received a call on Thursday from a marketing representative for the campaign who, while thanking him for his support, informed him that merchandise would now be sold only by a super PAC supporting Trump. Unlike the campaigns themselves, super PACs can accept unlimited donations, so it would not have to send Treibel any refunds for the merchandise he purchases.