Skip to content

Commit

Permalink
Payment show page for portal page
Browse files Browse the repository at this point in the history
  • Loading branch information
cuneytsenturk committed Jun 25, 2021
1 parent c20aa55 commit eb8d94a
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
15 changes: 15 additions & 0 deletions app/Http/Controllers/Portal/Payments.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use App\Models\Setting\Currency;
use App\Http\Requests\Portal\PaymentShow as Request;
use App\Utilities\Modules;
use Illuminate\Support\Facades\URL;

class Payments extends Controller
{
Expand Down Expand Up @@ -51,4 +52,18 @@ public function currencies()

return $this->response('portal.currencies.index', compact('currencies'));
}

public function signed(Transaction $payment)
{
if (empty($payment)) {
return redirect()->route('login');
}

$payment_methods = Modules::getPaymentMethods();

$print_action = URL::signedRoute('signed.payments.print', [$payment->id]);
$pdf_action = URL::signedRoute('signed.payments.pdf', [$payment->id]);

return view('portal.payments.signed', compact('payment', 'payment_methods', 'print_action', 'pdf_action'));
}
}
46 changes: 46 additions & 0 deletions resources/views/portal/payments/signed.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
@extends('layouts.signed')

@section('title', trans_choice('general.payments', 1) . ': ' . @date($payment->paid_at))

@section('new_button')
@stack('button_print_start')
<a href="{{ $print_action }}" target="_blank" class="btn btn-white btn-sm">
{{ trans('general.print') }}
</a>
@stack('button_print_end')

@stack('button_pdf_start')
<a href="{{ $pdf_action }}" class="btn btn-white btn-sm">
{{ trans('general.download') }}
</a>
@stack('button_pdf_end')

@stack('button_dashboard_start')
@if (!user())
<a href="{{ route('portal.dashboard') }}" class="btn btn-white btn-sm">
{{ trans('payments.all_payments') }}
</a>
@endif
@stack('button_dashboard_end')
@endsection

@section('content')
<x-transactions.show.header
type="payment"
:transaction="$payment"
hide-header-contact
class-header-status="col-md-8"
/>

<x-transactions.show.transaction
type="payment"
:transaction="$payment"
transaction-template="{{ setting('payment.template', 'default') }}"
hide-payment-methods
/>
@endsection

@push('footer_start')
<link rel="stylesheet" href="{{ asset('public/css/print.css?v=' . version('short')) }}" type="text/css">
<script src="{{ asset('public/js/portal/payments.js?v=' . version('short')) }}"></script>
@endpush

0 comments on commit eb8d94a

Please sign in to comment.