modification for upi certification cases
This commit is contained in:
parent
8c151e3136
commit
20be06c7db
@ -495,6 +495,7 @@ public class MainActivity extends AppCompatActivity implements
|
|||||||
navigateToQRSettlementAfterPOS(intent);
|
navigateToQRSettlementAfterPOS(intent);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// POS had no data, go straight to QR if available
|
// POS had no data, go straight to QR if available
|
||||||
if (hasQR) {
|
if (hasQR) {
|
||||||
handleQRSettlement(intent);
|
handleQRSettlement(intent);
|
||||||
|
|||||||
@ -256,9 +256,20 @@ public class CardWaitingFragment extends DataBindingFragment implements DataBind
|
|||||||
|
|
||||||
HashSet<CardSlotTypeEnum> allType = new HashSet<>();
|
HashSet<CardSlotTypeEnum> allType = new HashSet<>();
|
||||||
allType.clear();
|
allType.clear();
|
||||||
|
// if(sharedViewModel.getIsSeePhone().getValue() != null && sharedViewModel.getIsSeePhone().getValue()) {
|
||||||
|
// allType.add(CardSlotTypeEnum.RF);
|
||||||
|
// waitTimeout = 20;
|
||||||
|
// } else {
|
||||||
|
// allType.add(CardSlotTypeEnum.ICC1);
|
||||||
|
// allType.add(CardSlotTypeEnum.RF);
|
||||||
|
// allType.add(CardSlotTypeEnum.SWIPE);
|
||||||
|
// }
|
||||||
if(sharedViewModel.getIsSeePhone().getValue() != null && sharedViewModel.getIsSeePhone().getValue()) {
|
if(sharedViewModel.getIsSeePhone().getValue() != null && sharedViewModel.getIsSeePhone().getValue()) {
|
||||||
allType.add(CardSlotTypeEnum.RF);
|
allType.add(CardSlotTypeEnum.RF);
|
||||||
waitTimeout = 20;
|
waitTimeout = 20;
|
||||||
|
} else if(!SystemParamsOperation.getInstance().isNfcEnabled()) {
|
||||||
|
allType.add(CardSlotTypeEnum.ICC1);
|
||||||
|
allType.add(CardSlotTypeEnum.SWIPE);
|
||||||
} else {
|
} else {
|
||||||
allType.add(CardSlotTypeEnum.ICC1);
|
allType.add(CardSlotTypeEnum.ICC1);
|
||||||
allType.add(CardSlotTypeEnum.RF);
|
allType.add(CardSlotTypeEnum.RF);
|
||||||
|
|||||||
@ -78,13 +78,21 @@ public class EmvTransactionProcessViewModel extends EmvBaseViewModel implements
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
if (mPayDetail.PINCipher != null && !mPayDetail.PINCipher.isEmpty()) {
|
LogUtil.d("EmvTransactionProcessViewModel", "mPayDetail" + mPayDetail.PINCipher);
|
||||||
|
LogUtil.d("EmvTransactionProcessViewModel", "is offline pin entered " + isOfflinePinEntered);
|
||||||
|
|
||||||
|
if ((mPayDetail.PINCipher != null && !mPayDetail.PINCipher.isEmpty())) {
|
||||||
|
LogUtil.d("EmvTransactionProcessViewModel", "condition 1");
|
||||||
emvHandler.onSetPinInputResponse(true, false);
|
emvHandler.onSetPinInputResponse(true, false);
|
||||||
} else if(isOfflinePinEntered){
|
} else if(isOfflinePinEntered){
|
||||||
|
LogUtil.d("EmvTransactionProcessViewModel", "condition 2");
|
||||||
emvHandler.onSetPinInputResponse(true, false);
|
emvHandler.onSetPinInputResponse(true, false);
|
||||||
}else {
|
}else {
|
||||||
|
LogUtil.d("EmvTransactionProcessViewModel", "condition 3");
|
||||||
|
|
||||||
emvHandler.onSetPinInputResponse(true, true);
|
emvHandler.onSetPinInputResponse(true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (transType.getValue() == TransactionsType.PRE_AUTH_COMPLETE || transType.getValue() == TransactionsType.PRE_AUTH_VOID || transType.getValue() == TransactionsType.REFUND) {
|
if (transType.getValue() == TransactionsType.PRE_AUTH_COMPLETE || transType.getValue() == TransactionsType.PRE_AUTH_VOID || transType.getValue() == TransactionsType.REFUND) {
|
||||||
emvResultStatus.postValue(EmvResultStatus.ON_NEXT_SCREEN);
|
emvResultStatus.postValue(EmvResultStatus.ON_NEXT_SCREEN);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -212,6 +212,7 @@ public abstract class EmvBaseViewModel extends BaseViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void startProcess() {
|
public void startProcess() {
|
||||||
|
isOfflinePinEntered = false;
|
||||||
initData();
|
initData();
|
||||||
|
|
||||||
// Check if initialization was successful
|
// Check if initialization was successful
|
||||||
@ -489,8 +490,15 @@ public abstract class EmvBaseViewModel extends BaseViewModel {
|
|||||||
if (retCode == SdkResult.Success) {
|
if (retCode == SdkResult.Success) {
|
||||||
LogUtil.d(TAG, "Success");
|
LogUtil.d(TAG, "Success");
|
||||||
if(isOnlinePin) {
|
if(isOnlinePin) {
|
||||||
|
if(ByteUtil.bytes2HexStr(data).equals("0000000000000000")) {
|
||||||
|
mPayDetail.setPINCipher("");
|
||||||
|
} else {
|
||||||
mPayDetail.setPINCipher(ByteUtil.bytes2HexStr(data));
|
mPayDetail.setPINCipher(ByteUtil.bytes2HexStr(data));
|
||||||
}
|
}
|
||||||
|
// mPayDetail.setPINCipher(ByteUtil.bytes2HexStr(data));
|
||||||
|
} else {
|
||||||
|
isOfflinePinEntered = true;
|
||||||
|
}
|
||||||
mHandler.obtainMessage(PIN_CLICK_CONFIRM).sendToTarget();
|
mHandler.obtainMessage(PIN_CLICK_CONFIRM).sendToTarget();
|
||||||
} else if (retCode == SdkResult.Fail) {
|
} else if (retCode == SdkResult.Fail) {
|
||||||
LogUtil.d(TAG, "Failure");
|
LogUtil.d(TAG, "Failure");
|
||||||
@ -519,8 +527,9 @@ public abstract class EmvBaseViewModel extends BaseViewModel {
|
|||||||
LogUtil.d(TAG, "on click cancel");
|
LogUtil.d(TAG, "on click cancel");
|
||||||
mHandler.obtainMessage(PIN_CLICK_CANCEL).sendToTarget();
|
mHandler.obtainMessage(PIN_CLICK_CANCEL).sendToTarget();
|
||||||
} else if (keyCode == PinPadKeyCode.KEYCODE_CONFIRM) {
|
} else if (keyCode == PinPadKeyCode.KEYCODE_CONFIRM) {
|
||||||
LogUtil.d(TAG, "on click confirm");
|
// Wait for onInputResult() so the PIN cipher / offline PIN state is ready
|
||||||
mHandler.obtainMessage(PIN_CLICK_CONFIRM).sendToTarget();
|
// before EmvTransactionProcessViewModel handles PIN confirmation.
|
||||||
|
LogUtil.d(TAG, "on click confirm - waiting for input result");
|
||||||
} else {
|
} else {
|
||||||
LogUtil.d(TAG, "on click number");
|
LogUtil.d(TAG, "on click number");
|
||||||
mHandler.obtainMessage(PIN_CLICK_NUMBER, pinEnterCount, 0).sendToTarget();
|
mHandler.obtainMessage(PIN_CLICK_NUMBER, pinEnterCount, 0).sendToTarget();
|
||||||
|
|||||||
@ -52,8 +52,12 @@ public class AuthorizationProcessUtil {
|
|||||||
|
|
||||||
if(field39 != null && field39.getDataStr() != null ) {
|
if(field39 != null && field39.getDataStr() != null ) {
|
||||||
LogUtil.d(TAG,"Field 39:"+field39.getDataStr());
|
LogUtil.d(TAG,"Field 39:"+field39.getDataStr());
|
||||||
|
if(field39.getDataStr().equals("000")){
|
||||||
|
emvOnlineResult.setRejCode("00");
|
||||||
|
}else{
|
||||||
emvOnlineResult.setRejCode(field39.getDataStr());
|
emvOnlineResult.setRejCode(field39.getDataStr());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(field55 != null && field55.getDataStr() != null) {
|
if(field55 != null && field55.getDataStr() != null) {
|
||||||
LogUtil.d(TAG,"Field 55:"+field55.getDataStr());
|
LogUtil.d(TAG,"Field 55:"+field55.getDataStr());
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user