diff --git a/config/phinch.php b/config/phinch.php index 77947a8..cf68c9b 100644 --- a/config/phinch.php +++ b/config/phinch.php @@ -2,6 +2,27 @@ return [ + /* + |-------------------------------------------------------------------------- + | Products + |-------------------------------------------------------------------------- + | + | Here you may specify the products your app needs access to. + | All options are found in the Finch documentation: + | https://developer.tryfinch.com/docs/reference/ZG9jOjMxOTg1NTI3-permissions + | + */ + + 'products' => [ + 'company', + 'directory', + 'individual', + 'employment', + 'payment', + 'pay_statement', +// 'benefits', + ], + /* |-------------------------------------------------------------------------- | Default API Version diff --git a/src/ConnectFactory.php b/src/ConnectFactory.php index 8e20972..75602ff 100644 --- a/src/ConnectFactory.php +++ b/src/ConnectFactory.php @@ -2,8 +2,6 @@ namespace Phinch\Phinch; -use Illuminate\Contracts\Container\Container; -use Illuminate\Http\Request; use Illuminate\Support\Facades\URL; use Illuminate\Support\Str; use Phinch\Connect\Connect; @@ -13,10 +11,11 @@ class ConnectFactory { /** * @param array $config + * @param array $products * @param bool $sandbox * @return Connect */ - public static function make(array $config, bool $sandbox = false): Connect + public static function make(array $config, array $products = [], bool $sandbox = false): Connect { if (!Str::startsWith($redirect = $config['connect_redirect'], 'http')) { $redirect = URL::to($redirect); @@ -28,6 +27,8 @@ public static function make(array $config, bool $sandbox = false): Connect $redirect, ); + $connect->products($products); + if ($sandbox) { $connect->inSandbox(); } diff --git a/src/PhinchServiceProvider.php b/src/PhinchServiceProvider.php index 6b41057..d5d482d 100644 --- a/src/PhinchServiceProvider.php +++ b/src/PhinchServiceProvider.php @@ -27,6 +27,7 @@ public function register() $this->app->singleton(Connect::class, function ($app) { return ConnectFactory::make( config('services.finch'), + config('phinch.products'), config('phinch.sandbox') ); });