summaryrefslogtreecommitdiff
path: root/nexus/src/main/kotlin/tech/libeufin/nexus/taler.kt
diff options
context:
space:
mode:
authorMS <ms@taler.net>2020-05-28 17:13:48 +0200
committerMS <ms@taler.net>2020-05-28 17:13:48 +0200
commit56a1a942be96dc470d313e845dfbfc81fc607f6a (patch)
tree8b945200a1da9e9154e1a6271810112e864ede97 /nexus/src/main/kotlin/tech/libeufin/nexus/taler.kt
parent1179c26313c1a11df9c1f9f56f684f0f90b77b28 (diff)
downloadlibeufin-56a1a942be96dc470d313e845dfbfc81fc607f6a.tar.gz
libeufin-56a1a942be96dc470d313e845dfbfc81fc607f6a.tar.bz2
libeufin-56a1a942be96dc470d313e845dfbfc81fc607f6a.zip
Tie TWG endpoints to handlers.
Diffstat (limited to 'nexus/src/main/kotlin/tech/libeufin/nexus/taler.kt')
-rw-r--r--nexus/src/main/kotlin/tech/libeufin/nexus/taler.kt11
1 files changed, 11 insertions, 0 deletions
diff --git a/nexus/src/main/kotlin/tech/libeufin/nexus/taler.kt b/nexus/src/main/kotlin/tech/libeufin/nexus/taler.kt
index 56115104..7ab99826 100644
--- a/nexus/src/main/kotlin/tech/libeufin/nexus/taler.kt
+++ b/nexus/src/main/kotlin/tech/libeufin/nexus/taler.kt
@@ -12,6 +12,7 @@ import io.ktor.response.respondText
import io.ktor.routing.Route
import io.ktor.routing.get
import io.ktor.routing.post
+import org.apache.http.client.methods.RequestBuilder.post
import org.jetbrains.exposed.dao.Entity
import org.jetbrains.exposed.dao.IdTable
import org.jetbrains.exposed.sql.*
@@ -212,6 +213,7 @@ fun paymentFailed(entry: RawBankTransactionEntity): Boolean {
return false
}
+// /taler/transfer
suspend fun talerTransfer(call: ApplicationCall): Unit {
val exchangeUser = authenticateRequest(call.request)
val transferRequest = call.receive<TalerTransferRequest>()
@@ -290,6 +292,7 @@ suspend fun talerTransfer(call: ApplicationCall): Unit {
)
}
+// /taler/admin/add-incoming
suspend fun talerAddIncoming(call: ApplicationCall): Unit {
val exchangeUser = authenticateRequest(call.request)
val addIncomingData = call.receive<TalerAdminAddIncoming>()
@@ -405,6 +408,7 @@ fun ingestTransactions() {
}
}
+// /taler/history/incoming
suspend fun historyIncoming(call: ApplicationCall): Unit {
val exchangeUser = authenticateRequest(call.request)
val delta: Int = expectInt(call.expectUrlParameter("delta"))
@@ -439,4 +443,11 @@ suspend fun historyIncoming(call: ApplicationCall): Unit {
}
}
return call.respond(TextContent(customConverter(history), ContentType.Application.Json))
+}
+
+fun talerFacadeRoutes(route: Route) {
+ route.post("/transfer") {}
+ route.post("/admin/add-incoming") {}
+ route.get("/history/outgoing") {}
+ route.get("/history/incoming") {}
} \ No newline at end of file