1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

Merge pull request #3996 from beganovich/v2-fix-checkout-payments

Return view when Checkout payment fails
This commit is contained in:
David Bomba 2020-08-18 07:07:47 +10:00 committed by GitHub
commit 9361061013
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 6 deletions

View File

@ -229,7 +229,11 @@ class CheckoutComPaymentDriver extends BasePaymentDriver
SystemLogger::dispatch($message, SystemLog::CATEGORY_GATEWAY_RESPONSE, SystemLog::EVENT_GATEWAY_FAILURE, SystemLog::TYPE_CHECKOUT, $this->client);
throw new \Exception('Failed to process the payment: ' . $state['payment_response']->response_summary, 1);
// throw new \Exception('Failed to process the payment: ' . $state['payment_response']->response_summary, 1);
return render('gateways.unsuccessful', [
'code' => $state['payment_response']->response_code
]);
}
public function processInternallyFailedPayment($e, $state)

View File

@ -3243,4 +3243,8 @@ return [
'node_status_not_found' => 'I could not find Node anywhere. Is it installed?',
'npm_status_not_found' => 'I could not find NPM anywhere. Is it installed?',
'locked_invoice' => 'This invoice is locked and unable to be modified',
'common_codes' => 'Common codes and their meanings',
'payment_error_code_20087' => '20087: Bad Track Data (invalid CVV and/or expiry date)',
];

View File

@ -0,0 +1,13 @@
@extends('portal.ninja2020.layout.app')
@section('meta_title', ctrans('texts.error_title'))
@section('body')
<span class="text-center text-xl text-center">
{{ ctrans('texts.payment_error_code', ['code' => isset($code) ? $code : '']) }}
</span>
<span class="mt-6 block">{{ ctrans('texts.common_codes') }}:</span>
<ul>
<li>{{ ctrans('texts.payment_error_code_20087') }}.</li>
</ul>
@endsection

View File

@ -133,7 +133,7 @@
</div>
<div class="col-span-6 sm:col-span-3">
<label for="website" class="input-label">@lang('texts.website')</label>
<input id="website" class="input w-full" name="website"
<input id="website" class="input w-full" name="last_name"
value="{{ auth()->user()->client->website }}"/>
@error('website')
<div class="validation validation-fail">
@ -226,10 +226,10 @@
</div>
<div class="col-span-6 sm:col-span-2">
<label for="country" class="input-label">@lang('texts.country')</label>
<select id="country" class="input w-full form-select" name="country_id">
<select id="country" class="input w-full form-select" name="country">
@foreach($countries as $country)
<option
{{ $country->id == auth()->user()->client->country_id ? 'selected' : null }} value="{{ $country->id }}">
{{ $country == isset(auth()->user()->client->country->id) ? 'selected' : null }} value="{{ $country->id }}">
{{ $country->iso_3166_2 }}
({{ $country->name }})
</option>
@ -330,10 +330,10 @@
<div class="col-span-4 sm:col-span-2">
<label for="shipping_country"
class="input-label">@lang('texts.shipping_country')</label>
<select id="shipping_country" class="input w-full form-select" name="shipping_country_id">
<select id="shipping_country" class="input w-full form-select" name="shipping_country">
@foreach($countries as $country)
<option
{{ $country->id == auth()->user()->client->shipping_country_id ? 'selected' : null }} value="{{ $country->id }}">
{{ $country == isset(auth()->user()->client->shipping_country->id) ? 'selected' : null }} value="{{ $country->id }}">
{{ $country->iso_3166_2 }}
({{ $country->name }})
</option>