[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-android] 02/02: Don't restart withdrawal process after acc
From: |
gnunet |
Subject: |
[taler-wallet-android] 02/02: Don't restart withdrawal process after accepting ToS |
Date: |
Thu, 05 Mar 2020 17:44:08 +0100 |
This is an automated email from the git hooks/post-receive script.
torsten-grote pushed a commit to branch master
in repository wallet-android.
commit b666242c18173344d64724496cad213e58760ef7
Author: Torsten Grote <address@hidden>
AuthorDate: Thu Mar 5 13:43:38 2020 -0300
Don't restart withdrawal process after accepting ToS
---
.../net/taler/wallet/withdraw/WithdrawManager.kt | 25 ++++++++++++++++------
1 file changed, 18 insertions(+), 7 deletions(-)
diff --git a/app/src/main/java/net/taler/wallet/withdraw/WithdrawManager.kt
b/app/src/main/java/net/taler/wallet/withdraw/WithdrawManager.kt
index dec03af..8179d8d 100644
--- a/app/src/main/java/net/taler/wallet/withdraw/WithdrawManager.kt
+++ b/app/src/main/java/net/taler/wallet/withdraw/WithdrawManager.kt
@@ -30,7 +30,9 @@ sealed class WithdrawStatus {
val talerWithdrawUri: String,
val exchangeBaseUrl: String,
val tosText: String,
- val tosEtag: String
+ val tosEtag: String,
+ val amount: Amount,
+ val suggestedExchange: String
) : WithdrawStatus()
object Success : WithdrawStatus()
@@ -115,8 +117,13 @@ class WithdrawManager(private val walletBackendApi:
WalletBackendApi) {
Log.v(TAG, "ignoring withdrawal info result, not loading.")
return@sendRequest
}
+ val wi = result.getJSONObject("bankWithdrawDetails")
+ val suggestedExchange = wi.getString("suggestedExchange")
+ val amount = Amount.fromJson(wi.getJSONObject("amount"))
+
val ei = result.getJSONObject("exchangeWithdrawDetails")
val termsOfServiceAccepted =
ei.getBoolean("termsOfServiceAccepted")
+
if (!termsOfServiceAccepted) {
val exchange = ei.getJSONObject("exchangeInfo")
val tosText = exchange.getString("termsOfServiceText")
@@ -126,13 +133,12 @@ class WithdrawManager(private val walletBackendApi:
WalletBackendApi) {
status.talerWithdrawUri,
selectedExchange,
tosText,
- tosEtag
+ tosEtag,
+ amount,
+ suggestedExchange
)
)
} else {
- val wi = result.getJSONObject("bankWithdrawDetails")
- val suggestedExchange = wi.getString("suggestedExchange")
- val amount = Amount.fromJson(wi.getJSONObject("amount"))
withdrawStatus.postValue(
WithdrawStatus.ReceivedDetails(
status.talerWithdrawUri,
@@ -178,8 +184,13 @@ class WithdrawManager(private val walletBackendApi:
WalletBackendApi) {
if (isError) {
return@sendRequest
}
- // Try withdrawing again with accepted ToS
- getWithdrawalInfo(s.talerWithdrawUri)
+ withdrawStatus.postValue(
+ WithdrawStatus.ReceivedDetails(
+ s.talerWithdrawUri,
+ s.amount,
+ s.suggestedExchange
+ )
+ )
}
}
}
--
To stop receiving notification emails like this one, please contact
address@hidden.