libeufin

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

commit 05a705b79d0bc297ffae6d5a936fa23f4c83db36
parent 3d590aee84c1309c3a6298c0d8e6b49a19e9c2f5
Author: MS <ms@taler.net>
Date:   Wed, 20 May 2020 18:41:58 +0200

(half) testing mock payments

Diffstat:
Mintegration-tests/test-sandbox.py | 15++++++++++++++-
Msandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt | 4++++
2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/integration-tests/test-sandbox.py b/integration-tests/test-sandbox.py @@ -46,7 +46,6 @@ def assertResponse(response): # stdout/stderr from both services is A LOT of text. # Confusing to dump all that to console. print("Check nexus.log and sandbox.log, probably under /tmp") - nexus.terminate() sandbox.terminate() exit(1) # Allows for finer grained checks. @@ -105,5 +104,19 @@ assertResponse( ), ) ) + +# Generate a few payments related to such account. +assertResponse( + post( + "http://localhost:5000/admin/payments", + json=dict( + creditorIban="ES9121000418450200051332", + debitorIban="GB33BUKB20201555555555", + amount="EUR:0.99", + subject="test service" + ) + ) +) + sandbox.terminate() print("Test passed!") diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt @@ -60,6 +60,9 @@ import com.fasterxml.jackson.databind.exc.MismatchedInputException import com.fasterxml.jackson.module.kotlin.KotlinModule import com.fasterxml.jackson.module.kotlin.MissingKotlinParameterException import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper +import java.time.Instant +import java.time.LocalDate +import java.time.LocalDateTime class CustomerNotFound(id: String?) : Exception("Customer ${id} not found") class BadInputData(inputData: String?) : Exception("Customer provided invalid input data: ${inputData}") @@ -168,6 +171,7 @@ fun main() { debitorIban = body.debitorIban subject = body.subject amount = body.amount + date = Instant.now().toEpochMilli() } } call.respondText("Payment created")