In this section, you can find different scenarios for testing Klarna’s payment and checkout flows.
Test your Klarna integration by following the steps for each of the cases below. If a test case or a step doesn't apply to your store, for example, you don't offer partial refunds, skip the test case.
The cases cover 4 main stages of the order lifecycle:
Here are some things to keep in mind when you test:
Happy testing!
Don't use any real-life data when testing. Instead, use the sample customer data and sample payment data.
This test case lets you test placing an order that contains 1 item, capturing the order in full, and processing a refund for the order returned by your customer.
In the first stage, you place an order.
In the second stage, the goods are shipped to the customer and you capture the order to receive a payout for the items sold.
In the final stage, the customer returns the order and you refund the order amount back to the customer.
This test case lets you test placing an order that contains 2 items, capturing the order in full, and processing a refund for 1 out of 2 items.
In the process, you'll verify that the cart is being updated correctly when you navigate between the checkout and the product pages.
In the first stage, you place an order.
In the second stage, the goods are shipped to the customer and you capture the order to receive a payout for the items sold.
In the final stage, the customer returns 1 out of 2 items from the order and you refund the item amount back to the customer.
This test case lets you test placing an order that contains 2 items, capturing 1 out of 2 order items, and releasing the authorized amount for the other item that can't be shipped.
In the first stage, you place an order.
In the second stage, 1 item is shipped to the customer and you capture the order to receive a payout for that item.
In the final stage, you release the previously authorized amount for the item that wasn't captured back to the customer.
This test case lets you test placing an order that contains 1 item, applying a discount, capturing the order in full, and processing a refund.
In the first stage, you place an order.
In the second stage, the goods are shipped to the customer and you capture the order to receive a payout for the items sold.
In the final stage, the customer returns the order and you refund the order amount back to the customer.
This test case lets you test placing an order that contains 2 items, applying a gift card, capturing the order in full, and processing a refund for 1 out of 2 items.
In the first stage, you place an order.
In the second stage, the goods are shipped to the customer and you capture the order to receive a payout for the items sold.
In the final stage, the customer returns 1 out of 2 items from the order and you refund the item amount back to the customer.
This test case lets you test placing an order that contains 1 item, and canceling the order before it's captured.
In the first stage, you place an order.
In this stage, you cancel the order that can't be fulfilled.
This test case lets you test placing an order that contains 1 item while providing different billing and shipping addresses.
In the first stage, you place an order.
This test case lets you test placing an order that contains 1 item while applying a shipping fee to the order.
In the first stage, you place an order.
If you want to check if the test orders contain the correct details, review the logs in the Merchant portal. Refer to Klarna's API reference to learn about specific parameters and values in each request.
Order characteristics | Applicable test cases | Expected results in Logs |
---|---|---|
All placed orders | 1–8 | The order_lines object contains the product_url and image_url values. |
Refund an order | 1, 2, 4, 5 | The response header includes the refund's URI and ID. |
Order placed with a discount code | 4 | The order_lines object contains either:
|
Order placed with a gift card | 5 | The order_lines object contains a separate order line with type equal to gift_card and a negative amount value. |
Order placed with different billing and shipping addresses | 7 | The billing_address object and the shipping_address object have different values, corresponding to the values entered in the widget. |
An order with a shipping fee | 8 | A separate order_line with type equal to shipping_fee includes the correct shipping fee amount. |