payment method update

This commit is contained in:
denisdulici 2020-01-02 13:15:49 +03:00
parent bcc0ba960a
commit df7a5bd428
5 changed files with 18 additions and 66 deletions

View File

@ -43,12 +43,28 @@ abstract class PaymentController extends BaseController
public function show(Invoice $invoice, PaymentRequest $request)
{
return $this->getInvoiceShow($invoice, 'show');
$this->setContactFirstLastName($invoice);
$confirm_url = $this->getConfirmUrl($invoice);
$html = view('partials.portal.payment_method.' . $this->type, [
'setting' => $this->setting,
'invoice' => $invoice,
'confirm_url' => $confirm_url,
])->render();
return response()->json([
'code' => $this->setting['code'],
'name' => $this->setting['name'],
'description' => trans($this->alias . '::general.description'),
'redirect' => false,
'html' => $html,
]);
}
public function signed(Invoice $invoice, PaymentRequest $request)
{
return $this->getInvoiceShow($invoice, 'signed');
return $this->show($invoice, $request);
}
public function cancel(Invoice $invoice, $force_redirect = false)
@ -99,27 +115,6 @@ abstract class PaymentController extends BaseController
]);
}
public function getInvoiceShow(Invoice $invoice, $view = 'show')
{
$this->setContactFirstLastName($invoice);
$confirm_url = $this->getConfirmUrl($invoice);
$html = view('partials.portal.payment_method.' . $this->type . '.' . $view, [
'setting' => $this->setting,
'invoice' => $invoice,
'confirm_url' => $confirm_url,
])->render();
return response()->json([
'code' => $this->setting['code'],
'name' => $this->setting['name'],
'description' => trans($this->alias . '::general.description'),
'redirect' => false,
'html' => $html,
]);
}
public function getInvoiceUrl($invoice)
{
return $this->user

View File

@ -1,15 +0,0 @@
<card-form
:card="false"
:path="'{{ $confirm_url }}'"
:text-card-number="'{{ trans('general.card.number') }}'"
:placeholder-card-number="'{{ trans('general.form.enter', ['field' => trans('general.card.number')]) }}'"
:text-card-name="'{{ trans('general.card.name') }}'"
:placeholder-card-name="'{{ trans('general.form.enter', ['field' => trans('general.card.name')]) }}'"
:text-expiration-date="'{{ trans('general.card.expiration_date') }}'"
:text-month="'{{ trans('general.month') }}'"
:text-year="'{{ trans('general.year') }}'"
:text-cvv="'{{ trans('general.card.cvv') }}'"
:placeholder-card-cvv="'{{ trans('general.form.enter', ['field' => trans('general.card.cvv')]) }}'"
:textButton="'{{ trans('general.confirm') }}'"
:form-data="formData"
/>

View File

@ -1,28 +0,0 @@
<div>
<div class="d-none">
@if (!empty($setting['name']))
<h2>{{ $setting['name'] }}</h2>
@endif
@if (!empty($setting['description']))
<div class="well well-sm">{{ $setting['description'] }}</div>
@endif
</div>
<br>
<div class="buttons">
<div class="pull-right">
{!! Form::open([
'url' => $confirm_url,
'id' => 'redirect-form',
'role' => 'form',
'autocomplete' => "off",
'novalidate' => 'true'
]) !!}
<button @click="onRedirectConfirm" type="button" id="button-confirm" class="btn btn-success">
{{ trans('general.confirm') }}
</button>
{!! Form::close() !!}
</div>
</div>
</div>