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