diff --git a/app/Http/Controllers/OnlinePaymentController.php b/app/Http/Controllers/OnlinePaymentController.php index f45667893886..418d7cdce001 100644 --- a/app/Http/Controllers/OnlinePaymentController.php +++ b/app/Http/Controllers/OnlinePaymentController.php @@ -75,14 +75,14 @@ class OnlinePaymentController extends BaseController ]); } - if (! $invitation->invoice->canBePaid() && ! request()->update) { + if (! request()->capture && ! $invitation->invoice->canBePaid()) { return redirect()->to('view/' . $invitation->invitation_key); } $invitation = $invitation->load('invoice.client.account.account_gateways.gateway'); $account = $invitation->account; - if ($account->requiresAuthorization($invitation->invoice) && ! session('authorized:' . $invitation->invitation_key)) { + if (! request()->capture && $account->requiresAuthorization($invitation->invoice) && ! session('authorized:' . $invitation->invitation_key)) { return redirect()->to('view/' . $invitation->invitation_key); } @@ -126,14 +126,14 @@ class OnlinePaymentController extends BaseController $paymentDriver = $invitation->account->paymentDriver($invitation, $gatewayTypeId); - if (! $invitation->invoice->canBePaid() && ! request()->update) { + if (! $invitation->invoice->canBePaid() && ! request()->capture) { return redirect()->to('view/' . $invitation->invitation_key); } try { $paymentDriver->completeOnsitePurchase($request->all()); - if (request()->update) { + if (request()->capture) { return redirect('/client/dashboard')->withMessage(trans('texts.updated_payment_details')); } elseif ($paymentDriver->isTwoStep()) { Session::flash('warning', trans('texts.bank_account_verification_next_steps')); diff --git a/app/Ninja/PaymentDrivers/BasePaymentDriver.php b/app/Ninja/PaymentDrivers/BasePaymentDriver.php index 8cdf9ebbf04c..1601f9d3d789 100644 --- a/app/Ninja/PaymentDrivers/BasePaymentDriver.php +++ b/app/Ninja/PaymentDrivers/BasePaymentDriver.php @@ -164,8 +164,8 @@ class BasePaymentDriver } $url = 'payment/' . $this->invitation->invitation_key; - if (request()->update) { - $url .= '?update=true'; + if (request()->capture) { + $url .= '?capture=true'; } $data = [ @@ -303,7 +303,7 @@ class BasePaymentDriver } } - if ($this->isTwoStep() || request()->update) { + if ($this->isTwoStep() || request()->capture) { return; } diff --git a/resources/views/payments/braintree/paypal.blade.php b/resources/views/payments/braintree/paypal.blade.php index 0fdf0b79bbc2..dc4fd8ea9ea7 100644 --- a/resources/views/payments/braintree/paypal.blade.php +++ b/resources/views/payments/braintree/paypal.blade.php @@ -29,7 +29,7 @@
@if(isset($amount)) - {!! Button::success(request()->update ? strtoupper(trans('texts.submit')) : strtoupper(trans('texts.pay_now') . ' - ' . $account->formatMoney($amount, $client, CURRENCY_DECORATOR_CODE) )) + {!! Button::success(request()->capture ? strtoupper(trans('texts.submit')) : strtoupper(trans('texts.pay_now') . ' - ' . $account->formatMoney($amount, $client, CURRENCY_DECORATOR_CODE) )) ->submit() ->large() !!} @else diff --git a/resources/views/payments/credit_card.blade.php b/resources/views/payments/credit_card.blade.php index ea143c65490c..0cac21d014ec 100644 --- a/resources/views/payments/credit_card.blade.php +++ b/resources/views/payments/credit_card.blade.php @@ -450,7 +450,7 @@ @endif @if (isset($amount)) - {!! Button::success(request()->update ? strtoupper(trans('texts.submit')) : strtoupper(trans('texts.pay_now') . ' - ' . $account->formatMoney($amount, $client, CURRENCY_DECORATOR_CODE) )) + {!! Button::success(request()->capture ? strtoupper(trans('texts.submit')) : strtoupper(trans('texts.pay_now') . ' - ' . $account->formatMoney($amount, $client, CURRENCY_DECORATOR_CODE) )) ->submit() ->large() !!} @else diff --git a/resources/views/payments/payment_method.blade.php b/resources/views/payments/payment_method.blade.php index e3a4f5eaa47d..a2bc93088f2c 100644 --- a/resources/views/payments/payment_method.blade.php +++ b/resources/views/payments/payment_method.blade.php @@ -15,7 +15,7 @@
@if ($client && isset($invoiceNumber))

{{ $client->getDisplayName() }}

- @if (request()->update) + @if (request()->capture)

{{ trans('texts.update_payment_details') }}

@else

{{ trans('texts.invoice') . ' ' . $invoiceNumber }}|  {{ trans('texts.amount_due') }}: {{ $account->formatMoney($amount, $client, CURRENCY_DECORATOR_CODE) }}

diff --git a/resources/views/payments/paymentmethods_list.blade.php b/resources/views/payments/paymentmethods_list.blade.php index a2dd535febca..5ac40eef4df9 100644 --- a/resources/views/payments/paymentmethods_list.blade.php +++ b/resources/views/payments/paymentmethods_list.blade.php @@ -86,7 +86,7 @@ && $account->getGatewayByType(GATEWAY_TYPE_TOKEN) && $account->token_billing_type_id != TOKEN_BILLING_DISABLED)    - {!! Button::success(strtoupper(trans(!empty($paymentMethods) && count($paymentMethods) ? 'texts.update_credit_card' : 'texts.add_credit_card')))->asLinkTo(URL::to("/payment/$invitationKey/credit_card?update=true")) !!} + {!! Button::success(strtoupper(trans(!empty($paymentMethods) && count($paymentMethods) ? 'texts.update_credit_card' : 'texts.add_credit_card')))->asLinkTo(URL::to("/payment/$invitationKey/credit_card?capture=true")) !!} @endif diff --git a/resources/views/payments/stripe/bank_transfer.blade.php b/resources/views/payments/stripe/bank_transfer.blade.php index bb9feb718619..b8be00913a26 100644 --- a/resources/views/payments/stripe/bank_transfer.blade.php +++ b/resources/views/payments/stripe/bank_transfer.blade.php @@ -249,7 +249,7 @@ ->large() !!} @if ($accountGateway->getPlaidEnabled() && !empty($amount)) - {!! Button::success(request()->update ? strtoupper(trans('texts.submit')) : strtoupper(trans('texts.pay_now') . ' - ' . $account->formatMoney($amount, $client, CURRENCY_DECORATOR_CODE) )) + {!! Button::success(request()->capture ? strtoupper(trans('texts.submit')) : strtoupper(trans('texts.pay_now') . ' - ' . $account->formatMoney($amount, $client, CURRENCY_DECORATOR_CODE) )) ->submit() ->withAttributes(['style'=>'display:none', 'id'=>'pay_now_button']) ->large() !!} diff --git a/resources/views/payments/wepay/bank_transfer.blade.php b/resources/views/payments/wepay/bank_transfer.blade.php index b900923bb8e9..b2584caaf3de 100644 --- a/resources/views/payments/wepay/bank_transfer.blade.php +++ b/resources/views/payments/wepay/bank_transfer.blade.php @@ -33,7 +33,7 @@ {!! Button::normal(strtoupper(trans('texts.cancel')))->large()->asLinkTo($invitation->getLink()) !!}    @if (isset($amount)) - {!! Button::success(request()->update ? strtoupper(trans('texts.submit')) : strtoupper(trans('texts.pay_now') . ' - ' . $account->formatMoney($amount, $client, CURRENCY_DECORATOR_CODE) )) + {!! Button::success(request()->capture ? strtoupper(trans('texts.submit')) : strtoupper(trans('texts.pay_now') . ' - ' . $account->formatMoney($amount, $client, CURRENCY_DECORATOR_CODE) )) ->submit() ->large() !!} @else