Clarify credit error
This commit is contained in:
parent
43f38d9d84
commit
fceb82ea51
1 changed files with 15 additions and 3 deletions
|
|
@ -263,13 +263,25 @@
|
|||
$('#saveButton').attr('disabled', false);
|
||||
canSubmitPayment = true;
|
||||
|
||||
var error = '';
|
||||
var error = '{{ trans('texts.error_refresh_page') }}';
|
||||
if (data) {
|
||||
var error = firstJSONError(data.responseJSON) || data.statusText;
|
||||
error = firstPaymentError(data.responseJSON);
|
||||
}
|
||||
swal({!! json_encode(trans('texts.error_refresh_page')) !!}, error);
|
||||
|
||||
swal({title: '{{ trans('texts.an_error_occurred') }}', text: error});
|
||||
}
|
||||
|
||||
function firstPaymentError(json) {
|
||||
json = json['errors'];
|
||||
for (var key in json) {
|
||||
if ( ! json.hasOwnProperty(key)) {
|
||||
continue;
|
||||
}
|
||||
return json[key] + '';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
function submitAction(action) {
|
||||
$('#action').val(action);
|
||||
$('.main-form').submit();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue