mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 12:12:48 +01:00
Minor fixes for payments
This commit is contained in:
parent
c9a19cbd76
commit
e2ddabe95d
@ -356,7 +356,7 @@ class ClientPortalController extends BaseController
|
||||
'clientFontUrl' => $account->getFontsUrl(),
|
||||
'entityType' => ENTITY_PAYMENT,
|
||||
'title' => trans('texts.payments'),
|
||||
'columns' => Utils::trans(['invoice', 'transaction_reference', 'method', 'source', 'payment_amount', 'payment_date', 'status'])
|
||||
'columns' => Utils::trans(['invoice', 'transaction_reference', 'method', 'payment_amount', 'payment_date', 'status'])
|
||||
];
|
||||
|
||||
return response()->view('public_list', $data);
|
||||
@ -373,32 +373,6 @@ class ClientPortalController extends BaseController
|
||||
->addColumn('invoice_number', function ($model) { return $model->invitation_key ? link_to('/view/'.$model->invitation_key, $model->invoice_number)->toHtml() : $model->invoice_number; })
|
||||
->addColumn('transaction_reference', function ($model) { return $model->transaction_reference ? $model->transaction_reference : '<i>Manual entry</i>'; })
|
||||
->addColumn('payment_type', function ($model) { return ($model->payment_type && !$model->last4) ? $model->payment_type : ($model->account_gateway_id ? '<i>Online payment</i>' : ''); })
|
||||
->addColumn('payment_source', function ($model) {
|
||||
$code = str_replace(' ', '', strtolower($model->payment_type));
|
||||
$card_type = trans("texts.card_" . $code);
|
||||
if ($model->payment_type_id != PAYMENT_TYPE_ACH) {
|
||||
if($model->last4) {
|
||||
$expiration = trans('texts.card_expiration', array('expires' => Utils::fromSqlDate($model->expiration, false)->format('m/y')));
|
||||
return '<img height="22" src="' . URL::to('/images/credit_cards/' . $code . '.png') . '" alt="' . htmlentities($card_type) . '"> •••' . $model->last4 . ' ' . $expiration;
|
||||
} elseif ($model->email) {
|
||||
return $model->email;
|
||||
}
|
||||
} elseif ($model->last4) {
|
||||
if($model->bank_name) {
|
||||
$bankName = $model->bank_name;
|
||||
} else {
|
||||
$bankData = PaymentMethod::lookupBankData($model->routing_number);
|
||||
if($bankData) {
|
||||
$bankName = $bankData->name;
|
||||
}
|
||||
}
|
||||
if (!empty($bankName)) {
|
||||
return $bankName.' •••' . $model->last4;
|
||||
} elseif($model->last4) {
|
||||
return '<img height="22" src="' . URL::to('/images/credit_cards/ach.png') . '" alt="' . htmlentities($card_type) . '"> •••' . $model->last4;
|
||||
}
|
||||
}
|
||||
})
|
||||
->addColumn('amount', function ($model) { return Utils::formatMoney($model->amount, $model->currency_id, $model->country_id); })
|
||||
->addColumn('payment_date', function ($model) { return Utils::dateToString($model->payment_date); })
|
||||
->addColumn('status', function ($model) { return $this->getPaymentStatusLabel($model); })
|
||||
|
@ -58,7 +58,7 @@ class OnlinePaymentController extends BaseController
|
||||
}
|
||||
return redirect()->to('view/' . $invitation->invitation_key);
|
||||
} catch (Exception $exception) {
|
||||
return $this->error($paymentDriver, $exception);
|
||||
return $this->error($paymentDriver, $exception, true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -84,7 +84,7 @@ class OnlinePaymentController extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
private function error($paymentDriver, $exception)
|
||||
private function error($paymentDriver, $exception, $showPayment)
|
||||
{
|
||||
if (is_string($exception)) {
|
||||
$displayError = $exception;
|
||||
@ -100,7 +100,8 @@ class OnlinePaymentController extends BaseController
|
||||
$message = sprintf('Payment Error [%s]: %s', $paymentDriver->providerName(), $logError);
|
||||
Utils::logError($message, 'PHP', true);
|
||||
|
||||
return redirect()->to('view/' . $paymentDriver->invitation->invitation_key);
|
||||
$route = $showPayment ? 'payment/' : 'view/';
|
||||
return redirect()->to($route . $paymentDriver->invitation->invitation_key);
|
||||
}
|
||||
|
||||
public function getBankInfo($routingNumber) {
|
||||
|
@ -31,7 +31,7 @@ class PaymentController extends BaseController
|
||||
return View::make('list', array(
|
||||
'entityType' => ENTITY_PAYMENT,
|
||||
'title' => trans('texts.payments'),
|
||||
'sortCol' => '6',
|
||||
'sortCol' => '7',
|
||||
'columns' => Utils::trans([
|
||||
'checkbox',
|
||||
'invoice',
|
||||
|
@ -59,7 +59,7 @@ class PaymentDatatable extends EntityDatatable
|
||||
$card_type = trans("texts.card_" . $code);
|
||||
if ($model->payment_type_id != PAYMENT_TYPE_ACH) {
|
||||
if($model->last4) {
|
||||
$expiration = trans('texts.card_expiration', array('expires' => Utils::fromSqlDate($model->expiration, false)->format('m/y')));
|
||||
$expiration = Utils::fromSqlDate($model->expiration, false)->format('m/y');
|
||||
return '<img height="22" src="' . URL::to('/images/credit_cards/' . $code . '.png') . '" alt="' . htmlentities($card_type) . '"> •••' . $model->last4 . ' ' . $expiration;
|
||||
} elseif ($model->email) {
|
||||
return $model->email;
|
||||
|
@ -15,6 +15,7 @@ class WePayPaymentDriver extends BasePaymentDriver
|
||||
];
|
||||
}
|
||||
|
||||
/*
|
||||
public function startPurchase($input = false, $sourceId = false)
|
||||
{
|
||||
$data = parent::startPurchase($input, $sourceId);
|
||||
@ -27,6 +28,7 @@ class WePayPaymentDriver extends BasePaymentDriver
|
||||
|
||||
return $data;
|
||||
}
|
||||
*/
|
||||
|
||||
public function tokenize()
|
||||
{
|
||||
@ -167,7 +169,7 @@ class WePayPaymentDriver extends BasePaymentDriver
|
||||
if ($response->state == 'deleted') {
|
||||
return parent::removePaymentMethod($paymentMethod);
|
||||
} else {
|
||||
throw new Exception();
|
||||
throw new Exception(trans('texts.failed_remove_payment_method'));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1357,6 +1357,8 @@ $LANG = array(
|
||||
'use_bank_on_file' => 'Use Bank on File',
|
||||
'auto_bill_email_message' => 'This invoice will automatically be billed to the payment method on file on the due date.',
|
||||
'bitcoin' => 'Bitcoin',
|
||||
'added_on' => 'Added :date',
|
||||
'failed_remove_payment_method' => 'Failed to remove the payment method',
|
||||
|
||||
);
|
||||
|
||||
|
@ -16,13 +16,4 @@
|
||||
<p> <p>
|
||||
<p> <p>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function() {
|
||||
var height = $(window).height() - ($('.navbar').height() + $('footer').height() + 200);
|
||||
$('.well').height(Math.max(200, height));
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
@stop
|
@ -1,4 +1,4 @@
|
||||
<iframe id="theFrame" style="display:none" frameborder="1" width="100%" height="{{ isset($pdfHeight) ? $pdfHeight : 1180 }}px"></iframe>
|
||||
<iframe id="theFrame" style="display:block" frameborder="1" width="100%" height="{{ isset($pdfHeight) ? $pdfHeight : 1180 }}px"></iframe>
|
||||
<canvas id="theCanvas" style="display:none;width:100%;border:solid 1px #CCCCCC;"></canvas>
|
||||
|
||||
@if (!Utils::isNinja() || !Utils::isPro())
|
||||
@ -140,6 +140,7 @@
|
||||
canvas.width = viewport.width;
|
||||
|
||||
page.render({canvasContext: context, viewport: viewport});
|
||||
$('#theFrame').hide();
|
||||
$('#theCanvas').show();
|
||||
isRefreshing = false;
|
||||
if (needsRefresh) {
|
||||
|
@ -93,25 +93,30 @@
|
||||
@else
|
||||
{{ trans('texts.bank_account') }}
|
||||
@endif
|
||||
@if($paymentMethod->status == PAYMENT_METHOD_STATUS_NEW)
|
||||
@if($gateway->gateway_id == GATEWAY_STRIPE)
|
||||
<a href="#" onclick="completeVerification('{{$paymentMethod->public_id}}','{{$paymentMethod->currency->symbol}}')">({{trans('texts.complete_verification')}})</a>
|
||||
@else
|
||||
({{ trans('texts.verification_pending') }})
|
||||
@endif
|
||||
@elseif($paymentMethod->status == PAYMENT_METHOD_STATUS_VERIFICATION_FAILED)
|
||||
({{trans('texts.verification_failed')}})
|
||||
@endif
|
||||
@elseif($paymentMethod->payment_type_id == PAYMENT_TYPE_PAYPAL)
|
||||
{{ trans('texts.paypal') . ': ' . $paymentMethod->email }}
|
||||
@else
|
||||
{{ trans('texts.credit_card') }}
|
||||
@endif
|
||||
|
||||
- {{ trans('texts.added_on', ['date' => Utils::dateToString($paymentMethod->created_at)]) }}
|
||||
|
||||
@if($paymentMethod->payment_type_id == PAYMENT_TYPE_ACH)
|
||||
@if($paymentMethod->status == PAYMENT_METHOD_STATUS_NEW)
|
||||
@if($gateway->gateway_id == GATEWAY_STRIPE)
|
||||
<a href="#" onclick="completeVerification('{{$paymentMethod->public_id}}','{{$paymentMethod->currency->symbol}}')">({{trans('texts.complete_verification')}})</a>
|
||||
@else
|
||||
[{{ trans('texts.verification_pending') }}]
|
||||
@endif
|
||||
@elseif($paymentMethod->status == PAYMENT_METHOD_STATUS_VERIFICATION_FAILED)
|
||||
[{{trans('texts.verification_failed')}}]
|
||||
@endif
|
||||
@endif
|
||||
|
||||
@if($paymentMethod->id == $paymentMethod->account_gateway_token->default_payment_method_id)
|
||||
({{trans('texts.used_for_auto_bill')}})
|
||||
[{{trans('texts.used_for_auto_bill')}}]
|
||||
@elseif($paymentMethod->payment_type_id != PAYMENT_TYPE_ACH || $paymentMethod->status == PAYMENT_METHOD_STATUS_VERIFIED)
|
||||
<a href="#" onclick="setDefault('{{$paymentMethod->public_id}}')">({{trans('texts.use_for_auto_bill')}})</a>
|
||||
[<a href="#" onclick="setDefault('{{$paymentMethod->public_id}}')">{{trans('texts.use_for_auto_bill')}}</a>]
|
||||
@endif
|
||||
<a href="#" title="{{ trans('texts.remove') }}" class="payment_method_remove" onclick="removePaymentMethod('{{$paymentMethod->public_id}}')">×</a>
|
||||
|
||||
|
@ -53,11 +53,21 @@
|
||||
function getStarted() {
|
||||
$('#startForm').submit();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
// check that the footer appears at the bottom of the screen
|
||||
var height = $(window).height() - ($('#header').height() + $('#footer').height());
|
||||
if ($('#mainContent').height() < height) {
|
||||
$('#mainContent').height(height);
|
||||
}
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<nav class="navbar navbar-top navbar-inverse">
|
||||
<div id="header">
|
||||
<nav class="navbar navbar-top navbar-inverse">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
|
||||
@ -102,7 +112,7 @@
|
||||
@endif
|
||||
</div><!--/.nav-collapse -->
|
||||
</div>
|
||||
</nav>
|
||||
</nav>
|
||||
|
||||
<div class="container">
|
||||
|
||||
@ -120,8 +130,11 @@
|
||||
<div class="alert alert-danger">{!! Session::get('error') !!}</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@yield('content')
|
||||
<div id="mainContent">
|
||||
@yield('content')
|
||||
</div>
|
||||
|
||||
<footer id="footer" role="contentinfo">
|
||||
<div class="top">
|
||||
|
Loading…
Reference in New Issue
Block a user