mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-14 05:14:35 -04:00
Added views
This commit is contained in:
parent
b727a07476
commit
125250f62c
@ -29,7 +29,7 @@ class SEPA implements MethodInterface
|
|||||||
|
|
||||||
public function authorizeView($data)
|
public function authorizeView($data)
|
||||||
{
|
{
|
||||||
return render('gateways.stripe.sofort.authorize', $data);
|
return render('gateways.stripe.sepa.authorize', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function authorizeResponse(Request $request) { }
|
public function authorizeResponse(Request $request) { }
|
||||||
|
59
resources/js/clients/payments/stripe-sepa.js
vendored
Normal file
59
resources/js/clients/payments/stripe-sepa.js
vendored
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
/**
|
||||||
|
* Invoice Ninja (https://invoiceninja.com)
|
||||||
|
*
|
||||||
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
|
*
|
||||||
|
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
|
*
|
||||||
|
* @license https://opensource.org/licenses/AAL
|
||||||
|
*/
|
||||||
|
|
||||||
|
class ProcessSEPA {
|
||||||
|
constructor(key, stripeConnect) {
|
||||||
|
this.key = key;
|
||||||
|
this.errors = document.getElementById('errors');
|
||||||
|
this.stripeConnect = stripeConnect;
|
||||||
|
}
|
||||||
|
|
||||||
|
setupStripe = () => {
|
||||||
|
this.stripe = Stripe(this.key);
|
||||||
|
|
||||||
|
if(this.stripeConnect)
|
||||||
|
this.stripe.stripeAccount = stripeConnect;
|
||||||
|
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
|
handle = () => {
|
||||||
|
document.getElementById('pay-now').addEventListener('click', (e) => {
|
||||||
|
document.getElementById('pay-now').disabled = true;
|
||||||
|
document.querySelector('#pay-now > svg').classList.remove('hidden');
|
||||||
|
document.querySelector('#pay-now > span').classList.add('hidden');
|
||||||
|
|
||||||
|
this.stripe.confirmSEPAPayment(
|
||||||
|
document.querySelector('meta[name=pi-client-secret').content,
|
||||||
|
{
|
||||||
|
payment_method: {
|
||||||
|
sofort: {
|
||||||
|
country: document.querySelector(
|
||||||
|
'meta[name="country"]'
|
||||||
|
).content,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
return_url: document.querySelector(
|
||||||
|
'meta[name="return-url"]'
|
||||||
|
).content,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const publishableKey = document.querySelector(
|
||||||
|
'meta[name="stripe-publishable-key"]'
|
||||||
|
)?.content ?? '';
|
||||||
|
|
||||||
|
const stripeConnect =
|
||||||
|
document.querySelector('meta[name="stripe-account-id"]')?.content ?? '';
|
||||||
|
|
||||||
|
new ProcessSEPA(publishableKey, stripeConnect).setupStripe().handle();
|
@ -10,9 +10,9 @@
|
|||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('gateway_content')
|
@section('gateway_content')
|
||||||
@if(session()->has('ach_error'))
|
@if(session()->has('sepa_error'))
|
||||||
<div class="alert alert-failure mb-4">
|
<div class="alert alert-failure mb-4">
|
||||||
<p>{{ session('ach_error') }}</p>
|
<p>{{ session('sepa_error') }}</p>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@ -78,5 +78,5 @@
|
|||||||
|
|
||||||
@section('gateway_footer')
|
@section('gateway_footer')
|
||||||
<script src="https://js.stripe.com/v3/"></script>
|
<script src="https://js.stripe.com/v3/"></script>
|
||||||
<script src="{{ asset('js/clients/payments/stripe-ach.js') }}"></script>
|
<script src="{{ asset('js/clients/payments/stripe-sepa.js') }}"></script>
|
||||||
@endsection
|
@endsection
|
||||||
|
Loading…
x
Reference in New Issue
Block a user