How to distribute the HPP Session

After creating the HPP Session it will be necessary to get the Consumer access it so that they can complete the payment. This distribution of the HPP Session will change depending on the use case you are trying to achieve.

Technical constrains are defined by the use case (eCommerce, In-store or Telesales) and would most likely be covered by these cases:

  1. The Consumer is already on a website that you own. You are able to redirect their browser to the Hosted Payment Page. This use case is the most easy to fulfill and you can directly read our chapter on Redirection.

  2. The Consumer is interacting indirectly with your system, for example:

    • By speaking with a Salesperson
    • By email or via another asynchronous communication mechanism

    In all of these cases, you will need to get the Consumer use a web browser to actually access the Hosted Payment Page, and for that you can use our advanced distribution mechanisms.

  3. The Consumer is interacting with your system using a shared device, for example a Kiosk in a store. As Privacy standards are not met, it is also required to use advanced distribution mechanisms.

All distribution mechanisms can be used in the same way with Klarna Payments and Klarna Checkout.

Redirection

When creating the HPP Session you get back a redirection_url that can be used by a Consumer to access the Payment Page. You just need to redirect the Consumer to this URL.

If you expect the Consumer to be redirected to your own website after completing the payment, or by going back or cancelling, you will need to pass in Merchant URLs in the Create Session call .

This distribution mechanism is usually used in an eCommerce ecosystem and is not really adapted to In-store or Telesales.

NameUsage
Name
success
Usage
Consumer will get redirected there after a successful authorization of payment. Consumer may have seen a confirmation from Klarna before getting redirected, but it is mandatory that the integrator displays information about the payment that has just been authorized.
Name
failure
Usage
Consumer will get redirected there when payment was refused by Klarna. If an error occurs and no error URL was given, then the consumer will also get redirect to this URL. They will have seen a message explaining reasons of decline from Klarna before-hand.
Name
back
Usage
Consumer will get redirected there when clicking on the back button. This URL is recommended in an eCommerce flow and any cancel will be treated as a back URL. Whe consumers get redirected to the back URL, they can still access to the Payment Page, meaning that it is to the integrator’s to actually disable the session if needed. This URL may be used by the consumer to correct any information that was wrongly formated (ex: date of birth).
Name
cancel
Usage
Consumer will get redirected there when clicking on the cancellation button. This URL can’t be used in an eCommerce flow and will be considered as a back URL, meaning that the session won’t be cancelled. See back button versus cancel button chapter.
Name
error
Usage
Consumer will get redirected there when an error occurred in the flow. If this parameter is not set and a failure URL is present, the Consumer will get redirected to the failure one and integrator won’t be able to tell the difference between an error and a decline.

Cancel and Back - what are the difference

It is not possible to use both back and cancel options simultaneously, because the user interface will be adapted to use one of them:

  • When consumer has a back button on the page, then the Payment Page is still reachable after clicking on the button. It means that they can come back with their browser, or that you can redirected them back to the same redirect_url without changing anything.
  • When consumer has a cancel button on the page, they will get prompter to validate that they want to actually cancel the payment. If they do so, then the HPP Session will now be in a CANCELLED state and consumer won’t be able to interact with the payment anymore.

You can find out more on the difference between the IN_PROGRESS and CANCELLED states on our guide to track the HPP session status .

When on eCommerce, the value for the cancel URL is systematically considered as a back URL and consumers will always be able to come back to the Payment Page.

SMS/Email delivery

Use the distribution endpoint if you want to distribute to the Consumer a link to the Hosted Payment Page either by e-mail or SMS. A message will be sent directly to the Consumer and will be localised to the Consumer’s language, it will contain a link. When using the link, the Consumer will see the specific Hosted Payment Page. The phone number or e-mail address will be used by Klarna to try to pre-fill the Consumer if they already used Klarna before and agreed to be pre-filled, which will increase the speed of the payment.

Read our API reference on distributing the session by SMS or e-mail

QR Code

A qr_code_url is provided back in the creation call of the HPP Session, this URL is a public URL that can be displayed on every browser and doesn’t need any authentication.

You can embedded this picture in a display that can be seen by the Consumer, who would be able for example to read the QR Code using they mobile phone. The link embedded in the QR Code is leading to the Payment Page of the HPP Session. They will then be able to proceed to payment.

QR code leading to the Hosted Payment PageQR code leading to the Hosted Payment Page