Skip to content

Commit

Permalink
Alerts fix and added powered by payment methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Raccoon254 committed Jun 15, 2024
1 parent 5db5d34 commit 302bcb8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/Livewire/VerifyOrderPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class VerifyOrderPayment extends Component
{
public Payment $payment;
public Order $order;
public $payment_methods = ['paypal', 'cash_app', 'zelle'];
public function mount($paymentId): void
{
$this->payment = Payment::findOrFail($paymentId);
Expand All @@ -24,7 +25,7 @@ public function checkPaymentStatus(): void
if ($this->payment->status === 'completed') {
session()->flash('success', 'Payment has been verified successfully');
} else {
session()->flash('warning', 'Payment verification in progress');
session()->flash('error', 'Payment verification in progress');
}
}

Expand Down
18 changes: 17 additions & 1 deletion resources/views/orders/verify-order-payment.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,23 @@ class="max-w-full"></video>
@else
<p>No attachments for this order</p>
@endif

<h3 class="text-xl font-semibold mb-4">Powered by</h3>
<div class="flex space-x-3 opacity-50 mb-8">
@foreach($payment_methods as $method)
@php
//call getPaymentDetails method from OrderPayment class
$logo = (new App\Livewire\OrderPayment)->getPaymentDetails($method)['logo'];
@endphp
<div class="w-32 ring-1 ring-inset bg-gray-50 relative rounded-lg ring-blue-200 p-2 h-auto">
<!-- About icon -->
<a href="#"
class="absolute top-0 right-0 bg-blue-500 text-white p-2 rounded-bl-lg rounded-tr-lg hover:bg-blue-600">
<i class="fas h-2 w-2 text-xs center fa-info-circle"></i>
</a>
<img src="{{ $logo }}" alt="{{ $method }} Logo" class="h-16 object-cover w-auto">
</div>
@endforeach
</div>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/session/alerts.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@endif

@if(session('error'))
<div class="alert rounded-none mt-3 bg-red-500 alert-danger">
<div class="alert rounded-none border-none text-white mt-3 bg-red-500 alert-danger">
{{ session('error') }}
</div>
@endif
Expand Down

0 comments on commit 302bcb8

Please sign in to comment.