preauth void/ crashed case (assume socket close) / date & time showing actual value instead of mock now.
This commit is contained in:
parent
6f61532741
commit
ee91e6f787
@ -24,6 +24,8 @@ 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
|
||||||
@ -82,8 +84,8 @@ fun TransactionResultScreen(
|
|||||||
Spacer(modifier = Modifier.height(16.dp))
|
Spacer(modifier = Modifier.height(16.dp))
|
||||||
|
|
||||||
InfoCard(
|
InfoCard(
|
||||||
date = "26 May 2026",
|
date = "${state.payDetail?.transDate?.toFormattedDate()}",
|
||||||
time = "12:06 PM",
|
time = "${state.payDetail?.transTime?.toFormattedTime()}",
|
||||||
transactionId = state.payDetail?.referNo.toString()
|
transactionId = state.payDetail?.referNo.toString()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
18
app/src/main/java/com/mob/utsmyanmar/utils/Extensions.kt
Normal file
18
app/src/main/java/com/mob/utsmyanmar/utils/Extensions.kt
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
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!!)
|
||||||
|
}
|
||||||
@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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());
|
||||||
|
|||||||
@ -118,6 +118,7 @@ public class HostUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
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;
|
||||||
@ -142,11 +143,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,7 +198,8 @@ 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