From c0def1ed8277aaba9f11185fd42573720b2ca908 Mon Sep 17 00:00:00 2001 From: Sean Taylor Date: Wed, 3 Nov 2021 16:39:15 +0000 Subject: [PATCH 1/2] Allow the base url for the Stripe API to be customised --- src/Cashier.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Cashier.php b/src/Cashier.php index 9c19afa2..b1dec630 100644 --- a/src/Cashier.php +++ b/src/Cashier.php @@ -7,6 +7,7 @@ use Money\Formatter\IntlMoneyFormatter; use Money\Money; use NumberFormatter; +use Stripe\BaseStripeClient; use Stripe\Customer as StripeCustomer; use Stripe\StripeClient; @@ -26,6 +27,13 @@ class Cashier */ const STRIPE_VERSION = '2020-08-27'; + /** + * The base url for the Stripe API + * + * @var string + */ + public static $apiBaseUrl = BaseStripeClient::DEFAULT_API_BASE; + /** * The custom currency formatter. * @@ -106,6 +114,7 @@ public static function stripe(array $options = []) return new StripeClient(array_merge([ 'api_key' => $options['api_key'] ?? config('cashier.secret'), 'stripe_version' => static::STRIPE_VERSION, + 'api_base' => static::$apiBaseUrl, ], $options)); } From 53e511a183c01aa2dbe95d6803a807622c367926 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 5 Nov 2021 08:08:13 -0500 Subject: [PATCH 2/2] Update Cashier.php --- src/Cashier.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Cashier.php b/src/Cashier.php index b1dec630..4b0e2c0a 100644 --- a/src/Cashier.php +++ b/src/Cashier.php @@ -28,7 +28,7 @@ class Cashier const STRIPE_VERSION = '2020-08-27'; /** - * The base url for the Stripe API + * The base URL for the Stripe API * * @var string */