add braintree mandate

This commit is contained in:
David Bomba
2025-08-11 09:22:49 +10:00
parent 407b9661ca
commit 4fa9223beb
6 changed files with 27 additions and 10 deletions

View File

@@ -21,6 +21,13 @@ function boot() {
document
.getElementById('authorize-bank-account')
?.addEventListener('click', (e) => {
if (!document.getElementById('accept-terms').checked) {
errors.textContent = "You must accept the mandate terms prior to making payment.";
errors.hidden = false;
return;
}
e.target.parentElement.disabled = true;
document.getElementById('errors').hidden = true;

View File

@@ -33,6 +33,11 @@
<div class="alert alert-failure mb-4" hidden id="errors"></div>
@component('portal.ninja2020.components.general.card-element-single')
<input type="checkbox" class="form-checkbox mr-1" id="accept-terms" required>
<label for="accept-terms" class="cursor-pointer">By clicking ["Add Payment Method"], I authorize Braintree, a service of PayPal, on behalf of <b>{{ $company->present()->name() }}</b> (i) to verify my bank account information using bank information and consumer reports and (ii) to debit my bank account.</label>
@endcomponent
@component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.account_type')])
<span class="flex items-center mr-4">
<input class="form-radio mr-2" type="radio" value="checking" name="account-type" checked>

View File

@@ -29,6 +29,11 @@
<div class="alert alert-failure mb-4" hidden id="errors"></div>
@component('portal.ninja2020.components.general.card-element-single')
<input type="checkbox" class="form-checkbox mr-1" id="accept-terms" required>
<label for="accept-terms" class="cursor-pointer">By clicking ["Add Payment Method"], I authorize Braintree, a service of PayPal, on behalf of <b>{{ $company->present()->name() }}</b> (i) to verify my bank account information using bank information and consumer reports and (ii) to debit my bank account.</label>
@endcomponent
@component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.account_type')])
<span class="flex items-center mr-4">
<input class="form-radio mr-2" type="radio" value="checking" name="account-type" checked>