Compare commits
No commits in common. "477adcaa31ca2b37cb894501d6429fb8a806ce8c" and "48513f8da9c3637ff9357f2ce17a179c6e3b2efa" have entirely different histories.
477adcaa31
...
48513f8da9
@ -5,6 +5,9 @@ plugins {
|
|||||||
id("com.google.dagger.hilt.android")
|
id("com.google.dagger.hilt.android")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set default build variant
|
||||||
|
project.ext.set("android.defaultPublishConfig", "uatDebug")
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace = "com.mob.utsmyanmar"
|
namespace = "com.mob.utsmyanmar"
|
||||||
compileSdk {
|
compileSdk {
|
||||||
@ -59,14 +62,6 @@ android {
|
|||||||
"proguard-rules.pro"
|
"proguard-rules.pro"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
debug {
|
|
||||||
isMinifyEnabled = false
|
|
||||||
isDebuggable = true
|
|
||||||
// proguardFiles(
|
|
||||||
// getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
||||||
// "proguard-rules.pro"
|
|
||||||
// )
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility = JavaVersion.VERSION_11
|
sourceCompatibility = JavaVersion.VERSION_11
|
||||||
@ -125,6 +120,4 @@ dependencies {
|
|||||||
implementation(project(":ecr"))
|
implementation(project(":ecr"))
|
||||||
implementation(project(":xpay"))
|
implementation(project(":xpay"))
|
||||||
implementation(project(":cmhl"))
|
implementation(project(":cmhl"))
|
||||||
|
|
||||||
implementation("se.warting.signature:signature-pad:0.2.0")
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,13 +16,14 @@ import com.utsmyanmar.ecr.ECRHelper
|
|||||||
import com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation
|
import com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation
|
||||||
import com.utsmyanmar.paylibs.utils.iso_utils.TransactionsType
|
import com.utsmyanmar.paylibs.utils.iso_utils.TransactionsType
|
||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.Job
|
||||||
import kotlinx.coroutines.channels.Channel
|
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
|
import kotlinx.coroutines.channels.Channel
|
||||||
import kotlinx.coroutines.flow.MutableStateFlow
|
import kotlinx.coroutines.flow.MutableStateFlow
|
||||||
import kotlinx.coroutines.flow.asStateFlow
|
import kotlinx.coroutines.flow.asStateFlow
|
||||||
import kotlinx.coroutines.flow.receiveAsFlow
|
import kotlinx.coroutines.flow.receiveAsFlow
|
||||||
import kotlinx.coroutines.flow.update
|
import kotlinx.coroutines.flow.update
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
import sunmi.sunmiui.utils.LogUtil
|
||||||
|
|
||||||
class CardWaitingViewModel(
|
class CardWaitingViewModel(
|
||||||
private val cardReadViewModel: CardReaderViewModel,
|
private val cardReadViewModel: CardReaderViewModel,
|
||||||
|
|||||||
@ -1,8 +1,5 @@
|
|||||||
package com.mob.utsmyanmar.ui.dashboard
|
package com.mob.utsmyanmar.ui.dashboard
|
||||||
|
|
||||||
import androidx.compose.foundation.Image
|
|
||||||
import androidx.compose.foundation.layout.height
|
|
||||||
import androidx.compose.foundation.layout.size
|
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
import androidx.compose.material.icons.filled.AccountBalanceWallet
|
import androidx.compose.material.icons.filled.AccountBalanceWallet
|
||||||
import androidx.compose.material.icons.filled.CreditCard
|
import androidx.compose.material.icons.filled.CreditCard
|
||||||
@ -10,6 +7,7 @@ import androidx.compose.material.icons.filled.Lock
|
|||||||
import androidx.compose.material.icons.filled.LockOpen
|
import androidx.compose.material.icons.filled.LockOpen
|
||||||
import androidx.compose.material.icons.filled.Replay
|
import androidx.compose.material.icons.filled.Replay
|
||||||
import androidx.compose.material.icons.filled.SwapHoriz
|
import androidx.compose.material.icons.filled.SwapHoriz
|
||||||
|
import androidx.compose.foundation.layout.size
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
@ -17,7 +15,6 @@ import androidx.compose.ui.res.painterResource
|
|||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.mob.utsmyanmar.R
|
import com.mob.utsmyanmar.R
|
||||||
import com.mob.utsmyanmar.ui.theme.Color
|
import com.mob.utsmyanmar.ui.theme.Color
|
||||||
import com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation
|
|
||||||
|
|
||||||
class DashboardMenuItem(
|
class DashboardMenuItem(
|
||||||
val title: String,
|
val title: String,
|
||||||
@ -25,209 +22,121 @@ class DashboardMenuItem(
|
|||||||
val onClick: () -> Unit
|
val onClick: () -> Unit
|
||||||
)
|
)
|
||||||
|
|
||||||
val settlementEnabled = false
|
|
||||||
val voidEnabled = true
|
|
||||||
val refundEnabled = true
|
|
||||||
val preAuthEnabled = true
|
|
||||||
val preAuthVoidEnabled = true
|
|
||||||
val preAuthCompleteEnabled = true
|
|
||||||
val preAuthCompleteVoidEnabled = true
|
|
||||||
val cashAdvEnabled = true
|
|
||||||
|
|
||||||
fun buildMenuItems(
|
fun buildMenuItems(
|
||||||
onNavigateAmount: (String) -> Unit,
|
onNavigateAmount: (String) -> Unit,
|
||||||
onNavigateSignOn: () -> Unit,
|
onNavigateSignOn: () -> Unit,
|
||||||
onNavigateSettlement: () -> Unit,
|
onNavigateSettlement: () -> Unit,
|
||||||
onNavigateHistory: () -> Unit,
|
onNavigateHistory: () -> Unit,
|
||||||
onNavigateAction: (String) -> Unit
|
onNavigateAction: (String) -> Unit
|
||||||
): List<DashboardMenuItem> = buildList {
|
): List<DashboardMenuItem> = listOf(
|
||||||
|
DashboardMenuItem(
|
||||||
val mmqrEnabled = SystemParamsOperation.getInstance().mmqrStatus
|
"Sale",
|
||||||
|
{
|
||||||
add(
|
Icon(
|
||||||
DashboardMenuItem(
|
painterResource(R.drawable.ic_terminal),
|
||||||
"Sale",
|
contentDescription = null,
|
||||||
{
|
modifier = Modifier.size(40.dp),
|
||||||
Icon(
|
tint = Color.LegacyRed
|
||||||
painterResource(R.drawable.ic_terminal),
|
)
|
||||||
contentDescription = null,
|
}) { onNavigateAmount("Sale") },
|
||||||
modifier = Modifier.size(40.dp),
|
DashboardMenuItem(
|
||||||
tint = Color.LegacyRed
|
"History",
|
||||||
)
|
{
|
||||||
}
|
Icon(
|
||||||
) { onNavigateAmount("Sale") }
|
painterResource(R.drawable.ic_history),
|
||||||
)
|
contentDescription = null,
|
||||||
|
modifier = Modifier.size(32.dp),
|
||||||
|
tint = Color.LegacyRed
|
||||||
if (mmqrEnabled) {
|
)
|
||||||
add(
|
}) { onNavigateHistory() },
|
||||||
DashboardMenuItem(
|
DashboardMenuItem(
|
||||||
"MMQR",
|
"Sign On",
|
||||||
{
|
{
|
||||||
Image(
|
Icon(
|
||||||
painter = painterResource(R.drawable.ic_mmqr_logo),
|
painterResource(R.drawable.ic_sign_on),
|
||||||
contentDescription = null,
|
contentDescription = null,
|
||||||
modifier = Modifier.height(48.dp)
|
modifier = Modifier.size(32.dp),
|
||||||
)
|
tint = Color.LegacyRed
|
||||||
}
|
)
|
||||||
) { }
|
}) { onNavigateSignOn() },
|
||||||
)
|
DashboardMenuItem(
|
||||||
}
|
"Settlement",
|
||||||
add(
|
{
|
||||||
DashboardMenuItem(
|
Icon(
|
||||||
"History",
|
painterResource(R.drawable.ic_settlement),
|
||||||
{
|
contentDescription = null,
|
||||||
Icon(
|
modifier = Modifier.size(32.dp),
|
||||||
painterResource(R.drawable.ic_history),
|
tint = Color.LegacyRed
|
||||||
contentDescription = null,
|
)
|
||||||
modifier = Modifier.size(32.dp),
|
}) { onNavigateSettlement() },
|
||||||
tint = Color.LegacyRed
|
DashboardMenuItem(
|
||||||
)
|
"Void",
|
||||||
}
|
{
|
||||||
) { onNavigateHistory() }
|
Icon(
|
||||||
)
|
Icons.Default.Lock,
|
||||||
|
contentDescription = null,
|
||||||
add(
|
modifier = Modifier.size(32.dp),
|
||||||
DashboardMenuItem(
|
tint = Color.LegacyRed
|
||||||
"Sign On",
|
)
|
||||||
{
|
}) { onNavigateAction("Void") },
|
||||||
Icon(
|
DashboardMenuItem(
|
||||||
painterResource(R.drawable.ic_sign_on),
|
"Refund",
|
||||||
contentDescription = null,
|
{
|
||||||
modifier = Modifier.size(32.dp),
|
Icon(
|
||||||
tint = Color.LegacyRed
|
Icons.Default.Replay,
|
||||||
)
|
contentDescription = null,
|
||||||
}
|
modifier = Modifier.size(32.dp),
|
||||||
) { onNavigateSignOn() }
|
tint = Color.LegacyRed
|
||||||
)
|
)
|
||||||
|
}) { onNavigateAction("Refund") },
|
||||||
if (settlementEnabled) {
|
DashboardMenuItem(
|
||||||
add(
|
"Pre-Auth",
|
||||||
DashboardMenuItem(
|
{
|
||||||
"Settlement",
|
Icon(
|
||||||
{
|
Icons.Default.Lock,
|
||||||
Icon(
|
contentDescription = null,
|
||||||
painterResource(R.drawable.ic_settlement),
|
modifier = Modifier.size(32.dp),
|
||||||
contentDescription = null,
|
tint = Color.LegacyRed
|
||||||
modifier = Modifier.size(32.dp),
|
)
|
||||||
tint = Color.LegacyRed
|
}) { onNavigateAmount("Pre-Auth") },
|
||||||
)
|
DashboardMenuItem(
|
||||||
}
|
"Pre-Auth Void",
|
||||||
) { onNavigateSettlement() }
|
{
|
||||||
)
|
Icon(
|
||||||
}
|
Icons.Default.LockOpen,
|
||||||
|
contentDescription = null,
|
||||||
if (voidEnabled) {
|
modifier = Modifier.size(32.dp),
|
||||||
add(
|
tint = Color.LegacyRed
|
||||||
DashboardMenuItem(
|
)
|
||||||
"Void",
|
}) { onNavigateAction("Pre-Auth Void") },
|
||||||
{
|
DashboardMenuItem(
|
||||||
Icon(
|
"Pre-Auth Complete",
|
||||||
Icons.Default.Lock,
|
{
|
||||||
contentDescription = null,
|
Icon(
|
||||||
modifier = Modifier.size(32.dp),
|
Icons.Default.CreditCard,
|
||||||
tint = Color.LegacyRed
|
contentDescription = null,
|
||||||
)
|
modifier = Modifier.size(32.dp),
|
||||||
}
|
tint = Color.LegacyRed
|
||||||
) { onNavigateAction("Void") }
|
)
|
||||||
)
|
}) { onNavigateAction("Pre-Auth Complete") },
|
||||||
}
|
DashboardMenuItem(
|
||||||
|
"Pre-Auth Comp Void",
|
||||||
if (refundEnabled) {
|
{
|
||||||
add(
|
Icon(
|
||||||
DashboardMenuItem(
|
Icons.Default.SwapHoriz,
|
||||||
"Refund",
|
contentDescription = null,
|
||||||
{
|
modifier = Modifier.size(32.dp),
|
||||||
Icon(
|
tint = Color.LegacyRed
|
||||||
Icons.Default.Replay,
|
)
|
||||||
contentDescription = null,
|
}) { onNavigateAction("Pre-Auth Complete Void") },
|
||||||
modifier = Modifier.size(32.dp),
|
DashboardMenuItem(
|
||||||
tint = Color.LegacyRed
|
"Cash Adv",
|
||||||
)
|
{
|
||||||
}
|
Icon(
|
||||||
) { onNavigateAction("Refund") }
|
Icons.Default.AccountBalanceWallet,
|
||||||
)
|
contentDescription = null,
|
||||||
}
|
modifier = Modifier.size(32.dp),
|
||||||
|
tint = Color.LegacyRed
|
||||||
if (preAuthEnabled) {
|
)
|
||||||
add(
|
}) { onNavigateAmount("Cash Adv") },
|
||||||
DashboardMenuItem(
|
)
|
||||||
"Pre-Auth",
|
|
||||||
{
|
|
||||||
Icon(
|
|
||||||
Icons.Default.Lock,
|
|
||||||
contentDescription = null,
|
|
||||||
modifier = Modifier.size(32.dp),
|
|
||||||
tint = Color.LegacyRed
|
|
||||||
)
|
|
||||||
}
|
|
||||||
) { onNavigateAmount("Pre-Auth") }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (preAuthVoidEnabled) {
|
|
||||||
add(
|
|
||||||
DashboardMenuItem(
|
|
||||||
"Pre-Auth Void",
|
|
||||||
{
|
|
||||||
Icon(
|
|
||||||
Icons.Default.LockOpen,
|
|
||||||
contentDescription = null,
|
|
||||||
modifier = Modifier.size(32.dp),
|
|
||||||
tint = Color.LegacyRed
|
|
||||||
)
|
|
||||||
}
|
|
||||||
) { onNavigateAction("Pre-Auth Void") }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (preAuthCompleteEnabled) {
|
|
||||||
add(
|
|
||||||
DashboardMenuItem(
|
|
||||||
"Pre-Auth Complete",
|
|
||||||
{
|
|
||||||
Icon(
|
|
||||||
Icons.Default.CreditCard,
|
|
||||||
contentDescription = null,
|
|
||||||
modifier = Modifier.size(32.dp),
|
|
||||||
tint = Color.LegacyRed
|
|
||||||
)
|
|
||||||
}
|
|
||||||
) { onNavigateAction("Pre-Auth Complete") }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (preAuthCompleteVoidEnabled) {
|
|
||||||
add(
|
|
||||||
DashboardMenuItem(
|
|
||||||
"Pre-Auth Comp Void",
|
|
||||||
{
|
|
||||||
Icon(
|
|
||||||
Icons.Default.SwapHoriz,
|
|
||||||
contentDescription = null,
|
|
||||||
modifier = Modifier.size(32.dp),
|
|
||||||
tint = Color.LegacyRed
|
|
||||||
)
|
|
||||||
}
|
|
||||||
) { onNavigateAction("Pre-Auth Complete Void") }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cashAdvEnabled) {
|
|
||||||
add(
|
|
||||||
DashboardMenuItem(
|
|
||||||
"Cash Adv",
|
|
||||||
{
|
|
||||||
Icon(
|
|
||||||
Icons.Default.AccountBalanceWallet,
|
|
||||||
contentDescription = null,
|
|
||||||
modifier = Modifier.size(32.dp),
|
|
||||||
tint = Color.LegacyRed
|
|
||||||
)
|
|
||||||
}
|
|
||||||
) { onNavigateAmount("Cash Adv") }
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
@ -23,9 +23,6 @@ import androidx.compose.material.icons.filled.Menu
|
|||||||
import androidx.compose.material.icons.filled.Notifications
|
import androidx.compose.material.icons.filled.Notifications
|
||||||
import androidx.compose.material.icons.filled.Sync
|
import androidx.compose.material.icons.filled.Sync
|
||||||
import androidx.compose.material3.AlertDialog
|
import androidx.compose.material3.AlertDialog
|
||||||
import androidx.compose.material3.Card
|
|
||||||
import androidx.compose.material3.CardDefaults
|
|
||||||
import androidx.compose.material3.CircularProgressIndicator
|
|
||||||
import androidx.compose.material3.DrawerValue
|
import androidx.compose.material3.DrawerValue
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.IconButton
|
import androidx.compose.material3.IconButton
|
||||||
@ -50,7 +47,6 @@ import androidx.compose.ui.layout.ContentScale
|
|||||||
import androidx.compose.ui.res.painterResource
|
import androidx.compose.ui.res.painterResource
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.window.Dialog
|
|
||||||
import com.mob.utsmyanmar.R
|
import com.mob.utsmyanmar.R
|
||||||
import com.mob.utsmyanmar.ui.components.appbar.AppBar
|
import com.mob.utsmyanmar.ui.components.appbar.AppBar
|
||||||
import com.mob.utsmyanmar.ui.device_info.DeviceInfoUiState
|
import com.mob.utsmyanmar.ui.device_info.DeviceInfoUiState
|
||||||
@ -180,29 +176,6 @@ fun DashboardScreen2(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dashboardUiState.isSyncing) {
|
|
||||||
Dialog(onDismissRequest = {}) {
|
|
||||||
Card(
|
|
||||||
shape = RoundedCornerShape(16.dp),
|
|
||||||
colors = CardDefaults.cardColors(containerColor = Color.White),
|
|
||||||
elevation = CardDefaults.cardElevation(8.dp)
|
|
||||||
) {
|
|
||||||
Column(
|
|
||||||
modifier = Modifier.padding(32.dp),
|
|
||||||
horizontalAlignment = Alignment.CenterHorizontally
|
|
||||||
) {
|
|
||||||
CircularProgressIndicator(color = Color.LegacyRed)
|
|
||||||
Spacer(Modifier.height(16.dp))
|
|
||||||
Text(
|
|
||||||
text = dashboardUiState.syncStatusText,
|
|
||||||
style = MaterialTheme.typography.bodyMedium,
|
|
||||||
color = Color.Black
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ModalNavigationDrawer(
|
ModalNavigationDrawer(
|
||||||
drawerState = drawerState,
|
drawerState = drawerState,
|
||||||
drawerContent = {
|
drawerContent = {
|
||||||
|
|||||||
@ -17,7 +17,5 @@ data class DashboardUiState(
|
|||||||
val totalSaleCount: Int = 0,
|
val totalSaleCount: Int = 0,
|
||||||
val totalSaleAmount: Long = 0L,
|
val totalSaleAmount: Long = 0L,
|
||||||
val settlementStatusText: String = "Pending",
|
val settlementStatusText: String = "Pending",
|
||||||
val settlementDateTimeText: String = "--/-- --:--",
|
val settlementDateTimeText: String = "--/-- --:--"
|
||||||
val isSyncing: Boolean = false,
|
|
||||||
val syncStatusText: String = "Connecting to TMS server..."
|
|
||||||
)
|
)
|
||||||
|
|||||||
@ -72,18 +72,6 @@ class DashboardViewModel @Inject constructor(
|
|||||||
.takeIf { it > 0L }
|
.takeIf { it > 0L }
|
||||||
_uiState.update { it.copy(lastSyncTime = time) }
|
_uiState.update { it.copy(lastSyncTime = time) }
|
||||||
}
|
}
|
||||||
|
|
||||||
fun startSync() {
|
|
||||||
_uiState.update { it.copy(isSyncing = true, syncStatusText = "Connecting to TMS server...") }
|
|
||||||
}
|
|
||||||
|
|
||||||
fun finishSync(message: String) {
|
|
||||||
_uiState.update { it.copy(syncStatusText = message) }
|
|
||||||
viewModelScope.launch {
|
|
||||||
kotlinx.coroutines.delay(1500)
|
|
||||||
_uiState.update { it.copy(isSyncing = false) }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun PayDetail.toRecord(): TrnxRecord {
|
private fun PayDetail.toRecord(): TrnxRecord {
|
||||||
|
|||||||
@ -108,6 +108,11 @@ fun InputAmount(
|
|||||||
modifier = Modifier.align(Alignment.CenterHorizontally)
|
modifier = Modifier.align(Alignment.CenterHorizontally)
|
||||||
)
|
)
|
||||||
Spacer(modifier = Modifier.height(8.dp))
|
Spacer(modifier = Modifier.height(8.dp))
|
||||||
|
|
||||||
|
// Row(
|
||||||
|
// modifier = Modifier.align(Alignment.CenterHorizontally),
|
||||||
|
// verticalAlignment = Alignment.Bottom
|
||||||
|
// ) {
|
||||||
Text(
|
Text(
|
||||||
text = formatAmount(amount.ifEmpty { "0" }),
|
text = formatAmount(amount.ifEmpty { "0" }),
|
||||||
color = Color.LegacyRed,
|
color = Color.LegacyRed,
|
||||||
@ -122,7 +127,12 @@ fun InputAmount(
|
|||||||
modifier = Modifier.padding(end = 10.dp, bottom = 6.dp)
|
modifier = Modifier.padding(end = 10.dp, bottom = 6.dp)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
Spacer(modifier = Modifier.height(14.dp))
|
Spacer(modifier = Modifier.height(14.dp))
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
text = supportingText,
|
text = supportingText,
|
||||||
color = Color.Gray,
|
color = Color.Gray,
|
||||||
@ -131,6 +141,8 @@ fun InputAmount(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//second container
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
@ -234,15 +246,14 @@ private fun formatAmount(value: String): String {
|
|||||||
val groupedWholePart = "%,d".format(wholePart.toLongOrNull() ?: 0L)
|
val groupedWholePart = "%,d".format(wholePart.toLongOrNull() ?: 0L)
|
||||||
|
|
||||||
if (!normalized.contains(".")) {
|
if (!normalized.contains(".")) {
|
||||||
return "$groupedWholePart.00"
|
return groupedWholePart
|
||||||
}
|
}
|
||||||
|
|
||||||
val decimalPart = normalized.substringAfter(".", "")
|
val decimalPart = normalized.substringAfter(".", "")
|
||||||
return if (normalized.endsWith(".")) {
|
return if (normalized.endsWith(".")) {
|
||||||
"$groupedWholePart.00"
|
"$groupedWholePart."
|
||||||
} else {
|
} else {
|
||||||
val padded = decimalPart.padEnd(2, '0').take(2)
|
"$groupedWholePart.$decimalPart"
|
||||||
"$groupedWholePart.$padded"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -26,7 +26,6 @@ import com.mob.utsmyanmar.ui.device_info.DeviceInfoViewModel
|
|||||||
import com.mob.utsmyanmar.ui.error.TransactionErrorScreen
|
import com.mob.utsmyanmar.ui.error.TransactionErrorScreen
|
||||||
import com.mob.utsmyanmar.ui.functions.FunctionsScreen
|
import com.mob.utsmyanmar.ui.functions.FunctionsScreen
|
||||||
import com.mob.utsmyanmar.ui.history_functions.HistoryRoute
|
import com.mob.utsmyanmar.ui.history_functions.HistoryRoute
|
||||||
import com.mob.utsmyanmar.ui.history_functions.prepareReprintPayDetail
|
|
||||||
import com.mob.utsmyanmar.ui.input_amount.AmountRoute
|
import com.mob.utsmyanmar.ui.input_amount.AmountRoute
|
||||||
import com.mob.utsmyanmar.ui.password_input.InputPassword
|
import com.mob.utsmyanmar.ui.password_input.InputPassword
|
||||||
import com.mob.utsmyanmar.ui.password_input.PasswordType
|
import com.mob.utsmyanmar.ui.password_input.PasswordType
|
||||||
@ -37,6 +36,7 @@ import com.mob.utsmyanmar.ui.processing_card.ProcessingCardRoute
|
|||||||
import com.mob.utsmyanmar.ui.processing_card.ProcessingCardViewModel
|
import com.mob.utsmyanmar.ui.processing_card.ProcessingCardViewModel
|
||||||
import com.mob.utsmyanmar.ui.refund_rrn.InputRrnRoute
|
import com.mob.utsmyanmar.ui.refund_rrn.InputRrnRoute
|
||||||
import com.mob.utsmyanmar.ui.refund_rrn.RRNViewModel
|
import com.mob.utsmyanmar.ui.refund_rrn.RRNViewModel
|
||||||
|
import com.mob.utsmyanmar.ui.history_functions.prepareReprintPayDetail
|
||||||
import com.mob.utsmyanmar.ui.sale_void.TranDetailPage
|
import com.mob.utsmyanmar.ui.sale_void.TranDetailPage
|
||||||
import com.mob.utsmyanmar.ui.sale_void.VoidTraceScreen
|
import com.mob.utsmyanmar.ui.sale_void.VoidTraceScreen
|
||||||
import com.mob.utsmyanmar.ui.sale_void.VoidViewModel
|
import com.mob.utsmyanmar.ui.sale_void.VoidViewModel
|
||||||
@ -92,7 +92,7 @@ fun AppNavGraph(
|
|||||||
val sharedViewModel: SharedViewModel = hiltViewModel(activity)
|
val sharedViewModel: SharedViewModel = hiltViewModel(activity)
|
||||||
SignaturePad(
|
SignaturePad(
|
||||||
onBack = { navController.popBackStack() },
|
onBack = { navController.popBackStack() },
|
||||||
onConfirm = { bitmap, signatureBlob ->
|
onConfirm = { _, bitmap, signatureBlob ->
|
||||||
sharedViewModel.signBitmap = bitmap
|
sharedViewModel.signBitmap = bitmap
|
||||||
sharedViewModel.updateSignatureBlob(signatureBlob)
|
sharedViewModel.updateSignatureBlob(signatureBlob)
|
||||||
navController.navigate(Routes.TransactionResult.route) {
|
navController.navigate(Routes.TransactionResult.route) {
|
||||||
@ -120,31 +120,9 @@ fun AppNavGraph(
|
|||||||
deviceInfoViewModel.loadDeviceInfo()
|
deviceInfoViewModel.loadDeviceInfo()
|
||||||
}
|
}
|
||||||
|
|
||||||
val tmsSetupUiState by tmsSetupViewModel.uiState.collectAsStateWithLifecycle()
|
|
||||||
|
|
||||||
LaunchedEffect(tmsSetupViewModel) {
|
LaunchedEffect(tmsSetupViewModel) {
|
||||||
tmsSetupViewModel.onSyncCompleted.collect {
|
tmsSetupViewModel.onSyncCompleted.collect {
|
||||||
dashboardViewModel.refreshLastSyncTime()
|
dashboardViewModel.refreshLastSyncTime()
|
||||||
dashboardViewModel.finishSync("Sync completed")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LaunchedEffect(tmsSetupUiState.isLoading, tmsSetupUiState.isError) {
|
|
||||||
if (dashboardUiState.isSyncing && !tmsSetupUiState.isLoading) {
|
|
||||||
if (tmsSetupUiState.isError) {
|
|
||||||
dashboardViewModel.finishSync(tmsSetupUiState.statusText.ifBlank { "Download failed!" })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LaunchedEffect(tmsSetupUiState.isTerminalDisabled) {
|
|
||||||
if (tmsSetupUiState.isTerminalDisabled) {
|
|
||||||
navController.navigate(Routes.TmsSetup.route) {
|
|
||||||
popUpTo(Routes.Dashboard.route) {
|
|
||||||
inclusive = true
|
|
||||||
}
|
|
||||||
launchSingleTop = true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,7 +131,6 @@ fun AppNavGraph(
|
|||||||
dashboardUiState = dashboardUiState,
|
dashboardUiState = dashboardUiState,
|
||||||
deviceInfo = deviceInfoUiState,
|
deviceInfo = deviceInfoUiState,
|
||||||
onClickLastSync = {
|
onClickLastSync = {
|
||||||
dashboardViewModel.startSync()
|
|
||||||
tmsSetupViewModel.downloadConfigs()
|
tmsSetupViewModel.downloadConfigs()
|
||||||
},
|
},
|
||||||
onNavigateRecentTransaction = { record ->
|
onNavigateRecentTransaction = { record ->
|
||||||
@ -179,6 +156,7 @@ fun AppNavGraph(
|
|||||||
launchSingleTop = true
|
launchSingleTop = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
"Pre-Auth",
|
"Pre-Auth",
|
||||||
"Cash Adv" -> {
|
"Cash Adv" -> {
|
||||||
navController.navigate(Routes.Amount.createRoute(action)) {
|
navController.navigate(Routes.Amount.createRoute(action)) {
|
||||||
@ -801,14 +779,7 @@ fun AppNavGraph(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun formatAmountForDisplay(amount: String?): String {
|
private fun formatAmountForDisplay(amount: String?): String {
|
||||||
val raw = amount.orEmpty().trim()
|
val normalizedAmount = amount.orEmpty()
|
||||||
if (raw.isBlank()) return "0.00"
|
val value = normalizedAmount.toLongOrNull() ?: return normalizedAmount.ifBlank { "0" }
|
||||||
if (raw.contains(".")) {
|
return "%,d".format(value)
|
||||||
val whole = raw.substringBefore(".").ifEmpty { "0" }
|
|
||||||
val decimal = raw.substringAfter(".", "")
|
|
||||||
val grouped = "%,d".format(whole.toLongOrNull() ?: 0L)
|
|
||||||
return "$grouped.${decimal.padEnd(2, '0').take(2)}"
|
|
||||||
}
|
|
||||||
val value = raw.toLongOrNull() ?: return raw
|
|
||||||
return "%,d.00".format(value)
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import androidx.lifecycle.ViewModelProvider
|
|||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
import com.mob.utsmyanmar.model.CardTransactionType
|
import com.mob.utsmyanmar.model.CardTransactionType
|
||||||
import com.mob.utsmyanmar.ui.pinpad.PinPadViewModel
|
import com.mob.utsmyanmar.ui.pinpad.PinPadViewModel
|
||||||
|
import com.mob.utsmyanmar.utils.MockCardData
|
||||||
import com.mob.utsmyanmar.utils.MockData
|
import com.mob.utsmyanmar.utils.MockData
|
||||||
import com.mob.utsmyanmar.utils.TransactionUtil
|
import com.mob.utsmyanmar.utils.TransactionUtil
|
||||||
import com.mob.utsmyanmar.viewmodel.CardReaderViewModel
|
import com.mob.utsmyanmar.viewmodel.CardReaderViewModel
|
||||||
|
|||||||
@ -1,10 +1,15 @@
|
|||||||
package com.mob.utsmyanmar.ui.signature_pad
|
package com.mob.utsmyanmar.ui.signature_pad
|
||||||
|
|
||||||
import android.graphics.Bitmap
|
import android.graphics.Bitmap
|
||||||
import androidx.compose.foundation.border
|
import android.graphics.Paint
|
||||||
|
import androidx.compose.foundation.Canvas
|
||||||
|
import androidx.compose.foundation.background
|
||||||
|
import androidx.compose.foundation.gestures.detectDragGestures
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
|
import androidx.compose.foundation.layout.Spacer
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
@ -19,31 +24,82 @@ import androidx.compose.material3.OutlinedButton
|
|||||||
import androidx.compose.material3.Scaffold
|
import androidx.compose.material3.Scaffold
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.runtime.getValue
|
||||||
|
import androidx.compose.runtime.mutableStateListOf
|
||||||
|
import androidx.compose.runtime.mutableStateOf
|
||||||
|
import androidx.compose.runtime.remember
|
||||||
|
import androidx.compose.runtime.setValue
|
||||||
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.geometry.Offset
|
||||||
|
import androidx.compose.ui.geometry.Size
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.graphics.Path
|
||||||
|
import androidx.compose.ui.graphics.drawscope.Stroke
|
||||||
|
import androidx.compose.ui.input.pointer.pointerInput
|
||||||
|
import androidx.compose.ui.layout.onSizeChanged
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
|
import androidx.core.graphics.createBitmap
|
||||||
import com.mob.utsmyanmar.ui.components.appbar.AppBar
|
import com.mob.utsmyanmar.ui.components.appbar.AppBar
|
||||||
import com.mob.utsmyanmar.ui.theme.MOBPOSTheme
|
import com.mob.utsmyanmar.ui.theme.MOBPOSTheme
|
||||||
import se.warting.signaturepad.SignaturePadAdapter
|
|
||||||
import se.warting.signaturepad.SignaturePadView
|
|
||||||
import java.io.ByteArrayOutputStream
|
import java.io.ByteArrayOutputStream
|
||||||
|
import android.graphics.Canvas as AndroidCanvas
|
||||||
|
import android.graphics.Path as AndroidPath
|
||||||
import com.mob.utsmyanmar.ui.theme.Color as AppColor
|
import com.mob.utsmyanmar.ui.theme.Color as AppColor
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun SignaturePad(
|
fun SignaturePad(
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
|
signatureColor: Color = Color.Black,
|
||||||
onBack: () -> Unit = {},
|
onBack: () -> Unit = {},
|
||||||
onConfirm: (Bitmap?, ByteArray?) -> Unit = { _, _ -> }
|
onConfirm: (SignatureMode, Bitmap?, signatureBlob: ByteArray?) -> Unit = { _, _, _ -> }
|
||||||
) {
|
) {
|
||||||
var signaturePadAdapter: SignaturePadAdapter? = null
|
val paths = remember { mutableStateListOf<List<Offset>>() }
|
||||||
|
val currentPath = remember { mutableStateListOf<Offset>() }
|
||||||
|
var selectedMode by remember { mutableStateOf(SignatureMode.Digital) }
|
||||||
|
var canvasSize by remember { mutableStateOf(Size.Zero) }
|
||||||
|
var strokeWidth = 6f
|
||||||
|
|
||||||
val scaledWidth = 300
|
fun clearSignature() {
|
||||||
|
paths.clear()
|
||||||
|
currentPath.clear()
|
||||||
|
}
|
||||||
|
|
||||||
fun scaleBitmap(source: Bitmap): Bitmap {
|
fun buildBitmap(): Bitmap? {
|
||||||
val ratio = scaledWidth.toFloat() / source.width
|
if (selectedMode == SignatureMode.Manual) return null
|
||||||
val height = (source.height * ratio).toInt()
|
if (paths.isEmpty() && currentPath.isEmpty()) return null
|
||||||
return Bitmap.createScaledBitmap(source, scaledWidth, height, true)
|
if (canvasSize.width <= 0f || canvasSize.height <= 0f) return null
|
||||||
|
|
||||||
|
val bitmap =
|
||||||
|
createBitmap(canvasSize.width.toInt(), canvasSize.height.toInt(), Bitmap.Config.RGB_565)
|
||||||
|
val canvas = AndroidCanvas(bitmap)
|
||||||
|
canvas.drawColor(android.graphics.Color.WHITE)
|
||||||
|
|
||||||
|
val paint = Paint().apply {
|
||||||
|
color = android.graphics.Color.BLACK
|
||||||
|
style = Paint.Style.STROKE
|
||||||
|
isAntiAlias = true
|
||||||
|
strokeCap = Paint.Cap.ROUND
|
||||||
|
strokeJoin = Paint.Join.ROUND
|
||||||
|
strokeWidth = 10f
|
||||||
|
}
|
||||||
|
|
||||||
|
fun drawStroke(points: List<Offset>) {
|
||||||
|
if (points.size < 2) return
|
||||||
|
val path = AndroidPath().apply {
|
||||||
|
moveTo(points.first().x, points.first().y)
|
||||||
|
for (index in 1 until points.size) {
|
||||||
|
lineTo(points[index].x, points[index].y)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
canvas.drawPath(path, paint)
|
||||||
|
}
|
||||||
|
|
||||||
|
paths.forEach(::drawStroke)
|
||||||
|
drawStroke(currentPath)
|
||||||
|
|
||||||
|
return bitmap
|
||||||
}
|
}
|
||||||
|
|
||||||
fun bitmapToBlob(bitmap: Bitmap): ByteArray {
|
fun bitmapToBlob(bitmap: Bitmap): ByteArray {
|
||||||
@ -69,20 +125,103 @@ fun SignaturePad(
|
|||||||
.padding(16.dp),
|
.padding(16.dp),
|
||||||
verticalArrangement = Arrangement.spacedBy(16.dp)
|
verticalArrangement = Arrangement.spacedBy(16.dp)
|
||||||
) {
|
) {
|
||||||
SignaturePadView(
|
Box(
|
||||||
onReady = { signaturePadAdapter = it },
|
modifier = Modifier
|
||||||
|
.fillMaxWidth(0.85f)
|
||||||
|
.height(180.dp)
|
||||||
|
.align(Alignment.CenterHorizontally)
|
||||||
|
.background(
|
||||||
|
color = if (selectedMode == SignatureMode.Digital) {
|
||||||
|
Color.White
|
||||||
|
} else {
|
||||||
|
Color.White.copy(alpha = 0.55f)
|
||||||
|
},
|
||||||
|
shape = RoundedCornerShape(16.dp)
|
||||||
|
)
|
||||||
|
.padding(12.dp)
|
||||||
|
.onSizeChanged { size ->
|
||||||
|
canvasSize = Size(size.width.toFloat(), size.height.toFloat())
|
||||||
|
}
|
||||||
|
.pointerInput(selectedMode) {
|
||||||
|
if (selectedMode == SignatureMode.Manual) return@pointerInput
|
||||||
|
detectDragGestures(
|
||||||
|
onDragStart = { startOffset ->
|
||||||
|
currentPath.add(startOffset)
|
||||||
|
},
|
||||||
|
onDrag = { change, _ ->
|
||||||
|
change.consume()
|
||||||
|
currentPath.add(change.position)
|
||||||
|
},
|
||||||
|
onDragEnd = {
|
||||||
|
paths.add(currentPath.toList())
|
||||||
|
currentPath.clear()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
) {
|
||||||
|
Canvas(modifier = Modifier.fillMaxSize()) {
|
||||||
|
paths.forEach { points ->
|
||||||
|
if (points.size > 1) {
|
||||||
|
val path = Path().apply {
|
||||||
|
moveTo(points.first().x, points.first().y)
|
||||||
|
for (i in 1 until points.size) {
|
||||||
|
lineTo(points[i].x, points[i].y)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
drawPath(
|
||||||
|
path = path,
|
||||||
|
color = signatureColor,
|
||||||
|
style = Stroke(width = strokeWidth)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (currentPath.size > 1) {
|
||||||
|
val path = Path().apply {
|
||||||
|
moveTo(currentPath.first().x, currentPath.first().y)
|
||||||
|
for (i in 1 until currentPath.size) {
|
||||||
|
lineTo(currentPath[i].x, currentPath[i].y)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
drawPath(
|
||||||
|
path = path,
|
||||||
|
color = signatureColor,
|
||||||
|
style = Stroke(width = strokeWidth)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.height(200.dp)
|
.height(150.dp)
|
||||||
.border(width = 1.dp, color = AppColor.LegacyRed)
|
) {
|
||||||
)
|
SignatureModeOption(
|
||||||
|
title = "Manual Sign",
|
||||||
|
subtitle = "Signature on Paper",
|
||||||
|
selected = selectedMode == SignatureMode.Manual,
|
||||||
|
onClick = { selectedMode = SignatureMode.Manual },
|
||||||
|
modifier = Modifier.fillMaxWidth()
|
||||||
|
)
|
||||||
|
|
||||||
|
Spacer(Modifier.height(12.dp))
|
||||||
|
|
||||||
|
SignatureModeOption(
|
||||||
|
title = "Digital Sign",
|
||||||
|
subtitle = "Draw on pad",
|
||||||
|
selected = selectedMode == SignatureMode.Digital,
|
||||||
|
onClick = { selectedMode = SignatureMode.Digital },
|
||||||
|
modifier = Modifier.fillMaxWidth()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
horizontalArrangement = Arrangement.spacedBy(12.dp)
|
horizontalArrangement = Arrangement.spacedBy(12.dp)
|
||||||
) {
|
) {
|
||||||
OutlinedButton(
|
OutlinedButton(
|
||||||
onClick = { signaturePadAdapter?.clear() },
|
onClick = { clearSignature() },
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
.height(50.dp)
|
.height(50.dp)
|
||||||
@ -92,10 +231,9 @@ fun SignaturePad(
|
|||||||
|
|
||||||
Button(
|
Button(
|
||||||
onClick = {
|
onClick = {
|
||||||
val rawBitmap = signaturePadAdapter?.getSignatureBitmap()
|
val bitmap = buildBitmap()
|
||||||
val bitmap = rawBitmap?.let { scaleBitmap(it) }
|
|
||||||
val signatureBlob = bitmap?.let { bitmapToBlob(it) }
|
val signatureBlob = bitmap?.let { bitmapToBlob(it) }
|
||||||
onConfirm(bitmap, signatureBlob)
|
onConfirm(selectedMode, bitmap, signatureBlob)
|
||||||
},
|
},
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.weight(1f)
|
.weight(1f)
|
||||||
|
|||||||
@ -2,7 +2,6 @@ package com.mob.utsmyanmar.ui.tms_setup
|
|||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import androidx.core.content.edit
|
|
||||||
import androidx.lifecycle.ViewModel
|
import androidx.lifecycle.ViewModel
|
||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
import com.mob.utsmyanmar.model.sirius.SiriusResponse
|
import com.mob.utsmyanmar.model.sirius.SiriusResponse
|
||||||
@ -49,7 +48,7 @@ class TmsSetupViewModel @Inject constructor(
|
|||||||
private val emvParamOperation: EmvParamOperation,
|
private val emvParamOperation: EmvParamOperation,
|
||||||
@ApplicationContext private val context: Context
|
@ApplicationContext private val context: Context
|
||||||
) : ViewModel() {
|
) : ViewModel() {
|
||||||
private val TAG = TmsSetupViewModel::class.simpleName;
|
|
||||||
private val _uiState = MutableStateFlow(TmsSetupUiState())
|
private val _uiState = MutableStateFlow(TmsSetupUiState())
|
||||||
private val _dashboardUiState = MutableStateFlow(DashboardUiState())
|
private val _dashboardUiState = MutableStateFlow(DashboardUiState())
|
||||||
val uiState: StateFlow<TmsSetupUiState> = _uiState.asStateFlow()
|
val uiState: StateFlow<TmsSetupUiState> = _uiState.asStateFlow()
|
||||||
@ -145,27 +144,19 @@ class TmsSetupViewModel @Inject constructor(
|
|||||||
val ops = SystemParamsOperation.getInstance()
|
val ops = SystemParamsOperation.getInstance()
|
||||||
|
|
||||||
if (!ops.isActive) {
|
if (!ops.isActive) {
|
||||||
LogUtil.d(TAG, "isActive ${ops.isActive}")
|
|
||||||
val msg = ops.disabledMsg.takeIf { it.isNotEmpty() }
|
val msg = ops.disabledMsg.takeIf { it.isNotEmpty() }
|
||||||
?: "This terminal has been disabled. Please contact your administrator."
|
?: "This terminal has been disabled. Please contact your administrator."
|
||||||
_uiState.update {
|
_uiState.update { it.copy(isLoading = false) }
|
||||||
it.copy(
|
viewModelScope.launch { _navigateToDisable.emit(msg) }
|
||||||
isLoading = false,
|
|
||||||
isError = true,
|
|
||||||
isTerminalDisabled = true,
|
|
||||||
statusText = "Terminal Disabled",
|
|
||||||
errorMessage = msg
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
val validity = TMSUtil.getInstance().checkParams()
|
val validity = TMSUtil.getInstance().checkParams()
|
||||||
if (validity.status == ValidityStatus.SUCCESS) {
|
if (validity.status == ValidityStatus.SUCCESS) {
|
||||||
context.getSharedPreferences("mobpos_prefs", Context.MODE_PRIVATE)
|
context.getSharedPreferences("mobpos_prefs", Context.MODE_PRIVATE)
|
||||||
.edit {
|
.edit()
|
||||||
putLong("last_sync_time", System.currentTimeMillis())
|
.putLong("last_sync_time", System.currentTimeMillis())
|
||||||
}
|
.apply()
|
||||||
_uiState.update { it.copy(isLoading = false, statusText = "Ready.") }
|
_uiState.update { it.copy(isLoading = false, statusText = "Ready.") }
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
_onSyncCompleted.emit(Unit)
|
_onSyncCompleted.emit(Unit)
|
||||||
|
|||||||
@ -24,8 +24,6 @@ import androidx.compose.ui.text.style.TextAlign
|
|||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.mob.utsmyanmar.ui.preview.P2Preview
|
import com.mob.utsmyanmar.ui.preview.P2Preview
|
||||||
import com.mob.utsmyanmar.ui.theme.Color
|
import com.mob.utsmyanmar.ui.theme.Color
|
||||||
import com.mob.utsmyanmar.utils.toFormattedDate
|
|
||||||
import com.mob.utsmyanmar.utils.toFormattedTime
|
|
||||||
import com.utsmyanmar.paylibs.model.PayDetail
|
import com.utsmyanmar.paylibs.model.PayDetail
|
||||||
import com.utsmyanmar.paylibs.print.PrintReceipt
|
import com.utsmyanmar.paylibs.print.PrintReceipt
|
||||||
import com.utsmyanmar.paylibs.utils.POSUtil
|
import com.utsmyanmar.paylibs.utils.POSUtil
|
||||||
@ -84,8 +82,8 @@ fun TransactionResultScreen(
|
|||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
|
|
||||||
InfoCard(
|
InfoCard(
|
||||||
date = "${state.payDetail?.transDate?.toFormattedDate()}",
|
date = "26 May 2026",
|
||||||
time = "${state.payDetail?.transTime?.toFormattedTime()}",
|
time = "12:06 PM",
|
||||||
transactionId = state.payDetail?.referNo.toString()
|
transactionId = state.payDetail?.referNo.toString()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import com.mob.utsmyanmar.model.ecr.ECRResultStatus
|
|||||||
import com.mob.utsmyanmar.utils.CoreUtils
|
import com.mob.utsmyanmar.utils.CoreUtils
|
||||||
import com.mob.utsmyanmar.viewmodel.SharedViewModel
|
import com.mob.utsmyanmar.viewmodel.SharedViewModel
|
||||||
import com.utsmyanmar.baselib.emv.EmvParamOperation
|
import com.utsmyanmar.baselib.emv.EmvParamOperation
|
||||||
|
import com.utsmyanmar.baselib.network.model.sirius.SiriusRequest
|
||||||
import com.utsmyanmar.ecr.ECRHelper
|
import com.utsmyanmar.ecr.ECRHelper
|
||||||
import com.utsmyanmar.ecr.ECRProcess
|
import com.utsmyanmar.ecr.ECRProcess
|
||||||
import com.utsmyanmar.ecr.data.model.TransactionsResp
|
import com.utsmyanmar.ecr.data.model.TransactionsResp
|
||||||
|
|||||||
@ -1,18 +0,0 @@
|
|||||||
package com.mob.utsmyanmar.utils
|
|
||||||
|
|
||||||
import java.text.SimpleDateFormat
|
|
||||||
import java.util.Locale
|
|
||||||
|
|
||||||
fun String.toFormattedDate(): String {
|
|
||||||
val inputFormat = SimpleDateFormat("dd/MM/yy", Locale.ENGLISH)
|
|
||||||
val outputFormat = SimpleDateFormat("dd MMM yyyy", Locale.ENGLISH)
|
|
||||||
val date = inputFormat.parse(this)
|
|
||||||
return outputFormat.format(date!!)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun String.toFormattedTime(): String {
|
|
||||||
val inputFormat = SimpleDateFormat("HH:mm:ss", Locale.ENGLISH)
|
|
||||||
val outputFormat = SimpleDateFormat("hh:mm a", Locale.ENGLISH)
|
|
||||||
val time = inputFormat.parse(this)
|
|
||||||
return outputFormat.format(time!!)
|
|
||||||
}
|
|
||||||
@ -131,7 +131,7 @@ class TMSSetupsImpl : TMSSetups {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Properties
|
//Properties
|
||||||
for (prop in siriusProperty) {
|
for (prop in siriusProperty.orEmpty()) {
|
||||||
val name = prop.name
|
val name = prop.name
|
||||||
val data = prop.property
|
val data = prop.property
|
||||||
|
|
||||||
@ -221,7 +221,6 @@ class TMSSetupsImpl : TMSSetups {
|
|||||||
"speedup_contactless_enable" -> ops.setSpeedUpContactless(parseBoolean(data))
|
"speedup_contactless_enable" -> ops.setSpeedUpContactless(parseBoolean(data))
|
||||||
"manual_entry_pin_enable" -> ops.isManualEntryPinEnable = parseBoolean(data)
|
"manual_entry_pin_enable" -> ops.isManualEntryPinEnable = parseBoolean(data)
|
||||||
"cmhl_enabled" -> ops.setCMHLEnable(parseBoolean(data))
|
"cmhl_enabled" -> ops.setCMHLEnable(parseBoolean(data))
|
||||||
"mmqr_enable" -> ops.setMmqrStatus(parseBoolean(data))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ops.carouselUrls = imgUrls.joinToString(",")
|
ops.carouselUrls = imgUrls.joinToString(",")
|
||||||
|
|||||||
@ -4,7 +4,6 @@ import android.os.Handler
|
|||||||
import android.os.Looper
|
import android.os.Looper
|
||||||
import android.os.Message
|
import android.os.Message
|
||||||
import android.text.TextUtils
|
import android.text.TextUtils
|
||||||
import com.mob.utsmyanmar.model.TransResultStatus
|
|
||||||
import com.utsmyanmar.baselib.emv.EmvParamOperation
|
import com.utsmyanmar.baselib.emv.EmvParamOperation
|
||||||
import com.utsmyanmar.baselib.repo.Repository
|
import com.utsmyanmar.baselib.repo.Repository
|
||||||
import com.utsmyanmar.baselib.util.enums.EmvResultStatus
|
import com.utsmyanmar.baselib.util.enums.EmvResultStatus
|
||||||
@ -25,6 +24,7 @@ import com.utsmyanmar.paylibs.utils.iso_utils.TransactionsType
|
|||||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||||
import sunmi.sunmiui.utils.LogUtil
|
import sunmi.sunmiui.utils.LogUtil
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
import com.mob.utsmyanmar.model.TransResultStatus
|
||||||
|
|
||||||
@HiltViewModel
|
@HiltViewModel
|
||||||
class EmvTransactionProcessViewModel @Inject constructor(
|
class EmvTransactionProcessViewModel @Inject constructor(
|
||||||
|
|||||||
@ -25,6 +25,7 @@ import kotlinx.coroutines.flow.MutableStateFlow
|
|||||||
import kotlinx.coroutines.flow.asStateFlow
|
import kotlinx.coroutines.flow.asStateFlow
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
import kotlin.time.Duration.Companion.milliseconds
|
||||||
|
|
||||||
@HiltViewModel
|
@HiltViewModel
|
||||||
class TransProcessViewModel @Inject constructor(
|
class TransProcessViewModel @Inject constructor(
|
||||||
|
|||||||
@ -1,12 +1,17 @@
|
|||||||
package com.utsmyanmar.ecr
|
package com.utsmyanmar.ecr
|
||||||
|
|
||||||
|
import androidx.annotation.Keep
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
import com.utsmyanmar.ecr.data.ResultOf
|
import com.utsmyanmar.ecr.data.ResultOf
|
||||||
|
import com.utsmyanmar.ecr.data.TransType
|
||||||
import com.utsmyanmar.ecr.data.mapper.RequestTransMapper
|
import com.utsmyanmar.ecr.data.mapper.RequestTransMapper
|
||||||
import com.utsmyanmar.ecr.data.mapper.ResponseTransMapper
|
import com.utsmyanmar.ecr.data.mapper.ResponseTransMapper
|
||||||
import com.utsmyanmar.ecr.data.model.RequestTrans
|
import com.utsmyanmar.ecr.data.model.RequestTrans
|
||||||
|
import com.utsmyanmar.ecr.data.model.ResponseTrans
|
||||||
import com.utsmyanmar.ecr.data.model.Transactions
|
import com.utsmyanmar.ecr.data.model.Transactions
|
||||||
import com.utsmyanmar.ecr.data.model.TransactionsResp
|
import com.utsmyanmar.ecr.data.model.TransactionsResp
|
||||||
|
import com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation
|
||||||
|
import java.lang.Exception
|
||||||
|
|
||||||
//@Keep
|
//@Keep
|
||||||
object ECRProcess {
|
object ECRProcess {
|
||||||
|
|||||||
@ -503,7 +503,7 @@ public class ISOSocket {
|
|||||||
|
|
||||||
LogUtil.e(Constant.TAG, "E:" + e.toString());
|
LogUtil.e(Constant.TAG, "E:" + e.toString());
|
||||||
|
|
||||||
// closeSocket();
|
closeSocket();
|
||||||
if (isReversal) {
|
if (isReversal) {
|
||||||
listener.onError(Constant.REVERSAL);
|
listener.onError(Constant.REVERSAL);
|
||||||
// listener.onError(new ReversalException());
|
// listener.onError(new ReversalException());
|
||||||
@ -519,7 +519,7 @@ public class ISOSocket {
|
|||||||
@Override
|
@Override
|
||||||
public void onComplete() {
|
public void onComplete() {
|
||||||
LogUtil.d(Constant.TAG, "onComplete");
|
LogUtil.d(Constant.TAG, "onComplete");
|
||||||
// closeSocket();
|
closeSocket();
|
||||||
isReversal = false;
|
isReversal = false;
|
||||||
listener.onComplete();
|
listener.onComplete();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1189,11 +1189,10 @@ public class PrintReceipt {
|
|||||||
private void printSignature(Bitmap signatureBitmap) {
|
private void printSignature(Bitmap signatureBitmap) {
|
||||||
try {
|
try {
|
||||||
sunmiPrinterService.setAlignment(1, null);
|
sunmiPrinterService.setAlignment(1, null);
|
||||||
int targetHeight = 200;
|
if (signatureBitmap.getWidth() > 130) {
|
||||||
if (signatureBitmap.getHeight() > targetHeight) {
|
double size = 1.0 * signatureBitmap.getHeight() * 130 / signatureBitmap.getWidth();
|
||||||
double ratio = 1.0 * targetHeight / signatureBitmap.getHeight();
|
int newHeight = (int) size;
|
||||||
int newWidth = (int) (signatureBitmap.getWidth() * ratio);
|
signatureBitmap = BitmapUtils.scale(signatureBitmap, 130, newHeight);
|
||||||
signatureBitmap = BitmapUtils.scale(signatureBitmap, newWidth, targetHeight);
|
|
||||||
}
|
}
|
||||||
sunmiPrinterService.printBitmap(signatureBitmap, null);
|
sunmiPrinterService.printBitmap(signatureBitmap, null);
|
||||||
sunmiPrinterService.printText("\n", null);
|
sunmiPrinterService.printText("\n", null);
|
||||||
|
|||||||
@ -954,12 +954,6 @@ public abstract class BaseXPrint {
|
|||||||
if (signatureBlob != null && signatureBlob.length > 0) {
|
if (signatureBlob != null && signatureBlob.length > 0) {
|
||||||
Bitmap signatureBitmap = android.graphics.BitmapFactory.decodeByteArray(signatureBlob, 0, signatureBlob.length);
|
Bitmap signatureBitmap = android.graphics.BitmapFactory.decodeByteArray(signatureBlob, 0, signatureBlob.length);
|
||||||
if (signatureBitmap != null) {
|
if (signatureBitmap != null) {
|
||||||
int targetHeight = 200;
|
|
||||||
if (signatureBitmap.getHeight() > targetHeight) {
|
|
||||||
double ratio = 1.0 * targetHeight / signatureBitmap.getHeight();
|
|
||||||
int newWidth = (int) (signatureBitmap.getWidth() * ratio);
|
|
||||||
signatureBitmap = BitmapUtils.scale(signatureBitmap, newWidth, targetHeight);
|
|
||||||
}
|
|
||||||
sunmiPrinterService.printBitmap(signatureBitmap, innerResultCallback);
|
sunmiPrinterService.printBitmap(signatureBitmap, innerResultCallback);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -368,7 +368,7 @@ public class TransactionsOperation {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (transactionsType == TransactionsType.PRE_AUTH_VOID) {
|
} else if (transactionsType == TransactionsType.PRE_AUTH_VOID) {
|
||||||
// newPay.setCardType(oldPay.getCardType());
|
newPay.setCardType(oldPay.getCardType());
|
||||||
newPay.setCustomOrderNo(oldPay.getVoucherNo());
|
newPay.setCustomOrderNo(oldPay.getVoucherNo());
|
||||||
newPay.setReferNo(oldPay.getReferNo());
|
newPay.setReferNo(oldPay.getReferNo());
|
||||||
newPay.setCardInfo(oldPay.getCardInfo());
|
newPay.setCardInfo(oldPay.getCardInfo());
|
||||||
|
|||||||
@ -1,16 +1,16 @@
|
|||||||
package com.utsmyanmar.paylibs.utils.core_utils;
|
package com.utsmyanmar.paylibs.utils.core_utils;
|
||||||
|
|
||||||
import static com.utsmyanmar.paylibs.utils.core_utils.SystemParamsSettings.TRANSACTION_MANAGER_KEY;
|
|
||||||
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import com.utsmyanmar.paylibs.utils.enums.CurrencyType;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import sunmi.sunmiui.utils.LogUtil;
|
import sunmi.sunmiui.utils.LogUtil;
|
||||||
|
|
||||||
|
import static com.utsmyanmar.paylibs.utils.core_utils.SystemParamsSettings.TRANSACTION_MANAGER_KEY;
|
||||||
|
|
||||||
|
import com.utsmyanmar.paylibs.utils.enums.CurrencyType;
|
||||||
|
|
||||||
public class SystemParamsOperation {
|
public class SystemParamsOperation {
|
||||||
|
|
||||||
public static final String TAG = "SystemParamsOperation";
|
public static final String TAG = "SystemParamsOperation";
|
||||||
@ -33,6 +33,54 @@ public class SystemParamsOperation {
|
|||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* public void init(String serialNumStart,
|
||||||
|
String batchNumStart,
|
||||||
|
int purchaseOrderStyle,
|
||||||
|
int correctFrequency,
|
||||||
|
int transactionNumber,
|
||||||
|
boolean printNegative,
|
||||||
|
int nonConnection,
|
||||||
|
boolean stateSecret,
|
||||||
|
boolean shieldAuthorizationCard,
|
||||||
|
int nonConnectionChoice,
|
||||||
|
boolean eCashVisaExemption) {
|
||||||
|
SystemParamsSettings bean = getSystemParamsSettings();
|
||||||
|
bean.setSerialNum(serialNumStart);
|
||||||
|
bean.setBatchNumStart(batchNumStart);
|
||||||
|
bean.setPurchaseOrderStyle(purchaseOrderStyle);
|
||||||
|
bean.setCorrectFrequency(correctFrequency);
|
||||||
|
bean.setTransactionNumber(transactionNumber);
|
||||||
|
bean.setPrintNegative(printNegative);
|
||||||
|
bean.setNonConnection(nonConnection);
|
||||||
|
bean.setStateSecret(stateSecret);
|
||||||
|
bean.setShieldAuthorizationCard(shieldAuthorizationCard);
|
||||||
|
bean.setNonConnectionChoice(nonConnectionChoice);
|
||||||
|
bean.setCashVisaExemption(eCashVisaExemption);
|
||||||
|
saveSystemParamsSettings(bean);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
/*public boolean isDownloadParamsOnce() {
|
||||||
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
|
return params.isDownloadParamsOnce();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void saveDownloadParamsOnce(boolean downloadParamsOnce) {
|
||||||
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
|
params.setDownloadParamsOnce(downloadParamsOnce);
|
||||||
|
saveSystemParamsSettings(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isNeedDownLoadICParams() {
|
||||||
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
|
return params.isNeedDownLoadICParams();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void saveNeedDownLoadICParams(boolean needDownLoadICParams) {
|
||||||
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
|
params.setNeedDownLoadICParams(needDownLoadICParams);
|
||||||
|
saveSystemParamsSettings(params);
|
||||||
|
}*/
|
||||||
|
|
||||||
public boolean isInjectOnce(){
|
public boolean isInjectOnce(){
|
||||||
SystemParamsSettings params = getSystemParamsSettings();
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
return params.isInjectOnce();
|
return params.isInjectOnce();
|
||||||
@ -43,6 +91,13 @@ public class SystemParamsOperation {
|
|||||||
params.setInjectOnce(injectOnce);
|
params.setInjectOnce(injectOnce);
|
||||||
saveSystemParamsSettings(params);
|
saveSystemParamsSettings(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set serial number
|
||||||
|
*
|
||||||
|
* @param serialNumber Starting serial number
|
||||||
|
*/
|
||||||
public void saveSerialNumber(String serialNumber) {
|
public void saveSerialNumber(String serialNumber) {
|
||||||
if (TextUtils.isEmpty(serialNumber)) {
|
if (TextUtils.isEmpty(serialNumber)) {
|
||||||
return;
|
return;
|
||||||
@ -51,6 +106,12 @@ public class SystemParamsOperation {
|
|||||||
params.setSerialNum(serialNumber);
|
params.setSerialNum(serialNumber);
|
||||||
saveSystemParamsSettings(params);
|
saveSystemParamsSettings(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set invoice number
|
||||||
|
*
|
||||||
|
* @param invoiceNumber Starting invoice number
|
||||||
|
*/
|
||||||
public void saveInvoiceNumber(String invoiceNumber) {
|
public void saveInvoiceNumber(String invoiceNumber) {
|
||||||
if (TextUtils.isEmpty(invoiceNumber)) {
|
if (TextUtils.isEmpty(invoiceNumber)) {
|
||||||
return;
|
return;
|
||||||
@ -59,6 +120,13 @@ public class SystemParamsOperation {
|
|||||||
params.setInvoiceNum(invoiceNumber);
|
params.setInvoiceNum(invoiceNumber);
|
||||||
saveSystemParamsSettings(params);
|
saveSystemParamsSettings(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set batch number
|
||||||
|
*
|
||||||
|
* @param batchNumber Starting batch number
|
||||||
|
*/
|
||||||
public void saveBatchNumber(String batchNumber) {
|
public void saveBatchNumber(String batchNumber) {
|
||||||
if (TextUtils.isEmpty(batchNumber)) {
|
if (TextUtils.isEmpty(batchNumber)) {
|
||||||
return;
|
return;
|
||||||
@ -68,6 +136,11 @@ public class SystemParamsOperation {
|
|||||||
saveSystemParamsSettings(params);
|
saveSystemParamsSettings(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Serial number increment
|
||||||
|
*/
|
||||||
private void incrementSerialNum() {
|
private void incrementSerialNum() {
|
||||||
SystemParamsSettings params = getSystemParamsSettings();
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
String currentSerialNum = params.getCurrentSerialNum();
|
String currentSerialNum = params.getCurrentSerialNum();
|
||||||
@ -99,6 +172,10 @@ public class SystemParamsOperation {
|
|||||||
params.setSerialNum(transNumFormat);
|
params.setSerialNum(transNumFormat);
|
||||||
saveSystemParamsSettings(params);
|
saveSystemParamsSettings(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Invoice number increment
|
||||||
|
*/
|
||||||
private void incrementInvoiceNum() {
|
private void incrementInvoiceNum() {
|
||||||
SystemParamsSettings params = getSystemParamsSettings();
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
String currentInvoiceNum = params.getCurrentInvoiceNum();
|
String currentInvoiceNum = params.getCurrentInvoiceNum();
|
||||||
@ -875,17 +952,6 @@ public class SystemParamsOperation {
|
|||||||
saveSystemParamsSettings(params);
|
saveSystemParamsSettings(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMmqrStatus(boolean status) {
|
|
||||||
SystemParamsSettings params = getSystemParamsSettings();
|
|
||||||
params.setMmqrEnabled(status);
|
|
||||||
saveSystemParamsSettings(params);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getMmqrStatus(){
|
|
||||||
SystemParamsSettings params = getSystemParamsSettings();
|
|
||||||
return params.getMmqrEnabled();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isCMHLEnabled(){
|
public boolean isCMHLEnabled(){
|
||||||
SystemParamsSettings params = getSystemParamsSettings();
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
return params.isCmhlEnabled();
|
return params.isCmhlEnabled();
|
||||||
|
|||||||
@ -233,7 +233,6 @@ public class SystemParamsSettings implements Serializable {
|
|||||||
private byte[] pik_value;
|
private byte[] pik_value;
|
||||||
|
|
||||||
private byte[] pik_kcv;
|
private byte[] pik_kcv;
|
||||||
private boolean mmqrEnabled;
|
|
||||||
|
|
||||||
protected String getSecHostName() {
|
protected String getSecHostName() {
|
||||||
return secHostName;
|
return secHostName;
|
||||||
@ -903,14 +902,6 @@ public class SystemParamsSettings implements Serializable {
|
|||||||
this.emvEnabled = emvEnabled;
|
this.emvEnabled = emvEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMmqrEnabled(boolean status) {
|
|
||||||
this.mmqrEnabled = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getMmqrEnabled(){
|
|
||||||
return mmqrEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* // 流水号起始
|
/* // 流水号起始
|
||||||
private String serialNum = Configs.getInstance().SERIAL_NUM();
|
private String serialNum = Configs.getInstance().SERIAL_NUM();
|
||||||
// 批次号起始
|
// 批次号起始
|
||||||
|
|||||||
@ -117,10 +117,7 @@ public class HostUtils {
|
|||||||
msgType = MessageType.AUTHORIZATION;
|
msgType = MessageType.AUTHORIZATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case PRE_AUTH_VOID:
|
|
||||||
case PRE_AUTH_COMPLETE:
|
case PRE_AUTH_COMPLETE:
|
||||||
if (hostName == HostName.BPC) {
|
if (hostName == HostName.BPC) {
|
||||||
msgType = MessageType.FINANCIAL;
|
msgType = MessageType.FINANCIAL;
|
||||||
@ -145,11 +142,11 @@ public class HostUtils {
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
case VOID:
|
case VOID:
|
||||||
|
case PRE_AUTH_VOID:
|
||||||
if(isVisaMaster) {
|
if(isVisaMaster) {
|
||||||
msgType = MessageType.REVERSAL;
|
msgType = MessageType.REVERSAL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
msgType = MessageType.FINANCIAL;
|
msgType = MessageType.FINANCIAL;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -198,8 +198,7 @@ public class BitmapConfig {
|
|||||||
public static final String CZ_REVERSAL="7020078000C08000";
|
public static final String CZ_REVERSAL="7020078000C08000";
|
||||||
public static final String CZ_BATCH_UPLOAD="703805800CC00010";
|
public static final String CZ_BATCH_UPLOAD="703805800CC00010";
|
||||||
public static final String CZ_PRE_AUTH="7020058020C09000";
|
public static final String CZ_PRE_AUTH="7020058020C09000";
|
||||||
// public static final String CZ_PRE_AUTH_VOID="7038058028C08000";
|
public static final String CZ_PRE_AUTH_VOID="7038058028C08000";
|
||||||
public static final String CZ_PRE_AUTH_VOID="703C058008C08000";
|
|
||||||
public static final String CZ_PRE_AUTH_COMP="703805802CC08000";
|
public static final String CZ_PRE_AUTH_COMP="703805802CC08000";
|
||||||
public static final String CZ_PRE_AUTH_COMP_VOID="7038058008C00000";
|
public static final String CZ_PRE_AUTH_COMP_VOID="7038058008C00000";
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user