@Test public void testGetHiddenFiled() { final AbstractPayPalPaymentGatewayImpl pg = new AbstractPayPalPaymentGatewayImpl() { @Override public Payment authorizeCapture(final Payment payment, final boolean forceProcessing) { return null; } @Override public Payment authorize(final Payment payment, final boolean forceProcessing) { return null; } @Override public Payment reverseAuthorization(final Payment payment, final boolean forceProcessing) { return null; } @Override public Payment capture(final Payment payment, final boolean forceProcessing) { return null; } @Override public Payment voidCapture(final Payment payment, final boolean forceProcessing) { return null; } @Override public Payment refund(final Payment payment, final boolean forceProcessing) { return null; } @Override public PaymentGatewayFeature getPaymentGatewayFeatures() { return null; } @Override public String getHtmlForm(final String cardHolderName, final String locale, final BigDecimal amount, final String currencyCode, final String orderReference, final Payment payment) { return null; } @Override public Payment createPaymentPrototype(final String operation, final Map map, final boolean forceProcessing) { return null; } @Override public Collection<PaymentGatewayParameter> getPaymentGatewayParameters() { return Collections.emptyList(); } }; assertEquals("<input type='hidden' name='qwerty' value='1234567890'>\n", pg.getHiddenFieldValue("qwerty", "1234567890")); assertEquals("<input type='hidden' name='qwerty' value='1234567890'>\n", pg.getHiddenFieldValue("qwerty", "1'234'567'890")); }
String getHiddenFieldValue(final String fieldName, final String value) { if (value == null) { return ""; } final String str = value; if (StringUtils.isBlank(str)) { return ""; } return "<input type='hidden' name='" + fieldName + "' value='" + StringUtils.remove(value, '\'') + "'>\n"; }
AbstractPayPalPaymentGatewayImpl implements ConfigurablePaymentGateway, PaymentGateway { String getHiddenFieldValue(final String fieldName, final String value) { if (value == null) { return ""; } final String str = value; if (StringUtils.isBlank(str)) { return ""; } return "<input type='hidden' name='" + fieldName + "' value='" + StringUtils.remove(value, '\'') + "'>\n"; } }
AbstractPayPalPaymentGatewayImpl implements ConfigurablePaymentGateway, PaymentGateway { String getHiddenFieldValue(final String fieldName, final String value) { if (value == null) { return ""; } final String str = value; if (StringUtils.isBlank(str)) { return ""; } return "<input type='hidden' name='" + fieldName + "' value='" + StringUtils.remove(value, '\'') + "'>\n"; }  }
AbstractPayPalPaymentGatewayImpl implements ConfigurablePaymentGateway, PaymentGateway { String getHiddenFieldValue(final String fieldName, final String value) { if (value == null) { return ""; } final String str = value; if (StringUtils.isBlank(str)) { return ""; } return "<input type='hidden' name='" + fieldName + "' value='" + StringUtils.remove(value, '\'') + "'>\n"; }  @Override String getShopCode(); @Override String getLabel(); @Override String getName(final String locale); @Override Collection<PaymentGatewayParameter> getPaymentGatewayParameters(); @Override void deleteParameter(final String parameterLabel); @Override void addParameter(final PaymentGatewayParameter paymentGatewayParameter); @Override void updateParameter(final PaymentGatewayParameter paymentGatewayParameter); void setPaymentGatewayParameterService(
            final PaymentGatewayParameterService paymentGatewayParameterService); @Override String getParameterValue(final String valueLabel); @Override void accept(final PaymentGatewayConfigurationVisitor visitor); }
AbstractPayPalPaymentGatewayImpl implements ConfigurablePaymentGateway, PaymentGateway { String getHiddenFieldValue(final String fieldName, final String value) { if (value == null) { return ""; } final String str = value; if (StringUtils.isBlank(str)) { return ""; } return "<input type='hidden' name='" + fieldName + "' value='" + StringUtils.remove(value, '\'') + "'>\n"; }  @Override String getShopCode(); @Override String getLabel(); @Override String getName(final String locale); @Override Collection<PaymentGatewayParameter> getPaymentGatewayParameters(); @Override void deleteParameter(final String parameterLabel); @Override void addParameter(final PaymentGatewayParameter paymentGatewayParameter); @Override void updateParameter(final PaymentGatewayParameter paymentGatewayParameter); void setPaymentGatewayParameterService(
            final PaymentGatewayParameterService paymentGatewayParameterService); @Override String getParameterValue(final String valueLabel); @Override void accept(final PaymentGatewayConfigurationVisitor visitor);  }