aboutsummaryrefslogtreecommitdiff
path: root/merchant-lib/src/main/java/net/taler
diff options
context:
space:
mode:
Diffstat (limited to 'merchant-lib/src/main/java/net/taler')
-rw-r--r--merchant-lib/src/main/java/net/taler/merchantlib/MerchantApi.kt5
-rw-r--r--merchant-lib/src/main/java/net/taler/merchantlib/OrderHistory.kt3
-rw-r--r--merchant-lib/src/main/java/net/taler/merchantlib/PostOrderRequest.kt6
3 files changed, 9 insertions, 5 deletions
diff --git a/merchant-lib/src/main/java/net/taler/merchantlib/MerchantApi.kt b/merchant-lib/src/main/java/net/taler/merchantlib/MerchantApi.kt
index db37586..96892f5 100644
--- a/merchant-lib/src/main/java/net/taler/merchantlib/MerchantApi.kt
+++ b/merchant-lib/src/main/java/net/taler/merchantlib/MerchantApi.kt
@@ -29,7 +29,6 @@ import io.ktor.http.HttpHeaders.Authorization
import io.ktor.http.contentType
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.JsonConfiguration
-import net.taler.common.ContractTerms
import net.taler.merchantlib.Response.Companion.response
class MerchantApi(private val httpClient: HttpClient) {
@@ -40,12 +39,12 @@ class MerchantApi(private val httpClient: HttpClient) {
suspend fun postOrder(
merchantConfig: MerchantConfig,
- contractTerms: ContractTerms
+ orderRequest: PostOrderRequest
): Response<PostOrderResponse> = response {
httpClient.post(merchantConfig.urlFor("private/orders")) {
header(Authorization, "ApiKey ${merchantConfig.apiKey}")
contentType(Json)
- body = PostOrderRequest(contractTerms)
+ body = orderRequest
} as PostOrderResponse
}
diff --git a/merchant-lib/src/main/java/net/taler/merchantlib/OrderHistory.kt b/merchant-lib/src/main/java/net/taler/merchantlib/OrderHistory.kt
index 718bde5..b1ff5b1 100644
--- a/merchant-lib/src/main/java/net/taler/merchantlib/OrderHistory.kt
+++ b/merchant-lib/src/main/java/net/taler/merchantlib/OrderHistory.kt
@@ -41,6 +41,9 @@ data class OrderHistoryEntry(
// the summary of the order
val summary: String,
+ // if the order has been paid
+ val paid: Boolean,
+
// whether some part of the order is refundable
val refundable: Boolean
)
diff --git a/merchant-lib/src/main/java/net/taler/merchantlib/PostOrderRequest.kt b/merchant-lib/src/main/java/net/taler/merchantlib/PostOrderRequest.kt
index 4854a80..783dd19 100644
--- a/merchant-lib/src/main/java/net/taler/merchantlib/PostOrderRequest.kt
+++ b/merchant-lib/src/main/java/net/taler/merchantlib/PostOrderRequest.kt
@@ -25,12 +25,14 @@ import kotlinx.serialization.Serializer
import kotlinx.serialization.json.JsonInput
import kotlinx.serialization.json.JsonObject
import net.taler.common.ContractTerms
+import net.taler.common.Duration
@Serializable
data class PostOrderRequest(
@SerialName("order")
- val contractTerms: ContractTerms
-
+ val contractTerms: ContractTerms,
+ @SerialName("refund_delay")
+ val refundDelay: Duration? = null
)
@Serializable