diff --git a/routes/web.php b/routes/web.php index 7452bd54..3944fc97 100644 --- a/routes/web.php +++ b/routes/web.php @@ -117,9 +117,14 @@ 'success_url' => route('cart.success').'?session_id={CHECKOUT_SESSION_ID}', 'cancel_url' => route('course'), 'customer' => $user->stripe_id, + 'customer_update' => [ + 'name' => 'auto', + 'address' => 'auto', + ], 'metadata' => $metadata, 'allow_promotion_codes' => true, 'billing_address_collection' => 'required', + 'tax_id_collection' => ['enabled' => true], 'invoice_creation' => [ 'enabled' => true, 'invoice_data' => [ diff --git a/tests/Feature/CoursePageTest.php b/tests/Feature/CoursePageTest.php index 5d3c1ee7..051e5155 100644 --- a/tests/Feature/CoursePageTest.php +++ b/tests/Feature/CoursePageTest.php @@ -105,5 +105,7 @@ public function retrieve(): \Stripe\Customer $this->assertNotNull($capturedParams, 'Stripe checkout session should have been created'); $this->assertStringContainsString(route('cart.success'), $capturedParams['success_url']); $this->assertStringContainsString('{CHECKOUT_SESSION_ID}', $capturedParams['success_url']); + $this->assertEquals(['enabled' => true], $capturedParams['tax_id_collection']); + $this->assertEquals(['name' => 'auto', 'address' => 'auto'], $capturedParams['customer_update']); } }