Payment Page

Payment Page Model

public class Paypage implements PaymentType {
    public enum Status {SUCCESS, PENDING, ERRROR}

    private String id;
    private BigDecimal amount;
    private Currency currency;
    private URL returnUrl;

    private String logoImage;
    private String basketImage;
    private String fullPageImage;
    private String shopName;
    private String descriptionMain;
    private String descriptionSmall;
    private String shopDescription;
    private String tagline;
    private Map<String, String> css;
    private URL termsAndConditionUrl;
    private URL privacyPolicyUrl;
    private URL impressumUrl;
    private URL imprintUrl;
    private URL helpUrl;
    private URL contactUrl;
    private String invoiceId;
    private String orderId;
    private String card3ds;
    private String billingAddressRequired;
    private String shippingAddressRequired;
    private Map<String, String> additionalAttributes;
    private String[] excludeTypes;
    private Status status;
    private String action;
    private String redirectUrl;
    private String customerId;
    private String metadataId;
    private String paymentId;
    private String basketId;

Create and initialize payment page request

Create and initialize css map

protected Map<String, String> getCssMap() {
        Map<String, String> cssMap = new HashMap<String, String>();
        cssMap.put("shopDescription", "color: blue; font-size: 30px");
        cssMap.put("tagline", "color: blue; font-size: 30px");
        cssMap.put("header", "background-color: white");
        cssMap.put("shopName", "color: blue; font-size: 30px");
        cssMap.put("contactUrl", "color: blue; font-size: 30px");
        cssMap.put("helpUrl", "color: blue; font-size: 30px");
        return cssMap;

Create payment page request

protected Paypage getMaximumPaypage() throws MalformedURLException {
        Paypage paypage = new Paypage();
        String[] excludeTypes = {"paypal"};
        paypage.setReturnUrl(new URL(getReturnUrl()));
        paypage.setShopName("Heidelpay Demo Shop");
        paypage.setShopDescription("Heidelpay Demo Shop Description");
        paypage.setTagline("Heidelpay Tagline");
        paypage.setTermsAndConditionUrl(new URL(""));
        paypage.setPrivacyPolicyUrl(new URL(""));


        paypage.setContactUrl(new URL(""));
        paypage.setHelpUrl(new URL(""));
        paypage.setImprintUrl(new URL(""));
        paypage.setPrivacyPolicyUrl(new URL(""));
        paypage.setTermsAndConditionUrl(new URL(""));

        paypage.setInvoiceId(getRandomId()); // random number
        paypage.setOrderId(getRandomId());// random number
        return paypage;

Create payment page

Paypage request = getMaximumPaypage();
Paypage response = getHeidelpay().paypage(request);