Skip to content

Commit

Permalink
register custom stripe manager only for testing env
Browse files Browse the repository at this point in the history
  • Loading branch information
repl6669 committed Mar 14, 2024
1 parent 96e5bdf commit a4c8ea6
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/LunarApiStripeAdapterServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ public function register(): void
*/
public function boot(): void
{
$this->app->singleton(
'gc:stripe',
fn (Application $app) => $app->make(StripeManager::class),
);

$this->loadRoutesFrom(__DIR__.'/../routes/webhooks.php');

StripePaymentAdapter::register();
Expand All @@ -41,5 +36,13 @@ public function boot(): void
__DIR__.'/../config/stripe-webhooks.php' => config_path('stripe-webhooks.php'),
], 'lunar-api.stripe.config');
}

// Testing
if ($this->app->environment('testing')) {
$this->app->singleton(
'gc:stripe',
fn (Application $app) => $app->make(StripeManager::class),
);
}
}
}

0 comments on commit a4c8ea6

Please sign in to comment.