aboutsummaryrefslogtreecommitdiff
path: root/wallet/src/main/java/net
diff options
context:
space:
mode:
Diffstat (limited to 'wallet/src/main/java/net')
-rw-r--r--wallet/src/main/java/net/taler/wallet/payment/PaymentResponses.kt8
-rw-r--r--wallet/src/main/java/net/taler/wallet/transactions/TransactionDetailFragment.kt2
-rw-r--r--wallet/src/main/java/net/taler/wallet/transactions/Transactions.kt16
3 files changed, 18 insertions, 8 deletions
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 19007b0..2e99806 100644
--- a/wallet/src/main/java/net/taler/wallet/payment/PaymentResponses.kt
+++ b/wallet/src/main/java/net/taler/wallet/payment/PaymentResponses.kt
@@ -63,11 +63,7 @@ sealed class PreparePayResponse {
val paid: Boolean,
val amountRaw: Amount,
val amountEffective: Amount,
-
- /**
- * Redirect URL for the fulfillment page, only given if paid==true.
- */
- val nextUrl: String?,
+ val contractTerms: ContractTerms,
) : PreparePayResponse()
}
@@ -75,7 +71,7 @@ sealed class PreparePayResponse {
sealed class ConfirmPayResult {
@Serializable
@SerialName("done")
- data class Done(val nextUrl: String) : ConfirmPayResult()
+ data class Done(val contractTerms: ContractTerms) : ConfirmPayResult()
@Serializable
@SerialName("pending")
diff --git a/wallet/src/main/java/net/taler/wallet/transactions/TransactionDetailFragment.kt b/wallet/src/main/java/net/taler/wallet/transactions/TransactionDetailFragment.kt
index f5a4fc9..1103207 100644
--- a/wallet/src/main/java/net/taler/wallet/transactions/TransactionDetailFragment.kt
+++ b/wallet/src/main/java/net/taler/wallet/transactions/TransactionDetailFragment.kt
@@ -145,7 +145,7 @@ class TransactionDetailFragment : Fragment() {
orderAmountView.text = raw.toString()
feeView.text = getString(R.string.amount_negative, fee.toString())
orderSummaryView.text = info.summary
- if (info.fulfillmentUrl.startsWith("http")) {
+ if (info.fulfillmentUrl?.startsWith("http") == true) {
val i = Intent().apply {
data = Uri.parse(info.fulfillmentUrl)
}
diff --git a/wallet/src/main/java/net/taler/wallet/transactions/Transactions.kt b/wallet/src/main/java/net/taler/wallet/transactions/Transactions.kt
index 8c00540..3210093 100644
--- a/wallet/src/main/java/net/taler/wallet/transactions/Transactions.kt
+++ b/wallet/src/main/java/net/taler/wallet/transactions/Transactions.kt
@@ -86,6 +86,7 @@ class TransactionWithdrawal(
) : Transaction() {
override val icon = R.drawable.transaction_withdrawal
override val detailPageLayout = R.layout.fragment_transaction_withdrawal
+
@Transient
override val amountType = AmountType.Positive
override fun getTitle(context: Context) = cleanExchange(exchangeBaseUrl)
@@ -142,6 +143,7 @@ class TransactionPayment(
) : Transaction() {
override val icon = R.drawable.ic_cash_usd_outline
override val detailPageLayout = R.layout.fragment_transaction_payment
+
@Transient
override val amountType = AmountType.Negative
override fun getTitle(context: Context) = info.merchant.name
@@ -156,7 +158,16 @@ class TransactionInfo(
@SerialName("summary_i18n")
val summaryI18n: Map<String, String>? = null,
val products: List<ContractProduct>,
- val fulfillmentUrl: String
+ val fulfillmentUrl: String? = null,
+ /**
+ * Message shown to the user after the payment is complete.
+ * TODO actually show this
+ */
+ val fulfillmentMessage: String? = null,
+ /**
+ * Map from IETF BCP 47 language tags to localized fulfillment messages
+ */
+ val fulfillmentMessage_i18n: Map<String, String>? = null,
)
@Serializable
@@ -194,6 +205,7 @@ class TransactionRefund(
) : Transaction() {
override val icon = R.drawable.transaction_refund
override val detailPageLayout = R.layout.fragment_transaction_payment
+
@Transient
override val amountType = AmountType.Positive
override fun getTitle(context: Context): String {
@@ -218,6 +230,7 @@ class TransactionTip(
) : Transaction() {
override val icon = R.drawable.transaction_tip_accepted // TODO different when declined
override val detailPageLayout = R.layout.fragment_transaction_payment
+
@Transient
override val amountType = AmountType.Positive
override fun getTitle(context: Context): String {
@@ -240,6 +253,7 @@ class TransactionRefresh(
) : Transaction() {
override val icon = R.drawable.transaction_refresh
override val detailPageLayout = R.layout.fragment_transaction_withdrawal
+
@Transient
override val amountType = AmountType.Negative
override fun getTitle(context: Context): String {