LiqPayPaymentGatewayImpl extends AbstractLiqPayPaymentGatewayImpl implements PaymentGatewayExternalForm, CallbackAware { @Override public String getHtmlForm(final String cardHolderName, final String locale, final BigDecimal amount, final String currencyCode, final String orderReference, final Payment payment) { final LiqPay api = getLiqPayAPI(); final HashMap<String, String> params = new LinkedHashMap<>(); params.put("amount", amount.setScale(2, RoundingMode.HALF_UP).toPlainString()); params.put("server_url", getParameterValue(LP_SERVER_URL)); params.put("description", getDescription(payment)); params.put("pay_way", getParameterValue(LP_PAYWAY_URL)); params.put("result_url", getParameterValue(LP_RESULT_URL)); params.put("type", "buy"); params.put("order_id", orderReference); params.put("currency", currencyCode); params.put("formDataOnly", "formDataOnly"); final String form = api.cnb_form(params); LOG.debug("LiqPay form request: {}", form); return form; }  @Override String getPostActionUrl(); @Override String getSubmitButton(final String locale); @Override Callback convertToCallback(final Map privateCallBackParameters,
                                      final boolean forceProcessing); @Override CallbackAware.CallbackResult getExternalCallbackResult(final Map<String, String> callbackResult,
                                                                  final boolean forceProcessing); @Override void preProcess(final Payment payment, final Callback callback, final String processorOperation); @Override void postProcess(final Payment payment, final Callback callback, final String processorOperation); @Override String getHtmlForm(final String cardHolderName, final String locale, final BigDecimal amount,
                              final String currencyCode, final String orderReference, final Payment payment); @Override Payment authorizeCapture(final Payment payment, final boolean forceProcessing); @Override Payment authorize(final Payment paymentIn, final boolean forceProcessing); @Override Payment reverseAuthorization(final Payment paymentIn, final boolean forceProcessing); @Override Payment capture(final Payment paymentIn, final boolean forceProcessing); @Override Payment voidCapture(final Payment paymentIn, final boolean forceProcessing); @Override Payment refund(final Payment payment, final boolean forceProcessing); @Override Payment createPaymentPrototype(final String operation,
                                          final Map map,
                                          final boolean forceProcessing); @Override PaymentGatewayFeature getPaymentGatewayFeatures();  }
@Test public void testGetHtmlForm() throws Exception { final Map<String, String> params = new HashMap<>(); params.put(LiqPayPaymentGatewayImpl.LP_MERCHANT_ID, "00001"); params.put(LiqPayPaymentGatewayImpl.LP_MERCHANT_KEY, "secret"); params.put(LiqPayPaymentGatewayImpl.LP_PAYWAY_URL, "card"); params.put(LiqPayPaymentGatewayImpl.LP_SERVER_URL, "http: params.put(LiqPayPaymentGatewayImpl.LP_RESULT_URL, "http: final LiqPayPaymentGatewayImpl gatewayImpl = new LiqPayPaymentGatewayImpl() { @Override public String getParameterValue(String valueLabel) { if (params.containsKey(valueLabel)) { return params.get(valueLabel); } return ""; } }; String htmlFormPart = gatewayImpl.getHtmlForm( "holder name", "en", BigDecimal.TEN.setScale(2), "USD", "234-1324-1324-1324sdf-sdf", createTestPayment() ); assertEquals("<input type=\"hidden\" name=\"amount\" value=\"10.00\" />\n" + "<input type=\"hidden\" name=\"server_url\" value=\"http: "<input type=\"hidden\" name=\"description\" value=\"code2 x 1, bob@doe.com, 1234\" />\n" + "<input type=\"hidden\" name=\"pay_way\" value=\"card\" />\n" + "<input type=\"hidden\" name=\"result_url\" value=\"http: "<input type=\"hidden\" name=\"type\" value=\"buy\" />\n" + "<input type=\"hidden\" name=\"order_id\" value=\"234-1324-1324-1324sdf-sdf\" />\n" + "<input type=\"hidden\" name=\"currency\" value=\"USD\" />\n" + "<input type=\"hidden\" name=\"public_key\" value=\"00001\" />\n" + "<input type=\"hidden\" name=\"signature\" value=\"p5wT9l3BB3XxwRnyVLOQNX8LFvQ=\" />\n", htmlFormPart); }