Update InjectKeyFragment.java
This commit is contained in:
parent
3cb8fe218e
commit
4f28f7a118
@ -37,6 +37,7 @@ public class InjectKeyFragment extends DataBindingFragment {
|
||||
private DownloadFlow mDownloadFlow;
|
||||
private int keyIndexTmp = 8; // Default key index
|
||||
private final List<HostSelectionItem> hostSelectionItems = new ArrayList<>();
|
||||
private HostSelectionItem selectedHostSelectionItem;
|
||||
|
||||
@Override
|
||||
protected void initViewModel() {
|
||||
@ -128,6 +129,7 @@ public class InjectKeyFragment extends DataBindingFragment {
|
||||
}
|
||||
|
||||
private void applyHostSelection(@NonNull HostSelectionItem selectionItem) {
|
||||
selectedHostSelectionItem = selectionItem;
|
||||
binding.terminalIdValue.setText(getDisplayValue(selectionItem.terminalId));
|
||||
binding.merchantIdValue.setText(getDisplayValue(selectionItem.merchantId));
|
||||
}
|
||||
@ -156,14 +158,14 @@ public class InjectKeyFragment extends DataBindingFragment {
|
||||
|
||||
mDownloadFlow = DownloadFlow.getInstance();
|
||||
|
||||
String terminalId = SystemParamsOperation.getInstance().getTerminalId();
|
||||
String merchantId = SystemParamsOperation.getInstance().getMerchantId();
|
||||
String terminalId = selectedHostSelectionItem != null ? selectedHostSelectionItem.terminalId : null;
|
||||
String merchantId = selectedHostSelectionItem != null ? selectedHostSelectionItem.merchantId : null;
|
||||
String serialNo = TMSUtil.getInstance().getSerialNumber();
|
||||
|
||||
// Validate configuration
|
||||
if (TextUtils.isEmpty(terminalId) || TextUtils.isEmpty(merchantId) || TextUtils.isEmpty(serialNo)) {
|
||||
dismissLoadingDialog();
|
||||
showDeclineDialog("Please configure Terminal ID, Merchant ID first in TMS Configuration");
|
||||
showDeclineDialog("Please configure the selected Terminal ID and Merchant ID first in TMS Configuration");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user