Merge branch 'duel_settlement' into ESignature
This commit is contained in:
commit
bd90bc4a31
2
.gitignore
vendored
2
.gitignore
vendored
@ -21,3 +21,5 @@ local.properties
|
||||
/.idea
|
||||
/app/prod/release
|
||||
nexdlkey-lib/build/
|
||||
/nexsdk-lib
|
||||
/nexsdk-lib
|
||||
|
||||
@ -58,15 +58,12 @@ import com.utsmm.kbz.ui.navigation.NaviMainFragment;
|
||||
import com.utsmm.kbz.ui.navigation.NaviSetupFragment;
|
||||
import com.utsmm.kbz.util.ecr.CoreUtils;
|
||||
import com.utsmm.kbz.util.tms.TMSUtil;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import dagger.hilt.android.AndroidEntryPoint;
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
@ -76,7 +73,6 @@ import io.reactivex.rxjava3.disposables.Disposable;
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
import com.utsmyanmar.paylibs.utils.LogUtil;
|
||||
import com.utsmyanmar.paylibs.utils.params.Params;
|
||||
|
||||
/**
|
||||
* Main Activity handling application navigation and fragment interactions
|
||||
*/
|
||||
@ -165,7 +161,7 @@ public class MainActivity extends AppCompatActivity implements
|
||||
// SystemParamsOperation.getInstance().setTmsAddress("https://api-tms-uat.kbzbank.com:8443/sirius");
|
||||
// SystemParamsOperation.getInstance().setEReceiptAddress("https://api-tms-uat.kbzbank.com:8443/receipt");
|
||||
SystemParamsOperation.getInstance().setTmsAddress("https://sirius-nest.utsmyanmar.com/api/v1");
|
||||
SystemParamsOperation.getInstance().setEReceiptAddress("https://receipt-nest.utsmyanmar.com/api/v1");
|
||||
SystemParamsOperation.getInstance().setEReceiptAddress("https://receipt-nest.utsmyanmar.com");
|
||||
|
||||
PinPad pinPad = MyApplication.getInstance().deviceEngine.getPinPad();
|
||||
byte[] encryptedPIK = SystemParamsOperation.getInstance().getPIK();
|
||||
@ -480,6 +476,11 @@ public class MainActivity extends AppCompatActivity implements
|
||||
boolean hasPOS = intent.getBooleanExtra("AUTO_SETTLEMENT", false);
|
||||
boolean hasQR = intent.getBooleanExtra("AUTO_QR_SETTLEMENT", false);
|
||||
|
||||
if (!hasPOS && !hasQR) return;
|
||||
// Clear immediately so onResume won't re-trigger on next wake
|
||||
intent.removeExtra("AUTO_SETTLEMENT");
|
||||
intent.removeExtra("AUTO_QR_SETTLEMENT");
|
||||
|
||||
if (hasPOS) {
|
||||
PayDetail payDetail = (PayDetail) intent.getSerializableExtra("EXTRA_PAY_DETAIL");
|
||||
if (payDetail != null) {
|
||||
|
||||
@ -129,12 +129,49 @@ public class CardWaitingFragment extends DataBindingFragment implements DataBind
|
||||
}
|
||||
}
|
||||
|
||||
private void updateManualEntryVisibility() {
|
||||
TransactionsType type = sharedViewModel.transactionsType.getValue();
|
||||
boolean manualEntryStatus = SystemParamsOperation.getInstance().getManualEntryStatus();
|
||||
boolean preAuthManualEntryStatus = SystemParamsOperation.getInstance().getPreAuthManualEnabled();
|
||||
boolean preAuthCompManualEntryStatus = SystemParamsOperation.getInstance().getPreAuthCompleteManualEnabled();
|
||||
boolean preAuthCancelManualEntryStatus = SystemParamsOperation.getInstance().getPreAuthVoidManualEnabled();
|
||||
boolean show;
|
||||
if (type == null) {
|
||||
show = manualEntryStatus;
|
||||
} else {
|
||||
switch (type) {
|
||||
case SALE:
|
||||
case CASH_OUT:
|
||||
case CASH_DEPOSIT:
|
||||
case REFUND:
|
||||
case VOID:
|
||||
show = manualEntryStatus;
|
||||
break;
|
||||
case PRE_AUTH_SALE:
|
||||
show = preAuthManualEntryStatus;
|
||||
break;
|
||||
case PRE_AUTH_VOID:
|
||||
show = preAuthCancelManualEntryStatus;
|
||||
break;
|
||||
case PRE_AUTH_COMPLETE:
|
||||
show = preAuthCompManualEntryStatus;
|
||||
break;
|
||||
default:
|
||||
show = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
sharedViewModel.setManualEntryStatus(show);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
||||
resetUI();
|
||||
|
||||
updateManualEntryVisibility();
|
||||
|
||||
setToolBarTitleWithBackIcon(getResourceString(R.string.txt_title_card_capture));
|
||||
|
||||
delayFunctionCall(()-> {
|
||||
|
||||
@ -170,36 +170,6 @@ public class ProcessingCardFragment extends DataBindingFragment {
|
||||
transProcessViewModel.setTradeData(tradeData);
|
||||
pinPadViewModel.setTradeData(tradeData);
|
||||
|
||||
if(sharedViewModel.getTransactionsType().getValue() == TransactionsType.PRE_AUTH_VOID && SystemParamsOperation.getInstance().getPreAuthVoidManualEnabled() ) {
|
||||
|
||||
sharedViewModel.set_errorFragmentMsg(getResourceString(R.string.txt_alert_pre_auth_cancel));
|
||||
routeId = R.id.action_processingCardFragment_to_errorFragment;
|
||||
safeNavigateToRouteId();
|
||||
return;
|
||||
|
||||
}
|
||||
if(sharedViewModel.getTransactionsType().getValue() == TransactionsType.PRE_AUTH_SALE && SystemParamsOperation.getInstance().getPreAuthManualEnabled()) {
|
||||
|
||||
sharedViewModel.set_errorFragmentMsg(getResourceString(R.string.txt_alert_pre_auth_cancel));
|
||||
routeId = R.id.action_processingCardFragment_to_errorFragment;
|
||||
safeNavigateToRouteId();
|
||||
return;
|
||||
|
||||
}
|
||||
if(sharedViewModel.getTransactionsType().getValue() == TransactionsType.PRE_AUTH_COMPLETE && SystemParamsOperation.getInstance().getPreAuthCompleteManualEnabled()) {
|
||||
|
||||
sharedViewModel.set_errorFragmentMsg(getResourceString(R.string.txt_alert_pre_auth_cancel));
|
||||
routeId = R.id.action_processingCardFragment_to_errorFragment;
|
||||
safeNavigateToRouteId();
|
||||
return;
|
||||
|
||||
}
|
||||
// else if(sharedViewModel.transactionsType.getValue() == TransactionsType.REFUND) {
|
||||
// sharedViewModel.set_errorFragmentMsg(getResourceString(R.string.txt_card_not_supported));
|
||||
// routeId = R.id.action_processingCardFragment_to_errorFragment;
|
||||
//
|
||||
// }
|
||||
|
||||
sharedViewModel.setCardDataExist(true);
|
||||
|
||||
if(sharedViewModel.getTransMenu().getValue() != TransMenu.PRE_AUTH_FULL_VOID
|
||||
@ -259,32 +229,6 @@ public class ProcessingCardFragment extends DataBindingFragment {
|
||||
transProcessViewModel.setTradeData(tradeData);
|
||||
}
|
||||
|
||||
if(sharedViewModel.getTransactionsType().getValue() == TransactionsType.PRE_AUTH_VOID && SystemParamsOperation.getInstance().getPreAuthVoidManualEnabled() ) {
|
||||
|
||||
sharedViewModel.set_errorFragmentMsg(getResourceString(R.string.txt_alert_pre_auth_cancel));
|
||||
routeId = R.id.action_processingCardFragment_to_errorFragment;
|
||||
|
||||
}
|
||||
if(sharedViewModel.getTransactionsType().getValue() == TransactionsType.PRE_AUTH_SALE && SystemParamsOperation.getInstance().getPreAuthManualEnabled()) {
|
||||
|
||||
sharedViewModel.set_errorFragmentMsg(getResourceString(R.string.txt_alert_pre_auth_cancel));
|
||||
routeId = R.id.action_processingCardFragment_to_errorFragment;
|
||||
|
||||
|
||||
}
|
||||
if(sharedViewModel.getTransactionsType().getValue() == TransactionsType.PRE_AUTH_COMPLETE && SystemParamsOperation.getInstance().getPreAuthCompleteManualEnabled()) {
|
||||
|
||||
sharedViewModel.set_errorFragmentMsg(getResourceString(R.string.txt_alert_pre_auth_cancel));
|
||||
routeId = R.id.action_processingCardFragment_to_errorFragment;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// else if(sharedViewModel.transactionsType.getValue() == TransactionsType.REFUND) {
|
||||
// routeId = R.id.action_processingCardFragment_to_errorFragment;
|
||||
// }
|
||||
|
||||
sharedViewModel.setCardDataExist(true);
|
||||
|
||||
if(sharedViewModel.getTransMenu().getValue() != TransMenu.PRE_AUTH_FULL_VOID && sharedViewModel.getAmountExist().getValue() != null && !sharedViewModel.getAmountExist().getValue()) {
|
||||
@ -313,34 +257,6 @@ public class ProcessingCardFragment extends DataBindingFragment {
|
||||
|
||||
prepareEmvTransaction();
|
||||
|
||||
if(sharedViewModel.getTransactionsType().getValue() == TransactionsType.PRE_AUTH_VOID && SystemParamsOperation.getInstance().getPreAuthVoidManualEnabled() ) {
|
||||
|
||||
sharedViewModel.set_errorFragmentMsg(getResourceString(R.string.txt_alert_pre_auth_cancel));
|
||||
routeId = R.id.action_processingCardFragment_to_errorFragment;
|
||||
safeNavigateToRouteId();
|
||||
return;
|
||||
|
||||
}
|
||||
if(sharedViewModel.getTransactionsType().getValue() == TransactionsType.PRE_AUTH_SALE && SystemParamsOperation.getInstance().getPreAuthManualEnabled()) {
|
||||
|
||||
sharedViewModel.set_errorFragmentMsg(getResourceString(R.string.txt_alert_pre_auth_cancel));
|
||||
routeId = R.id.action_processingCardFragment_to_errorFragment;
|
||||
safeNavigateToRouteId();
|
||||
return;
|
||||
|
||||
|
||||
}
|
||||
if(sharedViewModel.getTransactionsType().getValue() == TransactionsType.PRE_AUTH_COMPLETE && SystemParamsOperation.getInstance().getPreAuthCompleteManualEnabled()) {
|
||||
|
||||
sharedViewModel.set_errorFragmentMsg(getResourceString(R.string.txt_alert_pre_auth_cancel));
|
||||
routeId = R.id.action_processingCardFragment_to_errorFragment;
|
||||
safeNavigateToRouteId();
|
||||
return;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
routeId = R.id.action_processingCardFragment_to_emvTransactionFragment;
|
||||
|
||||
} else {
|
||||
|
||||
@ -290,6 +290,7 @@
|
||||
<!-- Manual Entry minimalist outlined button -->
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/manualEntryCard"
|
||||
android:visibility="@{(sharedVM.ManualEntryStatus ?? false) ? View.VISIBLE : View.GONE}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="44dp"
|
||||
android:layout_marginStart="32dp"
|
||||
|
||||
@ -298,7 +298,7 @@ public abstract class EmvBaseViewModel extends BaseViewModel {
|
||||
LogUtil.d(TAG, "TransData :" + transData.getTransAmount());
|
||||
LogUtil.d(TAG, "start emv ");
|
||||
|
||||
emvHandler.emvDebugLog(true);
|
||||
emvHandler.emvDebugLog(false);
|
||||
emvHandler.emvProcess(transData, emvProcessListener);
|
||||
|
||||
|
||||
@ -1039,7 +1039,7 @@ public abstract class EmvBaseViewModel extends BaseViewModel {
|
||||
"9F2A", "9F26", "9F27", "9F10", "9F37", "9F36", "95", "9A", "9C", "9F02", "5F2A", "5F34", "82", "9F1A", //field 55 tag
|
||||
"9F03", "9F33", "4F", "9F08", "9F34", "9F35", "9F1E", "9F52","9F53", "84", "9F09", "9F41", //field55 tag
|
||||
"9F5B", "8A", "9B", "9F6E", "9F7C", "9F4C", "50", "9F12", "DF01", "9F63", "5F20", "9F0B", "9F42",
|
||||
"FF31", "9F7B", "8E","9F15", "9F01", "9F1B"
|
||||
"FF31", "9F7B", "8E","9F15", "9F01", "9F1B", "9F09"
|
||||
};
|
||||
|
||||
try {
|
||||
@ -1431,7 +1431,14 @@ private void configJcbContactlessParameter() {
|
||||
// emvHandler.setTlv(ByteUtils.hexString2ByteArray("DF8161"), ByteUtils.hexString2ByteArray("7F00"));
|
||||
byte[] tag9F53 = emvHandler.getJcbContactlessTIP();
|
||||
Log.d("nexgo", "getJcbContactlessTIP: tag9F53->:" + ByteUtils.byteArray2HexString(tag9F53));
|
||||
// if (tag9F53 != null) {
|
||||
// tag9F53[1] &= 0x7F; //disable issuer update
|
||||
// emvHandler.setJcbContactlessTIP(tag9F53);
|
||||
// Log.d("nexgo", "tag9F53->:" + ByteUtils.byteArray2HexString(tag9F53));
|
||||
//
|
||||
// }
|
||||
if (tag9F53 != null) {
|
||||
tag9F53[0] &= 0x73; //enable online pin
|
||||
tag9F53[1] &= 0x7F; //disable issuer update
|
||||
emvHandler.setJcbContactlessTIP(tag9F53);
|
||||
Log.d("nexgo", "tag9F53->:" + ByteUtils.byteArray2HexString(tag9F53));
|
||||
|
||||
@ -55,7 +55,27 @@ public class AuthorizationProcessUtil {
|
||||
if(field39.getDataStr().equals("000")){
|
||||
emvOnlineResult.setRejCode("00");
|
||||
}else{
|
||||
// emvOnlineResult.setRejCode(field39.getDataStr());
|
||||
switch (field39.getDataStr()) {
|
||||
case "103":
|
||||
emvOnlineResult.setRejCode("01");
|
||||
break;
|
||||
case "100":
|
||||
emvOnlineResult.setRejCode("05");
|
||||
break;
|
||||
case "117":
|
||||
emvOnlineResult.setRejCode("55");
|
||||
break;
|
||||
case "209":
|
||||
emvOnlineResult.setRejCode("04");
|
||||
break;
|
||||
case "104":
|
||||
emvOnlineResult.setRejCode("62");
|
||||
break;
|
||||
default:
|
||||
emvOnlineResult.setRejCode(field39.getDataStr());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -165,15 +185,24 @@ public class AuthorizationProcessUtil {
|
||||
importOnlineProcessStatus(SdkResult.Success,emvOnlineResult);
|
||||
|
||||
} else {
|
||||
equals = TextUtils.equals("3035", valueF039) || TextUtils.equals("3531", valueF039);
|
||||
// equals = TextUtils.equals("3035", valueF039) || TextUtils.equals("3531", valueF039);
|
||||
// if (equals) {
|
||||
// // Denial
|
||||
// importOnlineProcessStatus(SdkResult.Fail,emvOnlineResult);
|
||||
// } else {
|
||||
// // Failed
|
||||
// importOnlineProcessStatus(SdkResult.Fail,emvOnlineResult);
|
||||
// }
|
||||
equals = TextUtils.equals("3035", valueF039) || TextUtils.equals("3531", valueF039) || TextUtils.equals("313033", valueF039);
|
||||
if (equals) {
|
||||
// Denial
|
||||
importOnlineProcessStatus(SdkResult.Fail,emvOnlineResult);
|
||||
importOnlineProcessStatus(SdkResult.Success,emvOnlineResult);
|
||||
} else {
|
||||
// Failed
|
||||
importOnlineProcessStatus(SdkResult.Fail,emvOnlineResult);
|
||||
importOnlineProcessStatus(SdkResult.Success,emvOnlineResult);
|
||||
}
|
||||
}
|
||||
LogUtil.d(TAG,"Field 39 value:"+valueF039);
|
||||
LogUtil.e(Constant.TAG, "status: " );
|
||||
|
||||
String scriptResult = ByteUtil.bytes2HexStr(outData);
|
||||
|
||||
@ -45,7 +45,7 @@ public class SystemParamsSettings implements Serializable {
|
||||
// private String tmsAddress = "https://api-tms-uat.kbzbank.com:8443/sirius";
|
||||
// private String ereceiptAddress = "https://api-tms-uat.kbzbank.com:8443/receipt";
|
||||
private String tmsAddress = "https://sirius-nest.utsmyanmar.com/api/v1";
|
||||
private String ereceiptAddress = "https://receipt-nest.utsmyanmar.com/api/v1";
|
||||
private String ereceiptAddress = "https://receipt-nest.utsmyanmar.com";
|
||||
|
||||
private String binValues = "";
|
||||
private String restrictedBinValues = "";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user