2nd fix for see phone
This commit is contained in:
parent
2c7bc3a3d5
commit
de296b3b42
@ -148,6 +148,9 @@ public class CardWaitingFragment extends DataBindingFragment implements DataBind
|
||||
if(sharedViewModel.getIsFallback().getValue() != null && sharedViewModel.getIsFallback().getValue()) {
|
||||
cardReadViewModel.setCheckCardAlertMsg("Fallback!\nPlease stripe!",false);
|
||||
setupCardReadProcess(true);
|
||||
}else if(sharedViewModel.getIsSeePhone().getValue() != null && sharedViewModel.getIsSeePhone().getValue()) {
|
||||
cardReadViewModel.setCheckCardAlertMsg("Please Tap!",false);
|
||||
setupCardReadProcess(true);
|
||||
} else {
|
||||
setupCardReadProcess(false);
|
||||
}
|
||||
@ -230,6 +233,8 @@ public class CardWaitingFragment extends DataBindingFragment implements DataBind
|
||||
|
||||
|
||||
private void initCheckCard(boolean isFallback) {
|
||||
|
||||
int waitTimeout = cardWaitingTimeOut + 5;
|
||||
// int allType = AidlConstants.CardType.NFC.getValue() | AidlConstants.CardType.IC.getValue() | AidlConstants.CardType.MAGNETIC.getValue();
|
||||
//
|
||||
//
|
||||
@ -244,12 +249,18 @@ public class CardWaitingFragment extends DataBindingFragment implements DataBind
|
||||
// }
|
||||
|
||||
HashSet<CardSlotTypeEnum> allType = new HashSet<>();
|
||||
allType.add(CardSlotTypeEnum.ICC1);
|
||||
allType.add(CardSlotTypeEnum.RF);
|
||||
if(sharedViewModel.getIsSeePhone().getValue() != null && sharedViewModel.getIsSeePhone().getValue()) {
|
||||
allType.add(CardSlotTypeEnum.RF);
|
||||
waitTimeout = 20;
|
||||
} else {
|
||||
allType.add(CardSlotTypeEnum.ICC1);
|
||||
allType.add(CardSlotTypeEnum.RF);
|
||||
}
|
||||
|
||||
// int allType = AidlConstants.CardType.IC.getValue() | AidlConstants.CardType.MAGNETIC.getValue();
|
||||
|
||||
|
||||
cardReadViewModel.startCheckXProcessNex(allType, cardWaitingTimeOut + 5, new CheckCardResultX() {
|
||||
cardReadViewModel.startCheckXProcessNex(allType, waitTimeout, new CheckCardResultX() {
|
||||
@Override
|
||||
public void onSuccess(CardTypeX cardType, boolean isMPU) {
|
||||
LogUtil.d(TAG,"**** on success *****");
|
||||
|
||||
@ -200,7 +200,7 @@ public class EmvTransactionFragment extends DataBindingFragment {
|
||||
isCardInserted(new CardDetectCallback() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
sharedViewModel.setIsFallback(true);
|
||||
sharedViewModel.setIsSeePhone(true);
|
||||
navigateToCheckCard();
|
||||
}
|
||||
});
|
||||
|
||||
@ -162,7 +162,7 @@ public class EmvTransactionProcessViewModel extends EmvBaseViewModel implements
|
||||
handleTransactionFail(msg.arg1, msg.obj.toString());
|
||||
break;
|
||||
case EMV_TRY_AGAIN:
|
||||
emvResultStatus.postValue(EmvResultStatus.TRY_AGAIN);
|
||||
emvResultStatus.postValue(EmvResultStatus.READ_CARD);
|
||||
break;
|
||||
case EMV_CONFIRM_CODE_VERIFY:
|
||||
emvResultStatus.postValue(EmvResultStatus.CONFIRM_CODE_VERIFY);
|
||||
|
||||
@ -163,6 +163,7 @@ public class SharedViewModel extends ViewModel {
|
||||
public SingleLiveEvent<String> loadingMsg = new SingleLiveEvent<>();
|
||||
|
||||
private SingleLiveEvent<Boolean> isFallback = new SingleLiveEvent<>();
|
||||
private SingleLiveEvent<Boolean> isSeePhone = new SingleLiveEvent<>();
|
||||
|
||||
private SingleLiveEvent<Boolean> _isCardDataExist = new SingleLiveEvent<>();
|
||||
|
||||
@ -232,6 +233,10 @@ public class SharedViewModel extends ViewModel {
|
||||
|
||||
public SingleLiveEvent<Boolean> getIsFallback() { return isFallback;}
|
||||
|
||||
public void setIsSeePhone(boolean status) { isSeePhone.setValue(status);}
|
||||
|
||||
public SingleLiveEvent<Boolean> getIsSeePhone() { return isSeePhone;}
|
||||
|
||||
public void setCardDataExist(boolean exist) { _isCardDataExist.setValue(exist);}
|
||||
|
||||
public SingleLiveEvent<Boolean> getCardDataExist() { return _isCardDataExist; }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user