My plugin requires vendor library dependencies and api keys set. What is the recommended way to register an external library? I would also like to configure the public api keys separately for stage and production environments — is there a way to set these in craft/config with the rest of the multi-environment configuration? Or is it better to create a plugin config file of some kind?
Currently I am having to include these in each of my service methods (and something similar again in my javascript files):
private function _saveStripeCustomer($account, $token = NULL)
{
require_once(CRAFT_PLUGINS_PATH . 'businesslogic/vendor/stripe/lib/Stripe.php');
\Stripe::setApiKey("sk_test_xxxxxxxxxxxxxxxxxx");
// ...
}
I'm not familiar with composer. I don't know if that can perhaps help here.