sec host
This commit is contained in:
parent
999b26de2b
commit
e4bb3df554
@ -149,7 +149,7 @@ public class HostConfigFragment extends DataBindingFragment {
|
|||||||
float offScreenDistance = cardTop + cardHeight + 80f;
|
float offScreenDistance = cardTop + cardHeight + 80f;
|
||||||
|
|
||||||
rollUpAnimator = ObjectAnimator.ofFloat(hostCardView, View.TRANSLATION_Y, 0f, -offScreenDistance);
|
rollUpAnimator = ObjectAnimator.ofFloat(hostCardView, View.TRANSLATION_Y, 0f, -offScreenDistance);
|
||||||
rollUpAnimator.setDuration(2500);
|
rollUpAnimator.setDuration(3000);
|
||||||
rollUpAnimator.setInterpolator(new LinearInterpolator());
|
rollUpAnimator.setInterpolator(new LinearInterpolator());
|
||||||
rollUpAnimator.setRepeatMode(ValueAnimator.RESTART);
|
rollUpAnimator.setRepeatMode(ValueAnimator.RESTART);
|
||||||
rollUpAnimator.setRepeatCount(ValueAnimator.INFINITE);
|
rollUpAnimator.setRepeatCount(ValueAnimator.INFINITE);
|
||||||
|
|||||||
@ -40,6 +40,16 @@ public class HostConfigViewModel extends ViewModel {
|
|||||||
public MutableLiveData<String> secHostPrimaryPort = new MutableLiveData<>();
|
public MutableLiveData<String> secHostPrimaryPort = new MutableLiveData<>();
|
||||||
public MutableLiveData<String> secHostSecondaryIp = new MutableLiveData<>();
|
public MutableLiveData<String> secHostSecondaryIp = new MutableLiveData<>();
|
||||||
public MutableLiveData<String> secHostSecondaryPort = new MutableLiveData<>();
|
public MutableLiveData<String> secHostSecondaryPort = new MutableLiveData<>();
|
||||||
|
public MutableLiveData<String> secHostCurrency = new MutableLiveData<>();
|
||||||
|
|
||||||
|
// Third Host
|
||||||
|
public MutableLiveData<String> thirdHostName = new MutableLiveData<>();
|
||||||
|
public MutableLiveData<String> thirdHostShortCode = new MutableLiveData<>();
|
||||||
|
public MutableLiveData<String> thirdHostPrimaryIp = new MutableLiveData<>();
|
||||||
|
public MutableLiveData<String> thirdHostPrimaryPort = new MutableLiveData<>();
|
||||||
|
public MutableLiveData<String> thirdHostSecondaryIp = new MutableLiveData<>();
|
||||||
|
public MutableLiveData<String> thirdHostSecondaryPort = new MutableLiveData<>();
|
||||||
|
public MutableLiveData<String> thirdHostCurrency = new MutableLiveData<>();
|
||||||
|
|
||||||
public MutableLiveData<String> terminalName = new MutableLiveData<>();
|
public MutableLiveData<String> terminalName = new MutableLiveData<>();
|
||||||
|
|
||||||
@ -49,7 +59,7 @@ public class HostConfigViewModel extends ViewModel {
|
|||||||
merchantName.setValue(sp.getMerchantName());
|
merchantName.setValue(sp.getMerchantName());
|
||||||
merchantPhone.setValue(sp.getMerchantPhoneNo());
|
merchantPhone.setValue(sp.getMerchantPhoneNo());
|
||||||
merchantAddress1.setValue(wrapMerchantAddress(sp.getMerchantAddress()));
|
merchantAddress1.setValue(wrapMerchantAddress(sp.getMerchantAddress()));
|
||||||
terminalName.setValue(sp.getTerminalName());
|
terminalName.setValue(wrapTerminalName(sp.getTerminalName()));
|
||||||
|
|
||||||
// PRIMARY HOST
|
// PRIMARY HOST
|
||||||
hostName.setValue(sp.getHostName());
|
hostName.setValue(sp.getHostName());
|
||||||
@ -64,7 +74,7 @@ public class HostConfigViewModel extends ViewModel {
|
|||||||
secondaryIp.setValue(sec[0]);
|
secondaryIp.setValue(sec[0]);
|
||||||
secondaryPort.setValue(sec[1]);
|
secondaryPort.setValue(sec[1]);
|
||||||
|
|
||||||
currencyCode.setValue(sp.getCurrencyType() != null ? sp.getCurrencyType().toString() : "");
|
currencyCode.setValue(normalizeCurrency(sp.getCurrencyType() != null ? sp.getCurrencyType().toString() : ""));
|
||||||
|
|
||||||
|
|
||||||
if (sp.getSecHostName() != null && !sp.getSecHostName().isEmpty()) {
|
if (sp.getSecHostName() != null && !sp.getSecHostName().isEmpty()) {
|
||||||
@ -81,6 +91,46 @@ public class HostConfigViewModel extends ViewModel {
|
|||||||
String[] shs = split(sp.getSecHostSecIpAddress());
|
String[] shs = split(sp.getSecHostSecIpAddress());
|
||||||
secHostSecondaryIp.setValue(shs[0]);
|
secHostSecondaryIp.setValue(shs[0]);
|
||||||
secHostSecondaryPort.setValue(shs[1]);
|
secHostSecondaryPort.setValue(shs[1]);
|
||||||
|
secHostCurrency.setValue(normalizeCurrency(sp.getSecHostCurrency()));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sp.getThirdHostName() != null && !sp.getThirdHostName().isEmpty()) {
|
||||||
|
thirdHostName.setValue(sp.getThirdHostName());
|
||||||
|
thirdHostShortCode.setValue(sp.getThirdHostShortCode());
|
||||||
|
|
||||||
|
String[] thp = split(sp.getThirdHostIpAddress());
|
||||||
|
thirdHostPrimaryIp.setValue(thp[0]);
|
||||||
|
thirdHostPrimaryPort.setValue(thp[1]);
|
||||||
|
|
||||||
|
String[] ths = split(sp.getThirdHostSecIpAddress());
|
||||||
|
thirdHostSecondaryIp.setValue(ths[0]);
|
||||||
|
thirdHostSecondaryPort.setValue(ths[1]);
|
||||||
|
thirdHostCurrency.setValue(normalizeCurrency(sp.getThirdHostCurrency()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private String normalizeCurrency(String raw) {
|
||||||
|
if (TextUtils.isEmpty(raw)) return "";
|
||||||
|
String value = raw.trim().toUpperCase();
|
||||||
|
switch (value) {
|
||||||
|
case "104":
|
||||||
|
case "MMK":
|
||||||
|
return "MMK";
|
||||||
|
case "840":
|
||||||
|
case "USD":
|
||||||
|
return "USD";
|
||||||
|
case "156":
|
||||||
|
case "CNY":
|
||||||
|
case "RMB":
|
||||||
|
return "CNY";
|
||||||
|
case "764":
|
||||||
|
case "THB":
|
||||||
|
return "THB";
|
||||||
|
case "643":
|
||||||
|
case "RUB":
|
||||||
|
return "RUB";
|
||||||
|
default:
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,6 +150,20 @@ public class HostConfigViewModel extends ViewModel {
|
|||||||
return TextUtils.join("\n", lines);
|
return TextUtils.join("\n", lines);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String wrapTerminalName(String name) {
|
||||||
|
if (TextUtils.isEmpty(name)) return "";
|
||||||
|
|
||||||
|
String formattedName = name
|
||||||
|
.replace("\\r\\n", "\n")
|
||||||
|
.replace("\\n", "\n")
|
||||||
|
.replace("\r\n", "\n")
|
||||||
|
.trim();
|
||||||
|
|
||||||
|
List<String> lines = wrapAddressText(formattedName, 29);
|
||||||
|
|
||||||
|
return TextUtils.join("\n", lines);
|
||||||
|
}
|
||||||
|
|
||||||
private String[] split(String raw) {
|
private String[] split(String raw) {
|
||||||
if (raw == null || raw.trim().isEmpty()) {
|
if (raw == null || raw.trim().isEmpty()) {
|
||||||
return new String[]{"", ""};
|
return new String[]{"", ""};
|
||||||
|
|||||||
@ -103,6 +103,14 @@ public class TMSSetupsImpl implements TMSSetups{
|
|||||||
SystemParamsOperation.getInstance().setIpAddress("");
|
SystemParamsOperation.getInstance().setIpAddress("");
|
||||||
SystemParamsOperation.getInstance().setSecIpAddress("");
|
SystemParamsOperation.getInstance().setSecIpAddress("");
|
||||||
|
|
||||||
|
SystemParamsOperation.getInstance().setThirdHostName("");
|
||||||
|
SystemParamsOperation.getInstance().setThirdHostTerminalId("");
|
||||||
|
SystemParamsOperation.getInstance().setThirdHostMerchantId("");
|
||||||
|
SystemParamsOperation.getInstance().setThirdHostIpAddress("");
|
||||||
|
SystemParamsOperation.getInstance().setThirdHostSecIpAddress("");
|
||||||
|
SystemParamsOperation.getInstance().setThirdHostShortCode("");
|
||||||
|
SystemParamsOperation.getInstance().setThirdHostCurrency("");
|
||||||
|
|
||||||
SystemParamsOperation.getInstance().setSecHostName("");
|
SystemParamsOperation.getInstance().setSecHostName("");
|
||||||
SystemParamsOperation.getInstance().setSecHostTerminalId("");
|
SystemParamsOperation.getInstance().setSecHostTerminalId("");
|
||||||
SystemParamsOperation.getInstance().setSecHostMerchantId("");
|
SystemParamsOperation.getInstance().setSecHostMerchantId("");
|
||||||
@ -187,120 +195,96 @@ public class TMSSetupsImpl implements TMSSetups{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!siriusHosts.isEmpty()) {
|
if(!siriusHosts.isEmpty()) {
|
||||||
|
SiriusHost qrHost = null;
|
||||||
|
ArrayList<SiriusHost> cardHosts = new ArrayList<>();
|
||||||
|
|
||||||
for (SiriusHost siriusHost: siriusHosts) {
|
for (SiriusHost siriusHost: siriusHosts) {
|
||||||
|
if ("QR".equalsIgnoreCase(siriusHost.getTyp())) {
|
||||||
|
if (qrHost == null) qrHost = siriusHost;
|
||||||
|
} else {
|
||||||
|
cardHosts.add(siriusHost);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if( siriusHost.getTyp().equals("QR")) {
|
// For dual-currency card flow, prefer MMK as PRIMARY HOST.
|
||||||
|
if (cardHosts.size() >= 2) {
|
||||||
|
SiriusHost first = cardHosts.get(0);
|
||||||
|
SiriusHost second = cardHosts.get(1);
|
||||||
|
boolean firstIsMMK = "MMK".equalsIgnoreCase(first.getCurrency());
|
||||||
|
boolean secondIsMMK = "MMK".equalsIgnoreCase(second.getCurrency());
|
||||||
|
if (!firstIsMMK && secondIsMMK) {
|
||||||
|
cardHosts.set(0, second);
|
||||||
|
cardHosts.set(1, first);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SystemParamsOperation.getInstance().setSecHostId(siriusHost.getId());
|
// PRIMARY HOST (Card #1)
|
||||||
SystemParamsOperation.getInstance().setSecHostName(siriusHost.getName());
|
if (!cardHosts.isEmpty()) {
|
||||||
SystemParamsOperation.getInstance().setSecHostTerminalId(siriusHost.getTid());
|
SiriusHost primaryCard = cardHosts.get(0);
|
||||||
SystemParamsOperation.getInstance().setSecHostMerchantId(extractDigits(siriusHost.getMid()));
|
SystemParamsOperation.getInstance().setHostName(primaryCard.getName() == null ? "" : primaryCard.getName());
|
||||||
SystemParamsOperation.getInstance().setShortCode(siriusHost.getShortCode());
|
SystemParamsOperation.getInstance().setTerminalId(primaryCard.getTid() == null ? "" : primaryCard.getTid());
|
||||||
|
SystemParamsOperation.getInstance().setMerchantId(primaryCard.getMid() == null ? "" : primaryCard.getMid());
|
||||||
|
|
||||||
|
String primaryIp = primaryCard.getPrimaryIP();
|
||||||
|
SystemParamsOperation.getInstance().setIpAddress(primaryIp != null && primaryIp.contains(":") ? primaryIp.trim() : "");
|
||||||
|
|
||||||
if (siriusHost.getPrimaryIP().contains(":")) {
|
String secondaryIp = primaryCard.getSecondaryIP();
|
||||||
|
SystemParamsOperation.getInstance().setSecIpAddress(secondaryIp != null && secondaryIp.contains(":") ? secondaryIp.trim() : "");
|
||||||
|
|
||||||
SystemParamsOperation.getInstance().setSecHostIpAddress(siriusHost.getPrimaryIP().trim()+"/");
|
if (!TextUtils.isEmpty(primaryCard.getCurrency())) {
|
||||||
|
SystemParamsOperation.getInstance().setCurrencyType(currencyTextToCurrencyType(primaryCard.getCurrency()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} else if(siriusHost.getPrimaryIP().trim().isEmpty()) {
|
// SECONDARY HOST (Card #2)
|
||||||
|
if (cardHosts.size() > 1) {
|
||||||
|
SiriusHost secondaryCard = cardHosts.get(1);
|
||||||
|
SystemParamsOperation.getInstance().setThirdHostName(secondaryCard.getName() == null ? "" : secondaryCard.getName());
|
||||||
|
SystemParamsOperation.getInstance().setThirdHostTerminalId(secondaryCard.getTid() == null ? "" : secondaryCard.getTid());
|
||||||
|
SystemParamsOperation.getInstance().setThirdHostMerchantId(secondaryCard.getMid() == null ? "" : secondaryCard.getMid());
|
||||||
|
SystemParamsOperation.getInstance().setThirdHostShortCode(secondaryCard.getShortCode() == null ? "" : secondaryCard.getShortCode());
|
||||||
|
|
||||||
|
String thirdPrimaryIp = secondaryCard.getPrimaryIP();
|
||||||
|
SystemParamsOperation.getInstance().setThirdHostIpAddress(thirdPrimaryIp != null && thirdPrimaryIp.contains(":") ? thirdPrimaryIp.trim() : "");
|
||||||
|
|
||||||
|
String thirdSecondaryIp = secondaryCard.getSecondaryIP();
|
||||||
|
SystemParamsOperation.getInstance().setThirdHostSecIpAddress(thirdSecondaryIp != null && thirdSecondaryIp.contains(":") ? thirdSecondaryIp.trim() : "");
|
||||||
|
|
||||||
|
if (!TextUtils.isEmpty(secondaryCard.getCurrency())) {
|
||||||
|
SystemParamsOperation.getInstance().setThirdHostCurrency(currencyTextToCode(secondaryCard.getCurrency()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// QR HOST
|
||||||
|
if (qrHost != null) {
|
||||||
|
SystemParamsOperation.getInstance().setSecHostId(qrHost.getId());
|
||||||
|
SystemParamsOperation.getInstance().setSecHostName(qrHost.getName());
|
||||||
|
SystemParamsOperation.getInstance().setSecHostTerminalId(qrHost.getTid() == null ? "" : qrHost.getTid());
|
||||||
|
SystemParamsOperation.getInstance().setSecHostMerchantId(qrHost.getMid() == null ? "" : extractDigits(qrHost.getMid()));
|
||||||
|
SystemParamsOperation.getInstance().setShortCode(qrHost.getShortCode());
|
||||||
|
|
||||||
|
String qrPrimaryIp = qrHost.getPrimaryIP();
|
||||||
|
if (qrPrimaryIp != null && qrPrimaryIp.contains(":")) {
|
||||||
|
SystemParamsOperation.getInstance().setSecHostIpAddress(qrPrimaryIp.trim()+"/");
|
||||||
|
} else {
|
||||||
SystemParamsOperation.getInstance().setSecHostIpAddress("");
|
SystemParamsOperation.getInstance().setSecHostIpAddress("");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (siriusHost.getSecondaryIP().contains(":")) {
|
String qrSecondaryIp = qrHost.getSecondaryIP();
|
||||||
|
if (qrSecondaryIp != null && qrSecondaryIp.contains(":")) {
|
||||||
SystemParamsOperation.getInstance().setSecHostSecIpAddress(siriusHost.getSecondaryIP().trim()+"/");
|
SystemParamsOperation.getInstance().setSecHostSecIpAddress(qrSecondaryIp.trim()+"/");
|
||||||
|
} else {
|
||||||
} else if(siriusHost.getSecondaryIP().trim().isEmpty()) {
|
|
||||||
SystemParamsOperation.getInstance().setSecHostSecIpAddress("");
|
SystemParamsOperation.getInstance().setSecHostSecIpAddress("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!TextUtils.isEmpty(qrHost.getCurrency())) {
|
||||||
|
SystemParamsOperation.getInstance().setSecHostCurrency(currencyTextToCode(qrHost.getCurrency()));
|
||||||
if (!siriusHost.getCurrency().isEmpty()) {
|
|
||||||
SystemParamsOperation.getInstance().setSecHostCurrency(currencyTextToCode(siriusHost.getCurrency()));
|
|
||||||
// if(tmsUpdate == TMSUpdate.CHECK){
|
|
||||||
// if(SystemParamsOperation.getInstance().getSecHostCurrency() != null) {
|
|
||||||
// if(!currencyCodeToText(SystemParamsOperation.getInstance().getSecHostCurrency()).equals(siriusHost.getCurrency())) {
|
|
||||||
// SystemParamsOperation.getInstance().setNeedSettlement(true);
|
|
||||||
// } else {
|
|
||||||
//// SystemParamsOperation.getInstance().setCurrencyType(currencyTextToCurrencyType(siriusHost.getCurrency()));
|
|
||||||
// SystemParamsOperation.getInstance().setSecHostCurrency(currencyTextToCode(siriusHost.getCurrency()));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// } else if(tmsUpdate == TMSUpdate.UPDATE){
|
|
||||||
//
|
|
||||||
// SystemParamsOperation.getInstance().setSecHostCurrency(currencyTextToCode(siriusHost.getCurrency()));
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
if (siriusHost.getShortCode() == null || siriusHost.getShortCode().isEmpty()) {
|
|
||||||
|
if (qrHost.getShortCode() == null || qrHost.getShortCode().isEmpty()) {
|
||||||
SystemParamsOperation.getInstance().setShortCode("");
|
SystemParamsOperation.getInstance().setShortCode("");
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
SystemParamsOperation.getInstance().setHostName(siriusHost.getName());
|
|
||||||
SystemParamsOperation.getInstance().setTerminalId(siriusHost.getTid());
|
|
||||||
SystemParamsOperation.getInstance().setMerchantId(siriusHost.getMid());
|
|
||||||
|
|
||||||
if (siriusHost.getPrimaryIP().contains(":")) {
|
|
||||||
|
|
||||||
SystemParamsOperation.getInstance().setIpAddress(siriusHost.getPrimaryIP().trim());
|
|
||||||
|
|
||||||
} else if(siriusHost.getPrimaryIP().trim().isEmpty()) {
|
|
||||||
SystemParamsOperation.getInstance().setIpAddress("");
|
|
||||||
}
|
}
|
||||||
String secondaryIp = siriusHost.getSecondaryIP();
|
|
||||||
if(secondaryIp == null || secondaryIp.trim().isEmpty()){
|
|
||||||
SystemParamsOperation.getInstance().setSecIpAddress("");
|
|
||||||
}else if(secondaryIp.contains(":")){
|
|
||||||
SystemParamsOperation.getInstance().setSecIpAddress(secondaryIp.trim());
|
|
||||||
}
|
|
||||||
|
|
||||||
// if (siriusHost.getSecondaryIP().contains(":")) {
|
|
||||||
//
|
|
||||||
// SystemParamsOperation.getInstance().setSecIpAddress(siriusHost.getSecondaryIP().trim());
|
|
||||||
//
|
|
||||||
// } else if(siriusHost.getSecondaryIP().trim().isEmpty()){
|
|
||||||
// SystemParamsOperation.getInstance().setSecIpAddress("");
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
if (!siriusHost.getCurrency().isEmpty()) {
|
|
||||||
SystemParamsOperation.getInstance().setCurrencyType(currencyTextToCurrencyType(siriusHost.getCurrency()));
|
|
||||||
// if(tmsUpdate == TMSUpdate.CHECK){
|
|
||||||
// if(SystemParamsOperation.getInstance().getCurrencyCode() != null) {
|
|
||||||
// if(!currencyCodeToText(SystemParamsOperation.getInstance().getCurrencyCode()).equals(siriusHost.getCurrency())) {
|
|
||||||
// SystemParamsOperation.getInstance().setNeedSettlement(true);
|
|
||||||
// } else {
|
|
||||||
//
|
|
||||||
// SystemParamsOperation.getInstance().setCurrencyType(currencyTextToCurrencyType(siriusHost.getCurrency()));
|
|
||||||
//// SystemParamsOperation.getInstance().setCurrencyCode(currencyTextToCode(siriusHost.getCurrency()));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// } else if(tmsUpdate == TMSUpdate.UPDATE){
|
|
||||||
// SystemParamsOperation.getInstance().setCurrencyType(currencyTextToCurrencyType(siriusHost.getCurrency()));
|
|
||||||
//// SystemParamsOperation.getInstance().setCurrencyCode(currencyTextToCode(siriusHost.getCurrency()));
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
if (siriusHost.getTid().isEmpty() || siriusHost.getMid().isEmpty() ) {
|
|
||||||
if(siriusHost.getTid().isEmpty()) {
|
|
||||||
SystemParamsOperation.getInstance().setTerminalId("");
|
|
||||||
}
|
|
||||||
if(siriusHost.getMid().isEmpty()) {
|
|
||||||
SystemParamsOperation.getInstance().setMerchantId("");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -96,6 +96,13 @@
|
|||||||
android:layout_width="match_parent"/>
|
android:layout_width="match_parent"/>
|
||||||
|
|
||||||
<!-- ===== PRIMARY HOST ===== -->
|
<!-- ===== PRIMARY HOST ===== -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility='@{!TextUtils.isEmpty(viewModel.hostName) ? View.VISIBLE : View.GONE}'
|
||||||
|
tools:visibility="visible">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:text="PRIMARY HOST"
|
android:text="PRIMARY HOST"
|
||||||
android:paddingBottom="4dp"
|
android:paddingBottom="4dp"
|
||||||
@ -114,47 +121,48 @@
|
|||||||
android:text='@{": " + viewModel.hostName}'/>
|
android:text='@{": " + viewModel.hostName}'/>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
||||||
<TableRow>
|
<TableRow android:visibility='@{!TextUtils.isEmpty(viewModel.tid) ? View.VISIBLE : View.GONE}'>
|
||||||
<TextView style="@style/HostLabelStyle" android:text="TID"/>
|
<TextView style="@style/HostLabelStyle" android:text="TID"/>
|
||||||
<TextView style="@style/HostValueStyle"
|
<TextView style="@style/HostValueStyle"
|
||||||
android:text='@{": " + viewModel.tid}'/>
|
android:text='@{": " + viewModel.tid}'/>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
||||||
<TableRow>
|
<TableRow android:visibility='@{!TextUtils.isEmpty(viewModel.mid) ? View.VISIBLE : View.GONE}'>
|
||||||
<TextView style="@style/HostLabelStyle" android:text="MID"/>
|
<TextView style="@style/HostLabelStyle" android:text="MID"/>
|
||||||
<TextView style="@style/HostValueStyle"
|
<TextView style="@style/HostValueStyle"
|
||||||
android:text='@{": " + viewModel.mid}'/>
|
android:text='@{": " + viewModel.mid}'/>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
||||||
<TableRow>
|
<TableRow android:visibility='@{!TextUtils.isEmpty(viewModel.primaryIp) ? View.VISIBLE : View.GONE}'>
|
||||||
<TextView style="@style/HostLabelStyle" android:text="Primary IP"/>
|
<TextView style="@style/HostLabelStyle" android:text="Primary IP"/>
|
||||||
<TextView style="@style/HostValueStyle"
|
<TextView style="@style/HostValueStyle"
|
||||||
android:text='@{": " + viewModel.primaryIp}'/>
|
android:text='@{": " + viewModel.primaryIp}'/>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
<TableRow>
|
<TableRow android:visibility='@{!TextUtils.isEmpty(viewModel.primaryPort) ? View.VISIBLE : View.GONE}'>
|
||||||
<TextView style="@style/HostLabelStyle" android:text="Primary Port"/>
|
<TextView style="@style/HostLabelStyle" android:text="Primary Port"/>
|
||||||
<TextView style="@style/HostValueStyle"
|
<TextView style="@style/HostValueStyle"
|
||||||
android:text='@{": " + viewModel.primaryPort}'/>
|
android:text='@{": " + viewModel.primaryPort}'/>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
||||||
<TableRow>
|
<TableRow android:visibility='@{!TextUtils.isEmpty(viewModel.secondaryIp) ? View.VISIBLE : View.GONE}'>
|
||||||
<TextView style="@style/HostLabelStyle" android:text="Secondary IP"/>
|
<TextView style="@style/HostLabelStyle" android:text="Secondary IP"/>
|
||||||
<TextView style="@style/HostValueStyle"
|
<TextView style="@style/HostValueStyle"
|
||||||
android:text='@{": " + viewModel.secondaryIp}'/>
|
android:text='@{": " + viewModel.secondaryIp}'/>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
||||||
<TableRow>
|
<TableRow android:visibility='@{!TextUtils.isEmpty(viewModel.secondaryPort) ? View.VISIBLE : View.GONE}'>
|
||||||
<TextView style="@style/HostLabelStyle" android:text="Secondary Port"/>
|
<TextView style="@style/HostLabelStyle" android:text="Secondary Port"/>
|
||||||
<TextView style="@style/HostValueStyle"
|
<TextView style="@style/HostValueStyle"
|
||||||
android:text='@{": " + viewModel.secondaryPort}'/>
|
android:text='@{": " + viewModel.secondaryPort}'/>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
||||||
<TableRow>
|
<TableRow android:visibility='@{!TextUtils.isEmpty(viewModel.currencyCode) ? View.VISIBLE : View.GONE}'>
|
||||||
<TextView style="@style/HostLabelStyle" android:text="Currency"/>
|
<TextView style="@style/HostLabelStyle" android:text="Currency"/>
|
||||||
<TextView style="@style/HostValueStyle"
|
<TextView style="@style/HostValueStyle"
|
||||||
android:text='@{": " + viewModel.currencyCode}'/>
|
android:text='@{": " + viewModel.currencyCode}'/>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableLayout>
|
</TableLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:text="--------------------------------------------------------------------------"
|
android:text="--------------------------------------------------------------------------"
|
||||||
@ -168,8 +176,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:visibility='@{!TextUtils.isEmpty(viewModel.secHostName) ? View.VISIBLE : View.GONE}'
|
android:visibility='@{!TextUtils.isEmpty(viewModel.thirdHostName) ? View.VISIBLE : View.GONE}'
|
||||||
tools:visibility="visible">
|
tools:visibility="gone">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:text="SECONDARY HOST"
|
android:text="SECONDARY HOST"
|
||||||
@ -181,6 +189,80 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="match_parent"/>
|
android:layout_width="match_parent"/>
|
||||||
|
|
||||||
|
<TableLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:stretchColumns="1">
|
||||||
|
|
||||||
|
<TableRow>
|
||||||
|
<TextView style="@style/HostLabelStyle" android:text="Name"/>
|
||||||
|
<TextView style="@style/HostValueStyle"
|
||||||
|
android:text='@{": " + viewModel.thirdHostName}'/>
|
||||||
|
</TableRow>
|
||||||
|
|
||||||
|
<TableRow android:visibility='@{!TextUtils.isEmpty(viewModel.thirdHostShortCode) ? View.VISIBLE : View.GONE}'>
|
||||||
|
<TextView style="@style/HostLabelStyle" android:text="Short Code"/>
|
||||||
|
<TextView style="@style/HostValueStyle"
|
||||||
|
android:text='@{": " + viewModel.thirdHostShortCode}'/>
|
||||||
|
</TableRow>
|
||||||
|
|
||||||
|
<TableRow android:visibility='@{!TextUtils.isEmpty(viewModel.thirdHostPrimaryIp) ? View.VISIBLE : View.GONE}'>
|
||||||
|
<TextView style="@style/HostLabelStyle" android:text="Primary IP"/>
|
||||||
|
<TextView style="@style/HostValueStyle"
|
||||||
|
android:text='@{": " + viewModel.thirdHostPrimaryIp}'/>
|
||||||
|
</TableRow>
|
||||||
|
|
||||||
|
<TableRow android:visibility='@{!TextUtils.isEmpty(viewModel.thirdHostPrimaryPort) ? View.VISIBLE : View.GONE}'>
|
||||||
|
<TextView style="@style/HostLabelStyle" android:text="Primary Port"/>
|
||||||
|
<TextView style="@style/HostValueStyle"
|
||||||
|
android:text='@{": " + viewModel.thirdHostPrimaryPort}'/>
|
||||||
|
</TableRow>
|
||||||
|
|
||||||
|
<TableRow android:visibility='@{!TextUtils.isEmpty(viewModel.thirdHostSecondaryIp) ? View.VISIBLE : View.GONE}'>
|
||||||
|
<TextView style="@style/HostLabelStyle" android:text="Secondary IP"/>
|
||||||
|
<TextView style="@style/HostValueStyle"
|
||||||
|
android:text='@{": " + viewModel.thirdHostSecondaryIp}'/>
|
||||||
|
</TableRow>
|
||||||
|
|
||||||
|
<TableRow android:visibility='@{!TextUtils.isEmpty(viewModel.thirdHostSecondaryPort) ? View.VISIBLE : View.GONE}'>
|
||||||
|
<TextView style="@style/HostLabelStyle" android:text="Secondary Port"/>
|
||||||
|
<TextView style="@style/HostValueStyle"
|
||||||
|
android:text='@{": " + viewModel.thirdHostSecondaryPort}'/>
|
||||||
|
</TableRow>
|
||||||
|
|
||||||
|
<TableRow android:visibility='@{!TextUtils.isEmpty(viewModel.thirdHostCurrency) ? View.VISIBLE : View.GONE}'>
|
||||||
|
<TextView style="@style/HostLabelStyle" android:text="Currency"/>
|
||||||
|
<TextView style="@style/HostValueStyle"
|
||||||
|
android:text='@{": " + viewModel.thirdHostCurrency}'/>
|
||||||
|
</TableRow>
|
||||||
|
</TableLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:text="--------------------------------------------------------------------------"
|
||||||
|
android:gravity="left"
|
||||||
|
android:paddingVertical="8dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_width="match_parent"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- ===== QR HOST ===== -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility='@{!TextUtils.isEmpty(viewModel.secHostName) ? View.VISIBLE : View.GONE}'
|
||||||
|
tools:visibility="visible">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:text="QR HOST"
|
||||||
|
android:textSize="14sp"
|
||||||
|
style="@style/HostLabelStyle"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:fontFamily="@font/rubik_regular"
|
||||||
|
android:paddingTop="8dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_width="match_parent"/>
|
||||||
|
|
||||||
<TableLayout
|
<TableLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -192,40 +274,40 @@
|
|||||||
android:text='@{": " + viewModel.secHostName}'/>
|
android:text='@{": " + viewModel.secHostName}'/>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
||||||
<TableRow>
|
<TableRow android:visibility='@{!TextUtils.isEmpty(viewModel.shortCode) ? View.VISIBLE : View.GONE}'>
|
||||||
<TextView style="@style/HostLabelStyle" android:text="Short Code"/>
|
<TextView style="@style/HostLabelStyle" android:text="Short Code"/>
|
||||||
<TextView style="@style/HostValueStyle"
|
<TextView style="@style/HostValueStyle"
|
||||||
android:text='@{": " + viewModel.shortCode}'/>
|
android:text='@{": " + viewModel.shortCode}'/>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
||||||
<TableRow>
|
<TableRow android:visibility='@{!TextUtils.isEmpty(viewModel.secHostPrimaryIp) ? View.VISIBLE : View.GONE}'>
|
||||||
<TextView style="@style/HostLabelStyle" android:text="Primary IP"/>
|
<TextView style="@style/HostLabelStyle" android:text="Primary IP"/>
|
||||||
<TextView style="@style/HostValueStyle"
|
<TextView style="@style/HostValueStyle"
|
||||||
android:text='@{": " + viewModel.secHostPrimaryIp}'/>
|
android:text='@{": " + viewModel.secHostPrimaryIp}'/>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
||||||
<TableRow>
|
<TableRow android:visibility='@{!TextUtils.isEmpty(viewModel.secHostPrimaryPort) ? View.VISIBLE : View.GONE}'>
|
||||||
<TextView style="@style/HostLabelStyle" android:text="Primary Port"/>
|
<TextView style="@style/HostLabelStyle" android:text="Primary Port"/>
|
||||||
<TextView style="@style/HostValueStyle"
|
<TextView style="@style/HostValueStyle"
|
||||||
android:text='@{": " + viewModel.secHostPrimaryPort}'/>
|
android:text='@{": " + viewModel.secHostPrimaryPort}'/>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
||||||
<TableRow>
|
<TableRow android:visibility='@{!TextUtils.isEmpty(viewModel.secHostSecondaryIp) ? View.VISIBLE : View.GONE}'>
|
||||||
<TextView style="@style/HostLabelStyle" android:text="Secondary IP"/>
|
<TextView style="@style/HostLabelStyle" android:text="Secondary IP"/>
|
||||||
<TextView style="@style/HostValueStyle"
|
<TextView style="@style/HostValueStyle"
|
||||||
android:text='@{": " + viewModel.secHostSecondaryIp}'/>
|
android:text='@{": " + viewModel.secHostSecondaryIp}'/>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
||||||
<TableRow>
|
<TableRow android:visibility='@{!TextUtils.isEmpty(viewModel.secHostSecondaryPort) ? View.VISIBLE : View.GONE}'>
|
||||||
<TextView style="@style/HostLabelStyle" android:text="Secondary Port"/>
|
<TextView style="@style/HostLabelStyle" android:text="Secondary Port"/>
|
||||||
<TextView style="@style/HostValueStyle"
|
<TextView style="@style/HostValueStyle"
|
||||||
android:text='@{": " + viewModel.secHostSecondaryPort}'/>
|
android:text='@{": " + viewModel.secHostSecondaryPort}'/>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
||||||
<TableRow>
|
<TableRow android:visibility='@{!TextUtils.isEmpty(viewModel.secHostCurrency) ? View.VISIBLE : View.GONE}'>
|
||||||
<TextView style="@style/HostLabelStyle" android:text="Currency"/>
|
<TextView style="@style/HostLabelStyle" android:text="Currency"/>
|
||||||
<TextView style="@style/HostValueStyle"
|
<TextView style="@style/HostValueStyle"
|
||||||
android:text='@{": " + viewModel.currencyCode}'/>
|
android:text='@{": " + viewModel.secHostCurrency}'/>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableLayout>
|
</TableLayout>
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package com.utsmyanmar.baselib.network.model.sirius;
|
package com.utsmyanmar.baselib.network.model.sirius;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
public class SiriusHost {
|
public class SiriusHost {
|
||||||
|
|
||||||
private String id;
|
private String id;
|
||||||
@ -9,6 +11,8 @@ public class SiriusHost {
|
|||||||
private String primaryIP;
|
private String primaryIP;
|
||||||
|
|
||||||
private String secondaryIP;
|
private String secondaryIP;
|
||||||
|
@SerializedName(value = "thirdIP", alternate = {"thirdIp", "tertiaryIP", "tertiaryIp"})
|
||||||
|
private String thirdIP;
|
||||||
|
|
||||||
private String currency;
|
private String currency;
|
||||||
|
|
||||||
@ -53,6 +57,10 @@ public class SiriusHost {
|
|||||||
this.secondaryIP = secondaryIP;
|
this.secondaryIP = secondaryIP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setThirdIP(String thirdIP) {
|
||||||
|
this.thirdIP = thirdIP;
|
||||||
|
}
|
||||||
|
|
||||||
public void setCurrency(String currency) {
|
public void setCurrency(String currency) {
|
||||||
this.currency = currency;
|
this.currency = currency;
|
||||||
}
|
}
|
||||||
@ -89,6 +97,10 @@ public class SiriusHost {
|
|||||||
return secondaryIP;
|
return secondaryIP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getThirdIP() {
|
||||||
|
return thirdIP;
|
||||||
|
}
|
||||||
|
|
||||||
public String getCurrency() {
|
public String getCurrency() {
|
||||||
return currency;
|
return currency;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1070,14 +1070,27 @@ public abstract class BaseXPrint {
|
|||||||
merchantAddress = SystemParamsOperation.getInstance().getMerchantAddress();
|
merchantAddress = SystemParamsOperation.getInstance().getMerchantAddress();
|
||||||
|
|
||||||
if (merchantAddress != null) {
|
if (merchantAddress != null) {
|
||||||
//this step is needed for manually line break with \n in the Address
|
// Support manual line breaks entered as escaped/newline sequences.
|
||||||
merchantAddress = merchantAddress.replace("\\n", "\n");
|
merchantAddress = merchantAddress
|
||||||
|
.replace("\\r\\n", "\n")
|
||||||
|
.replace("\\n", "\n")
|
||||||
|
.replace("\r\n", "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
terminalName = SystemParamsOperation.getInstance().getTerminalName();
|
terminalName = SystemParamsOperation.getInstance().getTerminalName();
|
||||||
|
if (terminalName != null) {
|
||||||
|
// Keep behavior aligned with address wrapping for printed slips.
|
||||||
|
terminalName = terminalName
|
||||||
|
.replace("\\r\\n", "\n")
|
||||||
|
.replace("\\n", "\n")
|
||||||
|
.replace("\r\n", "\n");
|
||||||
|
}
|
||||||
|
|
||||||
assert merchantAddress != null;
|
assert merchantAddress != null;
|
||||||
List<String> result = wrapAddressText(merchantAddress, 29);
|
List<String> result = wrapAddressText(merchantAddress, 29);
|
||||||
|
List<String> terminalLines = TextUtils.isEmpty(terminalName)
|
||||||
|
? new ArrayList<>()
|
||||||
|
: wrapAddressText(terminalName.trim(), 29);
|
||||||
|
|
||||||
if (receiptHeader == null || TextUtils.equals(receiptHeader, "") || receiptHeader.trim().isEmpty()) {
|
if (receiptHeader == null || TextUtils.equals(receiptHeader, "") || receiptHeader.trim().isEmpty()) {
|
||||||
receiptHeader = merchantName;
|
receiptHeader = merchantName;
|
||||||
@ -1089,7 +1102,9 @@ public abstract class BaseXPrint {
|
|||||||
terminalName = "";
|
terminalName = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
printer.appendPrnStr(terminalName, fontNormal, AlignEnum.CENTER, true);
|
for (String line : terminalLines) {
|
||||||
|
printer.appendPrnStr(line, fontNormal, AlignEnum.CENTER, true);
|
||||||
|
}
|
||||||
|
|
||||||
for (String line : result) {
|
for (String line : result) {
|
||||||
//result get the List of text from auto/manually break the address
|
//result get the List of text from auto/manually break the address
|
||||||
@ -1316,7 +1331,7 @@ public abstract class BaseXPrint {
|
|||||||
dotBreak();
|
dotBreak();
|
||||||
// ---------- SECONDARY HOST (optional) ----------
|
// ---------- SECONDARY HOST (optional) ----------
|
||||||
if (!TextUtils.isEmpty(sp.getSecHostName())) {
|
if (!TextUtils.isEmpty(sp.getSecHostName())) {
|
||||||
printer.appendPrnStr("SECONDARY HOST", fontNormal, AlignEnum.LEFT, true);
|
printer.appendPrnStr("QR HOST", fontNormal, AlignEnum.LEFT, true);
|
||||||
printer.appendPrnStr("Name : " + sp.getSecHostName(), fontNormal, AlignEnum.LEFT, false);
|
printer.appendPrnStr("Name : " + sp.getSecHostName(), fontNormal, AlignEnum.LEFT, false);
|
||||||
printer.appendPrnStr("SHORT CODE : " + sp.getShortCode(), fontNormal, AlignEnum.LEFT, false);
|
printer.appendPrnStr("SHORT CODE : " + sp.getShortCode(), fontNormal, AlignEnum.LEFT, false);
|
||||||
String[] secHostIp = splitIpAndPort(sp.getSecHostIpAddress());
|
String[] secHostIp = splitIpAndPort(sp.getSecHostIpAddress());
|
||||||
@ -1325,10 +1340,26 @@ public abstract class BaseXPrint {
|
|||||||
String[] secHostSecIp = splitIpAndPort(sp.getSecHostSecIpAddress());
|
String[] secHostSecIp = splitIpAndPort(sp.getSecHostSecIpAddress());
|
||||||
printer.appendPrnStr("Secondary Ip : " + secHostSecIp[0], fontNormal, AlignEnum.LEFT, false);
|
printer.appendPrnStr("Secondary Ip : " + secHostSecIp[0], fontNormal, AlignEnum.LEFT, false);
|
||||||
printer.appendPrnStr("Secondary Port: " + secHostSecIp[1], fontNormal, AlignEnum.LEFT, false);
|
printer.appendPrnStr("Secondary Port: " + secHostSecIp[1], fontNormal, AlignEnum.LEFT, false);
|
||||||
printer.appendPrnStr("Currency Code : " + sp.getCurrencyType(), fontNormal, AlignEnum.LEFT, false);
|
String qrHostCurrency = TextUtils.isEmpty(sp.getSecHostCurrency()) ? String.valueOf(sp.getCurrencyType()) : sp.getSecHostCurrency();
|
||||||
|
printer.appendPrnStr("Currency Code : " + qrHostCurrency, fontNormal, AlignEnum.LEFT, false);
|
||||||
dotBreak();
|
dotBreak();
|
||||||
printer.appendPrnStr("App Version : " + getAppVersion(), fontNormal, AlignEnum.LEFT, false);
|
printer.appendPrnStr("App Version : " + getAppVersion(), fontNormal, AlignEnum.LEFT, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ---------- THIRD HOST (optional) ----------
|
||||||
|
if (!TextUtils.isEmpty(sp.getThirdHostName())) {
|
||||||
|
printer.appendPrnStr("SECONDARY HOST", fontNormal, AlignEnum.LEFT, true);
|
||||||
|
printer.appendPrnStr("Name : " + sp.getThirdHostName(), fontNormal, AlignEnum.LEFT, false);
|
||||||
|
printer.appendPrnStr("SHORT CODE : " + sp.getThirdHostShortCode(), fontNormal, AlignEnum.LEFT, false);
|
||||||
|
String[] thirdHostIp = splitIpAndPort(sp.getThirdHostIpAddress());
|
||||||
|
printer.appendPrnStr("Primary Ip : " + thirdHostIp[0], fontNormal, AlignEnum.LEFT, false);
|
||||||
|
printer.appendPrnStr("Primary Port : " + thirdHostIp[1], fontNormal, AlignEnum.LEFT, false);
|
||||||
|
String[] thirdHostSecIp = splitIpAndPort(sp.getThirdHostSecIpAddress());
|
||||||
|
printer.appendPrnStr("Secondary Ip : " + thirdHostSecIp[0], fontNormal, AlignEnum.LEFT, false);
|
||||||
|
printer.appendPrnStr("Secondary Port: " + thirdHostSecIp[1], fontNormal, AlignEnum.LEFT, false);
|
||||||
|
printer.appendPrnStr("Currency Code : " + sp.getThirdHostCurrency(), fontNormal, AlignEnum.LEFT, false);
|
||||||
|
dotBreak();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getAppVersion() {
|
private String getAppVersion() {
|
||||||
|
|||||||
@ -1014,6 +1014,7 @@ public class SystemParamsOperation {
|
|||||||
saveSystemParamsSettings(params);
|
saveSystemParamsSettings(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setTmsAddress(String tmsAddress){
|
public void setTmsAddress(String tmsAddress){
|
||||||
SystemParamsSettings params = getSystemParamsSettings();
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
params.setTmsAddress(tmsAddress);
|
params.setTmsAddress(tmsAddress);
|
||||||
@ -1036,6 +1037,7 @@ public class SystemParamsOperation {
|
|||||||
return params.getSecIpAddress();
|
return params.getSecIpAddress();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public int getPortAddress(){
|
public int getPortAddress(){
|
||||||
SystemParamsSettings params = getSystemParamsSettings();
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
return params.getPortAddress();
|
return params.getPortAddress();
|
||||||
@ -1344,22 +1346,44 @@ public class SystemParamsOperation {
|
|||||||
saveSystemParamsSettings(params);
|
saveSystemParamsSettings(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setThirdHostName(String hostName) {
|
||||||
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
|
params.setThirdHostName(hostName);
|
||||||
|
saveSystemParamsSettings(params);
|
||||||
|
}
|
||||||
|
|
||||||
public String getSecHostName() {
|
public String getSecHostName() {
|
||||||
SystemParamsSettings params = getSystemParamsSettings();
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
return params.getSecHostName();
|
return params.getSecHostName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getThirdHostName() {
|
||||||
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
|
return params.getThirdHostName();
|
||||||
|
}
|
||||||
|
|
||||||
public void setSecHostIpAddress(String ipAddress) {
|
public void setSecHostIpAddress(String ipAddress) {
|
||||||
SystemParamsSettings params = getSystemParamsSettings();
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
params.setSecHostIpAddress(ipAddress);
|
params.setSecHostIpAddress(ipAddress);
|
||||||
saveSystemParamsSettings(params);
|
saveSystemParamsSettings(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setThirdHostIpAddress(String ipAddress) {
|
||||||
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
|
params.setThirdHostIpAddress(ipAddress);
|
||||||
|
saveSystemParamsSettings(params);
|
||||||
|
}
|
||||||
|
|
||||||
public String getSecHostIpAddress() {
|
public String getSecHostIpAddress() {
|
||||||
SystemParamsSettings params = getSystemParamsSettings();
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
return params.getSecHostIpAddress();
|
return params.getSecHostIpAddress();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getThirdHostIpAddress() {
|
||||||
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
|
return params.getThirdHostIpAddress();
|
||||||
|
}
|
||||||
|
|
||||||
public void setTokenHostAddress(String tokenHostAddress) {
|
public void setTokenHostAddress(String tokenHostAddress) {
|
||||||
SystemParamsSettings params = getSystemParamsSettings();
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
params.setTokenHostAddress(tokenHostAddress);
|
params.setTokenHostAddress(tokenHostAddress);
|
||||||
@ -1387,39 +1411,78 @@ public class SystemParamsOperation {
|
|||||||
saveSystemParamsSettings(params);
|
saveSystemParamsSettings(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setThirdHostSecIpAddress(String ipAddress) {
|
||||||
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
|
params.setThirdHostSecIpAddress(ipAddress);
|
||||||
|
saveSystemParamsSettings(params);
|
||||||
|
}
|
||||||
|
|
||||||
public String getSecHostSecIpAddress() {
|
public String getSecHostSecIpAddress() {
|
||||||
SystemParamsSettings params = getSystemParamsSettings();
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
return params.getSecHostSecIpAddress();
|
return params.getSecHostSecIpAddress();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getThirdHostSecIpAddress() {
|
||||||
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
|
return params.getThirdHostSecIpAddress();
|
||||||
|
}
|
||||||
|
|
||||||
public void setSecHostTerminalId(String terminalId) {
|
public void setSecHostTerminalId(String terminalId) {
|
||||||
SystemParamsSettings params = getSystemParamsSettings();
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
params.setSecHostTerminalId(terminalId);
|
params.setSecHostTerminalId(terminalId);
|
||||||
saveSystemParamsSettings(params);
|
saveSystemParamsSettings(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setThirdHostTerminalId(String terminalId) {
|
||||||
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
|
params.setThirdHostTerminalId(terminalId);
|
||||||
|
saveSystemParamsSettings(params);
|
||||||
|
}
|
||||||
|
|
||||||
public String getSecHostTerminalId() {
|
public String getSecHostTerminalId() {
|
||||||
SystemParamsSettings params = getSystemParamsSettings();
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
return params.getSecHostTerminalId();
|
return params.getSecHostTerminalId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getThirdHostTerminalId() {
|
||||||
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
|
return params.getThirdHostTerminalId();
|
||||||
|
}
|
||||||
|
|
||||||
public void setSecHostMerchantId(String merchantId) {
|
public void setSecHostMerchantId(String merchantId) {
|
||||||
SystemParamsSettings params = getSystemParamsSettings();
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
params.setSecHostMerchantId(merchantId);
|
params.setSecHostMerchantId(merchantId);
|
||||||
saveSystemParamsSettings(params);
|
saveSystemParamsSettings(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setThirdHostMerchantId(String merchantId) {
|
||||||
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
|
params.setThirdHostMerchantId(merchantId);
|
||||||
|
saveSystemParamsSettings(params);
|
||||||
|
}
|
||||||
|
|
||||||
public void setShortCode(String shortCode) {
|
public void setShortCode(String shortCode) {
|
||||||
SystemParamsSettings params = getSystemParamsSettings();
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
params.setShortCode(shortCode);
|
params.setShortCode(shortCode);
|
||||||
saveSystemParamsSettings(params);
|
saveSystemParamsSettings(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setThirdHostShortCode(String shortCode) {
|
||||||
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
|
params.setThirdHostShortCode(shortCode);
|
||||||
|
saveSystemParamsSettings(params);
|
||||||
|
}
|
||||||
|
|
||||||
public String getShortCode() {
|
public String getShortCode() {
|
||||||
SystemParamsSettings params = getSystemParamsSettings();
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
return params.getShortCode();
|
return params.getShortCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getThirdHostShortCode() {
|
||||||
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
|
return params.getThirdHostShortCode();
|
||||||
|
}
|
||||||
|
|
||||||
public void setBinValue(String value) {
|
public void setBinValue(String value) {
|
||||||
SystemParamsSettings params = getSystemParamsSettings();
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
params.setBinValues(value);
|
params.setBinValues(value);
|
||||||
@ -1437,6 +1500,11 @@ public class SystemParamsOperation {
|
|||||||
return params.getSecHostMerchantId();
|
return params.getSecHostMerchantId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getThirdHostMerchantId() {
|
||||||
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
|
return params.getThirdHostMerchantId();
|
||||||
|
}
|
||||||
|
|
||||||
public void setLastSuccessTrnx(String lastSuccessTrnx) {
|
public void setLastSuccessTrnx(String lastSuccessTrnx) {
|
||||||
SystemParamsSettings params = getSystemParamsSettings();
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
params.setLastSuccessTranx(lastSuccessTrnx);
|
params.setLastSuccessTranx(lastSuccessTrnx);
|
||||||
@ -1454,11 +1522,22 @@ public class SystemParamsOperation {
|
|||||||
saveSystemParamsSettings(params);
|
saveSystemParamsSettings(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setThirdHostCurrency(String currency) {
|
||||||
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
|
params.setThirdHostCurrency(currency);
|
||||||
|
saveSystemParamsSettings(params);
|
||||||
|
}
|
||||||
|
|
||||||
public String getSecHostCurrency() {
|
public String getSecHostCurrency() {
|
||||||
SystemParamsSettings params = getSystemParamsSettings();
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
return params.getSecHostCurrency();
|
return params.getSecHostCurrency();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getThirdHostCurrency() {
|
||||||
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
|
return params.getThirdHostCurrency();
|
||||||
|
}
|
||||||
|
|
||||||
public String getCurrentSerialNum() {
|
public String getCurrentSerialNum() {
|
||||||
SystemParamsSettings params = getSystemParamsSettings();
|
SystemParamsSettings params = getSystemParamsSettings();
|
||||||
return params.getCurrentSerialNum();
|
return params.getCurrentSerialNum();
|
||||||
|
|||||||
@ -102,22 +102,29 @@ public class SystemParamsSettings implements Serializable {
|
|||||||
private String secHostId = "";
|
private String secHostId = "";
|
||||||
|
|
||||||
private String secHostName = "";
|
private String secHostName = "";
|
||||||
|
private String thirdHostName = "";
|
||||||
|
|
||||||
private String secHostIpAddress = "";
|
private String secHostIpAddress = "";
|
||||||
|
private String thirdHostIpAddress = "";
|
||||||
|
|
||||||
private String tokenHostAddress = "";
|
private String tokenHostAddress = "";
|
||||||
|
|
||||||
private String grantType = "";
|
private String grantType = "";
|
||||||
|
|
||||||
private String secHostSecIpAddress = "";
|
private String secHostSecIpAddress = "";
|
||||||
|
private String thirdHostSecIpAddress = "";
|
||||||
|
|
||||||
private String secHostTerminalId = "";
|
private String secHostTerminalId = "";
|
||||||
|
private String thirdHostTerminalId = "";
|
||||||
|
|
||||||
private String secHostMerchantId = "";
|
private String secHostMerchantId = "";
|
||||||
|
private String thirdHostMerchantId = "";
|
||||||
|
|
||||||
private String shortCode = "";
|
private String shortCode = "";
|
||||||
|
private String thirdHostShortCode = "";
|
||||||
|
|
||||||
private String secHostCurrency = "";
|
private String secHostCurrency = "";
|
||||||
|
private String thirdHostCurrency = "";
|
||||||
|
|
||||||
private String disabledMessage = "";
|
private String disabledMessage = "";
|
||||||
|
|
||||||
@ -278,26 +285,38 @@ public class SystemParamsSettings implements Serializable {
|
|||||||
return secHostName;
|
return secHostName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected String getThirdHostName() { return thirdHostName; }
|
||||||
|
|
||||||
protected String getSecHostIpAddress() {
|
protected String getSecHostIpAddress() {
|
||||||
return secHostIpAddress;
|
return secHostIpAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected String getThirdHostIpAddress() { return thirdHostIpAddress; }
|
||||||
|
|
||||||
protected String getSecHostSecIpAddress() {
|
protected String getSecHostSecIpAddress() {
|
||||||
return secHostSecIpAddress;
|
return secHostSecIpAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected String getThirdHostSecIpAddress() { return thirdHostSecIpAddress; }
|
||||||
|
|
||||||
protected String getSecHostTerminalId() {
|
protected String getSecHostTerminalId() {
|
||||||
return secHostTerminalId;
|
return secHostTerminalId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected String getThirdHostTerminalId() { return thirdHostTerminalId; }
|
||||||
|
|
||||||
protected String getSecHostMerchantId() {
|
protected String getSecHostMerchantId() {
|
||||||
return secHostMerchantId;
|
return secHostMerchantId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected String getThirdHostMerchantId() { return thirdHostMerchantId; }
|
||||||
|
|
||||||
protected String getSecHostCurrency() {
|
protected String getSecHostCurrency() {
|
||||||
return secHostCurrency;
|
return secHostCurrency;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected String getThirdHostCurrency() { return thirdHostCurrency; }
|
||||||
|
|
||||||
protected String getAuthToken() { return authToken;}
|
protected String getAuthToken() { return authToken;}
|
||||||
|
|
||||||
protected String getEreceiptAddress() { return ereceiptAddress; }
|
protected String getEreceiptAddress() { return ereceiptAddress; }
|
||||||
@ -323,10 +342,14 @@ public class SystemParamsSettings implements Serializable {
|
|||||||
this.secHostName = secHostName;
|
this.secHostName = secHostName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void setThirdHostName(String thirdHostName) { this.thirdHostName = thirdHostName; }
|
||||||
|
|
||||||
protected void setSecHostIpAddress(String secHostIpAddress) {
|
protected void setSecHostIpAddress(String secHostIpAddress) {
|
||||||
this.secHostIpAddress = secHostIpAddress;
|
this.secHostIpAddress = secHostIpAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void setThirdHostIpAddress(String thirdHostIpAddress) { this.thirdHostIpAddress = thirdHostIpAddress; }
|
||||||
|
|
||||||
protected void setBinValues(String binValues) {
|
protected void setBinValues(String binValues) {
|
||||||
this.binValues = binValues;
|
this.binValues = binValues;
|
||||||
}
|
}
|
||||||
@ -379,10 +402,14 @@ public class SystemParamsSettings implements Serializable {
|
|||||||
this.shortCode = shortCode;
|
this.shortCode = shortCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void setThirdHostShortCode(String thirdHostShortCode) { this.thirdHostShortCode = thirdHostShortCode; }
|
||||||
|
|
||||||
protected String getShortCode() {
|
protected String getShortCode() {
|
||||||
return this.shortCode;
|
return this.shortCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected String getThirdHostShortCode() { return this.thirdHostShortCode; }
|
||||||
|
|
||||||
protected long getuPiCvMLimit() {
|
protected long getuPiCvMLimit() {
|
||||||
return this.uPiCvMLimit;
|
return this.uPiCvMLimit;
|
||||||
}
|
}
|
||||||
@ -415,10 +442,14 @@ public class SystemParamsSettings implements Serializable {
|
|||||||
this.secHostSecIpAddress = secHostSecIpAddress;
|
this.secHostSecIpAddress = secHostSecIpAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void setThirdHostSecIpAddress(String thirdHostSecIpAddress) { this.thirdHostSecIpAddress = thirdHostSecIpAddress; }
|
||||||
|
|
||||||
protected void setSecHostTerminalId(String secHostTerminalId) {
|
protected void setSecHostTerminalId(String secHostTerminalId) {
|
||||||
this.secHostTerminalId = secHostTerminalId;
|
this.secHostTerminalId = secHostTerminalId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void setThirdHostTerminalId(String thirdHostTerminalId) { this.thirdHostTerminalId = thirdHostTerminalId; }
|
||||||
|
|
||||||
protected void setLastSuccessTranx(String lastSuccessTranx) {
|
protected void setLastSuccessTranx(String lastSuccessTranx) {
|
||||||
this.lastSuccessTranx = lastSuccessTranx;
|
this.lastSuccessTranx = lastSuccessTranx;
|
||||||
}
|
}
|
||||||
@ -431,10 +462,14 @@ public class SystemParamsSettings implements Serializable {
|
|||||||
this.secHostMerchantId = secHostMerchantId;
|
this.secHostMerchantId = secHostMerchantId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void setThirdHostMerchantId(String thirdHostMerchantId) { this.thirdHostMerchantId = thirdHostMerchantId; }
|
||||||
|
|
||||||
protected void setSecHostCurrency(String secHostCurrency) {
|
protected void setSecHostCurrency(String secHostCurrency) {
|
||||||
this.secHostCurrency = secHostCurrency;
|
this.secHostCurrency = secHostCurrency;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void setThirdHostCurrency(String thirdHostCurrency) { this.thirdHostCurrency = thirdHostCurrency; }
|
||||||
|
|
||||||
protected void setNeedSettlement(boolean needSettlement) {
|
protected void setNeedSettlement(boolean needSettlement) {
|
||||||
this.isNeedSettlement = needSettlement;
|
this.isNeedSettlement = needSettlement;
|
||||||
}
|
}
|
||||||
@ -670,6 +705,7 @@ public class SystemParamsSettings implements Serializable {
|
|||||||
|
|
||||||
protected void setSecIpAddress(String secIpAddress){ this.secIpAddress = secIpAddress;}
|
protected void setSecIpAddress(String secIpAddress){ this.secIpAddress = secIpAddress;}
|
||||||
|
|
||||||
|
|
||||||
protected void setHostReadTimeout(String hostReadTimeout){ this.hostReadTimeout = hostReadTimeout;}
|
protected void setHostReadTimeout(String hostReadTimeout){ this.hostReadTimeout = hostReadTimeout;}
|
||||||
|
|
||||||
protected void setReversalDelay(String reversalDelay) { this.reversalDelay = reversalDelay; }
|
protected void setReversalDelay(String reversalDelay) { this.reversalDelay = reversalDelay; }
|
||||||
@ -684,6 +720,7 @@ public class SystemParamsSettings implements Serializable {
|
|||||||
|
|
||||||
protected String getSecIpAddress(){ return secIpAddress;}
|
protected String getSecIpAddress(){ return secIpAddress;}
|
||||||
|
|
||||||
|
|
||||||
protected String getComp1() {
|
protected String getComp1() {
|
||||||
return comp1;
|
return comp1;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user