Biete den Kauf auf Rechnung im Frontend erst bei vollständigem Prozess an
SHOP_INVOICE ist jetzt standardmäßig aus; die Umsetzung bleibt vollständig erhalten, vorhandene Rechnungsbestellungen bleiben in der Verwaltung bearbeitbar. Zwei Tests schalten die Option bewusst ein, zwei neue prüfen Standard (nicht angeboten, gefälschte Anfrage abgewiesen) und Weiterbearbeitung. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9db3a98440
commit
32272e8e40
5 files changed
+36
-3
No files matched your search
@@ -164,6 +164,7 @@ public function test_the_order_page_shows_discount_and_payable_amount_and_stripe
|
||||
|
||||
public function test_a_club_can_order_on_invoice_and_only_the_operator_confirms_the_payment(): void
|
||||
{
|
||||
config(['shop.invoice' => true]);
|
||||
$vera = $this->vera();
|
||||
$this->actingAs($vera)->post(route('cart.add', $this->clubKonflikte()));
|
||||
|
||||
@@ -343,8 +344,33 @@ public function test_the_checkout_and_the_order_say_that_the_code_changes_the_pr
|
||||
$this->get(route('checkout'))->assertOk()->assertSee('Pro Bestellung gilt höchstens ein Code. Er ändert den Preis, nicht den Nutzungsumfang.');
|
||||
}
|
||||
|
||||
public function test_by_default_a_club_is_not_offered_the_invoice_and_a_forged_request_is_refused(): void
|
||||
{
|
||||
$this->assertFalse(Shop::invoice(), 'Standard: aus, bis der Rechnungsprozess vollständig ist.');
|
||||
$vera = $this->vera();
|
||||
$this->actingAs($vera)->post(route('cart.add', $this->clubKonflikte()));
|
||||
|
||||
$this->get(route('checkout'))->assertOk()->assertDontSee('Auf Rechnung');
|
||||
$this->post(route('checkout.place'), ['digest' => $this->checkoutDigest(), 'zahlungsweg' => 'rechnung', ...$this->consentFields()])->assertSessionHasErrors('checkout');
|
||||
$this->assertSame(0, Order::query()->count());
|
||||
}
|
||||
|
||||
public function test_an_existing_invoice_order_stays_manageable_when_the_option_is_off(): void
|
||||
{
|
||||
$order = $this->orderOf($this->vera(), [$this->clubKonflikte()], $this->club()->id);
|
||||
$order->update(['payment_method' => 'rechnung']);
|
||||
$this->assertFalse(Shop::invoice());
|
||||
|
||||
app(Checkout::class)->confirmInvoicePayment($order, 'RE-ALT-1', $this->tina());
|
||||
|
||||
$this->assertSame('bezahlt', $order->fresh()->status);
|
||||
app(Checkout::class)->refund($order, 'Storno');
|
||||
$this->assertSame('erstattet', $order->fresh()->status);
|
||||
}
|
||||
|
||||
public function test_an_invoice_order_is_never_paid_by_card_even_when_stripe_is_the_driver(): void
|
||||
{
|
||||
config(['shop.invoice' => true]);
|
||||
config(['services.payment.driver' => 'stripe', 'services.stripe.secret' => 'sk_test_nur_fuer_tests', 'services.stripe.api_base' => 'https://stripe.test']);
|
||||
$vera = $this->vera();
|
||||
$cart = app(Cart::class);
|
||||
|
||||
Reference in new issue
Block a user