aboutsummaryrefslogtreecommitdiff
path: root/merchant-lib
diff options
context:
space:
mode:
authorTorsten Grote <t@grobox.de>2022-11-17 13:53:48 -0300
committerTorsten Grote <t@grobox.de>2023-01-03 08:25:05 -0300
commit02ad9bde3e671a3566d68a6b968efe288e67d910 (patch)
tree9ff3cfc86c31def600fbdad0bba9bf103e65368f /merchant-lib
parentec0738e633076e2d601a624eb8c4b06b6ebf22d8 (diff)
downloadtaler-android-02ad9bde3e671a3566d68a6b968efe288e67d910.tar.gz
taler-android-02ad9bde3e671a3566d68a6b968efe288e67d910.tar.bz2
taler-android-02ad9bde3e671a3566d68a6b968efe288e67d910.zip
Adapt to new seconds based time format
Diffstat (limited to 'merchant-lib')
-rw-r--r--merchant-lib/src/main/java/net/taler/merchantlib/Orders.kt4
-rw-r--r--merchant-lib/src/test/java/net/taler/merchantlib/MerchantApiTest.kt9
2 files changed, 6 insertions, 7 deletions
diff --git a/merchant-lib/src/main/java/net/taler/merchantlib/Orders.kt b/merchant-lib/src/main/java/net/taler/merchantlib/Orders.kt
index 391abf5..9348ded 100644
--- a/merchant-lib/src/main/java/net/taler/merchantlib/Orders.kt
+++ b/merchant-lib/src/main/java/net/taler/merchantlib/Orders.kt
@@ -21,14 +21,14 @@ import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.json.JsonClassDiscriminator
import net.taler.common.ContractTerms
-import net.taler.common.Duration
+import net.taler.common.RelativeTime
@Serializable
data class PostOrderRequest(
@SerialName("order")
val contractTerms: ContractTerms,
@SerialName("refund_delay")
- val refundDelay: Duration? = null
+ val refundDelay: RelativeTime? = null
)
@Serializable
diff --git a/merchant-lib/src/test/java/net/taler/merchantlib/MerchantApiTest.kt b/merchant-lib/src/test/java/net/taler/merchantlib/MerchantApiTest.kt
index a89e2d3..9d6defd 100644
--- a/merchant-lib/src/test/java/net/taler/merchantlib/MerchantApiTest.kt
+++ b/merchant-lib/src/test/java/net/taler/merchantlib/MerchantApiTest.kt
@@ -19,7 +19,6 @@ package net.taler.merchantlib
import io.ktor.http.HttpStatusCode.Companion.NotFound
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.runBlocking
-import kotlinx.coroutines.test.TestCoroutineDispatcher
import kotlinx.coroutines.test.UnconfinedTestDispatcher
import net.taler.common.Amount
import net.taler.common.ContractProduct
@@ -173,7 +172,7 @@ class MerchantApiTest {
"order_id": "2020.217-0281FGXCS25P2",
"row_id": 183,
"timestamp": {
- "t_ms": 1596542338000
+ "t_s": 1596542338
},
"amount": "TESTKUDOS:1",
"summary": "Chips",
@@ -184,7 +183,7 @@ class MerchantApiTest {
"order_id": "2020.216-01G2ZPXSP6BYT",
"row_id": 154,
"timestamp": {
- "t_ms": 1596468174000
+ "t_s": 1596468174
},
"amount": "TESTKUDOS:0.8",
"summary": "Peanuts",
@@ -203,7 +202,7 @@ class MerchantApiTest {
assertEquals(true, order1.paid)
assertEquals(true, order1.refundable)
assertEquals("Chips", order1.summary)
- assertEquals(Timestamp(1596542338000), order1.timestamp)
+ assertEquals(Timestamp.fromMillis(1596542338000), order1.timestamp)
val order2 = it.orders[1]
assertEquals(Amount("TESTKUDOS", 0, 80000000), order2.amount)
@@ -211,7 +210,7 @@ class MerchantApiTest {
assertEquals(false, order2.paid)
assertEquals(false, order2.refundable)
assertEquals("Peanuts", order2.summary)
- assertEquals(Timestamp(1596468174000), order2.timestamp)
+ assertEquals(Timestamp.fromMillis(1596468174000), order2.timestamp)
}
}