phone number fixed
This commit is contained in:
parent
907eab4e72
commit
d59933f00a
@ -669,8 +669,22 @@ fun AppNavGraph(
|
|||||||
},
|
},
|
||||||
onNavigateInputAmount = { navController.popBackStack(Routes.Amount.route, false) },
|
onNavigateInputAmount = { navController.popBackStack(Routes.Amount.route, false) },
|
||||||
onNavigateProcessing = {},
|
onNavigateProcessing = {},
|
||||||
onNavigateEmvTransaction = {},
|
onNavigateEmvTransaction = {
|
||||||
onNavigateError = {},
|
navController.navigate(Routes.Processing.route) {
|
||||||
|
popUpTo(Routes.ProcessingCard.route) {
|
||||||
|
inclusive = true
|
||||||
|
}
|
||||||
|
launchSingleTop = true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onNavigateError = { message ->
|
||||||
|
navController.navigate(Routes.TransactionError.createRoute(false, message)) {
|
||||||
|
popUpTo(Routes.ProcessingCard.route) {
|
||||||
|
inclusive = true
|
||||||
|
}
|
||||||
|
launchSingleTop = true
|
||||||
|
}
|
||||||
|
},
|
||||||
onBack = { navController.popBackStack() },
|
onBack = { navController.popBackStack() },
|
||||||
onShowDecline = {}
|
onShowDecline = {}
|
||||||
)
|
)
|
||||||
@ -761,6 +775,7 @@ fun AppNavGraph(
|
|||||||
sharedViewModel = sharedViewModel,
|
sharedViewModel = sharedViewModel,
|
||||||
transProcessViewModel = transProcessViewModel,
|
transProcessViewModel = transProcessViewModel,
|
||||||
settlementViewModel = settlementViewModel,
|
settlementViewModel = settlementViewModel,
|
||||||
|
emvTransactionViewModel = hiltViewModel(activity),
|
||||||
onTransactionFinished = {
|
onTransactionFinished = {
|
||||||
tmsSetupViewModel.downloadConfigs(dashboardViewModel::refreshLastSyncTime)
|
tmsSetupViewModel.downloadConfigs(dashboardViewModel::refreshLastSyncTime)
|
||||||
},
|
},
|
||||||
|
|||||||
@ -22,7 +22,6 @@ import com.utsmyanmar.paylibs.model.PayDetail
|
|||||||
import com.utsmyanmar.paylibs.model.TradeData
|
import com.utsmyanmar.paylibs.model.TradeData
|
||||||
import com.utsmyanmar.paylibs.model.enums.TransCVM
|
import com.utsmyanmar.paylibs.model.enums.TransCVM
|
||||||
import com.utsmyanmar.paylibs.utils.POSUtil
|
import com.utsmyanmar.paylibs.utils.POSUtil
|
||||||
import com.utsmyanmar.paylibs.utils.core_utils.SystemParamsOperation
|
|
||||||
import com.utsmyanmar.paylibs.utils.enums.TransMenu
|
import com.utsmyanmar.paylibs.utils.enums.TransMenu
|
||||||
import com.utsmyanmar.paylibs.utils.params.Params
|
import com.utsmyanmar.paylibs.utils.params.Params
|
||||||
import kotlinx.coroutines.channels.Channel
|
import kotlinx.coroutines.channels.Channel
|
||||||
@ -250,7 +249,10 @@ class ProcessingCardViewModel(
|
|||||||
emvTransactionViewModel.transType.value =
|
emvTransactionViewModel.transType.value =
|
||||||
sharedViewModel.transactionsType.value
|
sharedViewModel.transactionsType.value
|
||||||
|
|
||||||
if (SystemParamsOperation.getInstance().isEmvEnabled) {
|
if (
|
||||||
|
// SystemParamsOperation.getInstance().isEmvEnabled
|
||||||
|
true
|
||||||
|
) {
|
||||||
prepareEmvTransaction()
|
prepareEmvTransaction()
|
||||||
sendUiEvent(ProcessingCardUiEvent.NavigateToEmvTransaction)
|
sendUiEvent(ProcessingCardUiEvent.NavigateToEmvTransaction)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -4,11 +4,13 @@ import android.R
|
|||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.LaunchedEffect
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
|
import androidx.compose.runtime.livedata.observeAsState
|
||||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||||
import com.mob.utsmyanmar.model.TransResultStatus
|
import com.mob.utsmyanmar.model.TransResultStatus
|
||||||
import com.mob.utsmyanmar.model.TransactionStatus
|
import com.mob.utsmyanmar.model.TransactionStatus
|
||||||
import com.mob.utsmyanmar.ui.settlement.SettlementViewModel
|
import com.mob.utsmyanmar.ui.settlement.SettlementViewModel
|
||||||
import com.mob.utsmyanmar.viewmodel.SharedViewModel
|
import com.mob.utsmyanmar.viewmodel.SharedViewModel
|
||||||
|
import com.mob.utsmyanmar.viewmodel.EmvTransactionProcessViewModel
|
||||||
import com.mob.utsmyanmar.viewmodel.TransProcessViewModel
|
import com.mob.utsmyanmar.viewmodel.TransProcessViewModel
|
||||||
import com.utsmyanmar.paylibs.utils.iso_utils.TransactionsType
|
import com.utsmyanmar.paylibs.utils.iso_utils.TransactionsType
|
||||||
|
|
||||||
@ -19,6 +21,7 @@ fun ProcessingRoute(
|
|||||||
sharedViewModel: SharedViewModel,
|
sharedViewModel: SharedViewModel,
|
||||||
transProcessViewModel: TransProcessViewModel,
|
transProcessViewModel: TransProcessViewModel,
|
||||||
settlementViewModel: SettlementViewModel,
|
settlementViewModel: SettlementViewModel,
|
||||||
|
emvTransactionViewModel: EmvTransactionProcessViewModel,
|
||||||
onNavigateTransactionResult: () -> Unit,
|
onNavigateTransactionResult: () -> Unit,
|
||||||
onNavigateSignature: () -> Unit,
|
onNavigateSignature: () -> Unit,
|
||||||
onNavigateError: (Boolean, String) -> Unit,
|
onNavigateError: (Boolean, String) -> Unit,
|
||||||
@ -26,12 +29,47 @@ fun ProcessingRoute(
|
|||||||
) {
|
) {
|
||||||
|
|
||||||
val transStatus by transProcessViewModel.transResultStatus.collectAsStateWithLifecycle()
|
val transStatus by transProcessViewModel.transResultStatus.collectAsStateWithLifecycle()
|
||||||
|
val emvStatus by emvTransactionViewModel.getTransStatus().observeAsState()
|
||||||
|
|
||||||
val state by transProcessViewModel.state.collectAsStateWithLifecycle()
|
val state by transProcessViewModel.state.collectAsStateWithLifecycle()
|
||||||
|
|
||||||
val settlementStatus by settlementViewModel.uiState.collectAsStateWithLifecycle()
|
val settlementStatus by settlementViewModel.uiState.collectAsStateWithLifecycle()
|
||||||
|
|
||||||
if(sharedViewModel.transactionsType.value == TransactionsType.SETTLEMENT) {
|
if (sharedViewModel.isEmvTrans().value == true) {
|
||||||
|
LaunchedEffect(Unit) {
|
||||||
|
emvTransactionViewModel.startProcess()
|
||||||
|
}
|
||||||
|
|
||||||
|
LaunchedEffect(emvStatus) {
|
||||||
|
when (emvStatus) {
|
||||||
|
TransResultStatus.SUCCESS,
|
||||||
|
TransResultStatus.OFFLINE_SUCCESS -> {
|
||||||
|
onTransactionFinished()
|
||||||
|
sharedViewModel.payDetail.value = emvTransactionViewModel.payDetailResult.value
|
||||||
|
onNavigateTransactionResult()
|
||||||
|
}
|
||||||
|
|
||||||
|
TransResultStatus.FAIL,
|
||||||
|
TransResultStatus.OFFLINE_FAILURE -> {
|
||||||
|
onTransactionFinished()
|
||||||
|
sharedViewModel.payDetail.value = emvTransactionViewModel.payDetailResult.value
|
||||||
|
onNavigateTransactionResult()
|
||||||
|
}
|
||||||
|
|
||||||
|
TransResultStatus.NETWORK_ERROR,
|
||||||
|
TransResultStatus.ERROR -> {
|
||||||
|
onTransactionFinished()
|
||||||
|
onNavigateError(
|
||||||
|
false,
|
||||||
|
emvTransactionViewModel.errorCodeMsg.value
|
||||||
|
?: "Something went wrong. Please try again."
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
else -> Unit
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if(sharedViewModel.transactionsType.value == TransactionsType.SETTLEMENT) {
|
||||||
LaunchedEffect(Unit) {
|
LaunchedEffect(Unit) {
|
||||||
settlementViewModel.startSettlementProcess()
|
settlementViewModel.startSettlementProcess()
|
||||||
}
|
}
|
||||||
@ -98,7 +136,9 @@ fun ProcessingRoute(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sharedViewModel.transactionsType.value == TransactionsType.SETTLEMENT) {
|
if (sharedViewModel.isEmvTrans().value == true) {
|
||||||
|
ProcessingScreen(state)
|
||||||
|
} else if(sharedViewModel.transactionsType.value == TransactionsType.SETTLEMENT) {
|
||||||
ProcessingScreen(settlementStatus.processingState)
|
ProcessingScreen(settlementStatus.processingState)
|
||||||
} else {
|
} else {
|
||||||
ProcessingScreen(state)
|
ProcessingScreen(state)
|
||||||
|
|||||||
@ -88,7 +88,7 @@ class TMSSetupsImpl : TMSSetups {
|
|||||||
ops.merchantName = m.name
|
ops.merchantName = m.name
|
||||||
ops.merchantAddress = m.address
|
ops.merchantAddress = m.address
|
||||||
ops.merchantPhoneNo = m.phone
|
ops.merchantPhoneNo = m.phone
|
||||||
ops.merchantMobileNo = m.mobile_phone
|
ops.merchantMobileNo = m.mobilePhone.orEmpty()
|
||||||
}
|
}
|
||||||
|
|
||||||
siriusResponse.address.takeIf { it.isNotEmpty() }?.let { ops.merchantAddress = it }
|
siriusResponse.address.takeIf { it.isNotEmpty() }?.let { ops.merchantAddress = it }
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package com.utsmyanmar.baselib.network.model.sirius;
|
package com.utsmyanmar.baselib.network.model.sirius;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
public class SiriusMerchant {
|
public class SiriusMerchant {
|
||||||
|
|
||||||
private String id;
|
private String id;
|
||||||
@ -16,7 +18,11 @@ public class SiriusMerchant {
|
|||||||
|
|
||||||
private String mobile;
|
private String mobile;
|
||||||
|
|
||||||
private String mobile_phone;
|
@SerializedName(value = "mobilePhone", alternate = {"mobile_phone"})
|
||||||
|
private String mobilePhone;
|
||||||
|
|
||||||
|
public SiriusMerchant() {
|
||||||
|
}
|
||||||
|
|
||||||
public SiriusMerchant(String id, String name, String description, String address,String address2,String phone,String mobile) {
|
public SiriusMerchant(String id, String name, String description, String address,String address2,String phone,String mobile) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
@ -28,6 +34,17 @@ public class SiriusMerchant {
|
|||||||
this.mobile = mobile;
|
this.mobile = mobile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SiriusMerchant(String id, String name, String description, String address, String address2, String phone, String mobile, String mobilePhone) {
|
||||||
|
this.id = id;
|
||||||
|
this.name = name;
|
||||||
|
this.description = description;
|
||||||
|
this.address = address;
|
||||||
|
this.address2 = address2;
|
||||||
|
this.phone = phone;
|
||||||
|
this.mobile = mobile;
|
||||||
|
this.mobilePhone = mobilePhone;
|
||||||
|
}
|
||||||
|
|
||||||
public void setAddress2(String address2) {
|
public void setAddress2(String address2) {
|
||||||
this.address2 = address2;
|
this.address2 = address2;
|
||||||
}
|
}
|
||||||
@ -52,12 +69,20 @@ public class SiriusMerchant {
|
|||||||
return mobile;
|
return mobile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getMobilePhone() {
|
||||||
|
return mobilePhone != null ? mobilePhone : mobile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMobilePhone(String mobilePhone) {
|
||||||
|
this.mobilePhone = mobilePhone;
|
||||||
|
}
|
||||||
|
|
||||||
public String getMobile_phone() {
|
public String getMobile_phone() {
|
||||||
return mobile_phone;
|
return getMobilePhone();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMobile_phone(String mobile_phone) {
|
public void setMobile_phone(String mobile_phone) {
|
||||||
this.mobile_phone = mobile_phone;
|
this.mobilePhone = mobile_phone;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setId(String id) {
|
public void setId(String id) {
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package com.utsmyanmar.paylibs.utils;
|
|||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import sunmi.sunmiui.utils.LogUtil;
|
import sunmi.sunmiui.utils.LogUtil;
|
||||||
|
import com.utsmyanmar.paylibs.utils.enums.CardScheme;
|
||||||
|
|
||||||
public class CardSchemeUtils {
|
public class CardSchemeUtils {
|
||||||
private static final String TAG = "CardSchemeUtil";
|
private static final String TAG = "CardSchemeUtil";
|
||||||
@ -25,19 +26,8 @@ public class CardSchemeUtils {
|
|||||||
} else if ("A000000524".equals(group)) {
|
} else if ("A000000524".equals(group)) {
|
||||||
accountType = AccountType.RPC.getValue();
|
accountType = AccountType.RPC.getValue();
|
||||||
} else if ("A000000333".equals(group)) {
|
} else if ("A000000333".equals(group)) {
|
||||||
if ("A000000333010101".equals(aid)) {
|
// Keep the scheme value used by host routing and receipt logic.
|
||||||
|
accountType = CardScheme.UPI.name;
|
||||||
accountType = AccountType.DD.getValue();
|
|
||||||
} else if ("A000000333010102".equals(aid)) {
|
|
||||||
|
|
||||||
accountType = AccountType.CC.getValue();
|
|
||||||
} else if ("A000000333010103".equals(aid)) {
|
|
||||||
|
|
||||||
accountType = AccountType.SCC.getValue();
|
|
||||||
} else if ("A000000333010101".equals(aid)) {
|
|
||||||
|
|
||||||
accountType = AccountType.EC.getValue();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
LogUtil.d(TAG, "Card accountType = " + accountType);
|
LogUtil.d(TAG, "Card accountType = " + accountType);
|
||||||
return accountType;
|
return accountType;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user