laravel / cashier-stripe

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.
https://laravel.com/docs/billing
MIT License
2.37k stars 670 forks source link

[14.x] Use container to resolve `StripeClient` #1624

Closed orkhanahmadov closed 8 months ago

orkhanahmadov commented 8 months ago

This PR uses the Laravel container to resolve StripeClient instead of initializing it in the Cashier class.

In complex test scenarios, this would allow us to mock the StripeClient instead of sending actual requests to Stripe and make those test cases focus only on actual business logic.