libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit f5e1649daa2e8470babcc2d8188b8ffae0f09d1e
parent 6c833ee015943eca1b863e9eaa657f18f012f52c
Author: MS <ms@taler.net>
Date:   Mon,  3 Aug 2020 13:51:35 +0200

Double submission of same PAIN.

Nexus returns 500, after having gotten a
EBICS_PROCESSING_ERROR from the Sandbox.

Diffstat:
Mintegration-tests/test-ebics-double-payment-submission.py | 7++++---
Mnexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsClient.kt | 4+++-
2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/integration-tests/test-ebics-double-payment-submission.py b/integration-tests/test-ebics-double-payment-submission.py @@ -43,8 +43,8 @@ def fail(msg): exit(1) -def assertResponse(response): - if response.status_code != 200: +def assertResponse(response, acceptedResponses=[200]): + if response.status_code not in acceptedResponses: print("Test failed on URL: {}".format(response.url)) # stdout/stderr from both services is A LOT of text. # Confusing to dump all that to console. @@ -155,7 +155,8 @@ assertResponse( f"http://localhost:5001/bank-accounts/{BANK_ACCOUNT_LABEL}/payment-initiations/{PREPARED_PAYMENT_UUID}/submit", json=dict(), headers=dict(Authorization=USER_AUTHORIZATION_HEADER), - ) + ), + [500] ) print("Test passed!") diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsClient.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/ebics/EbicsClient.kt @@ -224,7 +224,9 @@ suspend fun doEbicsUploadTransaction( EbicsReturnCode.EBICS_OK -> { } else -> { - throw NexusError(HttpStatusCode.InternalServerError, "unexpected return code") + throw NexusError(HttpStatusCode.InternalServerError, + "Unexpected EBICS return code: ${txResp.technicalReturnCode}" + ) } } }