From 3ab6f1569b307b155de6049ad7207e10bdf97567 Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Tue, 11 Aug 2020 17:35:16 -0300 Subject: [wallet] upgrade wallet-core and adapt payment API --- .../java/net/taler/wallet/payment/PaymentResponses.kt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'wallet/src/main/java/net/taler/wallet/payment/PaymentResponses.kt') diff --git a/wallet/src/main/java/net/taler/wallet/payment/PaymentResponses.kt b/wallet/src/main/java/net/taler/wallet/payment/PaymentResponses.kt index 1ff8867..120489d 100644 --- a/wallet/src/main/java/net/taler/wallet/payment/PaymentResponses.kt +++ b/wallet/src/main/java/net/taler/wallet/payment/PaymentResponses.kt @@ -19,8 +19,11 @@ package net.taler.wallet.payment import com.fasterxml.jackson.annotation.JsonTypeInfo import com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NAME import com.fasterxml.jackson.annotation.JsonTypeName +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable import net.taler.common.Amount import net.taler.common.ContractTerms +import net.taler.wallet.transactions.TransactionError @JsonTypeInfo(use = NAME, property = "status") sealed class PreparePayResponse(open val proposalId: String) { @@ -42,6 +45,7 @@ sealed class PreparePayResponse(open val proposalId: String) { @JsonTypeName("insufficient-balance") data class InsufficientBalanceResponse( override val proposalId: String, + val amountRaw: Amount, val contractTerms: ContractTerms ) : PreparePayResponse(proposalId) @@ -52,6 +56,8 @@ sealed class PreparePayResponse(open val proposalId: String) { * Did the payment succeed? */ val paid: Boolean, + val amountRaw: Amount, + val amountEffective: Amount, /** * Redirect URL for the fulfillment page, only given if paid==true. @@ -59,3 +65,14 @@ sealed class PreparePayResponse(open val proposalId: String) { val nextUrl: String? ) : PreparePayResponse(proposalId) } + +@Serializable +sealed class ConfirmPayResult { + @Serializable + @SerialName("done") + data class Done(val nextUrl: String) : ConfirmPayResult() + + @Serializable + @SerialName("pending") + data class Pending(val lastError: TransactionError) : ConfirmPayResult() +} -- cgit v1.2.3