mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-15 07:33:04 +01:00
Fixes for CVV issues on Authorize & Forte (#84)
* fixes for forte * fixes for authorize
This commit is contained in:
parent
3d69a0b88c
commit
19556eb970
@ -7,9 +7,6 @@
|
||||
|
||||
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
|
||||
<meta name="authnet-require-cvv" content="{{ $gateway->company_gateway->require_cvv }}">
|
||||
|
||||
<script src="{{ asset('build/public/js/card-js.min.js/card-js.min.js') }}"></script>
|
||||
<link href="{{ asset('build/public/css/card-js.min.css/card-js.min.css') }}" rel="stylesheet" type="text/css">
|
||||
@endsection
|
||||
|
||||
@section('gateway_content')
|
||||
@ -77,20 +74,11 @@
|
||||
|
||||
@push('footer')
|
||||
<script defer>
|
||||
|
||||
$(function() {
|
||||
|
||||
document.getElementsByClassName("expiry")[0].addEventListener('change', function() {
|
||||
|
||||
str = document.getElementsByClassName("expiry")[0].value.replace(/\s/g, '');
|
||||
const expiryArray = str.split("/");
|
||||
|
||||
document.getElementsByName('expiry-month')[0].value = expiryArray[0];
|
||||
document.getElementsByName('expiry-year')[0].value = expiryArray[1];
|
||||
document.querySelector('#date').addEventListener('change', (e) => {
|
||||
const [month, year] = e.target.value.replace(/\s/g, '').split('/');
|
||||
|
||||
document.getElementsByName('expiry-month')[0].value = month;
|
||||
document.getElementsByName('expiry-year')[0].value = `20${year}`;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
@endpush
|
||||
|
@ -3,11 +3,14 @@
|
||||
<div class="card-js" id="my-card" data-capture-name="true">
|
||||
<input class="input w-full" id="cardholder_name" name="card_holders_name"
|
||||
placeholder="{{ ctrans('texts.name')}}">
|
||||
<input type="text" class="input w-full" id="number" placeholder="0000 0000 0000 0000">
|
||||
<input type="text" class="input w-full" id="number" placeholder="0000 0000 0000 0000" name="card_number" />
|
||||
<div class="flex items-center gap-2">
|
||||
<input type="text" class="input w-1/2" id="date" placeholder="MM/YY">
|
||||
<input type="text" class="input w-1/2" id="cvv" placeholder="000">
|
||||
</div>
|
||||
|
||||
<input type="hidden" class="expiry-month" name="expiry-month" id="expiration_month" autocomplete="cc-exp-month" x-autocompletetype="cc-exp-month">
|
||||
<input type="hidden" class="expiry-year" name="expiry-year" id="expiration_year" autocomplete="cc-exp-year" x-autocompletetype="cc-exp-year">
|
||||
</div>
|
||||
|
||||
<div id="errors"></div>
|
||||
|
@ -5,9 +5,6 @@
|
||||
<meta name="instant-payment" content="yes" />
|
||||
|
||||
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
|
||||
<script src="{{ asset('js/clients/payments/forte-card-js.min.js') }}"></script>
|
||||
|
||||
<link href="{{ asset('css/card-js.min.css') }}" rel="stylesheet" type="text/css">
|
||||
@endsection
|
||||
|
||||
@section('gateway_content')
|
||||
@ -54,20 +51,11 @@
|
||||
|
||||
@push('footer')
|
||||
<script defer>
|
||||
|
||||
$(function() {
|
||||
|
||||
document.getElementsByClassName("expiry")[0].addEventListener('change', function() {
|
||||
|
||||
str = document.getElementsByClassName("expiry")[0].value.replace(/\s/g, '');
|
||||
const expiryArray = str.split("/");
|
||||
|
||||
document.getElementsByName('expiry-month')[0].value = expiryArray[0];
|
||||
document.getElementsByName('expiry-year')[0].value = expiryArray[1];
|
||||
document.querySelector('#date').addEventListener('change', (e) => {
|
||||
const [month, year] = e.target.value.replace(/\s/g, '').split('/');
|
||||
|
||||
document.getElementsByName('expiry-month')[0].value = month;
|
||||
document.getElementsByName('expiry-year')[0].value = `20${year}`;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
@endpush
|
||||
|
@ -3,11 +3,14 @@
|
||||
<div class="card-js" id="my-card" data-capture-name="true">
|
||||
<input class="input w-full" id="cardholder_name" name="card_holders_name"
|
||||
placeholder="{{ ctrans('texts.name')}}">
|
||||
<input type="text" class="input w-full" id="number" placeholder="0000 0000 0000 0000">
|
||||
<input type="text" class="input w-full" id="number" placeholder="0000 0000 0000 0000" name="card-number" />
|
||||
<div class="flex items-center gap-2">
|
||||
<input type="text" class="input w-1/2" id="date" placeholder="MM/YY">
|
||||
<input type="text" class="input w-1/2" id="cvv" placeholder="000">
|
||||
</div>
|
||||
|
||||
<input type="hidden" class="expiry-month" name="expiry-month" id="expiration_month" autocomplete="cc-exp-month" x-autocompletetype="cc-exp-month">
|
||||
<input type="hidden" class="expiry-year" name="expiry-year" id="expiration_year" autocomplete="cc-exp-year" x-autocompletetype="cc-exp-year">
|
||||
</div>
|
||||
|
||||
<div id="errors"></div>
|
||||
|
Loading…
Reference in New Issue
Block a user