e-receipt new fields
This commit is contained in:
parent
5799072d9f
commit
666325ed82
@ -167,6 +167,7 @@ public class QRRefundProcessFragment extends DataBindingFragment {
|
||||
referenceNo,
|
||||
payDetail != null ? payDetail.getInvoiceNo() : "",
|
||||
payDetail != null ? payDetail.getVoucherNo() : "",
|
||||
payDetail != null ? payDetail.getQrReferNo() != null ? payDetail.getQrReferNo() : "" : "" ,
|
||||
TransResultStatus.SUCCESS
|
||||
);
|
||||
sharedViewModel.pushReceipt(request);
|
||||
@ -189,6 +190,7 @@ public class QRRefundProcessFragment extends DataBindingFragment {
|
||||
referenceNo,
|
||||
payDetail != null ? payDetail.getInvoiceNo() : "",
|
||||
payDetail != null ? payDetail.getVoucherNo() : "",
|
||||
payDetail != null ? payDetail.getQrReferNo() != null ? payDetail.getQrReferNo() : "" : "" ,
|
||||
TransResultStatus.FAIL
|
||||
);
|
||||
sharedViewModel.pushReceipt(request);
|
||||
|
||||
@ -51,6 +51,7 @@ public class EReceiptUtil {
|
||||
public EReceiptRequest generateQRReceipt(PayDetail payDetail, TransResultStatus status) {
|
||||
|
||||
String terminalIdForEreceipt = SystemParamsOperation.getInstance().getTerminalIdForEreceipt();
|
||||
String hostId = SystemParamsOperation.getInstance().getSecHostId();
|
||||
|
||||
double realAmount = payDetail.getAmount() / 100.0;
|
||||
DecimalFormat df = new DecimalFormat("0.00");
|
||||
@ -60,10 +61,8 @@ public class EReceiptUtil {
|
||||
.format(new java.util.Date());
|
||||
EReceiptRequest request = new EReceiptRequest();
|
||||
request.setDE3("QR");
|
||||
|
||||
request.setDE7(currentTimeStamp);
|
||||
request.setDE37(payDetail.getReferNo());
|
||||
|
||||
request.setDE49("MMK");
|
||||
request.setSerial(serialNum);
|
||||
request.setAppId(packageName);
|
||||
@ -71,6 +70,9 @@ public class EReceiptUtil {
|
||||
request.setDE42(qrMerchantId);
|
||||
request.setTerminalId(terminalIdForEreceipt);
|
||||
request.setShortCode(qrMerchantId);
|
||||
request.setMmqrRef(payDetail.getQrReferNo() == null ? "" : payDetail.getQrReferNo());
|
||||
request.setHostId(hostId);
|
||||
|
||||
|
||||
request.setInvoiceNumber(payDetail.getInvoiceNo());
|
||||
request.setDE11(payDetail.getVoucherNo());
|
||||
@ -102,6 +104,7 @@ public class EReceiptUtil {
|
||||
String referenceNo,
|
||||
String invoiceNo,
|
||||
String voucherNo,
|
||||
String mmqrRef,
|
||||
TransResultStatus status
|
||||
) {
|
||||
long amt = POSUtil.getInstance().convertAmount(refundAmount);
|
||||
@ -109,6 +112,7 @@ public class EReceiptUtil {
|
||||
DecimalFormat df = new DecimalFormat("0.00");
|
||||
String amount = df.format(realAmount);
|
||||
String terminalIdForEreceipt = SystemParamsOperation.getInstance().getTerminalIdForEreceipt();
|
||||
String hostId = SystemParamsOperation.getInstance().getSecHostId();
|
||||
|
||||
String currentTimeStamp = new java.text.SimpleDateFormat("MMddHHmmss", java.util.Locale.getDefault())
|
||||
.format(new java.util.Date());
|
||||
@ -127,6 +131,7 @@ public class EReceiptUtil {
|
||||
request.setShortCode(qrMerchantId);
|
||||
request.setInvoiceNumber(invoiceNo != null ? invoiceNo : "");
|
||||
request.setDE11(voucherNo != null ? voucherNo : "");
|
||||
request.setHostId(hostId);
|
||||
|
||||
// need to add payment identifier field too
|
||||
|
||||
|
||||
@ -182,6 +182,7 @@ public class TMSSetupsImpl implements TMSSetups{
|
||||
|
||||
if( siriusHost.getTyp().equals("QR")) {
|
||||
|
||||
SystemParamsOperation.getInstance().setSecHostId(siriusHost.getId());
|
||||
SystemParamsOperation.getInstance().setSecHostName(siriusHost.getName());
|
||||
SystemParamsOperation.getInstance().setSecHostTerminalId(siriusHost.getTid());
|
||||
SystemParamsOperation.getInstance().setSecHostMerchantId(extractDigits(siriusHost.getMid()));
|
||||
|
||||
@ -37,10 +37,19 @@ public class EReceiptRequest {
|
||||
private String batchNumber;
|
||||
private String shortCode;
|
||||
private String terminalId;
|
||||
private String mmqrRef;
|
||||
|
||||
private String hostId;
|
||||
|
||||
public EReceiptRequest() {}
|
||||
|
||||
// GETTERS
|
||||
|
||||
|
||||
public String getHostId(){ return hostId; }
|
||||
|
||||
public void setHostId(String hostId){ this.hostId = hostId; }
|
||||
public String getMmqrRef(){ return mmqrRef; }
|
||||
public String getTerminalId(){ return terminalId; }
|
||||
public String getShortCode(){ return shortCode; }
|
||||
|
||||
@ -239,6 +248,5 @@ public class EReceiptRequest {
|
||||
public void setCardLabel(String cardLabel) {
|
||||
this.cardLabel = cardLabel;
|
||||
}
|
||||
|
||||
|
||||
public void setMmqrRef(String mmqrRef){ this.mmqrRef = mmqrRef; }
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package com.utsmyanmar.baselib.network.model.sirius;
|
||||
|
||||
public class SiriusHost {
|
||||
|
||||
private String id;
|
||||
private String name;
|
||||
private String description;
|
||||
|
||||
@ -19,7 +20,7 @@ public class SiriusHost {
|
||||
|
||||
private String typ;
|
||||
|
||||
public SiriusHost(String name, String description, String primaryIP, String secondaryIP, String currency, String mid, String tid) {
|
||||
public SiriusHost(String id ,String name, String description, String primaryIP, String secondaryIP, String currency, String mid, String tid) {
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.primaryIP = primaryIP;
|
||||
@ -27,6 +28,13 @@ public class SiriusHost {
|
||||
this.currency = currency;
|
||||
this.mid = mid;
|
||||
this.tid = tid;
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setId(String id){ this.id = id; }
|
||||
|
||||
public String getId(){
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
|
||||
@ -1676,4 +1676,15 @@ public class SystemParamsOperation {
|
||||
params.setTerminalName(description);
|
||||
saveSystemParamsSettings(params);
|
||||
}
|
||||
|
||||
public void setSecHostId(String id) {
|
||||
SystemParamsSettings params = getSystemParamsSettings();
|
||||
params.setSecHostId(id);
|
||||
saveSystemParamsSettings(params);
|
||||
}
|
||||
|
||||
public String getSecHostId(){
|
||||
SystemParamsSettings paramsSettings = getSystemParamsSettings();
|
||||
return paramsSettings.getSecHostId();
|
||||
}
|
||||
}
|
||||
@ -95,6 +95,8 @@ public class SystemParamsSettings implements Serializable {
|
||||
|
||||
private String hostName = "";
|
||||
|
||||
private String secHostId = "";
|
||||
|
||||
private String secHostName = "";
|
||||
|
||||
private String secHostIpAddress = "";
|
||||
@ -1018,6 +1020,14 @@ public class SystemParamsSettings implements Serializable {
|
||||
this.terminalName = terminalName;
|
||||
}
|
||||
|
||||
public void setSecHostId(String id) {
|
||||
this.secHostId = id;
|
||||
}
|
||||
|
||||
public String getSecHostId() {
|
||||
return secHostId;
|
||||
}
|
||||
|
||||
/* // 流水号起始
|
||||
private String serialNum = Configs.getInstance().SERIAL_NUM();
|
||||
// 批次号起始
|
||||
|
||||
Loading…
Reference in New Issue
Block a user