mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for payment methods datatables
This commit is contained in:
parent
46602a21c5
commit
89330e6e34
@ -2,19 +2,19 @@
|
|||||||
|
|
||||||
@section('credit_card')
|
@section('credit_card')
|
||||||
|
|
||||||
{!! Former::framework('TwitterBootstrap4'); !!}
|
{!! Former::framework('TwitterBootstrap4'); !!}
|
||||||
|
|
||||||
{!! Former::horizontal_open()
|
{!! Former::horizontal_open()
|
||||||
->id('server_response')
|
->id('server_response')
|
||||||
->route('client.payment_methods.store')
|
->route('client.payment_methods.store')
|
||||||
->method('POST'); !!}
|
->method('POST'); !!}
|
||||||
|
|
||||||
{!! Former::hidden('company_gateway_id')->value($gateway->gateway_id) !!}
|
{!! Former::hidden('company_gateway_id')->value($gateway->gateway_id) !!}
|
||||||
{!! Former::hidden('gateway_type_id')->value(1) !!}
|
{!! Former::hidden('gateway_type_id')->value(1) !!}
|
||||||
{!! Former::hidden('gateway_response')->id('gateway_response') !!}
|
{!! Former::hidden('gateway_response')->id('gateway_response') !!}
|
||||||
{!! Former::hidden('is_default')->id('is_default') !!}
|
{!! Former::hidden('is_default')->id('is_default') !!}
|
||||||
|
|
||||||
{!! Former::close() !!}
|
{!! Former::close() !!}
|
||||||
|
|
||||||
|
|
||||||
<div class="py-md-5 ninja stripe">
|
<div class="py-md-5 ninja stripe">
|
||||||
|
@ -61,18 +61,14 @@
|
|||||||
var cardButton = document.getElementById('card-button');
|
var cardButton = document.getElementById('card-button');
|
||||||
var clientSecret = cardButton.dataset.secret;
|
var clientSecret = cardButton.dataset.secret;
|
||||||
|
|
||||||
|
@if($token)
|
||||||
cardButton.addEventListener('click', function(ev) {
|
cardButton.addEventListener('click', function(ev) {
|
||||||
stripe.handleCardPayment(
|
stripe.handleCardPayment(
|
||||||
clientSecret, cardElement, {
|
clientSecret, {
|
||||||
payment_method_data: {
|
payment_method: {{$token->token}},
|
||||||
billing_details: {name: cardholderName.value}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
).then(function(result) {
|
).then(function(result) {
|
||||||
if (result.error) {
|
if (result.error) {
|
||||||
// Display error.message in your UI.
|
|
||||||
// console.log(result.error);
|
|
||||||
// console.log(result.error.message);
|
|
||||||
|
|
||||||
$("#card-errors").empty();
|
$("#card-errors").empty();
|
||||||
$("#card-errors").append("<b>" + result.error.message + "</b>");
|
$("#card-errors").append("<b>" + result.error.message + "</b>");
|
||||||
@ -85,7 +81,29 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@else
|
||||||
|
cardButton.addEventListener('click', function(ev) {
|
||||||
|
stripe.handleCardPayment(
|
||||||
|
clientSecret, cardElement, {
|
||||||
|
payment_method_data: {
|
||||||
|
billing_details: {name: cardholderName.value}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
).then(function(result) {
|
||||||
|
if (result.error) {
|
||||||
|
|
||||||
|
$("#card-errors").empty();
|
||||||
|
$("#card-errors").append("<b>" + result.error.message + "</b>");
|
||||||
|
$("#card-button").removeAttr("disabled");
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// The setup has succeeded. Display a success message.
|
||||||
|
console.log(result);
|
||||||
|
postResult(result);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
@endif
|
||||||
$("#card-button").attr("disabled", true);
|
$("#card-button").attr("disabled", true);
|
||||||
|
|
||||||
$('#cardholder-name').on('input',function(e){
|
$('#cardholder-name').on('input',function(e){
|
||||||
|
@ -69,6 +69,10 @@ $(function() {
|
|||||||
loadingRecords: "{{ trans('texts.loading') }}",
|
loadingRecords: "{{ trans('texts.loading') }}",
|
||||||
zeroRecords: "{{ trans('texts.no_records_found') }}"
|
zeroRecords: "{{ trans('texts.no_records_found') }}"
|
||||||
},
|
},
|
||||||
|
ajax: {
|
||||||
|
url: '{!! route('client.payment_methods.index') !!}'
|
||||||
|
|
||||||
|
},
|
||||||
columns: [
|
columns: [
|
||||||
|
|
||||||
{data: 'created_at', name: 'created_at', title: '{{ctrans('texts.created_at')}}', visible: true},
|
{data: 'created_at', name: 'created_at', title: '{{ctrans('texts.created_at')}}', visible: true},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user