Merge pull request #6149 from beganovich/v5-2806-wepay-ach

(v5) Preselect the first token on WePay ACH payment page
This commit is contained in:
Benjamin Beganović 2021-06-28 14:30:30 +02:00 committed by GitHub
commit 1915a15ee1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,5 +53,14 @@
document.getElementById('pay-now').addEventListener('click', function () { document.getElementById('pay-now').addEventListener('click', function () {
document.getElementById('server-response').submit(); document.getElementById('server-response').submit();
}); });
document.addEventListener('DOMContentLoaded', () => {
let firstAccount = document
.querySelector('.toggle-payment-with-token')
firstAccount.checked = true;
document.querySelector('input[name=source]').value = firstAccount.dataset.token;
});
</script> </script>
@endpush @endpush