2019-10-05 00:27:24 +00:00
|
|
|
package net.dankito.fints
|
|
|
|
|
2019-10-12 22:49:49 +00:00
|
|
|
import net.dankito.fints.messages.datenelemente.abgeleiteteformate.Datum
|
2019-10-05 00:27:24 +00:00
|
|
|
import net.dankito.fints.messages.datenelemente.abgeleiteteformate.Laenderkennzeichen
|
|
|
|
import net.dankito.fints.messages.datenelemente.implementierte.Dialogsprache
|
|
|
|
import net.dankito.fints.messages.datenelemente.implementierte.signatur.Sicherheitsfunktion
|
|
|
|
import net.dankito.fints.model.*
|
2019-10-12 22:49:49 +00:00
|
|
|
import java.math.BigDecimal
|
2019-10-05 15:20:49 +00:00
|
|
|
import java.util.*
|
2019-10-05 00:27:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
abstract class FinTsTestBase {
|
|
|
|
|
|
|
|
companion object {
|
|
|
|
const val BankCode = "12345678"
|
|
|
|
|
|
|
|
val Bank = BankData(BankCode, Laenderkennzeichen.Germany, "")
|
|
|
|
|
|
|
|
const val CustomerId = "0987654321"
|
|
|
|
|
|
|
|
const val Pin = "12345"
|
|
|
|
|
|
|
|
val Language = Dialogsprache.German
|
|
|
|
|
|
|
|
val SecurityFunction = Sicherheitsfunktion.PIN_TAN_911
|
|
|
|
|
|
|
|
const val ControlReference = "1"
|
|
|
|
|
|
|
|
val Customer = CustomerData(CustomerId, Pin, selectedTanProcedure = TanProcedure("chipTAN-optisch", SecurityFunction, TanProcedureType.ChipTan), selectedLanguage = Language)
|
|
|
|
|
|
|
|
const val ProductName = "FinTS-TestClient25Stellen"
|
|
|
|
|
|
|
|
const val ProductVersion = "1"
|
|
|
|
|
|
|
|
val Product = ProductData(ProductName, ProductVersion)
|
|
|
|
|
|
|
|
const val Date = 19880327
|
|
|
|
|
|
|
|
const val Time = 182752
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-10-05 15:20:49 +00:00
|
|
|
protected open fun createDialogId(): String {
|
|
|
|
return UUID.randomUUID().toString().replace("-", "")
|
|
|
|
}
|
|
|
|
|
2019-10-12 22:49:49 +00:00
|
|
|
protected open fun convertAmount(amount: BigDecimal): String {
|
|
|
|
return amount.toString().replace('.', ',')
|
|
|
|
}
|
|
|
|
|
|
|
|
protected open fun convertDate(date: Date): String {
|
|
|
|
return Datum.HbciDateFormat.format(date)
|
|
|
|
}
|
|
|
|
|
2019-10-05 00:27:24 +00:00
|
|
|
protected open fun normalizeBinaryData(message: String): String {
|
|
|
|
return message.replace(0.toChar(), ' ')
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|