From 0627ac331e32cc5acda8ad4c7541f5bc465edf45 Mon Sep 17 00:00:00 2001 From: Orkhan Ahmadov Date: Thu, 21 Dec 2023 15:15:38 +0100 Subject: [PATCH] Use container to resolve StripeClient (#1624) --- src/Cashier.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Cashier.php b/src/Cashier.php index 08ad41d2..dd85f482 100644 --- a/src/Cashier.php +++ b/src/Cashier.php @@ -125,11 +125,13 @@ public static function findBillable($stripeId) */ public static function stripe(array $options = []) { - return new StripeClient(array_merge([ + $config = array_merge([ 'api_key' => $options['api_key'] ?? config('cashier.secret'), 'stripe_version' => static::STRIPE_VERSION, 'api_base' => static::$apiBaseUrl, - ], $options)); + ], $options); + + return app(StripeClient::class, ['config' => $config]); } /**