preauth void/ crashed case (assume socket close) / date & time showing actual value instead of mock now.

This commit is contained in:
kizzy 2026-07-16 15:11:58 +07:00
parent 6f61532741
commit ee91e6f787
6 changed files with 29 additions and 7 deletions

View File

@ -24,6 +24,8 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import com.mob.utsmyanmar.ui.preview.P2Preview
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.print.PrintReceipt
import com.utsmyanmar.paylibs.utils.POSUtil
@ -82,8 +84,8 @@ fun TransactionResultScreen(
Spacer(modifier = Modifier.height(16.dp))
InfoCard(
date = "26 May 2026",
time = "12:06 PM",
date = "${state.payDetail?.transDate?.toFormattedDate()}",
time = "${state.payDetail?.transTime?.toFormattedTime()}",
transactionId = state.payDetail?.referNo.toString()
)

View 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!!)
}

View File

@ -503,7 +503,7 @@ public class ISOSocket {
LogUtil.e(Constant.TAG, "E:" + e.toString());
closeSocket();
// closeSocket();
if (isReversal) {
listener.onError(Constant.REVERSAL);
// listener.onError(new ReversalException());
@ -519,7 +519,7 @@ public class ISOSocket {
@Override
public void onComplete() {
LogUtil.d(Constant.TAG, "onComplete");
closeSocket();
// closeSocket();
isReversal = false;
listener.onComplete();
}

View File

@ -368,7 +368,7 @@ public class TransactionsOperation {
}
}
} else if (transactionsType == TransactionsType.PRE_AUTH_VOID) {
newPay.setCardType(oldPay.getCardType());
// newPay.setCardType(oldPay.getCardType());
newPay.setCustomOrderNo(oldPay.getVoucherNo());
newPay.setReferNo(oldPay.getReferNo());
newPay.setCardInfo(oldPay.getCardInfo());

View File

@ -118,6 +118,7 @@ public class HostUtils {
}
break;
case PRE_AUTH_VOID:
case PRE_AUTH_COMPLETE:
if (hostName == HostName.BPC) {
msgType = MessageType.FINANCIAL;
@ -142,11 +143,11 @@ public class HostUtils {
break;
case VOID:
case PRE_AUTH_VOID:
if(isVisaMaster) {
msgType = MessageType.REVERSAL;
break;
}
default:
msgType = MessageType.FINANCIAL;
break;

View File

@ -198,7 +198,8 @@ public class BitmapConfig {
public static final String CZ_REVERSAL="7020078000C08000";
public static final String CZ_BATCH_UPLOAD="703805800CC00010";
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_VOID="7038058008C00000";