-
-
Save jimrubenstein/f879c91f57573f9cfd84 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
STRIPE_SECRET_KEY=XXXXXXX | |
STRIPE_PUBLIC_KEY=YYYYYYY |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace App\Providers; | |
use Illuminate\Support\ServiceProvider; | |
use Stripe\Stripe; | |
use Config; | |
use Blade; | |
class StripeServiceProvider extends ServiceProvider { | |
/** | |
* Indicates if loading of the provider is deferred. | |
* | |
* @var bool | |
*/ | |
protected $defer = false; | |
/** | |
* Bootstrap the application events. | |
* | |
* @return void | |
*/ | |
public function boot() | |
{ | |
$api_key = Config::get('stripe.api_key'); | |
$public_key = Config::get('stripe.publishable_key'); | |
Stripe::setApiKey($api_key); | |
Blade::extend(function($view, $Compiler) use ($public_key) { | |
$pattern = $Compiler->createPlainMatcher('stripePublicKey'); | |
return preg_replace($pattern, $public_key, $view); | |
}); | |
} | |
/** | |
* Register the service provider. | |
* | |
* @return void | |
*/ | |
public function register() | |
{ | |
// | |
} | |
/** | |
* Get the services provided by the provider. | |
* | |
* @return array | |
*/ | |
public function provides() | |
{ | |
return array(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return array( | |
'api_key' => env('STRIPE_SECRET_KEY', ''), | |
'publishable_key' => env('STRIPE_PUBLIC_KEY', ''), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment