aboutsummaryrefslogtreecommitdiff
path: root/merchant-terminal
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2022-05-16 19:58:31 +0200
committerFlorian Dold <florian@dold.me>2022-05-19 11:05:18 +0200
commit023ea96d26a65d29d408ef78c9405411bb842afd (patch)
tree658717478320443c4dd3cb6c5c906cfa443d2cad /merchant-terminal
parent29e19d02b7befa0c8e18b9c73ac912bb256aa7ee (diff)
downloadtaler-android-023ea96d26a65d29d408ef78c9405411bb842afd.tar.gz
taler-android-023ea96d26a65d29d408ef78c9405411bb842afd.tar.bz2
taler-android-023ea96d26a65d29d408ef78c9405411bb842afd.zip
-remove multiplatform dependency, library upgrade WIP
Diffstat (limited to 'merchant-terminal')
-rw-r--r--merchant-terminal/src/main/AndroidManifest.xml1
-rw-r--r--merchant-terminal/src/main/java/net/taler/merchantpos/config/ConfigManager.kt7
-rw-r--r--merchant-terminal/src/main/java/net/taler/merchantpos/config/PosConfig.kt2
-rw-r--r--merchant-terminal/src/main/java/net/taler/merchantpos/order/LiveOrder.kt2
-rw-r--r--merchant-terminal/src/main/java/net/taler/merchantpos/order/Order.kt4
-rw-r--r--merchant-terminal/src/main/java/net/taler/merchantpos/order/OrderStateFragment.kt9
-rw-r--r--merchant-terminal/src/main/java/net/taler/merchantpos/payment/PaymentManager.kt2
-rw-r--r--merchant-terminal/src/main/java/net/taler/merchantpos/refund/RefundFragment.kt4
-rw-r--r--merchant-terminal/src/main/java/net/taler/merchantpos/refund/RefundManager.kt2
-rw-r--r--merchant-terminal/src/test/java/net/taler/merchantpos/order/OrderManagerTest.kt2
10 files changed, 19 insertions, 16 deletions
diff --git a/merchant-terminal/src/main/AndroidManifest.xml b/merchant-terminal/src/main/AndroidManifest.xml
index eb7940f..f7b4929 100644
--- a/merchant-terminal/src/main/AndroidManifest.xml
+++ b/merchant-terminal/src/main/AndroidManifest.xml
@@ -39,6 +39,7 @@
<activity
android:name=".MainActivity"
android:label="@string/app_name"
+ android:exported="true"
android:screenOrientation="landscape"
android:theme="@style/AppTheme.NoActionBar"
tools:ignore="LockedOrientationActivity">
diff --git a/merchant-terminal/src/main/java/net/taler/merchantpos/config/ConfigManager.kt b/merchant-terminal/src/main/java/net/taler/merchantpos/config/ConfigManager.kt
index 165bb8e..4327f4e 100644
--- a/merchant-terminal/src/main/java/net/taler/merchantpos/config/ConfigManager.kt
+++ b/merchant-terminal/src/main/java/net/taler/merchantpos/config/ConfigManager.kt
@@ -26,7 +26,8 @@ import androidx.annotation.WorkerThread
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import io.ktor.client.HttpClient
-import io.ktor.client.features.ClientRequestException
+import io.ktor.client.call.body
+import io.ktor.client.plugins.ClientRequestException
import io.ktor.client.request.get
import io.ktor.client.request.header
import io.ktor.http.HttpHeaders.Authorization
@@ -34,8 +35,8 @@ import io.ktor.http.HttpStatusCode.Companion.Unauthorized
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
+import net.taler.common.Version
import net.taler.common.getIncompatibleStringOrNull
-import net.taler.lib.common.Version
import net.taler.merchantlib.ConfigResponse
import net.taler.merchantlib.MerchantApi
import net.taler.merchantlib.MerchantConfig
@@ -105,7 +106,7 @@ class ConfigManager(
val credentials = "${config.username}:${config.password}"
val auth = ("Basic ${encodeToString(credentials.toByteArray(), NO_WRAP)}")
header(Authorization, auth)
- }
+ }.body()
val merchantConfig = posConfig.merchantConfig
// get config from merchant backend API
api.getConfig(merchantConfig.baseUrl).handleSuspend(::onNetworkError) {
diff --git a/merchant-terminal/src/main/java/net/taler/merchantpos/config/PosConfig.kt b/merchant-terminal/src/main/java/net/taler/merchantpos/config/PosConfig.kt
index 971f92c..1f1ab74 100644
--- a/merchant-terminal/src/main/java/net/taler/merchantpos/config/PosConfig.kt
+++ b/merchant-terminal/src/main/java/net/taler/merchantpos/config/PosConfig.kt
@@ -19,10 +19,10 @@ package net.taler.merchantpos.config
import android.os.Build.VERSION.SDK_INT
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
+import net.taler.common.Amount
import net.taler.common.ContractProduct
import net.taler.common.Product
import net.taler.common.TalerUtils
-import net.taler.lib.common.Amount
import net.taler.merchantlib.MerchantConfig
import java.util.UUID
diff --git a/merchant-terminal/src/main/java/net/taler/merchantpos/order/LiveOrder.kt b/merchant-terminal/src/main/java/net/taler/merchantpos/order/LiveOrder.kt
index f48c1db..ad9af74 100644
--- a/merchant-terminal/src/main/java/net/taler/merchantpos/order/LiveOrder.kt
+++ b/merchant-terminal/src/main/java/net/taler/merchantpos/order/LiveOrder.kt
@@ -20,8 +20,8 @@ import androidx.annotation.UiThread
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
+import net.taler.common.Amount
import net.taler.common.CombinedLiveData
-import net.taler.lib.common.Amount
import net.taler.merchantpos.config.Category
import net.taler.merchantpos.config.ConfigProduct
import net.taler.merchantpos.order.RestartState.DISABLED
diff --git a/merchant-terminal/src/main/java/net/taler/merchantpos/order/Order.kt b/merchant-terminal/src/main/java/net/taler/merchantpos/order/Order.kt
index 0bea20c..9860dbd 100644
--- a/merchant-terminal/src/main/java/net/taler/merchantpos/order/Order.kt
+++ b/merchant-terminal/src/main/java/net/taler/merchantpos/order/Order.kt
@@ -16,10 +16,10 @@
package net.taler.merchantpos.order
+import net.taler.common.Amount
import net.taler.common.ContractTerms
+import net.taler.common.Timestamp
import net.taler.common.now
-import net.taler.lib.common.Amount
-import net.taler.lib.common.Timestamp
import net.taler.merchantpos.config.Category
import net.taler.merchantpos.config.ConfigProduct
import java.net.URLEncoder
diff --git a/merchant-terminal/src/main/java/net/taler/merchantpos/order/OrderStateFragment.kt b/merchant-terminal/src/main/java/net/taler/merchantpos/order/OrderStateFragment.kt
index d86f504..c4a5228 100644
--- a/merchant-terminal/src/main/java/net/taler/merchantpos/order/OrderStateFragment.kt
+++ b/merchant-terminal/src/main/java/net/taler/merchantpos/order/OrderStateFragment.kt
@@ -26,6 +26,7 @@ import androidx.recyclerview.selection.SelectionPredicates
import androidx.recyclerview.selection.SelectionTracker
import androidx.recyclerview.selection.StorageStrategy
import androidx.recyclerview.widget.LinearLayoutManager
+import net.taler.common.Amount
import net.taler.common.fadeIn
import net.taler.common.fadeOut
import net.taler.merchantpos.MainViewModel
@@ -82,11 +83,11 @@ class OrderStateFragment : Fragment() {
liveOrder.selectOrderLine(item)
}
})
- liveOrder.order.observe(viewLifecycleOwner, { order ->
+ liveOrder.order.observe(viewLifecycleOwner) { order ->
if (order == null) return@observe
onOrderChanged(order, tracker)
- })
- liveOrder.orderTotal.observe(viewLifecycleOwner, { orderTotal ->
+ }
+ liveOrder.orderTotal.observe(viewLifecycleOwner) { orderTotal: Amount ->
if (orderTotal.isZero()) {
ui.totalView.fadeOut()
ui.totalView.text = null
@@ -94,7 +95,7 @@ class OrderStateFragment : Fragment() {
ui.totalView.text = getString(R.string.order_total, orderTotal)
ui.totalView.fadeIn()
}
- })
+ }
}
override fun onSaveInstanceState(outState: Bundle) {
diff --git a/merchant-terminal/src/main/java/net/taler/merchantpos/payment/PaymentManager.kt b/merchant-terminal/src/main/java/net/taler/merchantpos/payment/PaymentManager.kt
index 98161db..d703a31 100644
--- a/merchant-terminal/src/main/java/net/taler/merchantpos/payment/PaymentManager.kt
+++ b/merchant-terminal/src/main/java/net/taler/merchantpos/payment/PaymentManager.kt
@@ -26,8 +26,8 @@ import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
+import net.taler.common.Duration
import net.taler.common.assertUiThread
-import net.taler.lib.common.Duration
import net.taler.merchantlib.CheckPaymentResponse
import net.taler.merchantlib.MerchantApi
import net.taler.merchantlib.PostOrderRequest
diff --git a/merchant-terminal/src/main/java/net/taler/merchantpos/refund/RefundFragment.kt b/merchant-terminal/src/main/java/net/taler/merchantpos/refund/RefundFragment.kt
index bb98dbd..03c786f 100644
--- a/merchant-terminal/src/main/java/net/taler/merchantpos/refund/RefundFragment.kt
+++ b/merchant-terminal/src/main/java/net/taler/merchantpos/refund/RefundFragment.kt
@@ -24,12 +24,12 @@ import androidx.annotation.StringRes
import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
import androidx.navigation.fragment.findNavController
+import net.taler.common.Amount
+import net.taler.common.AmountParserException
import net.taler.common.fadeIn
import net.taler.common.fadeOut
import net.taler.common.navigate
import net.taler.common.showError
-import net.taler.lib.common.Amount
-import net.taler.lib.common.AmountParserException
import net.taler.merchantlib.OrderHistoryEntry
import net.taler.merchantpos.MainViewModel
import net.taler.merchantpos.R
diff --git a/merchant-terminal/src/main/java/net/taler/merchantpos/refund/RefundManager.kt b/merchant-terminal/src/main/java/net/taler/merchantpos/refund/RefundManager.kt
index 8b3efca..849dbaa 100644
--- a/merchant-terminal/src/main/java/net/taler/merchantpos/refund/RefundManager.kt
+++ b/merchant-terminal/src/main/java/net/taler/merchantpos/refund/RefundManager.kt
@@ -21,8 +21,8 @@ import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.launch
+import net.taler.common.Amount
import net.taler.common.assertUiThread
-import net.taler.lib.common.Amount
import net.taler.merchantlib.MerchantApi
import net.taler.merchantlib.OrderHistoryEntry
import net.taler.merchantlib.RefundRequest
diff --git a/merchant-terminal/src/test/java/net/taler/merchantpos/order/OrderManagerTest.kt b/merchant-terminal/src/test/java/net/taler/merchantpos/order/OrderManagerTest.kt
index ca48b6e..bb8dcb7 100644
--- a/merchant-terminal/src/test/java/net/taler/merchantpos/order/OrderManagerTest.kt
+++ b/merchant-terminal/src/test/java/net/taler/merchantpos/order/OrderManagerTest.kt
@@ -20,7 +20,7 @@ import android.app.Application
import androidx.test.core.app.ApplicationProvider.getApplicationContext
import androidx.test.ext.junit.runners.AndroidJUnit4
import kotlinx.coroutines.runBlocking
-import net.taler.lib.common.Amount
+import net.taler.common.Amount
import net.taler.merchantlib.MerchantConfig
import net.taler.merchantpos.R
import net.taler.merchantpos.config.Category