You can now access fints4k via JavaScript, e.g.:
var webClient = {
post_w74nik$: function(url, body, contentType, userAgent) {
var xmlHttp = new XMLHttpRequest()
xmlHttp.open( "POST", "https://cors-anywhere.herokuapp.com/" + url, false )
xmlHttp.setRequestHeader("Content-Type", contentType)
xmlHttp.send( body )
return { successful: xmlHttp.status == 200, responseCode: xmlHttp.status, error: null, body: xmlHttp.responseText }
}
}
var fints = this.fints4k.net.dankito.banking.fints
var bank = new fints.model.BankData("[Bank code (Bankleitzahl)>", 280, "[FinTS Server Address]", "[BIC]")
var customer = new fints.model.CustomerData("[Your customer id (Online Banking login name)]", "[Password]")
var client = new fints.FinTsClientForCustomer(bank, customer, null, webClient) // TODO: add callback
setTimeout(function() {
var addAccountResponse = client.addAccount()
console.log(addAccountResponse)
}, 1)