Add feature tests for shop functionality and organization purchases
- Implement OfferOptionAdminTest to validate offer option management, including price display, activation, and cancellation. - Create OrganizationPurchaseTest to ensure correct handling of organization purchases, including access control and order processing. - Add ShopProductPageTest to verify shop product listings, search functionality, and product page details. - Introduce BuildsShop trait for seeding test data related to shop functionality. - Implement MoneyTest to validate money parsing and formatting, ensuring correct handling of euro amounts.
This commit is contained in:
1 parent
6c8bbee363
commit
4e0760db1e
106 files changed
+4068
-76
No files matched your search
@@ -3,6 +3,14 @@
|
||||
@section('title', 'Bestellung')
|
||||
|
||||
@section('content')
|
||||
@php
|
||||
$statusText = [
|
||||
'offen' => 'Offen. Die Testzahlung steht noch aus, Rechte gibt es erst nach bestätigter Zahlung.',
|
||||
'bezahlt' => 'Bezahlt (Testzahlung). Die Inhalte liegen in der Bibliothek.',
|
||||
'fehlgeschlagen' => 'Die Testzahlung wurde abgelehnt. Es wurde keine Berechtigung vergeben.',
|
||||
'erstattet' => 'Erstattet. Die Berechtigungen dieser Bestellung sind widerrufen.',
|
||||
][$order->status] ?? $order->status;
|
||||
@endphp
|
||||
<header class="member-intro">
|
||||
<p class="flag">Testzahlung</p>
|
||||
<h1>Bestellung {{ $order->id }}</h1>
|
||||
@@ -10,15 +18,20 @@
|
||||
@if ($errors->any())
|
||||
<div class="errors" role="alert">{{ $errors->first() }}</div>
|
||||
@endif
|
||||
<p class="state">Status: {{ $order->status }}</p>
|
||||
<p class="state">Status: {{ $statusText }}</p>
|
||||
<dl class="facts">
|
||||
<div><dt>Lizenzinhaber</dt><dd>{{ $order->party?->display_name }}</dd></div>
|
||||
<div><dt>Bestellt von</dt><dd>{{ $order->user?->name }}</dd></div>
|
||||
</dl>
|
||||
<ul class="license-list">
|
||||
@foreach ($order->lines as $line)
|
||||
<li>
|
||||
<h2>{{ filled($line->offer_name) ? $line->offer_name : ($line->offerVersion->offer->name ?? 'Angebot') }}</h2>
|
||||
<p>{{ number_format($line->price_cents / 100, 2, ',', '.') }} €</p>
|
||||
<p>{{ \App\Domain\Commerce\Money::format($line->price_cents) }}</p>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
<p class="state">Summe: {{ \App\Domain\Commerce\Money::format($order->total_cents ?? $order->lines->sum('price_cents')) }}</p>
|
||||
@if ($testPayment && $order->status === 'offen')
|
||||
<form method="post" action="{{ route('member.order.confirm', $order) }}">
|
||||
@csrf
|
||||
@@ -30,9 +43,10 @@
|
||||
</form>
|
||||
@endif
|
||||
@if ($order->status === 'bezahlt')
|
||||
<p><a class="button" href="{{ route('member.library') }}">Zur Bibliothek</a></p>
|
||||
<form method="post" action="{{ route('member.order.refund', $order) }}">
|
||||
@csrf
|
||||
<button class="button button-quiet" type="submit">Widerrufen</button>
|
||||
</form>
|
||||
@endif
|
||||
@endsection
|
||||
@endsection
|
||||
Reference in new issue
Block a user