After creating the HPP Session, it will be necessary to get the Consumer to 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:
All distribution mechanisms can be used in the same way with Klarna Payments and Klarna Checkout.
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.
|success||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.|
|failure||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 redirected to this URL. They will have seen a message explaining the reasons for a decline from Klarna beforehand.|
|back||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 abackURL. When consumers get redirected to the back URL, they can still access to the Payment Page, meaning that it is up to the integrator to actually disable the session if needed. This URL may be used by the consumer to correct any information that was wrongly formatted (ex: date of birth).|
|cancel||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.|
|error||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 the integrator won’t be able to tell the difference between an error and a decline.|
It is not possible to use both back and cancel options simultaneously, because the user interface will be adapted to use one of them:
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 go back to the Payment Page.
With the HPP API you can create payment flows that are asynchronous or where you don’t own any website, for example for an In-store payment. You will be able to send payment requests to consumers by SMS, e-mail or letting them read a QR code displayed on a screen. Depending on the use case and whether it is programmatically driven or human driven, you may choose to integrate with our distribution APIs or using our Distribution Module.
The Distribution Module is the recommended way to create flows where payment links are distributed by an operator. An operator can be a store associate, a telesales person or the consumers themselves. This user interface is future proof and will let Klarna optimize for the smooothest experience.
This interface implements all the best practices to get the link delivered to the end Consumer the fastest possible. It supports an interface for a seller (staff, sale associate, clerk) as well as one that is directed to the consumer themselves in a self-checkout context.
After the integration, you will be able to update the features of the interface without making any changes to your code using our profiles mechanism. All it requires is a web application or an application capable of displaying web pages.
For integrations where payment links are sent automatically, or legacy systems that can’t open any web page, you can integrate with our APIs directly.
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.
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.