Search…
⌃K
Links

Accounts

​
Firstly, please take a look at our backend service and implement account linking as well as account information service in order to proceed further.
Implement account linking:
val hceAccountManager = KevinHcePlugin.getAccountManager(context)
// get account info from your backend by supplying authorizationCode returned
// from the kevin. Mobile SDK
val accountInfo = apiClient.getAccountInfo(authorizationCode)
val expirationDate = Date(accountInfo.expires_at * 1000)
// link bank account
val linkedAccount = hceAccountManager.linkBankAccount(
AccountInfo(
accountInfo.authId,
accountInfo.bankName,
accountInfo.ibans,
expirationDate
)
)
// set default payment account by choosing any of the user ibans
hceAccountManager.setDefaultPaymentAccount(
linkedAccount.linkId,
accountInfo.ibans.first()
)
Get a list of linked accounts as well and remove the account:
val hceAccountManager = KevinHcePlugin.getAccountManager(context)
// get all linked accounts
val linkedAccounts = hceAccountManager.getBankAccounts()
// get default account
val defaultAccount = hceAccountManager.getDefaultBankAccount()
// delete account
hceAccountManager.removePaymentAccount(
defaultAccount.linkId,
defaultAccount.paymentAccounts.first.ibans.first
)