Implemented pretty printing HBCI messages

This commit is contained in:
dankl 2020-01-19 16:51:59 +01:00 committed by dankito
parent e5d04fc3c8
commit a62e3e4c16
1 changed files with 6 additions and 2 deletions

View File

@ -598,7 +598,7 @@ open class FinTsClient @JvmOverloads constructor(
}
protected open fun getResponseForMessage(requestBody: String, bank: BankData): WebClientResponse {
log.debug("Sending message:\n$requestBody")
log.debug("Sending message:\n${prettyPrintHbciMessage(requestBody)}")
val encodedRequestBody = base64Service.encode(requestBody)
@ -614,7 +614,7 @@ open class FinTsClient @JvmOverloads constructor(
val decodedResponse = decodeBase64Response(responseBody)
log.debug("Received message:\n$decodedResponse")
log.debug("Received message:\n${prettyPrintHbciMessage(decodedResponse)}")
return responseParser.parse(decodedResponse)
}
@ -629,6 +629,10 @@ open class FinTsClient @JvmOverloads constructor(
return base64Service.decode(responseBody.replace("\r", "").replace("\n", ""))
}
protected fun prettyPrintHbciMessage(message: String): String {
return message.replace("'", "'\r\n")
}
protected open fun handleMayRequiredTan(response: Response, bank: BankData, customer: CustomerData, dialogData: DialogData): Response {
if (response.isStrongAuthenticationRequired) {
response.tanResponse?.let { tanResponse ->