error slip printing error fixed
This commit is contained in:
parent
d92c18f3f7
commit
e51d658733
@ -170,9 +170,10 @@ public class TransactionResultFragment extends DataBindingFragment implements Da
|
|||||||
|
|
||||||
if (isNonApprovedTrade(payDetail) && isNonQRPayTransaction(transactionType)) {
|
if (isNonApprovedTrade(payDetail) && isNonQRPayTransaction(transactionType)) {
|
||||||
if (SystemParamsOperation.getInstance().getPrinterEnabled()) {
|
if (SystemParamsOperation.getInstance().getPrinterEnabled()) {
|
||||||
startPrintProcess(false);
|
startPrintErrorReceipt();
|
||||||
|
} else {
|
||||||
|
isCardInside();
|
||||||
}
|
}
|
||||||
isCardInside();
|
|
||||||
} else if (transactionType == TransactionsType.SETTLEMENT || transactionType == TransactionsType.MMQR_SETTLEMENT) {
|
} else if (transactionType == TransactionsType.SETTLEMENT || transactionType == TransactionsType.MMQR_SETTLEMENT) {
|
||||||
handleSettlementTransaction(siriusReq);
|
handleSettlementTransaction(siriusReq);
|
||||||
} else if (isQRPayNonSuccessTransaction(transactionType, payDetail)) {
|
} else if (isQRPayNonSuccessTransaction(transactionType, payDetail)) {
|
||||||
@ -378,6 +379,50 @@ public class TransactionResultFragment extends DataBindingFragment implements Da
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void startPrintErrorReceipt() {
|
||||||
|
PrintHelper.getInstance().checkPaperRollStatus(new PaperRollStatusCallback() {
|
||||||
|
@Override
|
||||||
|
public void printerReady() {
|
||||||
|
sharedViewModel.printErrorReceipt(new PrintXStatus() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
isCardInside();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure() {
|
||||||
|
handleForEmptyPaperRoll(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void paperRollIsEmpty() {
|
||||||
|
handleForEmptyPaperRoll(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void printNotComplete() {
|
||||||
|
handleForEmptyPaperRoll(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void printerTooHot() {
|
||||||
|
handleForEmptyPaperRoll(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void printerFailed() {
|
||||||
|
handleForEmptyPaperRoll(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void unknownStatusOccur(int code) {
|
||||||
|
handleForEmptyPaperRoll(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private void handleForEmptyPaperRoll(boolean isSettle) {
|
private void handleForEmptyPaperRoll(boolean isSettle) {
|
||||||
cancelTimeout();
|
cancelTimeout();
|
||||||
|
|
||||||
@ -392,7 +437,11 @@ public class TransactionResultFragment extends DataBindingFragment implements Da
|
|||||||
@Override
|
@Override
|
||||||
public void onClickRetry() {
|
public void onClickRetry() {
|
||||||
dismissPrinterAlertDialog();
|
dismissPrinterAlertDialog();
|
||||||
startPrintProcess(isSettle);
|
if (isSettle) {
|
||||||
|
startPrintProcess(true);
|
||||||
|
} else {
|
||||||
|
startPrintErrorReceipt();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -403,6 +403,10 @@ public class SharedViewModel extends ViewModel {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void printErrorReceipt(PrintXStatus printXStatus) {
|
||||||
|
PrintXReceipt.getInstance().printSmileReceipt(payDetail.getValue(), true, printXStatus);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void startPrintReceipt(boolean isFirstPrint) {
|
public void startPrintReceipt(boolean isFirstPrint) {
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -1648,6 +1648,7 @@ public abstract class BaseXPrint {
|
|||||||
|
|
||||||
if (printer.getStatus() != SdkResult.Success) {
|
if (printer.getStatus() != SdkResult.Success) {
|
||||||
callbackStatus.onFailure();
|
callbackStatus.onFailure();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
printer.startPrint(true, new OnPrintListener() {
|
printer.startPrint(true, new OnPrintListener() {
|
||||||
|
|||||||
@ -112,6 +112,9 @@ public class PrintXImpl extends BaseXPrint implements PrintX {
|
|||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
if (callbackStatus != null) {
|
||||||
|
callbackStatus.onFailure();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -177,6 +180,9 @@ public class PrintXImpl extends BaseXPrint implements PrintX {
|
|||||||
|
|
||||||
} catch (RemoteException | NullPointerException e) {
|
} catch (RemoteException | NullPointerException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
if (callbackStatus != null) {
|
||||||
|
callbackStatus.onFailure();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -305,6 +311,9 @@ public class PrintXImpl extends BaseXPrint implements PrintX {
|
|||||||
|
|
||||||
} catch (RemoteException | NullPointerException e) {
|
} catch (RemoteException | NullPointerException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
if (callbackStatus != null) {
|
||||||
|
callbackStatus.onFailure();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user