diff --git a/src/Controller/Component/StripeComponent.php b/src/Controller/Component/StripeComponent.php new file mode 100644 index 0000000..1ae7a44 --- /dev/null +++ b/src/Controller/Component/StripeComponent.php @@ -0,0 +1,93 @@ +controller = $this->_registry->getController(); + + // if mode is not set in bootstrap, defaults to 'Test' + $mode = Configure::read('Stripe.mode'); + if ($mode) { + $this->mode = $mode; + } + + // set the Stripe API key + $this->key = Configure::read('Stripe.' . $this->mode . 'Secret'); + if (!$this->key) { + throw new Exception('Stripe API Secret key is not set'); + } + + // if currency is not set, defaults to 'usd' + $currency = Configure::read('Stripe.currency'); + if ($currency) { + $this->currency = strtolower($currency); + } + } + + + + + + + +}