Klarna Docs - Customization

Customization

WhenĀ creating an HPP SessionĀ you have some optional parameters that will let you modify the look and feel of Klarnaā€™s Hosted Payment Page in order to better match your own branding.

WhenĀ creating an HPP SessionĀ you can define the URL that you want the Consumer to be redirected to after making an action on the payment page. These URLs are in theĀ merchant_urlsĀ block, but they are also optional. When you donā€™t put any value in there, generic pages are displayed to the Consumer.

Failure

Cancellation

A description of the options that can be passed to HPP. All of these are optional, some default to a sensible value if omitted in the call.

When provided your logo and feature image will appear on the Hosted Payment Page, their positions will depend on the Consumerā€™s browser capacities as HPP as different responsive designs. Both can be configured through the merchant portal. Merchants can try their setup in playground as well as production environment. It may take sometime for the changes to reflect on HPP.

Logo configuration is documented atĀ Merchant Branding Configuration Page

Use this parameter to send a list of images to use as backgrounds on the payment page. HPP will use the image that fits the better to the Consumerā€™s browser capacities using the width parameter given. Images have to be served over HTTPS to avoid all kind of security warning on the Consumerā€™s browser.

Keybackground_images
DescriptionA list of images to be used as the background for HPP
TypeArray
Defaultnone
ParameterTypeUsage
urlStringUrl of the image, must be served over HTTPS
widthIntWidth of the screen the image works best on
JSON
{
    "options": {
        "background_images": [
            {
                "url": "https://example.com/background.jpg",
                "width": 1280
            },
            {
                "url": "https://example.com/background_small.jpg",
                "width": 480

Use this parameter to modify the title of the Hosted Payment Page. This title is shown in the page and as header of the Consumerā€™s browser. As it is defined by you, you are responsible of its localization to the Locale of the Consumer.

Keypage_title
DescriptionTitle on top of the Hosted Payment Page
TypeString
DefaultComplete your purchase
JSON
{
    "options": {
        "page_title": "Complete your purchase"
    }
}

Depending on the kind of goods you are selling, use this parameter to change the label of the button on which the Consumer will click to finalize the purchase. Label is localized in the locale of the Session.

Keypurchase_type
DescriptionPurchase type, reflected in the complete purchase button on the bottom of HPP
TypeEnum
Accepted valuesBOOK,BUY,CONTINUE,DOWNLOAD,ORDER,RENT,SUBSCRIBE,PAY
DefaultBUY
ValueButton label in English
BOOKBook
BUYBuy
CONTINUEContinue
DOWNLOADDownload
ORDEROrder
RENTRent
SUBSCRIBESubscribe
PAYPay
JSON
{
    "options": {
        "purchase_type": "buy"
    }
}

Use this parameter to enable the user to go back to purchase page while providing the flexibility to you to end or keep alive the purchase session. When provided, a ā€œGo Backā€ button will be displayed on the page instead of a ā€œCancelā€ button and the consumer will get redirected to this url on clicking on the go back button.

SeeĀ back button versus cancel button chapterĀ for more information.

Keyback
DescriptionRedirection url on back button click
TypeString
DefaultThere is no back button by default. If this parameter is not provided, a cancel button will be displayed.
JSON
{
    "merchant_urls": {
        "back": "https://example.com/back?token=<random_uuid>&sid={{session_id}}"
    }
}

Documented in theĀ KP docs