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