@Test public void testGetReceiptFromPaymentResponseWithoutReceipt() throws IOException { TerminalAPIResponse terminalAPIResponse = createResponseFromFile(TEST_RESPONSE_DIR+"SaleToPOIResponse.json"); String receipt = TerminalAPIUtil.getReceiptFromPaymentResponse(terminalAPIResponse); assertNotNull(receipt); assertEquals("<table class='terminal-api-receipt'></table>", receipt); }
public static String getReceiptFromPaymentResponse(TerminalAPIResponse terminalApiResponse) { String posReceipt = null; if (terminalApiResponse != null && terminalApiResponse.getSaleToPOIResponse() != null && terminalApiResponse.getSaleToPOIResponse().getPaymentResponse() != null) { posReceipt = TerminalAPIUtil.formatTerminalAPIReceipt(terminalApiResponse.getSaleToPOIResponse().getPaymentResponse().getPaymentReceipt()); } return posReceipt; }
TerminalAPIUtil { public static String getReceiptFromPaymentResponse(TerminalAPIResponse terminalApiResponse) { String posReceipt = null; if (terminalApiResponse != null && terminalApiResponse.getSaleToPOIResponse() != null && terminalApiResponse.getSaleToPOIResponse().getPaymentResponse() != null) { posReceipt = TerminalAPIUtil.formatTerminalAPIReceipt(terminalApiResponse.getSaleToPOIResponse().getPaymentResponse().getPaymentReceipt()); } return posReceipt; } }
TerminalAPIUtil { public static String getReceiptFromPaymentResponse(TerminalAPIResponse terminalApiResponse) { String posReceipt = null; if (terminalApiResponse != null && terminalApiResponse.getSaleToPOIResponse() != null && terminalApiResponse.getSaleToPOIResponse().getPaymentResponse() != null) { posReceipt = TerminalAPIUtil.formatTerminalAPIReceipt(terminalApiResponse.getSaleToPOIResponse().getPaymentResponse().getPaymentReceipt()); } return posReceipt; }  }
TerminalAPIUtil { public static String getReceiptFromPaymentResponse(TerminalAPIResponse terminalApiResponse) { String posReceipt = null; if (terminalApiResponse != null && terminalApiResponse.getSaleToPOIResponse() != null && terminalApiResponse.getSaleToPOIResponse().getPaymentResponse() != null) { posReceipt = TerminalAPIUtil.formatTerminalAPIReceipt(terminalApiResponse.getSaleToPOIResponse().getPaymentResponse().getPaymentReceipt()); } return posReceipt; }  static ResultType getStatusResultFromStatusResponse(TerminalAPIResponse terminalApiResponse); static ErrorConditionType getErrorConditionForPaymentFromStatusResponse(TerminalAPIResponse terminalApiResponse); static ErrorConditionType getErrorConditionForPaymentResponse(TerminalAPIResponse terminalApiResponse); static ErrorConditionType getErrorConditionForStatusFromStatusResponse(TerminalAPIResponse terminalApiResponse); static ResultType getPaymentResultFromStatusOrPaymentResponse(TerminalAPIResponse terminalApiResponse); static String getReceiptFromPaymentResponse(TerminalAPIResponse terminalApiResponse); static String getReceiptFromStatusResponse(TerminalAPIResponse terminalApiResponse); static String formatTerminalAPIReceipt(List<PaymentReceipt> paymentReceipts); static String getErrorMessageForNonAuthorizedPosPayment(TerminalAPIResponse terminalApiResponse); static String getErrorMessageByPosErrorCondition(ErrorConditionType errorCondition); }
TerminalAPIUtil { public static String getReceiptFromPaymentResponse(TerminalAPIResponse terminalApiResponse) { String posReceipt = null; if (terminalApiResponse != null && terminalApiResponse.getSaleToPOIResponse() != null && terminalApiResponse.getSaleToPOIResponse().getPaymentResponse() != null) { posReceipt = TerminalAPIUtil.formatTerminalAPIReceipt(terminalApiResponse.getSaleToPOIResponse().getPaymentResponse().getPaymentReceipt()); } return posReceipt; }  static ResultType getStatusResultFromStatusResponse(TerminalAPIResponse terminalApiResponse); static ErrorConditionType getErrorConditionForPaymentFromStatusResponse(TerminalAPIResponse terminalApiResponse); static ErrorConditionType getErrorConditionForPaymentResponse(TerminalAPIResponse terminalApiResponse); static ErrorConditionType getErrorConditionForStatusFromStatusResponse(TerminalAPIResponse terminalApiResponse); static ResultType getPaymentResultFromStatusOrPaymentResponse(TerminalAPIResponse terminalApiResponse); static String getReceiptFromPaymentResponse(TerminalAPIResponse terminalApiResponse); static String getReceiptFromStatusResponse(TerminalAPIResponse terminalApiResponse); static String formatTerminalAPIReceipt(List<PaymentReceipt> paymentReceipts); static String getErrorMessageForNonAuthorizedPosPayment(TerminalAPIResponse terminalApiResponse); static String getErrorMessageByPosErrorCondition(ErrorConditionType errorCondition); static final Logger LOGGER; }