32 lines
714 B
PHP
32 lines
714 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Braintree\Gateway;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class BraintreeServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register services.
|
|
*/
|
|
public function register(): void
|
|
{
|
|
$this->app->singleton(Gateway::class, function () {
|
|
return new Gateway([
|
|
'environment' => env('BRAINTREE_ENVIRONMENT'),
|
|
'merchantId' => env('BRAINTREE_MERCHANT_ID'),
|
|
'publicKey' => env('BRAINTREE_PUBLIC_KEY'),
|
|
'privateKey' => env('BRAINTREE_PRIVATE_KEY'),
|
|
]);
|
|
});
|
|
}
|
|
/**
|
|
* Bootstrap services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
//
|
|
}
|
|
}
|