1. Basically, if you have the resources AND the tech, you should be able to simply pay the raw resource cost ...
2. however ... if you have the Tech and not the resources, you can buy it from the shop.
3. If you don't have the Tech ... then you can buy it from a Rival's Shop that does have the tech.
a randomly wandering NPC with its own AI and its own treasury of GOLD would only have the option of purchasing from a Faction shop. (or go adventuring for Items)
(then it would be possible to impose tariffs upon other Factions perusing your wares) ... and of course, you would need at least one of your champions in rival territory (and not at war) in order to peruse your Rival's wares (based on Tech).
Any tarriffs imposed ... the extra gold would go into the State Treasury that held the shop.
heck, you could also Tariff the goods bought from "free agent" NPCs
... so on the Diplo screen you could have a Tariff% for Faction A, B, C, D, X, and Free-Agents
heck, you could even have an additive constant-effect for Tarrif% of empires or kingdoms ... so you (if Kingdom) might want a high tariff on Empire buyers.
Tariff sliders oh my!
even without tariffs, I think the Three option system is superior to ALWAYS having to buy from a Shop. (If you are a Sovereign)