Renamed TanProcedure to TanMethod in UI
This commit is contained in:
parent
f5f3f34d3b
commit
be42e3b330
|
@ -3,7 +3,7 @@ package net.dankito.banking.persistence.model
|
||||||
import com.fasterxml.jackson.annotation.*
|
import com.fasterxml.jackson.annotation.*
|
||||||
import net.dankito.banking.ui.model.ICustomer
|
import net.dankito.banking.ui.model.ICustomer
|
||||||
import net.dankito.banking.ui.model.tan.TanMedium
|
import net.dankito.banking.ui.model.tan.TanMedium
|
||||||
import net.dankito.banking.ui.model.tan.TanProcedure
|
import net.dankito.banking.ui.model.tan.TanMethod
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
|
|
||||||
|
@ -20,8 +20,8 @@ open class CustomerEntity(
|
||||||
override var userId: String = customerId,
|
override var userId: String = customerId,
|
||||||
override var iconUrl: String? = null,
|
override var iconUrl: String? = null,
|
||||||
override var accounts: List<BankAccountEntity> = listOf(),
|
override var accounts: List<BankAccountEntity> = listOf(),
|
||||||
override var supportedTanProcedures: List<TanProcedure> = listOf(),
|
override var supportedTanMethods: List<TanMethod> = listOf(),
|
||||||
override var selectedTanProcedure: TanProcedure? = null,
|
override var selectedTanMethod: TanMethod? = null,
|
||||||
override var tanMedia: List<TanMedium> = listOf(),
|
override var tanMedia: List<TanMedium> = listOf(),
|
||||||
override var countDaysForWhichTransactionsAreKept: Int? = null,
|
override var countDaysForWhichTransactionsAreKept: Int? = null,
|
||||||
override var technicalId: String = UUID.randomUUID().toString(),
|
override var technicalId: String = UUID.randomUUID().toString(),
|
||||||
|
|
|
@ -4,20 +4,20 @@ import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import net.dankito.banking.ui.android.R
|
import net.dankito.banking.ui.android.R
|
||||||
import net.dankito.banking.ui.model.tan.TanProcedure
|
import net.dankito.banking.ui.model.tan.TanMethod
|
||||||
import net.dankito.utils.android.extensions.asActivity
|
import net.dankito.utils.android.extensions.asActivity
|
||||||
import net.dankito.utils.android.ui.adapter.ListAdapter
|
import net.dankito.utils.android.ui.adapter.ListAdapter
|
||||||
|
|
||||||
|
|
||||||
open class TanProceduresAdapter : ListAdapter<TanProcedure>() {
|
open class TanMethodsAdapter : ListAdapter<TanMethod>() {
|
||||||
|
|
||||||
override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View? {
|
override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View? {
|
||||||
val procedure = getItem(position)
|
val method = getItem(position)
|
||||||
|
|
||||||
val view = convertView ?: parent?.context?.asActivity()?.layoutInflater?.inflate(
|
val view = convertView ?: parent?.context?.asActivity()?.layoutInflater?.inflate(
|
||||||
R.layout.list_item_tan_procedure, parent, false)
|
R.layout.list_item_tan_method, parent, false)
|
||||||
|
|
||||||
view?.findViewById<TextView>(R.id.txtTanProcedureDisplayName)?.text = procedure.displayName
|
view?.findViewById<TextView>(R.id.txtTanMethodDisplayName)?.text = method.displayName
|
||||||
|
|
||||||
return view
|
return view
|
||||||
}
|
}
|
|
@ -18,7 +18,7 @@ import kotlinx.android.synthetic.main.dialog_enter_tan.view.*
|
||||||
import kotlinx.android.synthetic.main.view_collapsible_text.view.*
|
import kotlinx.android.synthetic.main.view_collapsible_text.view.*
|
||||||
import net.dankito.banking.ui.android.R
|
import net.dankito.banking.ui.android.R
|
||||||
import net.dankito.banking.ui.android.adapter.TanMediumAdapter
|
import net.dankito.banking.ui.android.adapter.TanMediumAdapter
|
||||||
import net.dankito.banking.ui.android.adapter.TanProceduresAdapter
|
import net.dankito.banking.ui.android.adapter.TanMethodsAdapter
|
||||||
import net.dankito.banking.ui.android.di.BankingComponent
|
import net.dankito.banking.ui.android.di.BankingComponent
|
||||||
import net.dankito.banking.ui.android.listener.ListItemSelectedListener
|
import net.dankito.banking.ui.android.listener.ListItemSelectedListener
|
||||||
import net.dankito.banking.ui.model.TypedCustomer
|
import net.dankito.banking.ui.model.TypedCustomer
|
||||||
|
@ -32,10 +32,10 @@ import javax.inject.Inject
|
||||||
open class EnterTanDialog : DialogFragment() {
|
open class EnterTanDialog : DialogFragment() {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
val QrCodeTanProcedures = listOf(TanProcedureType.ChipTanQrCode, TanProcedureType.QrCode)
|
val QrCodeTanMethods = listOf(TanMethodType.ChipTanQrCode, TanMethodType.QrCode)
|
||||||
|
|
||||||
val OpticalTanProcedures = listOf(TanProcedureType.ChipTanFlickercode, TanProcedureType.ChipTanQrCode,
|
val OpticalTanMethods = listOf(TanMethodType.ChipTanFlickercode, TanMethodType.ChipTanQrCode,
|
||||||
TanProcedureType.ChipTanPhotoTanMatrixCode, TanProcedureType.photoTan, TanProcedureType.QrCode)
|
TanMethodType.ChipTanPhotoTanMatrixCode, TanMethodType.photoTan, TanMethodType.QrCode)
|
||||||
|
|
||||||
const val DialogTag = "EnterTanDialog"
|
const val DialogTag = "EnterTanDialog"
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,7 @@ open class EnterTanDialog : DialogFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun setupUI(rootView: View) {
|
protected open fun setupUI(rootView: View) {
|
||||||
setupSelectTanProcedureView(rootView)
|
setupSelectTanMethodView(rootView)
|
||||||
|
|
||||||
setupTanView(rootView)
|
setupTanView(rootView)
|
||||||
|
|
||||||
|
@ -95,23 +95,23 @@ open class EnterTanDialog : DialogFragment() {
|
||||||
rootView.btnEnteringTanDone.setOnClickListener { enteringTanDone(rootView.edtxtEnteredTan.text.toString()) }
|
rootView.btnEnteringTanDone.setOnClickListener { enteringTanDone(rootView.edtxtEnteredTan.text.toString()) }
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun setupSelectTanProcedureView(rootView: View) {
|
protected open fun setupSelectTanMethodView(rootView: View) {
|
||||||
val adapter = TanProceduresAdapter()
|
val adapter = TanMethodsAdapter()
|
||||||
val tanProceduresWithoutUnsupported = customer.supportedTanProcedures.filterNot { it.type == TanProcedureType.ChipTanUsb } // USB tan generators are not supported on Android
|
val tanMethodsWithoutUnsupported = customer.supportedTanMethods.filterNot { it.type == TanMethodType.ChipTanUsb } // USB tan generators are not supported on Android
|
||||||
adapter.setItems(tanProceduresWithoutUnsupported)
|
adapter.setItems(tanMethodsWithoutUnsupported)
|
||||||
|
|
||||||
rootView.findViewById<Spinner>(R.id.spnTanProcedures)?.let { spinner ->
|
rootView.findViewById<Spinner>(R.id.spnTanMethods)?.let { spinner ->
|
||||||
spinner.adapter = adapter
|
spinner.adapter = adapter
|
||||||
|
|
||||||
val selectedTanProcedure = customer.selectedTanProcedure
|
val selectedTanMethod = customer.selectedTanMethod
|
||||||
?: tanProceduresWithoutUnsupported.firstOrNull { it.type != TanProcedureType.ChipTanManuell && it.type != TanProcedureType.ChipTanUsb }
|
?: tanMethodsWithoutUnsupported.firstOrNull { it.type != TanMethodType.ChipTanManuell && it.type != TanMethodType.ChipTanUsb }
|
||||||
?: tanProceduresWithoutUnsupported.firstOrNull()
|
?: tanMethodsWithoutUnsupported.firstOrNull()
|
||||||
selectedTanProcedure?.let { spinner.setSelection(adapter.getItems().indexOf(selectedTanProcedure)) }
|
selectedTanMethod?.let { spinner.setSelection(adapter.getItems().indexOf(selectedTanMethod)) }
|
||||||
|
|
||||||
spinner.onItemSelectedListener = ListItemSelectedListener(adapter) { newSelectedTanProcedure ->
|
spinner.onItemSelectedListener = ListItemSelectedListener(adapter) { newSelectedTanMethod ->
|
||||||
if (newSelectedTanProcedure != selectedTanProcedure) {
|
if (newSelectedTanMethod != selectedTanMethod) {
|
||||||
tanEnteredCallback(EnterTanResult.userAsksToChangeTanProcedure(newSelectedTanProcedure))
|
tanEnteredCallback(EnterTanResult.userAsksToChangeTanMethod(newSelectedTanMethod))
|
||||||
// TODO: find a way to update account.selectedTanProcedure afterwards
|
// TODO: find a way to update account.selectedTanMethod afterwards
|
||||||
|
|
||||||
dismiss()
|
dismiss()
|
||||||
}
|
}
|
||||||
|
@ -120,9 +120,9 @@ open class EnterTanDialog : DialogFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun setupSelectTanMediumView(rootView: View) {
|
protected open fun setupSelectTanMediumView(rootView: View) {
|
||||||
val tanMediaForTanProcedure = presenter.getTanMediaForTanProcedure(customer, tanChallenge.tanProcedure)
|
val tanMediaForTanMethod = presenter.getTanMediaForTanMethod(customer, tanChallenge.tanMethod)
|
||||||
|
|
||||||
if (tanMediaForTanProcedure.size > 1) {
|
if (tanMediaForTanMethod.size > 1) {
|
||||||
rootView.lytTanMedium.visibility = View.VISIBLE
|
rootView.lytTanMedium.visibility = View.VISIBLE
|
||||||
|
|
||||||
tanMediumAdapter.setItems(customer.tanMediaSorted)
|
tanMediumAdapter.setItems(customer.tanMediaSorted)
|
||||||
|
@ -145,7 +145,7 @@ open class EnterTanDialog : DialogFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun setupTanView(rootView: View) {
|
protected open fun setupTanView(rootView: View) {
|
||||||
if (OpticalTanProcedures.contains(tanChallenge.tanProcedure.type)) {
|
if (OpticalTanMethods.contains(tanChallenge.tanMethod.type)) {
|
||||||
setupSelectTanMediumView(rootView)
|
setupSelectTanMediumView(rootView)
|
||||||
|
|
||||||
if (tanChallenge is FlickerCodeTanChallenge) {
|
if (tanChallenge is FlickerCodeTanChallenge) {
|
||||||
|
@ -158,11 +158,11 @@ open class EnterTanDialog : DialogFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun setupEnteringTan(rootView: View) {
|
protected open fun setupEnteringTan(rootView: View) {
|
||||||
if (tanChallenge.tanProcedure.isNumericTan) {
|
if (tanChallenge.tanMethod.isNumericTan) {
|
||||||
rootView.edtxtEnteredTan.inputType = InputType.TYPE_CLASS_NUMBER
|
rootView.edtxtEnteredTan.inputType = InputType.TYPE_CLASS_NUMBER
|
||||||
}
|
}
|
||||||
|
|
||||||
tanChallenge.tanProcedure.maxTanInputLength?.let { maxInputLength ->
|
tanChallenge.tanMethod.maxTanInputLength?.let { maxInputLength ->
|
||||||
rootView.edtxtEnteredTan.filters = arrayOf<InputFilter>(InputFilter.LengthFilter(maxInputLength))
|
rootView.edtxtEnteredTan.filters = arrayOf<InputFilter>(InputFilter.LengthFilter(maxInputLength))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -260,18 +260,18 @@ open class EnterTanDialog : DialogFragment() {
|
||||||
|
|
||||||
|
|
||||||
protected open fun checkIfAppSettingsChanged() {
|
protected open fun checkIfAppSettingsChanged() {
|
||||||
if (flickerCodeView.didTanProcedureSettingsChange) {
|
if (flickerCodeView.didTanMethodSettingsChange) {
|
||||||
presenter.appSettings.flickerCodeSettings = flickerCodeView.tanProcedureSettings
|
presenter.appSettings.flickerCodeSettings = flickerCodeView.tanMethodSettings
|
||||||
|
|
||||||
presenter.appSettingsChanged()
|
presenter.appSettingsChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tanImageView.didTanProcedureSettingsChange) {
|
if (tanImageView.didTanMethodSettingsChange) {
|
||||||
if (isQrTan(tanChallenge)) {
|
if (isQrTan(tanChallenge)) {
|
||||||
presenter.appSettings.qrCodeSettings = tanImageView.tanProcedureSettings
|
presenter.appSettings.qrCodeSettings = tanImageView.tanMethodSettings
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
presenter.appSettings.photoTanSettings = tanImageView.tanProcedureSettings
|
presenter.appSettings.photoTanSettings = tanImageView.tanMethodSettings
|
||||||
}
|
}
|
||||||
|
|
||||||
presenter.appSettingsChanged()
|
presenter.appSettingsChanged()
|
||||||
|
@ -279,7 +279,7 @@ open class EnterTanDialog : DialogFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun isQrTan(tanChallenge: TanChallenge): Boolean {
|
protected open fun isQrTan(tanChallenge: TanChallenge): Boolean {
|
||||||
return QrCodeTanProcedures.contains(tanChallenge.tanProcedure.type)
|
return QrCodeTanMethods.contains(tanChallenge.tanMethod.type)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -12,7 +12,7 @@ import net.dankito.banking.ui.android.R
|
||||||
import net.dankito.banking.ui.model.tan.FlickerCode
|
import net.dankito.banking.ui.model.tan.FlickerCode
|
||||||
import net.dankito.banking.ui.util.FlickerCodeAnimator
|
import net.dankito.banking.ui.util.FlickerCodeAnimator
|
||||||
import net.dankito.banking.ui.model.settings.ITanView
|
import net.dankito.banking.ui.model.settings.ITanView
|
||||||
import net.dankito.banking.ui.model.settings.TanProcedureSettings
|
import net.dankito.banking.ui.model.settings.TanMethodSettings
|
||||||
import net.dankito.banking.ui.util.Step
|
import net.dankito.banking.ui.util.Step
|
||||||
|
|
||||||
|
|
||||||
|
@ -57,10 +57,10 @@ open class ChipTanFlickerCodeView @JvmOverloads constructor(
|
||||||
protected var isFlickerCodePaused = false
|
protected var isFlickerCodePaused = false
|
||||||
|
|
||||||
|
|
||||||
override var didTanProcedureSettingsChange: Boolean = false
|
override var didTanMethodSettingsChange: Boolean = false
|
||||||
protected set
|
protected set
|
||||||
|
|
||||||
override var tanProcedureSettings: TanProcedureSettings? = null
|
override var tanMethodSettings: TanMethodSettings? = null
|
||||||
protected set
|
protected set
|
||||||
|
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ open class ChipTanFlickerCodeView @JvmOverloads constructor(
|
||||||
|
|
||||||
setMarkerPositionAfterStripesLayoutSet()
|
setMarkerPositionAfterStripesLayoutSet()
|
||||||
|
|
||||||
tanProcedureSettings?.let {
|
tanMethodSettings?.let {
|
||||||
setSize(it.width, it.height, it.space)
|
setSize(it.width, it.height, it.space)
|
||||||
setFrequency(it.frequency)
|
setFrequency(it.frequency)
|
||||||
}
|
}
|
||||||
|
@ -156,7 +156,7 @@ open class ChipTanFlickerCodeView @JvmOverloads constructor(
|
||||||
|
|
||||||
setMarkerPositionAfterStripesLayoutSet()
|
setMarkerPositionAfterStripesLayoutSet()
|
||||||
|
|
||||||
tanProcedureSettingsChanged()
|
tanMethodSettingsChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun setMarkerPositionAfterStripesLayoutSet() {
|
protected open fun setMarkerPositionAfterStripesLayoutSet() {
|
||||||
|
@ -187,13 +187,13 @@ open class ChipTanFlickerCodeView @JvmOverloads constructor(
|
||||||
|
|
||||||
animator.setFrequency(frequency)
|
animator.setFrequency(frequency)
|
||||||
|
|
||||||
tanProcedureSettingsChanged()
|
tanMethodSettingsChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun tanProcedureSettingsChanged() {
|
protected open fun tanMethodSettingsChanged() {
|
||||||
tanProcedureSettings = TanProcedureSettings(stripesWidth, stripesHeight, spaceBetweenStripes, currentFrequency)
|
tanMethodSettings = TanMethodSettings(stripesWidth, stripesHeight, spaceBetweenStripes, currentFrequency)
|
||||||
|
|
||||||
didTanProcedureSettingsChange = true // we don't check if settings really changed, it's not that important
|
didTanMethodSettingsChange = true // we don't check if settings really changed, it's not that important
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -211,10 +211,10 @@ open class ChipTanFlickerCodeView @JvmOverloads constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
open fun setCode(flickerCode: FlickerCode, tanProcedureSettings: TanProcedureSettings?) {
|
open fun setCode(flickerCode: FlickerCode, tanMethodSettings: TanMethodSettings?) {
|
||||||
animator.stop()
|
animator.stop()
|
||||||
|
|
||||||
tanProcedureSettings?.let {
|
tanMethodSettings?.let {
|
||||||
setSize(it.width, it.height, it.space)
|
setSize(it.width, it.height, it.space)
|
||||||
setFrequency(it.frequency)
|
setFrequency(it.frequency)
|
||||||
}
|
}
|
||||||
|
@ -222,8 +222,8 @@ open class ChipTanFlickerCodeView @JvmOverloads constructor(
|
||||||
setFrequency(DefaultFrequency)
|
setFrequency(DefaultFrequency)
|
||||||
}
|
}
|
||||||
|
|
||||||
this.tanProcedureSettings = tanProcedureSettings
|
this.tanMethodSettings = tanMethodSettings
|
||||||
this.didTanProcedureSettingsChange = false
|
this.didTanMethodSettingsChange = false
|
||||||
|
|
||||||
animator.animateFlickerCode(flickerCode) { step ->
|
animator.animateFlickerCode(flickerCode) { step ->
|
||||||
showStepOnUiThread(step)
|
showStepOnUiThread(step)
|
||||||
|
|
|
@ -10,7 +10,7 @@ import kotlinx.android.synthetic.main.view_tan_image.view.*
|
||||||
import kotlinx.android.synthetic.main.view_tan_image_size_controls.view.*
|
import kotlinx.android.synthetic.main.view_tan_image_size_controls.view.*
|
||||||
import net.dankito.banking.ui.android.R
|
import net.dankito.banking.ui.android.R
|
||||||
import net.dankito.banking.ui.model.settings.ITanView
|
import net.dankito.banking.ui.model.settings.ITanView
|
||||||
import net.dankito.banking.ui.model.settings.TanProcedureSettings
|
import net.dankito.banking.ui.model.settings.TanMethodSettings
|
||||||
import net.dankito.banking.ui.model.tan.ImageTanChallenge
|
import net.dankito.banking.ui.model.tan.ImageTanChallenge
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,10 +30,10 @@ open class TanImageView @JvmOverloads constructor(
|
||||||
protected lateinit var imgTanImageView: ImageView
|
protected lateinit var imgTanImageView: ImageView
|
||||||
|
|
||||||
|
|
||||||
override var didTanProcedureSettingsChange: Boolean = false
|
override var didTanMethodSettingsChange: Boolean = false
|
||||||
protected set
|
protected set
|
||||||
|
|
||||||
override var tanProcedureSettings: TanProcedureSettings? = null
|
override var tanMethodSettings: TanMethodSettings? = null
|
||||||
protected set
|
protected set
|
||||||
|
|
||||||
|
|
||||||
|
@ -55,13 +55,13 @@ open class TanImageView @JvmOverloads constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
open fun setImage(challenge: ImageTanChallenge, tanProcedureSettings: TanProcedureSettings?) {
|
open fun setImage(challenge: ImageTanChallenge, tanMethodSettings: TanMethodSettings?) {
|
||||||
val decodedImage = challenge.image
|
val decodedImage = challenge.image
|
||||||
|
|
||||||
val bitmap = BitmapFactory.decodeByteArray(decodedImage.imageBytes, 0, decodedImage.imageBytes.size)
|
val bitmap = BitmapFactory.decodeByteArray(decodedImage.imageBytes, 0, decodedImage.imageBytes.size)
|
||||||
rootView.imgTanImageView.setImageBitmap(bitmap)
|
rootView.imgTanImageView.setImageBitmap(bitmap)
|
||||||
|
|
||||||
tanProcedureSettings?.let {
|
tanMethodSettings?.let {
|
||||||
setWidthAndHeight(it.width)
|
setWidthAndHeight(it.width)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,14 +92,14 @@ open class TanImageView @JvmOverloads constructor(
|
||||||
|
|
||||||
requestLayout()
|
requestLayout()
|
||||||
|
|
||||||
tanProcedureSettingsChanged(newWidthAndHeight)
|
tanMethodSettingsChanged(newWidthAndHeight)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun tanProcedureSettingsChanged(newWidthAndHeight: Int) {
|
protected open fun tanMethodSettingsChanged(newWidthAndHeight: Int) {
|
||||||
tanProcedureSettings = TanProcedureSettings(newWidthAndHeight, newWidthAndHeight)
|
tanMethodSettings = TanMethodSettings(newWidthAndHeight, newWidthAndHeight)
|
||||||
|
|
||||||
didTanProcedureSettingsChange = true // we don't check if settings really changed, it's not that important
|
didTanMethodSettingsChange = true // we don't check if settings really changed, it's not that important
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -15,24 +15,24 @@
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/dialog_enter_tan_tan_procedure_height"
|
android:layout_height="@dimen/dialog_enter_tan_tan_method_height"
|
||||||
android:layout_marginBottom="@dimen/dialog_enter_tan_tan_procedure_margin_bottom"
|
android:layout_marginBottom="@dimen/dialog_enter_tan_tan_method_margin_bottom"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
>
|
>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginRight="@dimen/dialog_enter_tan_tan_procedure_label_right_margin"
|
android:layout_marginRight="@dimen/dialog_enter_tan_tan_method_label_right_margin"
|
||||||
android:layout_marginEnd="@dimen/dialog_enter_tan_tan_procedure_label_right_margin"
|
android:layout_marginEnd="@dimen/dialog_enter_tan_tan_method_label_right_margin"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
android:textSize="@dimen/dialog_enter_tan_tan_procedure_text_size"
|
android:textSize="@dimen/dialog_enter_tan_tan_method_text_size"
|
||||||
android:text="@string/dialog_enter_tan_select_tan_procedure"
|
android:text="@string/dialog_enter_tan_select_tan_method"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Spinner
|
<Spinner
|
||||||
android:id="@+id/spnTanProcedures"
|
android:id="@+id/spnTanMethods"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<TextView
|
<TextView
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/txtTanProcedureDisplayName"
|
android:id="@+id/txtTanMethodDisplayName"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
style="@style/TextAppearance.AppCompat.Medium"
|
style="@style/TextAppearance.AppCompat.Medium"
|
||||||
android:textSize="@dimen/dialog_enter_tan_tan_procedure_text_size"
|
android:textSize="@dimen/dialog_enter_tan_tan_method_text_size"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:ellipsize="marquee"
|
android:ellipsize="marquee"
|
||||||
android:padding="@dimen/list_item_tan_procedure_padding"
|
android:padding="@dimen/list_item_tan_method_padding"
|
||||||
/>
|
/>
|
|
@ -74,7 +74,7 @@
|
||||||
|
|
||||||
<string name="view_flicker_code_frequency">Geschw.:</string>
|
<string name="view_flicker_code_frequency">Geschw.:</string>
|
||||||
|
|
||||||
<string name="dialog_enter_tan_select_tan_procedure">TAN Verfahren</string>
|
<string name="dialog_enter_tan_select_tan_method">TAN Verfahren</string>
|
||||||
<string name="dialog_enter_tan_select_tan_medium">TAN Medium</string>
|
<string name="dialog_enter_tan_select_tan_medium">TAN Medium</string>
|
||||||
<string name="dialog_enter_tan_tan_description_label">Hinweis Ihrer Bank:</string>
|
<string name="dialog_enter_tan_tan_description_label">Hinweis Ihrer Bank:</string>
|
||||||
<string name="dialog_enter_tan_enter_tan">TAN eingeben:</string>
|
<string name="dialog_enter_tan_enter_tan">TAN eingeben:</string>
|
||||||
|
|
|
@ -112,10 +112,10 @@
|
||||||
<dimen name="view_tan_generator_marker_margin_bottom">6dp</dimen>
|
<dimen name="view_tan_generator_marker_margin_bottom">6dp</dimen>
|
||||||
|
|
||||||
<dimen name="dialog_enter_tan_padding">4dp</dimen>
|
<dimen name="dialog_enter_tan_padding">4dp</dimen>
|
||||||
<dimen name="dialog_enter_tan_tan_procedure_height">30dp</dimen>
|
<dimen name="dialog_enter_tan_tan_method_height">30dp</dimen>
|
||||||
<dimen name="dialog_enter_tan_tan_procedure_margin_bottom">6dp</dimen>
|
<dimen name="dialog_enter_tan_tan_method_margin_bottom">6dp</dimen>
|
||||||
<dimen name="dialog_enter_tan_tan_procedure_label_right_margin">8dp</dimen>
|
<dimen name="dialog_enter_tan_tan_method_label_right_margin">8dp</dimen>
|
||||||
<dimen name="dialog_enter_tan_tan_procedure_text_size">15sp</dimen>
|
<dimen name="dialog_enter_tan_tan_method_text_size">15sp</dimen>
|
||||||
<dimen name="dialog_enter_tan_tan_medium_height">30dp</dimen>
|
<dimen name="dialog_enter_tan_tan_medium_height">30dp</dimen>
|
||||||
<dimen name="dialog_enter_tan_tan_medium_label_right_margin">8dp</dimen>
|
<dimen name="dialog_enter_tan_tan_medium_label_right_margin">8dp</dimen>
|
||||||
<dimen name="dialog_enter_tan_tan_medium_text_size">15sp</dimen>
|
<dimen name="dialog_enter_tan_tan_medium_text_size">15sp</dimen>
|
||||||
|
@ -128,7 +128,7 @@
|
||||||
<dimen name="dialog_enter_tan_enter_tan_margin_bottom">8dp</dimen>
|
<dimen name="dialog_enter_tan_enter_tan_margin_bottom">8dp</dimen>
|
||||||
<dimen name="dialog_enter_tan_buttons_width">120dp</dimen>
|
<dimen name="dialog_enter_tan_buttons_width">120dp</dimen>
|
||||||
|
|
||||||
<dimen name="list_item_tan_procedure_padding">4dp</dimen>
|
<dimen name="list_item_tan_method_padding">4dp</dimen>
|
||||||
|
|
||||||
<dimen name="list_item_tan_medium_padding">4dp</dimen>
|
<dimen name="list_item_tan_medium_padding">4dp</dimen>
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@
|
||||||
|
|
||||||
<string name="view_flicker_code_frequency">Frequency:</string>
|
<string name="view_flicker_code_frequency">Frequency:</string>
|
||||||
|
|
||||||
<string name="dialog_enter_tan_select_tan_procedure">TAN procedure</string>
|
<string name="dialog_enter_tan_select_tan_method">TAN procedure</string>
|
||||||
<string name="dialog_enter_tan_select_tan_medium">TAN medium</string>
|
<string name="dialog_enter_tan_select_tan_medium">TAN medium</string>
|
||||||
<string name="dialog_enter_tan_tan_description_label">Hint from your bank:</string>
|
<string name="dialog_enter_tan_tan_description_label">Hint from your bank:</string>
|
||||||
<string name="dialog_enter_tan_enter_tan">Enter TAN:</string>
|
<string name="dialog_enter_tan_enter_tan">Enter TAN:</string>
|
||||||
|
|
|
@ -49,7 +49,7 @@ add.account.dialog.successfully.added.account.bank.supports.retrieving.transacti
|
||||||
|
|
||||||
|
|
||||||
enter.tan.dialog.title=TAN required
|
enter.tan.dialog.title=TAN required
|
||||||
enter.tan.dialog.select.tan.procedure=TAN procedure:
|
enter.tan.dialog.select.tan.method=TAN method:
|
||||||
enter.tan.dialog.select.tan.medium=TAN medium:
|
enter.tan.dialog.select.tan.medium=TAN medium:
|
||||||
enter.tan.dialog.size.label=Size:
|
enter.tan.dialog.size.label=Size:
|
||||||
enter.tan.dialog.frequency.label=Speed:
|
enter.tan.dialog.frequency.label=Speed:
|
||||||
|
|
|
@ -49,7 +49,7 @@ add.account.dialog.successfully.added.account.bank.supports.retrieving.transacti
|
||||||
|
|
||||||
|
|
||||||
enter.tan.dialog.title=TAN wird benötigt
|
enter.tan.dialog.title=TAN wird benötigt
|
||||||
enter.tan.dialog.select.tan.procedure=TAN Verfahren:
|
enter.tan.dialog.select.tan.method=TAN Verfahren:
|
||||||
enter.tan.dialog.select.tan.medium=TAN Medium:
|
enter.tan.dialog.select.tan.medium=TAN Medium:
|
||||||
enter.tan.dialog.size.label=Größe:
|
enter.tan.dialog.size.label=Größe:
|
||||||
enter.tan.dialog.frequency.label=Geschwindigkeit:
|
enter.tan.dialog.frequency.label=Geschwindigkeit:
|
||||||
|
|
|
@ -27,7 +27,7 @@ open class EnterTanDialog(
|
||||||
) : Window() {
|
) : Window() {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
val QrCodeTanProcedures = listOf(TanProcedureType.ChipTanQrCode, TanProcedureType.QrCode)
|
val QrCodeTanMethods = listOf(TanMethodType.ChipTanQrCode, TanMethodType.QrCode)
|
||||||
|
|
||||||
private val ButtonHeight = 40.0
|
private val ButtonHeight = 40.0
|
||||||
private val ButtonWidth = 150.0
|
private val ButtonWidth = 150.0
|
||||||
|
@ -41,9 +41,9 @@ open class EnterTanDialog(
|
||||||
protected var tanImageView: TanImageView? = null
|
protected var tanImageView: TanImageView? = null
|
||||||
|
|
||||||
|
|
||||||
protected val tanProceduresWithoutUnsupported = customer.supportedTanProcedures.filterNot { it.type == TanProcedureType.ChipTanUsb } // USB tan generators are not supported
|
protected val tanMethodsWithoutUnsupported = customer.supportedTanMethods.filterNot { it.type == TanMethodType.ChipTanUsb } // USB tan generators are not supported
|
||||||
|
|
||||||
protected val selectedTanProcedure = SimpleObjectProperty<TanProcedure>(customer.selectedTanProcedure ?: tanProceduresWithoutUnsupported.firstOrNull { it.displayName.contains("manuell", true) == false } ?: tanProceduresWithoutUnsupported.firstOrNull())
|
protected val selectedTanMethod = SimpleObjectProperty<TanMethod>(customer.selectedTanMethod ?: tanMethodsWithoutUnsupported.firstOrNull { it.displayName.contains("manuell", true) == false } ?: tanMethodsWithoutUnsupported.firstOrNull())
|
||||||
|
|
||||||
protected val selectedTanMedium = SimpleObjectProperty<TanMedium>(customer.tanMediaSorted.firstOrNull())
|
protected val selectedTanMedium = SimpleObjectProperty<TanMedium>(customer.tanMediaSorted.firstOrNull())
|
||||||
|
|
||||||
|
@ -51,8 +51,8 @@ open class EnterTanDialog(
|
||||||
|
|
||||||
|
|
||||||
init {
|
init {
|
||||||
selectedTanProcedure.addListener { _, _, newValue ->
|
selectedTanMethod.addListener { _, _, newValue ->
|
||||||
tanEnteredCallback(EnterTanResult.userAsksToChangeTanProcedure(newValue))
|
tanEnteredCallback(EnterTanResult.userAsksToChangeTanMethod(newValue))
|
||||||
|
|
||||||
close()
|
close()
|
||||||
}
|
}
|
||||||
|
@ -72,12 +72,12 @@ open class EnterTanDialog(
|
||||||
|
|
||||||
form {
|
form {
|
||||||
fieldset {
|
fieldset {
|
||||||
field(messages["enter.tan.dialog.select.tan.procedure"]) {
|
field(messages["enter.tan.dialog.select.tan.method"]) {
|
||||||
label.apply {
|
label.apply {
|
||||||
font = Font.font(font.family, FontWeight.BLACK, font.size)
|
font = Font.font(font.family, FontWeight.BLACK, font.size)
|
||||||
}
|
}
|
||||||
|
|
||||||
combobox(selectedTanProcedure, tanProceduresWithoutUnsupported) {
|
combobox(selectedTanMethod, tanMethodsWithoutUnsupported) {
|
||||||
cellFormat {
|
cellFormat {
|
||||||
text = it.displayName
|
text = it.displayName
|
||||||
}
|
}
|
||||||
|
@ -261,18 +261,18 @@ open class EnterTanDialog(
|
||||||
|
|
||||||
|
|
||||||
protected open fun checkIfAppSettingsChanged() {
|
protected open fun checkIfAppSettingsChanged() {
|
||||||
if (flickerCodeView?.didTanProcedureSettingsChange == true) {
|
if (flickerCodeView?.didTanMethodSettingsChange == true) {
|
||||||
presenter.appSettings.flickerCodeSettings = flickerCodeView?.tanProcedureSettings
|
presenter.appSettings.flickerCodeSettings = flickerCodeView?.tanMethodSettings
|
||||||
|
|
||||||
presenter.appSettingsChanged()
|
presenter.appSettingsChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tanImageView?.didTanProcedureSettingsChange == true) {
|
if (tanImageView?.didTanMethodSettingsChange == true) {
|
||||||
if (isQrTan(challenge)) {
|
if (isQrTan(challenge)) {
|
||||||
presenter.appSettings.qrCodeSettings = tanImageView?.tanProcedureSettings
|
presenter.appSettings.qrCodeSettings = tanImageView?.tanMethodSettings
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
presenter.appSettings.photoTanSettings = tanImageView?.tanProcedureSettings
|
presenter.appSettings.photoTanSettings = tanImageView?.tanMethodSettings
|
||||||
}
|
}
|
||||||
|
|
||||||
presenter.appSettingsChanged()
|
presenter.appSettingsChanged()
|
||||||
|
@ -280,7 +280,7 @@ open class EnterTanDialog(
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun isQrTan(tanChallenge: TanChallenge): Boolean {
|
protected open fun isQrTan(tanChallenge: TanChallenge): Boolean {
|
||||||
return QrCodeTanProcedures.contains(tanChallenge.tanProcedure.type)
|
return QrCodeTanMethods.contains(tanChallenge.tanMethod.type)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -6,11 +6,10 @@ import javafx.geometry.Pos
|
||||||
import javafx.scene.paint.Color
|
import javafx.scene.paint.Color
|
||||||
import net.dankito.banking.ui.model.tan.FlickerCode
|
import net.dankito.banking.ui.model.tan.FlickerCode
|
||||||
import net.dankito.banking.ui.util.FlickerCodeAnimator
|
import net.dankito.banking.ui.util.FlickerCodeAnimator
|
||||||
import net.dankito.banking.ui.util.Bit
|
|
||||||
import net.dankito.banking.javafx.dialogs.tan.controls.ChipTanFlickerCodeStripeView
|
import net.dankito.banking.javafx.dialogs.tan.controls.ChipTanFlickerCodeStripeView
|
||||||
import net.dankito.banking.javafx.dialogs.tan.controls.TanGeneratorMarkerView
|
import net.dankito.banking.javafx.dialogs.tan.controls.TanGeneratorMarkerView
|
||||||
import net.dankito.banking.ui.model.settings.ITanView
|
import net.dankito.banking.ui.model.settings.ITanView
|
||||||
import net.dankito.banking.ui.model.settings.TanProcedureSettings
|
import net.dankito.banking.ui.model.settings.TanMethodSettings
|
||||||
import net.dankito.banking.ui.util.Step
|
import net.dankito.banking.ui.util.Step
|
||||||
import net.dankito.utils.javafx.ui.extensions.fixedHeight
|
import net.dankito.utils.javafx.ui.extensions.fixedHeight
|
||||||
import net.dankito.utils.javafx.ui.extensions.fixedWidth
|
import net.dankito.utils.javafx.ui.extensions.fixedWidth
|
||||||
|
@ -20,7 +19,7 @@ import tornadofx.*
|
||||||
|
|
||||||
open class ChipTanFlickerCodeView(
|
open class ChipTanFlickerCodeView(
|
||||||
protected val flickerCode: FlickerCode,
|
protected val flickerCode: FlickerCode,
|
||||||
tanProcedureSettings: TanProcedureSettings?
|
tanMethodSettings: TanMethodSettings?
|
||||||
): View(), ITanView {
|
): View(), ITanView {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
@ -41,9 +40,9 @@ open class ChipTanFlickerCodeView(
|
||||||
|
|
||||||
protected val flickerCodeLeftRightMargin = SimpleDoubleProperty(31.0)
|
protected val flickerCodeLeftRightMargin = SimpleDoubleProperty(31.0)
|
||||||
|
|
||||||
protected val stripesHeight = SimpleDoubleProperty(tanProcedureSettings?.height?.toDouble() ?: 127.0)
|
protected val stripesHeight = SimpleDoubleProperty(tanMethodSettings?.height?.toDouble() ?: 127.0)
|
||||||
protected val stripesWidth = SimpleDoubleProperty(tanProcedureSettings?.width?.toDouble() ?: 42.0)
|
protected val stripesWidth = SimpleDoubleProperty(tanMethodSettings?.width?.toDouble() ?: 42.0)
|
||||||
protected val spaceBetweenStripes = SimpleDoubleProperty(tanProcedureSettings?.space?.toDouble() ?: 10.0)
|
protected val spaceBetweenStripes = SimpleDoubleProperty(tanMethodSettings?.space?.toDouble() ?: 10.0)
|
||||||
|
|
||||||
protected val flickerCodeViewWidth = SimpleDoubleProperty()
|
protected val flickerCodeViewWidth = SimpleDoubleProperty()
|
||||||
|
|
||||||
|
@ -59,15 +58,15 @@ open class ChipTanFlickerCodeView(
|
||||||
protected val isMinFrequencyReached = SimpleBooleanProperty(false)
|
protected val isMinFrequencyReached = SimpleBooleanProperty(false)
|
||||||
protected val isMaxFrequencyReached = SimpleBooleanProperty(false)
|
protected val isMaxFrequencyReached = SimpleBooleanProperty(false)
|
||||||
|
|
||||||
protected var currentFrequency = tanProcedureSettings?.frequency ?: DefaultFrequency
|
protected var currentFrequency = tanMethodSettings?.frequency ?: DefaultFrequency
|
||||||
|
|
||||||
protected val animator = FlickerCodeAnimator()
|
protected val animator = FlickerCodeAnimator()
|
||||||
|
|
||||||
|
|
||||||
override var didTanProcedureSettingsChange: Boolean = false
|
override var didTanMethodSettingsChange: Boolean = false
|
||||||
protected set
|
protected set
|
||||||
|
|
||||||
override var tanProcedureSettings: TanProcedureSettings? = tanProcedureSettings
|
override var tanMethodSettings: TanMethodSettings? = tanMethodSettings
|
||||||
protected set
|
protected set
|
||||||
|
|
||||||
|
|
||||||
|
@ -203,7 +202,7 @@ open class ChipTanFlickerCodeView(
|
||||||
setSize(stripesWidth.value + ChangeSizeStripeWidthStep, stripesHeight.value + ChangeSizeStripeHeightStep,
|
setSize(stripesWidth.value + ChangeSizeStripeWidthStep, stripesHeight.value + ChangeSizeStripeHeightStep,
|
||||||
spaceBetweenStripes.value + ChangeSizeSpaceBetweenStripesStep)
|
spaceBetweenStripes.value + ChangeSizeSpaceBetweenStripesStep)
|
||||||
|
|
||||||
tanProcedureSettingsChanged()
|
tanMethodSettingsChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
updateMinAndMaxSizeReached()
|
updateMinAndMaxSizeReached()
|
||||||
|
@ -214,7 +213,7 @@ open class ChipTanFlickerCodeView(
|
||||||
setSize(stripesWidth.value - ChangeSizeStripeWidthStep, stripesHeight.value - ChangeSizeStripeHeightStep,
|
setSize(stripesWidth.value - ChangeSizeStripeWidthStep, stripesHeight.value - ChangeSizeStripeHeightStep,
|
||||||
spaceBetweenStripes.value - ChangeSizeSpaceBetweenStripesStep)
|
spaceBetweenStripes.value - ChangeSizeSpaceBetweenStripesStep)
|
||||||
|
|
||||||
tanProcedureSettingsChanged()
|
tanMethodSettingsChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
updateMinAndMaxSizeReached()
|
updateMinAndMaxSizeReached()
|
||||||
|
@ -225,7 +224,7 @@ open class ChipTanFlickerCodeView(
|
||||||
this.stripesHeight.value = height
|
this.stripesHeight.value = height
|
||||||
this.spaceBetweenStripes.value = spaceBetweenStripes
|
this.spaceBetweenStripes.value = spaceBetweenStripes
|
||||||
|
|
||||||
tanProcedureSettingsChanged()
|
tanMethodSettingsChanged()
|
||||||
|
|
||||||
updateMinAndMaxSizeReached()
|
updateMinAndMaxSizeReached()
|
||||||
}
|
}
|
||||||
|
@ -264,7 +263,7 @@ open class ChipTanFlickerCodeView(
|
||||||
|
|
||||||
updateMinAndMaxFrequencyReached()
|
updateMinAndMaxFrequencyReached()
|
||||||
|
|
||||||
tanProcedureSettingsChanged()
|
tanMethodSettingsChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun updateMinAndMaxFrequencyReached() {
|
protected open fun updateMinAndMaxFrequencyReached() {
|
||||||
|
@ -273,11 +272,11 @@ open class ChipTanFlickerCodeView(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected open fun tanProcedureSettingsChanged() {
|
protected open fun tanMethodSettingsChanged() {
|
||||||
tanProcedureSettings = TanProcedureSettings(stripesWidth.value.toInt(), stripesHeight.value.toInt(),
|
tanMethodSettings = TanMethodSettings(stripesWidth.value.toInt(), stripesHeight.value.toInt(),
|
||||||
spaceBetweenStripes.value.toInt(), currentFrequency)
|
spaceBetweenStripes.value.toInt(), currentFrequency)
|
||||||
|
|
||||||
didTanProcedureSettingsChange = true // we don't check if settings really changed, it's not that important
|
didTanMethodSettingsChange = true // we don't check if settings really changed, it's not that important
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -5,7 +5,7 @@ import javafx.geometry.Pos
|
||||||
import javafx.scene.image.Image
|
import javafx.scene.image.Image
|
||||||
import javafx.scene.image.ImageView
|
import javafx.scene.image.ImageView
|
||||||
import net.dankito.banking.ui.model.settings.ITanView
|
import net.dankito.banking.ui.model.settings.ITanView
|
||||||
import net.dankito.banking.ui.model.settings.TanProcedureSettings
|
import net.dankito.banking.ui.model.settings.TanMethodSettings
|
||||||
import net.dankito.banking.ui.model.tan.TanImage
|
import net.dankito.banking.ui.model.tan.TanImage
|
||||||
import net.dankito.utils.javafx.ui.extensions.updateWindowSize
|
import net.dankito.utils.javafx.ui.extensions.updateWindowSize
|
||||||
import tornadofx.*
|
import tornadofx.*
|
||||||
|
@ -14,7 +14,7 @@ import java.io.ByteArrayInputStream
|
||||||
|
|
||||||
open class TanImageView(
|
open class TanImageView(
|
||||||
protected val tanImage: TanImage,
|
protected val tanImage: TanImage,
|
||||||
tanProcedureSettings: TanProcedureSettings?
|
tanMethodSettings: TanMethodSettings?
|
||||||
) : View(), ITanView {
|
) : View(), ITanView {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
@ -34,10 +34,10 @@ open class TanImageView(
|
||||||
protected var tanImageView: ImageView by singleAssign()
|
protected var tanImageView: ImageView by singleAssign()
|
||||||
|
|
||||||
|
|
||||||
override var didTanProcedureSettingsChange: Boolean = false
|
override var didTanMethodSettingsChange: Boolean = false
|
||||||
protected set
|
protected set
|
||||||
|
|
||||||
override var tanProcedureSettings: TanProcedureSettings? = tanProcedureSettings
|
override var tanMethodSettings: TanMethodSettings? = tanMethodSettings
|
||||||
protected set
|
protected set
|
||||||
|
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ open class TanImageView(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tanProcedureSettings?.let {
|
tanMethodSettings?.let {
|
||||||
runLater {
|
runLater {
|
||||||
setWidthAndHeight(it.width.toDouble())
|
setWidthAndHeight(it.width.toDouble())
|
||||||
}
|
}
|
||||||
|
@ -86,17 +86,17 @@ open class TanImageView(
|
||||||
|
|
||||||
updateWindowSize()
|
updateWindowSize()
|
||||||
|
|
||||||
tanProcedureSettingsChanged(newWidthAndHeight.toInt())
|
tanMethodSettingsChanged(newWidthAndHeight.toInt())
|
||||||
}
|
}
|
||||||
|
|
||||||
isMinSizeReached.value = tanImageView.fitHeight <= MinHeight
|
isMinSizeReached.value = tanImageView.fitHeight <= MinHeight
|
||||||
isMaxSizeReached.value = tanImageView.fitHeight >= MaxHeight
|
isMaxSizeReached.value = tanImageView.fitHeight >= MaxHeight
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun tanProcedureSettingsChanged(newWidthAndHeight: Int) {
|
protected open fun tanMethodSettingsChanged(newWidthAndHeight: Int) {
|
||||||
tanProcedureSettings = TanProcedureSettings(newWidthAndHeight, newWidthAndHeight)
|
tanMethodSettings = TanMethodSettings(newWidthAndHeight, newWidthAndHeight)
|
||||||
|
|
||||||
didTanProcedureSettingsChange = true // we don't check if settings really changed, it's not that important
|
didTanMethodSettingsChange = true // we don't check if settings really changed, it's not that important
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
package net.dankito.banking.ui.model
|
package net.dankito.banking.ui.model
|
||||||
|
|
||||||
import net.dankito.banking.ui.model.tan.TanMedium
|
import net.dankito.banking.ui.model.tan.TanMedium
|
||||||
import net.dankito.banking.ui.model.tan.TanProcedure
|
import net.dankito.banking.ui.model.tan.TanMethod
|
||||||
import net.dankito.utils.multiplatform.UUID
|
import net.dankito.utils.multiplatform.UUID
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,9 +30,9 @@ open class Customer(
|
||||||
override var technicalId: String = UUID.random()
|
override var technicalId: String = UUID.random()
|
||||||
|
|
||||||
|
|
||||||
override var supportedTanProcedures: List<TanProcedure> = listOf()
|
override var supportedTanMethods: List<TanMethod> = listOf()
|
||||||
|
|
||||||
override var selectedTanProcedure: TanProcedure? = null
|
override var selectedTanMethod: TanMethod? = null
|
||||||
|
|
||||||
override var tanMedia: List<TanMedium> = listOf()
|
override var tanMedia: List<TanMedium> = listOf()
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ package net.dankito.banking.ui.model
|
||||||
|
|
||||||
import net.dankito.banking.ui.model.tan.TanMedium
|
import net.dankito.banking.ui.model.tan.TanMedium
|
||||||
import net.dankito.banking.ui.model.tan.TanMediumStatus
|
import net.dankito.banking.ui.model.tan.TanMediumStatus
|
||||||
import net.dankito.banking.ui.model.tan.TanProcedure
|
import net.dankito.banking.ui.model.tan.TanMethod
|
||||||
import net.dankito.banking.util.sortedByDisplayIndex
|
import net.dankito.banking.util.sortedByDisplayIndex
|
||||||
import net.dankito.utils.multiplatform.BigDecimal
|
import net.dankito.utils.multiplatform.BigDecimal
|
||||||
import net.dankito.utils.multiplatform.sum
|
import net.dankito.utils.multiplatform.sum
|
||||||
|
@ -27,8 +27,8 @@ interface ICustomer<TAccount: IBankAccount<TAccountTransaction>, TAccountTransac
|
||||||
|
|
||||||
var accounts: List<TAccount>
|
var accounts: List<TAccount>
|
||||||
|
|
||||||
var supportedTanProcedures: List<TanProcedure>
|
var supportedTanMethods: List<TanMethod>
|
||||||
var selectedTanProcedure: TanProcedure?
|
var selectedTanMethod: TanMethod?
|
||||||
var tanMedia: List<TanMedium>
|
var tanMedia: List<TanMedium>
|
||||||
|
|
||||||
var userSetDisplayName: String?
|
var userSetDisplayName: String?
|
||||||
|
|
|
@ -56,9 +56,9 @@ interface IModelCreator {
|
||||||
) : IAccountTransaction
|
) : IAccountTransaction
|
||||||
|
|
||||||
|
|
||||||
fun createTanProcedure(displayName: String, type: TanProcedureType, bankInternalProcedureCode: String,
|
fun createTanMethod(displayName: String, type: TanMethodType, bankInternalMethodCode: String,
|
||||||
maxTanInputLength: Int? = null, allowedTanFormat: AllowedTanFormat = AllowedTanFormat.Alphanumeric): TanProcedure {
|
maxTanInputLength: Int? = null, allowedTanFormat: AllowedTanFormat = AllowedTanFormat.Alphanumeric): TanMethod {
|
||||||
return TanProcedure(displayName, type, bankInternalProcedureCode, maxTanInputLength)
|
return TanMethod(displayName, type, bankInternalMethodCode, maxTanInputLength)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun createTanMedium(displayName: String, status: TanMediumStatus): TanMedium {
|
fun createTanMedium(displayName: String, status: TanMediumStatus): TanMedium {
|
||||||
|
|
|
@ -2,9 +2,9 @@ package net.dankito.banking.ui.model.settings
|
||||||
|
|
||||||
|
|
||||||
open class AppSettings(
|
open class AppSettings(
|
||||||
var flickerCodeSettings: TanProcedureSettings? = null,
|
var flickerCodeSettings: TanMethodSettings? = null,
|
||||||
var qrCodeSettings: TanProcedureSettings? = null,
|
var qrCodeSettings: TanMethodSettings? = null,
|
||||||
var photoTanSettings: TanProcedureSettings? = null
|
var photoTanSettings: TanMethodSettings? = null
|
||||||
) {
|
) {
|
||||||
|
|
||||||
internal constructor() : this(null, null, null) // for object deserializers
|
internal constructor() : this(null, null, null) // for object deserializers
|
||||||
|
|
|
@ -3,8 +3,8 @@ package net.dankito.banking.ui.model.settings
|
||||||
|
|
||||||
interface ITanView {
|
interface ITanView {
|
||||||
|
|
||||||
val didTanProcedureSettingsChange: Boolean
|
val didTanMethodSettingsChange: Boolean
|
||||||
|
|
||||||
val tanProcedureSettings: TanProcedureSettings?
|
val tanMethodSettings: TanMethodSettings?
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
package net.dankito.banking.ui.model.settings
|
package net.dankito.banking.ui.model.settings
|
||||||
|
|
||||||
|
|
||||||
open class TanProcedureSettings(
|
open class TanMethodSettings(
|
||||||
var width: Int,
|
var width: Int,
|
||||||
var height: Int,
|
var height: Int,
|
||||||
var space: Int = -1, // only needed for flicker code view
|
var space: Int = -1, // only needed for flicker code view
|
|
@ -5,7 +5,7 @@ import net.dankito.banking.ui.model.responses.BankingClientResponse
|
||||||
|
|
||||||
open class EnterTanResult protected constructor(
|
open class EnterTanResult protected constructor(
|
||||||
val enteredTan: String?,
|
val enteredTan: String?,
|
||||||
val changeTanProcedureTo: TanProcedure? = null,
|
val changeTanMethodTo: TanMethod? = null,
|
||||||
val changeTanMediumTo: TanMedium? = null,
|
val changeTanMediumTo: TanMedium? = null,
|
||||||
val changeTanMediumResultCallback: ((BankingClientResponse) -> Unit)? = null
|
val changeTanMediumResultCallback: ((BankingClientResponse) -> Unit)? = null
|
||||||
) {
|
) {
|
||||||
|
@ -20,8 +20,8 @@ open class EnterTanResult protected constructor(
|
||||||
return EnterTanResult(null)
|
return EnterTanResult(null)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun userAsksToChangeTanProcedure(changeTanProcedureTo: TanProcedure): EnterTanResult {
|
fun userAsksToChangeTanMethod(changeTanMethodTo: TanMethod): EnterTanResult {
|
||||||
return EnterTanResult(null, changeTanProcedureTo)
|
return EnterTanResult(null, changeTanMethodTo)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun userAsksToChangeTanMedium(changeTanMediumTo: TanMedium, changeTanMediumResultCallback: ((BankingClientResponse) -> Unit)?): EnterTanResult {
|
fun userAsksToChangeTanMedium(changeTanMediumTo: TanMedium, changeTanMediumResultCallback: ((BankingClientResponse) -> Unit)?): EnterTanResult {
|
||||||
|
@ -31,8 +31,8 @@ open class EnterTanResult protected constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
if (changeTanProcedureTo != null) {
|
if (changeTanMethodTo != null) {
|
||||||
return "User asks to change TAN procedure to $changeTanProcedureTo"
|
return "User asks to change TAN method to $changeTanMethodTo"
|
||||||
}
|
}
|
||||||
|
|
||||||
if (changeTanMediumTo != null) {
|
if (changeTanMediumTo != null) {
|
||||||
|
|
|
@ -4,12 +4,12 @@ package net.dankito.banking.ui.model.tan
|
||||||
open class FlickerCodeTanChallenge(
|
open class FlickerCodeTanChallenge(
|
||||||
val flickerCode: FlickerCode,
|
val flickerCode: FlickerCode,
|
||||||
messageToShowToUser: String,
|
messageToShowToUser: String,
|
||||||
tanProcedure: TanProcedure
|
tanMethod: TanMethod
|
||||||
|
|
||||||
) : TanChallenge(messageToShowToUser, tanProcedure) {
|
) : TanChallenge(messageToShowToUser, tanMethod) {
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return "$tanProcedure $flickerCode: $messageToShowToUser"
|
return "$tanMethod $flickerCode: $messageToShowToUser"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -4,12 +4,12 @@ package net.dankito.banking.ui.model.tan
|
||||||
open class ImageTanChallenge(
|
open class ImageTanChallenge(
|
||||||
val image: TanImage,
|
val image: TanImage,
|
||||||
messageToShowToUser: String,
|
messageToShowToUser: String,
|
||||||
tanProcedure: TanProcedure
|
tanMethod: TanMethod
|
||||||
|
|
||||||
) : TanChallenge(messageToShowToUser, tanProcedure) {
|
) : TanChallenge(messageToShowToUser, tanMethod) {
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return "$tanProcedure $image: $messageToShowToUser"
|
return "$tanMethod $image: $messageToShowToUser"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -3,11 +3,11 @@ package net.dankito.banking.ui.model.tan
|
||||||
|
|
||||||
open class TanChallenge(
|
open class TanChallenge(
|
||||||
val messageToShowToUser: String,
|
val messageToShowToUser: String,
|
||||||
val tanProcedure: TanProcedure
|
val tanMethod: TanMethod
|
||||||
) {
|
) {
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return "$tanProcedure: $messageToShowToUser"
|
return "$tanMethod: $messageToShowToUser"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -5,16 +5,21 @@ import net.dankito.utils.multiplatform.UUID
|
||||||
import kotlin.jvm.Transient
|
import kotlin.jvm.Transient
|
||||||
|
|
||||||
|
|
||||||
open class TanProcedure(
|
open class TanMethod(
|
||||||
|
@Transient
|
||||||
override val displayName: String,
|
override val displayName: String,
|
||||||
open val type: TanProcedureType,
|
@Transient
|
||||||
open val bankInternalProcedureCode: String,
|
open val type: TanMethodType,
|
||||||
|
@Transient
|
||||||
|
open val bankInternalMethodCode: String,
|
||||||
|
@Transient
|
||||||
open val maxTanInputLength: Int? = null,
|
open val maxTanInputLength: Int? = null,
|
||||||
|
@Transient
|
||||||
open val allowedTanFormat: AllowedTanFormat = AllowedTanFormat.Alphanumeric
|
open val allowedTanFormat: AllowedTanFormat = AllowedTanFormat.Alphanumeric
|
||||||
) : Displayable {
|
) : Displayable {
|
||||||
|
|
||||||
|
|
||||||
internal constructor() : this("", TanProcedureType.EnterTan, "") // for object deserializers
|
internal constructor() : this("", TanMethodType.EnterTan, "") // for object deserializers
|
||||||
|
|
||||||
|
|
||||||
@Transient
|
@Transient
|
||||||
|
@ -26,11 +31,11 @@ open class TanProcedure(
|
||||||
|
|
||||||
override fun equals(other: Any?): Boolean {
|
override fun equals(other: Any?): Boolean {
|
||||||
if (this === other) return true
|
if (this === other) return true
|
||||||
if (other !is TanProcedure) return false
|
if (other !is TanMethod) return false
|
||||||
|
|
||||||
if (displayName != other.displayName) return false
|
if (displayName != other.displayName) return false
|
||||||
if (type != other.type) return false
|
if (type != other.type) return false
|
||||||
if (bankInternalProcedureCode != other.bankInternalProcedureCode) return false
|
if (bankInternalMethodCode != other.bankInternalMethodCode) return false
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
@ -38,13 +43,13 @@ open class TanProcedure(
|
||||||
override fun hashCode(): Int {
|
override fun hashCode(): Int {
|
||||||
var result = displayName.hashCode()
|
var result = displayName.hashCode()
|
||||||
result = 31 * result + type.hashCode()
|
result = 31 * result + type.hashCode()
|
||||||
result = 31 * result + bankInternalProcedureCode.hashCode()
|
result = 31 * result + bankInternalMethodCode.hashCode()
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return "$displayName ($type, ${bankInternalProcedureCode})"
|
return "$displayName ($type, ${bankInternalMethodCode})"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
package net.dankito.banking.ui.model.tan
|
package net.dankito.banking.ui.model.tan
|
||||||
|
|
||||||
|
|
||||||
enum class TanProcedureType {
|
enum class TanMethodType {
|
||||||
|
|
||||||
EnterTan,
|
EnterTan,
|
||||||
|
|
|
@ -48,8 +48,8 @@ open class BankingPresenter(
|
||||||
) {
|
) {
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
val ChipTanTanProcedures = listOf(TanProcedureType.ChipTanManuell, TanProcedureType.ChipTanFlickercode, TanProcedureType.ChipTanUsb,
|
val ChipTanTanMethods = listOf(TanMethodType.ChipTanManuell, TanMethodType.ChipTanFlickercode, TanMethodType.ChipTanUsb,
|
||||||
TanProcedureType.ChipTanQrCode, TanProcedureType.ChipTanPhotoTanMatrixCode)
|
TanMethodType.ChipTanQrCode, TanMethodType.ChipTanPhotoTanMatrixCode)
|
||||||
|
|
||||||
protected const val OneDayMillis = 24 * 60 * 60 * 1000L
|
protected const val OneDayMillis = 24 * 60 * 60 * 1000L
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ open class BankingPresenter(
|
||||||
}
|
}
|
||||||
|
|
||||||
router.getTanFromUserFromNonUiThread(customer, tanChallenge, this@BankingPresenter) { result ->
|
router.getTanFromUserFromNonUiThread(customer, tanChallenge, this@BankingPresenter) { result ->
|
||||||
if (result.changeTanProcedureTo != null || result.changeTanMediumTo != null) { // then either selected TAN medium or procedure will change -> save account on next call to enterTan() as then changes will be visible
|
if (result.changeTanMethodTo != null || result.changeTanMediumTo != null) { // then either selected TAN medium or method will change -> save account on next call to enterTan() as then changes will be visible
|
||||||
saveAccountOnNextEnterTanInvocation = true
|
saveAccountOnNextEnterTanInvocation = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -778,11 +778,11 @@ open class BankingPresenter(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
open fun getTanMediaForTanProcedure(bank: TypedCustomer, tanProcedure: TanProcedure): List<TanMedium> {
|
open fun getTanMediaForTanMethod(bank: TypedCustomer, tanMethod: TanMethod): List<TanMedium> {
|
||||||
if (ChipTanTanProcedures.contains(tanProcedure.type)) {
|
if (ChipTanTanMethods.contains(tanMethod.type)) {
|
||||||
return bank.tanMediaSorted.filterIsInstance<TanGeneratorTanMedium>()
|
return bank.tanMediaSorted.filterIsInstance<TanGeneratorTanMedium>()
|
||||||
}
|
}
|
||||||
else if (tanProcedure.type == TanProcedureType.SmsTan) {
|
else if (tanMethod.type == TanMethodType.SmsTan) {
|
||||||
return bank.tanMediaSorted.filterIsInstance<MobilePhoneTanMedium>()
|
return bank.tanMediaSorted.filterIsInstance<MobilePhoneTanMedium>()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,7 @@
|
||||||
36E21ED524DC549800649DC8 /* BankSettingsDialog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36E21ED424DC549800649DC8 /* BankSettingsDialog.swift */; };
|
36E21ED524DC549800649DC8 /* BankSettingsDialog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36E21ED424DC549800649DC8 /* BankSettingsDialog.swift */; };
|
||||||
36E21ED724DC617200649DC8 /* BankAccountSettingsDialog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36E21ED624DC617200649DC8 /* BankAccountSettingsDialog.swift */; };
|
36E21ED724DC617200649DC8 /* BankAccountSettingsDialog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36E21ED624DC617200649DC8 /* BankAccountSettingsDialog.swift */; };
|
||||||
36E21EDB24DC990300649DC8 /* LabelledUIKitTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36E21EDA24DC990300649DC8 /* LabelledUIKitTextField.swift */; };
|
36E21EDB24DC990300649DC8 /* LabelledUIKitTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36E21EDA24DC990300649DC8 /* LabelledUIKitTextField.swift */; };
|
||||||
36E21EDD24DCA89100649DC8 /* TanProcedurePicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36E21EDC24DCA89100649DC8 /* TanProcedurePicker.swift */; };
|
36E21EDD24DCA89100649DC8 /* TanMethodPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36E21EDC24DCA89100649DC8 /* TanMethodPicker.swift */; };
|
||||||
36E21EDF24DCCC2700649DC8 /* CheckmarkListItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36E21EDE24DCCC2700649DC8 /* CheckmarkListItem.swift */; };
|
36E21EDF24DCCC2700649DC8 /* CheckmarkListItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36E21EDE24DCCC2700649DC8 /* CheckmarkListItem.swift */; };
|
||||||
36E7BA1424B3D05C00757859 /* ViewExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36E7BA1324B3D05C00757859 /* ViewExtensions.swift */; };
|
36E7BA1424B3D05C00757859 /* ViewExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36E7BA1324B3D05C00757859 /* ViewExtensions.swift */; };
|
||||||
36FC929C24B39A05002B12E9 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36FC929B24B39A05002B12E9 /* AppDelegate.swift */; };
|
36FC929C24B39A05002B12E9 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36FC929B24B39A05002B12E9 /* AppDelegate.swift */; };
|
||||||
|
@ -240,7 +240,7 @@
|
||||||
36E21ED424DC549800649DC8 /* BankSettingsDialog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BankSettingsDialog.swift; sourceTree = "<group>"; };
|
36E21ED424DC549800649DC8 /* BankSettingsDialog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BankSettingsDialog.swift; sourceTree = "<group>"; };
|
||||||
36E21ED624DC617200649DC8 /* BankAccountSettingsDialog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BankAccountSettingsDialog.swift; sourceTree = "<group>"; };
|
36E21ED624DC617200649DC8 /* BankAccountSettingsDialog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BankAccountSettingsDialog.swift; sourceTree = "<group>"; };
|
||||||
36E21EDA24DC990300649DC8 /* LabelledUIKitTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabelledUIKitTextField.swift; sourceTree = "<group>"; };
|
36E21EDA24DC990300649DC8 /* LabelledUIKitTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabelledUIKitTextField.swift; sourceTree = "<group>"; };
|
||||||
36E21EDC24DCA89100649DC8 /* TanProcedurePicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TanProcedurePicker.swift; sourceTree = "<group>"; };
|
36E21EDC24DCA89100649DC8 /* TanMethodPicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TanMethodPicker.swift; sourceTree = "<group>"; };
|
||||||
36E21EDE24DCCC2700649DC8 /* CheckmarkListItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckmarkListItem.swift; sourceTree = "<group>"; };
|
36E21EDE24DCCC2700649DC8 /* CheckmarkListItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckmarkListItem.swift; sourceTree = "<group>"; };
|
||||||
36E7BA1324B3D05C00757859 /* ViewExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewExtensions.swift; sourceTree = "<group>"; };
|
36E7BA1324B3D05C00757859 /* ViewExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewExtensions.swift; sourceTree = "<group>"; };
|
||||||
36E7BA1824B9E70C00757859 /* xcode-frameworks */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "xcode-frameworks"; path = "../../tools/BankFinder/build/xcode-frameworks"; sourceTree = "<group>"; };
|
36E7BA1824B9E70C00757859 /* xcode-frameworks */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "xcode-frameworks"; path = "../../tools/BankFinder/build/xcode-frameworks"; sourceTree = "<group>"; };
|
||||||
|
@ -353,7 +353,7 @@
|
||||||
360782D224F429F70098FEFE /* FlickerCodeStripe.swift */,
|
360782D224F429F70098FEFE /* FlickerCodeStripe.swift */,
|
||||||
3608D6C124FBA9C6006C93A8 /* TrianglePointingDown.swift */,
|
3608D6C124FBA9C6006C93A8 /* TrianglePointingDown.swift */,
|
||||||
3608D6C524FBAB41006C93A8 /* TanGeneratorPositionMarker.swift */,
|
3608D6C524FBAB41006C93A8 /* TanGeneratorPositionMarker.swift */,
|
||||||
36E21EDC24DCA89100649DC8 /* TanProcedurePicker.swift */,
|
36E21EDC24DCA89100649DC8 /* TanMethodPicker.swift */,
|
||||||
360782CA24E5746A0098FEFE /* FlickerCodeAnimator.swift */,
|
360782CA24E5746A0098FEFE /* FlickerCodeAnimator.swift */,
|
||||||
);
|
);
|
||||||
path = tan;
|
path = tan;
|
||||||
|
@ -754,7 +754,7 @@
|
||||||
36BCF89524C31F02005BEC29 /* AppData.swift in Sources */,
|
36BCF89524C31F02005BEC29 /* AppData.swift in Sources */,
|
||||||
3642F01A2502931F005186FE /* InstantPaymentInfoView.swift in Sources */,
|
3642F01A2502931F005186FE /* InstantPaymentInfoView.swift in Sources */,
|
||||||
36B8A44F2503D97D00C15359 /* AuthenticationType.swift in Sources */,
|
36B8A44F2503D97D00C15359 /* AuthenticationType.swift in Sources */,
|
||||||
36E21EDD24DCA89100649DC8 /* TanProcedurePicker.swift in Sources */,
|
36E21EDD24DCA89100649DC8 /* TanMethodPicker.swift in Sources */,
|
||||||
3608D6C624FBAB41006C93A8 /* TanGeneratorPositionMarker.swift in Sources */,
|
3608D6C624FBAB41006C93A8 /* TanGeneratorPositionMarker.swift in Sources */,
|
||||||
36B8A4542503E93B00C15359 /* UIAlert.swift in Sources */,
|
36B8A4542503E93B00C15359 /* UIAlert.swift in Sources */,
|
||||||
36BE065B24CA4B3500CBBB68 /* SelectBankDialog.swift in Sources */,
|
36BE065B24CA4B3500CBBB68 /* SelectBankDialog.swift in Sources */,
|
||||||
|
|
|
@ -69,20 +69,20 @@
|
||||||
<attribute name="finTsServerAddress" attributeType="String"/>
|
<attribute name="finTsServerAddress" attributeType="String"/>
|
||||||
<attribute name="iconUrl" optional="YES" attributeType="String"/>
|
<attribute name="iconUrl" optional="YES" attributeType="String"/>
|
||||||
<attribute name="password" attributeType="String"/>
|
<attribute name="password" attributeType="String"/>
|
||||||
<attribute name="selectedTanProcedureCode" optional="YES" attributeType="String"/>
|
<attribute name="selectedTanMethodCode" optional="YES" attributeType="String"/>
|
||||||
<attribute name="userId" attributeType="String"/>
|
<attribute name="userId" attributeType="String"/>
|
||||||
<attribute name="userSetDisplayName" optional="YES" attributeType="String"/>
|
<attribute name="userSetDisplayName" optional="YES" attributeType="String"/>
|
||||||
<relationship name="accounts" toMany="YES" deletionRule="Cascade" ordered="YES" destinationEntity="PersistedBankAccount" inverseName="customer" inverseEntity="PersistedBankAccount"/>
|
<relationship name="accounts" toMany="YES" deletionRule="Cascade" ordered="YES" destinationEntity="PersistedBankAccount" inverseName="customer" inverseEntity="PersistedBankAccount"/>
|
||||||
<relationship name="supportedTanProcedures" toMany="YES" deletionRule="Cascade" ordered="YES" destinationEntity="PersistedTanProcedure"/>
|
<relationship name="supportedTanMethods" toMany="YES" deletionRule="Cascade" ordered="YES" destinationEntity="PersistedTanMethod"/>
|
||||||
<relationship name="tanMedia" optional="YES" toMany="YES" deletionRule="Cascade" ordered="YES" destinationEntity="PersistedTanMedium"/>
|
<relationship name="tanMedia" optional="YES" toMany="YES" deletionRule="Cascade" ordered="YES" destinationEntity="PersistedTanMedium"/>
|
||||||
</entity>
|
</entity>
|
||||||
<entity name="PersistedTanMedium" representedClassName="PersistedTanMedium" syncable="YES" codeGenerationType="class">
|
<entity name="PersistedTanMedium" representedClassName="PersistedTanMedium" syncable="YES" codeGenerationType="class">
|
||||||
<attribute name="displayName" attributeType="String"/>
|
<attribute name="displayName" attributeType="String"/>
|
||||||
<attribute name="status" attributeType="String"/>
|
<attribute name="status" attributeType="String"/>
|
||||||
</entity>
|
</entity>
|
||||||
<entity name="PersistedTanProcedure" representedClassName="PersistedTanProcedure" syncable="YES" codeGenerationType="class">
|
<entity name="PersistedTanMethod" representedClassName="PersistedTanMethod" syncable="YES" codeGenerationType="class">
|
||||||
<attribute name="allowedTanFormat" attributeType="String" defaultValueString=""/>
|
<attribute name="allowedTanFormat" attributeType="String" defaultValueString=""/>
|
||||||
<attribute name="bankInternalProcedureCode" attributeType="String"/>
|
<attribute name="bankInternalMethodCode" attributeType="String"/>
|
||||||
<attribute name="displayName" attributeType="String"/>
|
<attribute name="displayName" attributeType="String"/>
|
||||||
<attribute name="maxTanInputLength" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES"/>
|
<attribute name="maxTanInputLength" optional="YES" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES"/>
|
||||||
<attribute name="type" attributeType="String"/>
|
<attribute name="type" attributeType="String"/>
|
||||||
|
@ -90,8 +90,8 @@
|
||||||
<elements>
|
<elements>
|
||||||
<element name="PersistedAccountTransaction" positionX="-36" positionY="45" width="128" height="553"/>
|
<element name="PersistedAccountTransaction" positionX="-36" positionY="45" width="128" height="553"/>
|
||||||
<element name="PersistedBankAccount" positionX="-54" positionY="63" width="128" height="343"/>
|
<element name="PersistedBankAccount" positionX="-54" positionY="63" width="128" height="343"/>
|
||||||
<element name="PersistedCustomer" positionX="-63" positionY="-18" width="128" height="28"/>
|
<element name="PersistedCustomer" positionX="-63" positionY="-18" width="128" height="283"/>
|
||||||
<element name="PersistedTanMedium" positionX="-45" positionY="144" width="128" height="28"/>
|
<element name="PersistedTanMedium" positionX="-45" positionY="144" width="128" height="28"/>
|
||||||
<element name="PersistedTanProcedure" positionX="-54" positionY="135" width="128" height="118"/>
|
<element name="PersistedTanMethod" positionX="-54" positionY="135" width="128" height="118"/>
|
||||||
</elements>
|
</elements>
|
||||||
</model>
|
</model>
|
|
@ -122,7 +122,7 @@ Unfortunately, Bankmeister cannot know whether a bank charges for instant paymen
|
||||||
/* EnterTanDialog */
|
/* EnterTanDialog */
|
||||||
|
|
||||||
"Enter TAN Dialog Title" = "Enter TAN";
|
"Enter TAN Dialog Title" = "Enter TAN";
|
||||||
"TAN procedure" = "TAN procedure";
|
"TAN method" = "TAN method";
|
||||||
"TAN medium" = "TAN medium";
|
"TAN medium" = "TAN medium";
|
||||||
"Tan Generator Frequency" = "Frequency";
|
"Tan Generator Frequency" = "Frequency";
|
||||||
"Size" = "Size";
|
"Size" = "Size";
|
||||||
|
|
|
@ -4,15 +4,15 @@ import BankingUiSwift
|
||||||
|
|
||||||
let previewBanks = createPreviewBanks()
|
let previewBanks = createPreviewBanks()
|
||||||
|
|
||||||
let previewTanProcedures = createPreviewTanProcedures()
|
let previewTanMethods = createPreviewTanMethod()
|
||||||
|
|
||||||
let previewTanMedia = createPreviewTanMedia()
|
let previewTanMedia = createPreviewTanMedia()
|
||||||
|
|
||||||
let previewTanChallenge = TanChallenge(messageToShowToUser: "Hier ist eine Nachricht deiner Bank, die dir die Welt erklaert", tanProcedure: previewTanProcedures[0])
|
let previewTanChallenge = TanChallenge(messageToShowToUser: "Hier ist eine Nachricht deiner Bank, die dir die Welt erklaert", tanMethod: previewTanMethods[0])
|
||||||
|
|
||||||
let previewImageTanChallenge = ImageTanChallenge(image: TanImage(mimeType: "image/png", imageBytes: KotlinByteArray(size: 0), decodingError: nil), messageToShowToUser: "", tanProcedure: previewTanProcedures[1])
|
let previewImageTanChallenge = ImageTanChallenge(image: TanImage(mimeType: "image/png", imageBytes: KotlinByteArray(size: 0), decodingError: nil), messageToShowToUser: "", tanMethod: previewTanMethods[1])
|
||||||
|
|
||||||
let previewFlickerCodeTanChallenge = FlickerCodeTanChallenge(flickerCode: FlickerCode(challengeHHD_UC: "", parsedDataSet: "", decodingError: nil), messageToShowToUser: "", tanProcedure: previewTanProcedures[0])
|
let previewFlickerCodeTanChallenge = FlickerCodeTanChallenge(flickerCode: FlickerCode(challengeHHD_UC: "", parsedDataSet: "", decodingError: nil), messageToShowToUser: "", tanMethod: previewTanMethods[0])
|
||||||
|
|
||||||
|
|
||||||
func createPreviewBanks() -> [ICustomer] {
|
func createPreviewBanks() -> [ICustomer] {
|
||||||
|
@ -35,11 +35,11 @@ func createPreviewBanks() -> [ICustomer] {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func createPreviewTanProcedures() -> [TanProcedure] {
|
func createPreviewTanMethod() -> [TanMethod] {
|
||||||
return [
|
return [
|
||||||
TanProcedure(displayName: "chipTAN optisch", type: .chiptanflickercode, bankInternalProcedureCode: "", maxTanInputLength: 6, allowedTanFormat: .numeric),
|
TanMethod(displayName: "chipTAN optisch", type: .chiptanflickercode, bankInternalMethodCode: "", maxTanInputLength: 6, allowedTanFormat: .numeric),
|
||||||
TanProcedure(displayName: "chipTAN QR", type: .chiptanqrcode, bankInternalProcedureCode: "", maxTanInputLength: 8, allowedTanFormat: .numeric),
|
TanMethod(displayName: "chipTAN QR", type: .chiptanqrcode, bankInternalMethodCode: "", maxTanInputLength: 8, allowedTanFormat: .numeric),
|
||||||
TanProcedure(displayName: "Secure Super Duper Plus", type: .apptan, bankInternalProcedureCode: "", maxTanInputLength: 6, allowedTanFormat: .alphanumeric)
|
TanMethod(displayName: "Secure Super Duper Plus", type: .apptan, bankInternalMethodCode: "", maxTanInputLength: 6, allowedTanFormat: .alphanumeric)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ Ob eine Bank Gebühren für Echtzeitüberweisungen erhebt, kann Bankmeister leid
|
||||||
/* EnterTanDialog */
|
/* EnterTanDialog */
|
||||||
|
|
||||||
"Enter TAN Dialog Title" = "TAN-Abfrage";
|
"Enter TAN Dialog Title" = "TAN-Abfrage";
|
||||||
"TAN procedure" = "TAN Verfahren";
|
"TAN method" = "TAN Verfahren";
|
||||||
"TAN medium" = "TAN Medium";
|
"TAN medium" = "TAN Medium";
|
||||||
"Tan Generator Frequency" = "Geschw.";
|
"Tan Generator Frequency" = "Geschw.";
|
||||||
"Size" = "Größe";
|
"Size" = "Größe";
|
||||||
|
|
|
@ -166,8 +166,8 @@ extension Remittee : Identifiable {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extension TanProcedure : Identifiable {
|
extension TanMethod : Identifiable {
|
||||||
|
|
||||||
public var id: String { self.bankInternalProcedureCode }
|
public var id: String { self.bankInternalMethodCode }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,9 +44,9 @@ class CoreDataBankingPersistence: IBankingPersistence, IRemitteeSearcher {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for tanProcedure in customer.supportedTanProcedures {
|
for tanMethod in customer.supportedTanMethods {
|
||||||
if let mappedTanProcedure = mappedCustomer.supportedTanProcedures?.first { ($0 as! PersistedTanProcedure).bankInternalProcedureCode == tanProcedure.bankInternalProcedureCode } as? PersistedTanProcedure {
|
if let mappedTanMethod = mappedCustomer.supportedTanMethods?.first { ($0 as! PersistedTanMethod).bankInternalMethodCode == tanMethod.bankInternalMethodCode } as? PersistedTanMethod {
|
||||||
tanProcedure.technicalId = mappedTanProcedure.objectIDAsString
|
tanMethod.technicalId = mappedTanMethod.objectIDAsString
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,8 @@ class Mapper {
|
||||||
|
|
||||||
mapped.accounts = map(mapped, customer.accounts?.array as? [PersistedBankAccount])
|
mapped.accounts = map(mapped, customer.accounts?.array as? [PersistedBankAccount])
|
||||||
|
|
||||||
mapped.supportedTanProcedures = map(customer.supportedTanProcedures?.array as? [PersistedTanProcedure])
|
mapped.supportedTanMethods = map(customer.supportedTanMethods?.array as? [PersistedTanMethod])
|
||||||
mapped.selectedTanProcedure = mapped.supportedTanProcedures.first(where: { $0.bankInternalProcedureCode == customer.selectedTanProcedureCode })
|
mapped.selectedTanMethod = mapped.supportedTanMethods.first(where: { $0.bankInternalMethodCode == customer.selectedTanMethodCode })
|
||||||
|
|
||||||
mapped.tanMedia = map(customer.tanMedia?.array as? [PersistedTanMedium])
|
mapped.tanMedia = map(customer.tanMedia?.array as? [PersistedTanMedium])
|
||||||
|
|
||||||
|
@ -44,8 +44,8 @@ class Mapper {
|
||||||
|
|
||||||
mapped.accounts = NSOrderedSet(array: map(mapped, customer.accounts, context))
|
mapped.accounts = NSOrderedSet(array: map(mapped, customer.accounts, context))
|
||||||
|
|
||||||
mapped.supportedTanProcedures = NSOrderedSet(array: map(customer.supportedTanProcedures, context))
|
mapped.supportedTanMethods = NSOrderedSet(array: map(customer.supportedTanMethods, context))
|
||||||
mapped.selectedTanProcedureCode = customer.selectedTanProcedure?.bankInternalProcedureCode
|
mapped.selectedTanMethodCode = customer.selectedTanMethod?.bankInternalMethodCode
|
||||||
|
|
||||||
mapped.tanMedia = NSOrderedSet(array: map(customer.tanMedia, context))
|
mapped.tanMedia = NSOrderedSet(array: map(customer.tanMedia, context))
|
||||||
|
|
||||||
|
@ -203,65 +203,65 @@ class Mapper {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func map(_ tanProcedures: [PersistedTanProcedure]?) -> [TanProcedure] {
|
func map(_ tanMethods: [PersistedTanMethod]?) -> [TanMethod] {
|
||||||
return tanProcedures?.map { map($0) } ?? []
|
return tanMethods?.map { map($0) } ?? []
|
||||||
}
|
}
|
||||||
|
|
||||||
func map(_ tanProcedure: PersistedTanProcedure) -> TanProcedure {
|
func map(_ tanMethod: PersistedTanMethod) -> TanMethod {
|
||||||
let mapped = TanProcedure(
|
let mapped = TanMethod(
|
||||||
displayName: map(tanProcedure.displayName),
|
displayName: map(tanMethod.displayName),
|
||||||
type: mapTanProcedureType(tanProcedure.type),
|
type: mapTanMethodType(tanMethod.type),
|
||||||
bankInternalProcedureCode: map(tanProcedure.bankInternalProcedureCode),
|
bankInternalMethodCode: map(tanMethod.bankInternalMethodCode),
|
||||||
maxTanInputLength: map(tanProcedure.maxTanInputLength),
|
maxTanInputLength: map(tanMethod.maxTanInputLength),
|
||||||
allowedTanFormat: tanProcedure.allowedTanFormat == "numeric" ? .numeric : .alphanumeric
|
allowedTanFormat: tanMethod.allowedTanFormat == "numeric" ? .numeric : .alphanumeric
|
||||||
)
|
)
|
||||||
|
|
||||||
mapped.technicalId = tanProcedure.objectIDAsString
|
mapped.technicalId = tanMethod.objectIDAsString
|
||||||
|
|
||||||
return mapped
|
return mapped
|
||||||
}
|
}
|
||||||
|
|
||||||
func map(_ tanProcedures: [TanProcedure], _ context: NSManagedObjectContext) -> [PersistedTanProcedure] {
|
func map(_ tanMethods: [TanMethod], _ context: NSManagedObjectContext) -> [PersistedTanMethod] {
|
||||||
return tanProcedures.map { map($0, context) }
|
return tanMethods.map { map($0, context) }
|
||||||
}
|
}
|
||||||
|
|
||||||
func map(_ tanProcedure: TanProcedure, _ context: NSManagedObjectContext) -> PersistedTanProcedure {
|
func map(_ tanMethod: TanMethod, _ context: NSManagedObjectContext) -> PersistedTanMethod {
|
||||||
let mapped = context.objectByID(tanProcedure.technicalId) ?? PersistedTanProcedure(context: context)
|
let mapped = context.objectByID(tanMethod.technicalId) ?? PersistedTanMethod(context: context)
|
||||||
|
|
||||||
mapped.displayName = tanProcedure.displayName
|
mapped.displayName = tanMethod.displayName
|
||||||
mapped.type = tanProcedure.type.name
|
mapped.type = tanMethod.type.name
|
||||||
mapped.bankInternalProcedureCode = tanProcedure.bankInternalProcedureCode
|
mapped.bankInternalMethodCode = tanMethod.bankInternalMethodCode
|
||||||
|
|
||||||
mapped.maxTanInputLength = map(tanProcedure.maxTanInputLength) ?? -1
|
mapped.maxTanInputLength = map(tanMethod.maxTanInputLength) ?? -1
|
||||||
mapped.allowedTanFormat = tanProcedure.allowedTanFormat.name
|
mapped.allowedTanFormat = tanMethod.allowedTanFormat.name
|
||||||
|
|
||||||
return mapped
|
return mapped
|
||||||
}
|
}
|
||||||
|
|
||||||
func mapTanProcedureType(_ type: String?) -> TanProcedureType {
|
func mapTanMethodType(_ type: String?) -> TanMethodType {
|
||||||
switch type {
|
switch type {
|
||||||
case TanProcedureType.entertan.name:
|
case TanMethodType.entertan.name:
|
||||||
return TanProcedureType.entertan
|
return TanMethodType.entertan
|
||||||
case TanProcedureType.chiptanmanuell.name:
|
case TanMethodType.chiptanmanuell.name:
|
||||||
return TanProcedureType.chiptanmanuell
|
return TanMethodType.chiptanmanuell
|
||||||
case TanProcedureType.chiptanflickercode.name:
|
case TanMethodType.chiptanflickercode.name:
|
||||||
return TanProcedureType.chiptanflickercode
|
return TanMethodType.chiptanflickercode
|
||||||
case TanProcedureType.chiptanusb.name:
|
case TanMethodType.chiptanusb.name:
|
||||||
return TanProcedureType.chiptanusb
|
return TanMethodType.chiptanusb
|
||||||
case TanProcedureType.chiptanqrcode.name:
|
case TanMethodType.chiptanqrcode.name:
|
||||||
return TanProcedureType.chiptanqrcode
|
return TanMethodType.chiptanqrcode
|
||||||
case TanProcedureType.chiptanphototanmatrixcode.name:
|
case TanMethodType.chiptanphototanmatrixcode.name:
|
||||||
return TanProcedureType.chiptanphototanmatrixcode
|
return TanMethodType.chiptanphototanmatrixcode
|
||||||
case TanProcedureType.smstan.name:
|
case TanMethodType.smstan.name:
|
||||||
return TanProcedureType.smstan
|
return TanMethodType.smstan
|
||||||
case TanProcedureType.apptan.name:
|
case TanMethodType.apptan.name:
|
||||||
return TanProcedureType.apptan
|
return TanMethodType.apptan
|
||||||
case TanProcedureType.phototan.name:
|
case TanMethodType.phototan.name:
|
||||||
return TanProcedureType.phototan
|
return TanMethodType.phototan
|
||||||
case TanProcedureType.qrcode.name:
|
case TanMethodType.qrcode.name:
|
||||||
return TanProcedureType.qrcode
|
return TanMethodType.qrcode
|
||||||
default:
|
default:
|
||||||
return TanProcedureType.entertan
|
return TanMethodType.entertan
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ struct BankSettingsDialog: View {
|
||||||
@State private var customerId: String
|
@State private var customerId: String
|
||||||
@State private var password: String
|
@State private var password: String
|
||||||
|
|
||||||
@State private var selectedTanProcedure: TanProcedure?
|
@State private var selectedTanMethod: TanMethod?
|
||||||
|
|
||||||
@State private var accountsSorted: [IBankAccount]
|
@State private var accountsSorted: [IBankAccount]
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ struct BankSettingsDialog: View {
|
||||||
return bank.displayName != displayName
|
return bank.displayName != displayName
|
||||||
|| bank.customerId != customerId
|
|| bank.customerId != customerId
|
||||||
|| bank.password != password
|
|| bank.password != password
|
||||||
|| bank.selectedTanProcedure != selectedTanProcedure
|
|| bank.selectedTanMethod != selectedTanMethod
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ struct BankSettingsDialog: View {
|
||||||
_customerId = State(initialValue: bank.customerId)
|
_customerId = State(initialValue: bank.customerId)
|
||||||
_password = State(initialValue: bank.password)
|
_password = State(initialValue: bank.password)
|
||||||
|
|
||||||
_selectedTanProcedure = State(initialValue: bank.selectedTanProcedure)
|
_selectedTanMethod = State(initialValue: bank.selectedTanMethod)
|
||||||
|
|
||||||
_accountsSorted = State(initialValue: bank.accountsSorted)
|
_accountsSorted = State(initialValue: bank.accountsSorted)
|
||||||
}
|
}
|
||||||
|
@ -59,8 +59,8 @@ struct BankSettingsDialog: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
Section {
|
Section {
|
||||||
TanProcedurePicker(bank) { selectedTanProcedure in
|
TanMethodPicker(bank) { selectedTanMethod in
|
||||||
self.selectedTanProcedure = selectedTanProcedure
|
self.selectedTanMethod = selectedTanMethod
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ struct BankSettingsDialog: View {
|
||||||
bank.customerId = customerId
|
bank.customerId = customerId
|
||||||
bank.password = password
|
bank.password = password
|
||||||
|
|
||||||
bank.selectedTanProcedure = selectedTanProcedure
|
bank.selectedTanMethod = selectedTanMethod
|
||||||
|
|
||||||
presenter.accountUpdated(bank: bank)
|
presenter.accountUpdated(bank: bank)
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ struct EnterTanDialog: View {
|
||||||
|
|
||||||
self.customersTanMedia = customer.tanMediaSorted
|
self.customersTanMedia = customer.tanMediaSorted
|
||||||
|
|
||||||
self.showSelectTanMediumView = self.customersTanMedia.count > 1 // TODO: use isOpticalTanProcedure && tanMedia.count > 1
|
self.showSelectTanMediumView = self.customersTanMedia.count > 1 // TODO: use isOpticalTanMethod && tanMedia.count > 1
|
||||||
|
|
||||||
self.flickerCodeTanChallenge = tanChallenge as? FlickerCodeTanChallenge
|
self.flickerCodeTanChallenge = tanChallenge as? FlickerCodeTanChallenge
|
||||||
self.imageTanChallenge = tanChallenge as? ImageTanChallenge
|
self.imageTanChallenge = tanChallenge as? ImageTanChallenge
|
||||||
|
@ -73,8 +73,8 @@ struct EnterTanDialog: View {
|
||||||
var body: some View {
|
var body: some View {
|
||||||
Form {
|
Form {
|
||||||
Section {
|
Section {
|
||||||
TanProcedurePicker(customer, state.tanChallenge.tanProcedure) { selectedTanProcedure in
|
TanMethodPicker(customer, state.tanChallenge.tanMethod) { selectedTanMethod in
|
||||||
self.selectedTanProcedureChanged(selectedTanProcedure)
|
self.selectedTanMethodChanged(selectedTanMethod)
|
||||||
}
|
}
|
||||||
|
|
||||||
if showSelectTanMediumView {
|
if showSelectTanMediumView {
|
||||||
|
@ -109,8 +109,8 @@ struct EnterTanDialog: View {
|
||||||
.padding(.vertical, 2)
|
.padding(.vertical, 2)
|
||||||
|
|
||||||
Section {
|
Section {
|
||||||
LabelledUIKitTextField(label: "Enter TAN:", text: $enteredTan, keyboardType: tanChallenge.tanProcedure.isNumericTan ? .numberPad : .default,
|
LabelledUIKitTextField(label: "Enter TAN:", text: $enteredTan, keyboardType: tanChallenge.tanMethod.isNumericTan ? .numberPad : .default,
|
||||||
autocapitalizationType: .none, addDoneButton: tanChallenge.tanProcedure.isNumericTan, actionOnReturnKeyPress: {
|
autocapitalizationType: .none, addDoneButton: tanChallenge.tanMethod.isNumericTan, actionOnReturnKeyPress: {
|
||||||
if self.isRequiredDataEntered() {
|
if self.isRequiredDataEntered() {
|
||||||
self.enteringTanDone()
|
self.enteringTanDone()
|
||||||
return true
|
return true
|
||||||
|
@ -143,12 +143,12 @@ struct EnterTanDialog: View {
|
||||||
return self.enteredTan.isNotBlank
|
return self.enteredTan.isNotBlank
|
||||||
}
|
}
|
||||||
|
|
||||||
private func selectedTanProcedureChanged(_ changeTanProcedureTo: TanProcedure) {
|
private func selectedTanMethodChanged(_ changeTanMethodTo: TanMethod) {
|
||||||
// do async as at this point Picker dialog gets dismissed -> this EnterTanDialog would never get dismissed (and dismiss has to be called before callback.changeTanProcedure())
|
// do async as at this point Picker dialog gets dismissed -> this EnterTanDialog would never get dismissed (and dismiss has to be called before callback.changeTanMethod())
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
self.dismissDialog()
|
self.dismissDialog()
|
||||||
|
|
||||||
self.state.callback(EnterTanResult.Companion().userAsksToChangeTanProcedure(changeTanProcedureTo: changeTanProcedureTo))
|
self.state.callback(EnterTanResult.Companion().userAsksToChangeTanMethod(changeTanMethodTo: changeTanMethodTo))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -216,7 +216,7 @@ struct EnterTanDialog: View {
|
||||||
struct EnterTanDialog_Previews: PreviewProvider {
|
struct EnterTanDialog_Previews: PreviewProvider {
|
||||||
static var previews: some View {
|
static var previews: some View {
|
||||||
let customer = Customer(bankCode: "", customerId: "", password: "", finTsServerAddress: "")
|
let customer = Customer(bankCode: "", customerId: "", password: "", finTsServerAddress: "")
|
||||||
customer.supportedTanProcedures = previewTanProcedures
|
customer.supportedTanMethods = previewTanMethods
|
||||||
|
|
||||||
customer.tanMedia = previewTanMedia
|
customer.tanMedia = previewTanMedia
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,72 @@
|
||||||
|
import SwiftUI
|
||||||
|
import BankingUiSwift
|
||||||
|
|
||||||
|
|
||||||
|
struct TanMethodPicker: View {
|
||||||
|
|
||||||
|
private let bank: ICustomer
|
||||||
|
|
||||||
|
private let selectedTanMethodChanged: (TanMethod) -> Void
|
||||||
|
|
||||||
|
|
||||||
|
private var customersTanMethods: [TanMethod] = []
|
||||||
|
|
||||||
|
private let initiallySelectedTanMethod: TanMethod?
|
||||||
|
|
||||||
|
@State private var selectedTanMethodIndex: Int
|
||||||
|
|
||||||
|
private var selectedTanMethodIndexBinding: Binding<Int> {
|
||||||
|
Binding<Int>(
|
||||||
|
get: { self.selectedTanMethodIndex },
|
||||||
|
set: { newValue in
|
||||||
|
if (self.selectedTanMethodIndex != newValue || self.initiallySelectedTanMethod == nil) { // only if TAN method has really changed
|
||||||
|
self.selectedTanMethodIndex = newValue
|
||||||
|
self.dispatchSelectedTanMethodChanged(self.customersTanMethods[newValue])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
init(_ bank: ICustomer, _ initiallySelectedTanMethod: TanMethod? = nil, selectedTanMethodChanged: @escaping (TanMethod) -> Void) {
|
||||||
|
self.bank = bank
|
||||||
|
|
||||||
|
self.selectedTanMethodChanged = selectedTanMethodChanged
|
||||||
|
|
||||||
|
|
||||||
|
self.customersTanMethods = bank.supportedTanMethods.filter( {$0.type != .chiptanusb } ) // USB tan generators are not supported on iOS
|
||||||
|
|
||||||
|
self.initiallySelectedTanMethod = initiallySelectedTanMethod ?? bank.selectedTanMethod
|
||||||
|
let initiallySelectedTanMethodType = self.initiallySelectedTanMethod?.type
|
||||||
|
|
||||||
|
_selectedTanMethodIndex = State(initialValue: customersTanMethods.firstIndex(where: { $0.type == initiallySelectedTanMethodType } )
|
||||||
|
?? bank.supportedTanMethods.firstIndex(where: { $0.type != .chiptanmanuell && $0.type != .chiptanusb } )
|
||||||
|
?? 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
Picker("TAN method", selection: selectedTanMethodIndexBinding) {
|
||||||
|
ForEach(0 ..< self.customersTanMethods.count) { index in
|
||||||
|
Text(self.customersTanMethods[index].displayName)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private func dispatchSelectedTanMethodChanged(_ selectedTanMethod: TanMethod) {
|
||||||
|
// do async as at this point Picker dialog gets dismissed -> this EnterTanDialog would never get dismissed (and dismiss has to be called before callback.changeTanMethod())
|
||||||
|
DispatchQueue.main.async {
|
||||||
|
self.selectedTanMethodChanged(selectedTanMethod)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
struct TanMethodPicker_Previews: PreviewProvider {
|
||||||
|
|
||||||
|
static var previews: some View {
|
||||||
|
TanMethodPicker(previewBanks[0]) { _ in }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,72 +0,0 @@
|
||||||
import SwiftUI
|
|
||||||
import BankingUiSwift
|
|
||||||
|
|
||||||
|
|
||||||
struct TanProcedurePicker: View {
|
|
||||||
|
|
||||||
private let bank: ICustomer
|
|
||||||
|
|
||||||
private let selectedTanProcedureChanged: (TanProcedure) -> Void
|
|
||||||
|
|
||||||
|
|
||||||
private var customersTanProcedures: [TanProcedure] = []
|
|
||||||
|
|
||||||
private let initiallySelectedTanProcedure: TanProcedure?
|
|
||||||
|
|
||||||
@State private var selectedTanProcedureIndex: Int
|
|
||||||
|
|
||||||
private var selectedTanProcedureIndexBinding: Binding<Int> {
|
|
||||||
Binding<Int>(
|
|
||||||
get: { self.selectedTanProcedureIndex },
|
|
||||||
set: { newValue in
|
|
||||||
if (self.selectedTanProcedureIndex != newValue || self.initiallySelectedTanProcedure == nil) { // only if TAN procedure has really changed
|
|
||||||
self.selectedTanProcedureIndex = newValue
|
|
||||||
self.dispatchSelectedTanProcedureChanged(self.customersTanProcedures[newValue])
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
init(_ bank: ICustomer, _ initiallySelectedTanProcedure: TanProcedure? = nil, selectedTanProcedureChanged: @escaping (TanProcedure) -> Void) {
|
|
||||||
self.bank = bank
|
|
||||||
|
|
||||||
self.selectedTanProcedureChanged = selectedTanProcedureChanged
|
|
||||||
|
|
||||||
|
|
||||||
self.customersTanProcedures = bank.supportedTanProcedures.filter( {$0.type != .chiptanusb } ) // USB tan generators are not supported on iOS
|
|
||||||
|
|
||||||
self.initiallySelectedTanProcedure = initiallySelectedTanProcedure ?? bank.selectedTanProcedure
|
|
||||||
let initiallySelectedTanProcedureType = self.initiallySelectedTanProcedure?.type
|
|
||||||
|
|
||||||
_selectedTanProcedureIndex = State(initialValue: customersTanProcedures.firstIndex(where: { $0.type == initiallySelectedTanProcedureType } )
|
|
||||||
?? bank.supportedTanProcedures.firstIndex(where: { $0.type != .chiptanmanuell && $0.type != .chiptanusb } )
|
|
||||||
?? 0)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var body: some View {
|
|
||||||
Picker("TAN procedure", selection: selectedTanProcedureIndexBinding) {
|
|
||||||
ForEach(0 ..< self.customersTanProcedures.count) { index in
|
|
||||||
Text(self.customersTanProcedures[index].displayName)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private func dispatchSelectedTanProcedureChanged(_ selectedTanProcedure: TanProcedure) {
|
|
||||||
// do async as at this point Picker dialog gets dismissed -> this EnterTanDialog would never get dismissed (and dismiss has to be called before callback.changeTanProcedure())
|
|
||||||
DispatchQueue.main.async {
|
|
||||||
self.selectedTanProcedureChanged(selectedTanProcedure)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
struct TanProcedurePicker_Previews: PreviewProvider {
|
|
||||||
|
|
||||||
static var previews: some View {
|
|
||||||
TanProcedurePicker(previewBanks[0]) { _ in }
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -220,7 +220,7 @@ open class fints4kBankingClient(
|
||||||
return object : FinTsClientCallback {
|
return object : FinTsClientCallback {
|
||||||
|
|
||||||
override fun askUserForTanMethod(supportedTanMethods: List<TanMethod>, suggestedTanMethod: TanMethod?, callback: (TanMethod?) -> Unit) {
|
override fun askUserForTanMethod(supportedTanMethods: List<TanMethod>, suggestedTanMethod: TanMethod?, callback: (TanMethod?) -> Unit) {
|
||||||
handleAskUserForTanProcedure(supportedTanMethods, suggestedTanMethod, callback)
|
handleAskUserForTanMethod(supportedTanMethods, suggestedTanMethod, callback)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun enterTan(bank: BankData, tanChallenge: TanChallenge, callback: (EnterTanResult) -> Unit) {
|
override fun enterTan(bank: BankData, tanChallenge: TanChallenge, callback: (EnterTanResult) -> Unit) {
|
||||||
|
@ -234,13 +234,13 @@ open class fints4kBankingClient(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun handleAskUserForTanProcedure(supportedTanMethods: List<TanMethod>, suggestedTanMethod: TanMethod?, callback: (TanMethod?) -> Unit) {
|
protected open fun handleAskUserForTanMethod(supportedTanMethods: List<TanMethod>, suggestedTanMethod: TanMethod?, callback: (TanMethod?) -> Unit) {
|
||||||
// we simply return suggestedTanProcedure as even so it's not user's preferred TAN procedure she still can select it in EnterTanDialog
|
// we simply return suggestedTanProcedure as even so it's not user's preferred TAN procedure she still can select it in EnterTanDialog
|
||||||
callback(suggestedTanMethod)
|
callback(suggestedTanMethod)
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun handleEnterTan(bank: BankData, tanChallenge: TanChallenge, enterTanCallback: (EnterTanResult) -> Unit, clientCallback: BankingClientCallback) {
|
protected open fun handleEnterTan(bank: BankData, tanChallenge: TanChallenge, enterTanCallback: (EnterTanResult) -> Unit, clientCallback: BankingClientCallback) {
|
||||||
mapper.updateTanMediaAndProcedures(this@fints4kBankingClient.customer, bank)
|
mapper.updateTanMediaAndMethods(this@fints4kBankingClient.customer, bank)
|
||||||
|
|
||||||
clientCallback.enterTan(this@fints4kBankingClient.customer, mapper.mapTanChallenge(tanChallenge)) { result ->
|
clientCallback.enterTan(this@fints4kBankingClient.customer, mapper.mapTanChallenge(tanChallenge)) { result ->
|
||||||
enterTanCallback(mapper.mapEnterTanResult(result, bank))
|
enterTanCallback(mapper.mapEnterTanResult(result, bank))
|
||||||
|
@ -248,7 +248,7 @@ open class fints4kBankingClient(
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun handleEnterTanGeneratorAtc(bank: BankData, tanMedium: TanGeneratorTanMedium, enterAtcCallback: (EnterTanGeneratorAtcResult) -> Unit, clientCallback: BankingClientCallback) {
|
protected open fun handleEnterTanGeneratorAtc(bank: BankData, tanMedium: TanGeneratorTanMedium, enterAtcCallback: (EnterTanGeneratorAtcResult) -> Unit, clientCallback: BankingClientCallback) {
|
||||||
mapper.updateTanMediaAndProcedures(this@fints4kBankingClient.customer, bank)
|
mapper.updateTanMediaAndMethods(this@fints4kBankingClient.customer, bank)
|
||||||
|
|
||||||
clientCallback.enterTanGeneratorAtc(mapper.mapTanMedium(tanMedium)) { result ->
|
clientCallback.enterTanGeneratorAtc(mapper.mapTanMedium(tanMedium)) { result ->
|
||||||
enterAtcCallback(mapper.mapEnterTanGeneratorAtcResult(result))
|
enterAtcCallback(mapper.mapEnterTanGeneratorAtcResult(result))
|
||||||
|
|
|
@ -93,7 +93,7 @@ open class fints4kModelMapper(protected val modelCreator: IModelCreator) {
|
||||||
|
|
||||||
bank.bankCode = customer.bankCode
|
bank.bankCode = customer.bankCode
|
||||||
|
|
||||||
bank.selectedTanMethod = findTanMethod(bank, customer.selectedTanProcedure) ?: bank.selectedTanMethod
|
bank.selectedTanMethod = findTanMethod(bank, customer.selectedTanMethod) ?: bank.selectedTanMethod
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -236,15 +236,15 @@ open class fints4kModelMapper(protected val modelCreator: IModelCreator) {
|
||||||
|
|
||||||
|
|
||||||
open fun updateTanMediaAndMethods(account: TypedCustomer, bank: BankData) {
|
open fun updateTanMediaAndMethods(account: TypedCustomer, bank: BankData) {
|
||||||
account.supportedTanProcedures = bank.tanMethodsAvailableForUser.map { tanMethod ->
|
account.supportedTanMethods = bank.tanMethodsAvailableForUser.map { tanMethod ->
|
||||||
findMappedTanMethod(account, tanMethod) ?: mapTanMethod(tanMethod)
|
findMappedTanMethod(account, tanMethod) ?: mapTanMethod(tanMethod)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bank.isTanMethodSelected) {
|
if (bank.isTanMethodSelected) {
|
||||||
account.selectedTanProcedure = findMappedTanMethod(account, bank.selectedTanMethod)
|
account.selectedTanMethod = findMappedTanMethod(account, bank.selectedTanMethod)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
account.selectedTanProcedure = null
|
account.selectedTanMethod = null
|
||||||
}
|
}
|
||||||
|
|
||||||
account.tanMedia = bank.tanMedia.map { tanMedium ->
|
account.tanMedia = bank.tanMedia.map { tanMedium ->
|
||||||
|
@ -253,12 +253,12 @@ open class fints4kModelMapper(protected val modelCreator: IModelCreator) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
open fun mapTanMethods(tanMethods: List<net.dankito.banking.fints.model.TanMethod>): List<TanProcedure> {
|
open fun mapTanMethods(tanMethods: List<net.dankito.banking.fints.model.TanMethod>): List<TanMethod> {
|
||||||
return tanMethods.map { mapTanMethod(it) }
|
return tanMethods.map { mapTanMethod(it) }
|
||||||
}
|
}
|
||||||
|
|
||||||
open fun mapTanMethod(tanMethod: net.dankito.banking.fints.model.TanMethod): TanProcedure {
|
open fun mapTanMethod(tanMethod: net.dankito.banking.fints.model.TanMethod): TanMethod {
|
||||||
return modelCreator.createTanProcedure(
|
return modelCreator.createTanMethod(
|
||||||
tanMethod.displayName,
|
tanMethod.displayName,
|
||||||
mapTanMethodType(tanMethod.type),
|
mapTanMethodType(tanMethod.type),
|
||||||
tanMethod.securityFunction.code,
|
tanMethod.securityFunction.code,
|
||||||
|
@ -267,18 +267,18 @@ open class fints4kModelMapper(protected val modelCreator: IModelCreator) {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
open fun mapTanMethodType(type: net.dankito.banking.fints.model.TanMethodType): TanProcedureType {
|
open fun mapTanMethodType(type: net.dankito.banking.fints.model.TanMethodType): TanMethodType {
|
||||||
return when (type) {
|
return when (type) {
|
||||||
net.dankito.banking.fints.model.TanMethodType.EnterTan -> TanProcedureType.EnterTan
|
net.dankito.banking.fints.model.TanMethodType.EnterTan -> TanMethodType.EnterTan
|
||||||
net.dankito.banking.fints.model.TanMethodType.ChipTanManuell -> TanProcedureType.ChipTanManuell
|
net.dankito.banking.fints.model.TanMethodType.ChipTanManuell -> TanMethodType.ChipTanManuell
|
||||||
net.dankito.banking.fints.model.TanMethodType.ChipTanFlickercode -> TanProcedureType.ChipTanFlickercode
|
net.dankito.banking.fints.model.TanMethodType.ChipTanFlickercode -> TanMethodType.ChipTanFlickercode
|
||||||
net.dankito.banking.fints.model.TanMethodType.ChipTanUsb -> TanProcedureType.ChipTanUsb
|
net.dankito.banking.fints.model.TanMethodType.ChipTanUsb -> TanMethodType.ChipTanUsb
|
||||||
net.dankito.banking.fints.model.TanMethodType.ChipTanQrCode -> TanProcedureType.ChipTanQrCode
|
net.dankito.banking.fints.model.TanMethodType.ChipTanQrCode -> TanMethodType.ChipTanQrCode
|
||||||
net.dankito.banking.fints.model.TanMethodType.ChipTanPhotoTanMatrixCode -> TanProcedureType.ChipTanPhotoTanMatrixCode
|
net.dankito.banking.fints.model.TanMethodType.ChipTanPhotoTanMatrixCode -> TanMethodType.ChipTanPhotoTanMatrixCode
|
||||||
net.dankito.banking.fints.model.TanMethodType.SmsTan -> TanProcedureType.SmsTan
|
net.dankito.banking.fints.model.TanMethodType.SmsTan -> TanMethodType.SmsTan
|
||||||
net.dankito.banking.fints.model.TanMethodType.AppTan -> TanProcedureType.AppTan
|
net.dankito.banking.fints.model.TanMethodType.AppTan -> TanMethodType.AppTan
|
||||||
net.dankito.banking.fints.model.TanMethodType.photoTan -> TanProcedureType.photoTan
|
net.dankito.banking.fints.model.TanMethodType.photoTan -> TanMethodType.photoTan
|
||||||
net.dankito.banking.fints.model.TanMethodType.QrCode -> TanProcedureType.QrCode
|
net.dankito.banking.fints.model.TanMethodType.QrCode -> TanMethodType.QrCode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -289,16 +289,16 @@ open class fints4kModelMapper(protected val modelCreator: IModelCreator) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun findMappedTanMethod(customer: TypedCustomer, tanMethod: net.dankito.banking.fints.model.TanMethod): TanProcedure? {
|
protected open fun findMappedTanMethod(customer: TypedCustomer, tanMethod: net.dankito.banking.fints.model.TanMethod): TanMethod? {
|
||||||
return customer.supportedTanProcedures.firstOrNull { it.bankInternalProcedureCode == tanMethod.securityFunction.code }
|
return customer.supportedTanMethods.firstOrNull { it.bankInternalMethodCode == tanMethod.securityFunction.code }
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun findTanMethod(bank: BankData, tanProcedure: TanProcedure?): net.dankito.banking.fints.model.TanMethod? {
|
protected open fun findTanMethod(bank: BankData, tanMethod: TanMethod?): net.dankito.banking.fints.model.TanMethod? {
|
||||||
if (tanProcedure == null) {
|
if (tanMethod == null) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
return bank.tanMethodsAvailableForUser.firstOrNull { it.securityFunction.code == tanProcedure.bankInternalProcedureCode }
|
return bank.tanMethodsAvailableForUser.firstOrNull { it.securityFunction.code == tanMethod.bankInternalMethodCode }
|
||||||
}
|
}
|
||||||
|
|
||||||
protected open fun findMappedTanMedium(customer: TypedCustomer, tanMedium: net.dankito.banking.fints.messages.datenelemente.implementierte.tan.TanMedium): TanMedium? {
|
protected open fun findMappedTanMedium(customer: TypedCustomer, tanMedium: net.dankito.banking.fints.messages.datenelemente.implementierte.tan.TanMedium): TanMedium? {
|
||||||
|
@ -393,29 +393,29 @@ open class fints4kModelMapper(protected val modelCreator: IModelCreator) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
open fun mapTanMethod(tanProcedure: TanProcedure): net.dankito.banking.fints.model.TanMethod {
|
open fun mapTanMethod(tanMethod: TanMethod): net.dankito.banking.fints.model.TanMethod {
|
||||||
return net.dankito.banking.fints.model.TanMethod(
|
return net.dankito.banking.fints.model.TanMethod(
|
||||||
tanProcedure.displayName,
|
tanMethod.displayName,
|
||||||
Sicherheitsfunktion.values().first { it.code == tanProcedure.bankInternalProcedureCode },
|
Sicherheitsfunktion.values().first { it.code == tanMethod.bankInternalMethodCode },
|
||||||
mapTanMethodType(tanProcedure.type),
|
mapTanMethodType(tanMethod.type),
|
||||||
null, // TODO: where to get HDD Version from?
|
null, // TODO: where to get HDD Version from?
|
||||||
tanProcedure.maxTanInputLength,
|
tanMethod.maxTanInputLength,
|
||||||
mapAllowedTanFormat(tanProcedure.allowedTanFormat)
|
mapAllowedTanFormat(tanMethod.allowedTanFormat)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
open fun mapTanMethodType(type: TanProcedureType): net.dankito.banking.fints.model.TanMethodType {
|
open fun mapTanMethodType(type: TanMethodType): net.dankito.banking.fints.model.TanMethodType {
|
||||||
return when (type) {
|
return when (type) {
|
||||||
TanProcedureType.EnterTan -> net.dankito.banking.fints.model.TanMethodType.EnterTan
|
TanMethodType.EnterTan -> net.dankito.banking.fints.model.TanMethodType.EnterTan
|
||||||
TanProcedureType.ChipTanManuell -> net.dankito.banking.fints.model.TanMethodType.ChipTanManuell
|
TanMethodType.ChipTanManuell -> net.dankito.banking.fints.model.TanMethodType.ChipTanManuell
|
||||||
TanProcedureType.ChipTanFlickercode -> net.dankito.banking.fints.model.TanMethodType.ChipTanFlickercode
|
TanMethodType.ChipTanFlickercode -> net.dankito.banking.fints.model.TanMethodType.ChipTanFlickercode
|
||||||
TanProcedureType.ChipTanUsb -> net.dankito.banking.fints.model.TanMethodType.ChipTanUsb
|
TanMethodType.ChipTanUsb -> net.dankito.banking.fints.model.TanMethodType.ChipTanUsb
|
||||||
TanProcedureType.ChipTanQrCode -> net.dankito.banking.fints.model.TanMethodType.ChipTanQrCode
|
TanMethodType.ChipTanQrCode -> net.dankito.banking.fints.model.TanMethodType.ChipTanQrCode
|
||||||
TanProcedureType.ChipTanPhotoTanMatrixCode -> net.dankito.banking.fints.model.TanMethodType.ChipTanPhotoTanMatrixCode
|
TanMethodType.ChipTanPhotoTanMatrixCode -> net.dankito.banking.fints.model.TanMethodType.ChipTanPhotoTanMatrixCode
|
||||||
TanProcedureType.SmsTan -> net.dankito.banking.fints.model.TanMethodType.SmsTan
|
TanMethodType.SmsTan -> net.dankito.banking.fints.model.TanMethodType.SmsTan
|
||||||
TanProcedureType.AppTan -> net.dankito.banking.fints.model.TanMethodType.AppTan
|
TanMethodType.AppTan -> net.dankito.banking.fints.model.TanMethodType.AppTan
|
||||||
TanProcedureType.photoTan -> net.dankito.banking.fints.model.TanMethodType.photoTan
|
TanMethodType.photoTan -> net.dankito.banking.fints.model.TanMethodType.photoTan
|
||||||
TanProcedureType.QrCode -> net.dankito.banking.fints.model.TanMethodType.QrCode
|
TanMethodType.QrCode -> net.dankito.banking.fints.model.TanMethodType.QrCode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -427,7 +427,7 @@ open class fints4kModelMapper(protected val modelCreator: IModelCreator) {
|
||||||
}
|
}
|
||||||
|
|
||||||
open fun mapEnterTanResult(result: EnterTanResult, bank: BankData): net.dankito.banking.fints.model.EnterTanResult {
|
open fun mapEnterTanResult(result: EnterTanResult, bank: BankData): net.dankito.banking.fints.model.EnterTanResult {
|
||||||
result.changeTanProcedureTo?.let { changeTanMethodTo ->
|
result.changeTanMethodTo?.let { changeTanMethodTo ->
|
||||||
return net.dankito.banking.fints.model.EnterTanResult.userAsksToChangeTanMethod(mapTanMethod(changeTanMethodTo))
|
return net.dankito.banking.fints.model.EnterTanResult.userAsksToChangeTanMethod(mapTanMethod(changeTanMethodTo))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue