restricted_bin_list
This commit is contained in:
parent
75fb969740
commit
8f218b5c99
@ -645,6 +645,9 @@ public class TMSSetupsImpl implements TMSSetups{
|
||||
else if(TextUtils.equals(name,"bin_list")) {
|
||||
SystemParamsOperation.getInstance().setBinValue(data);
|
||||
}
|
||||
else if (TextUtils.equals(name, "restricted_bin_list")) {
|
||||
SystemParamsOperation.getInstance().setRestrictedBinValue(data);
|
||||
}
|
||||
else if(TextUtils.equals(name, "printer_enabled")){
|
||||
SystemParamsOperation.getInstance().setPrinterEnabled(parseBoolean(data));
|
||||
}else if(TextUtils.equals(name, "is_duel_currency")){
|
||||
|
||||
@ -75,4 +75,13 @@ public class TerminalUtil {
|
||||
else
|
||||
return binParser(SystemParamsOperation.getInstance().getBinValues());
|
||||
}
|
||||
|
||||
public List<String> getRestrictedBinList() {
|
||||
if (SystemParamsOperation.getInstance().getRestrictedBinValues() == null
|
||||
|| SystemParamsOperation.getInstance().getRestrictedBinValues().isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
} else {
|
||||
return binParser(SystemParamsOperation.getInstance().getRestrictedBinValues());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -179,7 +179,6 @@ public abstract class EmvBaseViewModel extends BaseViewModel {
|
||||
protected boolean isSecondCall = false;
|
||||
protected int mProcessStep;
|
||||
protected int mAppSelect = 0;
|
||||
|
||||
private static final String[] RESTRICTED_BINS = {"624430",
|
||||
"624431",
|
||||
"624445",
|
||||
@ -192,9 +191,7 @@ public abstract class EmvBaseViewModel extends BaseViewModel {
|
||||
"62441900",
|
||||
"62441901"
|
||||
};
|
||||
|
||||
private boolean isMPU_UPIContactless = false;
|
||||
|
||||
private boolean mMPUContactlessConfigured = false;
|
||||
private Looper mLooper = Looper.getMainLooper();
|
||||
private final Handler mHandler = new Handler(mLooper) {
|
||||
@ -540,7 +537,8 @@ public abstract class EmvBaseViewModel extends BaseViewModel {
|
||||
|
||||
private boolean isRestrictedBin(String cardNo) {
|
||||
if (cardNo == null || cardNo.isEmpty()) return false;
|
||||
for (String bin : RESTRICTED_BINS) {
|
||||
List<String> restrictedBins = TerminalUtil.getInstance().getRestrictedBinList();
|
||||
for (String bin : restrictedBins) {
|
||||
if (cardNo.startsWith(bin)) {
|
||||
LogUtil.d(TAG, "isRestrictedBin: matched BIN " + bin);
|
||||
return true;
|
||||
|
||||
@ -1536,6 +1536,17 @@ public class SystemParamsOperation {
|
||||
return params.getBinValues();
|
||||
}
|
||||
|
||||
public void setRestrictedBinValue(String value) {
|
||||
SystemParamsSettings params = getSystemParamsSettings();
|
||||
params.setRestrictedBinValues(value);
|
||||
saveSystemParamsSettings(params);
|
||||
}
|
||||
|
||||
public String getRestrictedBinValues() {
|
||||
SystemParamsSettings params = getSystemParamsSettings();
|
||||
return params.getRestrictedBinValues();
|
||||
}
|
||||
|
||||
public String getSecHostMerchantId() {
|
||||
SystemParamsSettings params = getSystemParamsSettings();
|
||||
return params.getSecHostMerchantId();
|
||||
|
||||
@ -44,6 +44,7 @@ public class SystemParamsSettings implements Serializable {
|
||||
private String ereceiptAddress = "https://api-tms.kbzbank.com/receipt";
|
||||
|
||||
private String binValues = "";
|
||||
private String restrictedBinValues = "";
|
||||
|
||||
private String terminalName = "";
|
||||
|
||||
@ -363,6 +364,14 @@ public class SystemParamsSettings implements Serializable {
|
||||
return this.binValues;
|
||||
}
|
||||
|
||||
protected void setRestrictedBinValues(String restrictedBinValues) {
|
||||
this.restrictedBinValues = restrictedBinValues;
|
||||
}
|
||||
|
||||
protected String getRestrictedBinValues() {
|
||||
return this.restrictedBinValues;
|
||||
}
|
||||
|
||||
protected void setDisabledMessage(String disabledMessage) {
|
||||
this.disabledMessage = disabledMessage;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user