Merge branch 'feature/stripe-steuersatz' into develop
Deploy Test / test (push) Successful in 2m3s
Deploy Test / deploy (push) Successful in 27s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
StommerandClaude Sonnet 5.5 committed 2026-11-22 08:37:39 +01:00
commit 631502c064
5 files changed
+62

No files matched your search

+34
View File
@@ -85,6 +85,40 @@ public function test_paying_creates_a_checkout_session_with_the_order_amounts_an
$this->assertSame('offen', $order->fresh()->status, 'Bezahlt wird erst durch die signierte Meldung.');
}
public function test_a_configured_tax_rate_is_sent_with_every_line_and_otherwise_none(): void
{
$order = $this->orderOf($this->tina(), [$this->privateKonflikte(), $this->privateGrenzen()]);
Http::fake(['stripe.test/v1/checkout/sessions' => Http::response(['id' => 'cs_test_s', 'url' => 'https://checkout.stripe.test/s'])]);
$this->actingAs($this->tina())->post(route('member.order.pay', $order))->assertRedirect();
Http::assertSent(function (HttpRequest $request): bool {
parse_str($request->body(), $body);
return ! isset($body['line_items'][0]['tax_rates']) && ! isset($body['line_items'][1]['tax_rates']);
});
$order->payments()->delete();
config(['services.stripe.tax_rate' => 'txr_Testsatz123']);
$this->actingAs($this->tina())->post(route('member.order.pay', $order))->assertRedirect();
Http::assertSent(function (HttpRequest $request): bool {
parse_str($request->body(), $body);
return ($body['line_items'][0]['tax_rates'] ?? null) === ['txr_Testsatz123']
&& ($body['line_items'][1]['tax_rates'] ?? null) === ['txr_Testsatz123'];
});
}
public function test_an_invalid_tax_rate_id_is_refused_before_any_call(): void
{
$order = $this->orderOf($this->tina(), [$this->privateKonflikte()]);
config(['services.stripe.tax_rate' => 'txcd_99999999']);
Http::fake();
$this->actingAs($this->tina())->post(route('member.order.pay', $order))
->assertSessionHasErrors(['payment' => 'Die Steuersatz-ID für Stripe ist ungültig (erwartet txr_...).']);
Http::assertNothingSent();
}
public function test_an_open_session_is_reused(): void
{
$order = $this->orderOf($this->tina(), [$this->privateKonflikte()]);