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;
    @Deprecated
    private String basketImage;
    private String fullPageImage;
    private String shopName;
    @Deprecated
    private String descriptionMain;
    @Deprecated
    private String descriptionSmall;
    private String shopDescription;
    private String tagline;
    private Map<String, String> css;
    private URL termsAndConditionUrl;
    private URL privacyPolicyUrl;
    @Deprecated
    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.setExcludeTypes(excludeTypes);
        paypage.setAmount(BigDecimal.ONE);
        paypage.setCurrency(Currency.getInstance("EUR"));
        paypage.setReturnUrl(new URL(getReturnUrl()));
        paypage.setShopName("Heidelpay Demo Shop");
        paypage.setShopDescription("Heidelpay Demo Shop Description");
        paypage.setTagline("Heidelpay Tagline");
        paypage.setTermsAndConditionUrl(new URL("https://www.heidelpay.com/en/privacy-statement/"));
        paypage.setPrivacyPolicyUrl(new URL("https://www.heidelpay.com/en/privacy-statement/"));
        paypage.setCss(getCssMap());

        paypage.setLogoImage("https://www.heidelpay.com/typo3conf/ext/heidelpay_site/Resources/Public/Images/Heidelpay-Logo_mitUnterzeile-orange.svg");
        paypage.setFullPageImage("https://www.heidelpay.com/fileadmin/content/header-Imges-neu/Header_Phone_12.jpg");

        paypage.setContactUrl(new URL("mailto:rene.felder@heidelpay.com"));
        paypage.setHelpUrl(new URL("https://www.heidelpay.com/de/support/"));
        paypage.setImprintUrl(new URL("https://www.heidelpay.com/de/imprint/"));
        paypage.setPrivacyPolicyUrl(new URL("https://www.heidelpay.com/de/datenschutz/"));
        paypage.setTermsAndConditionUrl(new URL("https://www.heidelpay.com/de/datenschutz/"));

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

Create payment page

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