By recommendation of Tim: create a civix module, and declare the payment gateway as a managed resource (mgd), which is what the Stripe module also does.