Klarna Test Cases

Introduction

Pre-requisites

Before you can start testing the Klarna payment method it must be activated for your merchant/shop. Contact your account manager or the Support team to request this configuration.

A valid request for a Klarna Deposit needs to contain the following details:

Test Cases

Klarna Deposit

Klarna Deposit in Checkout

Detailed information for integrating Klarna Deposit via PXP Financial Checkout can be found in the Klarna Deposit Redirect Integration documentation.

Sample test data for different markets can also be found in the Klarna Provider documentation.

#Test Case NameSteps to ExecuteExpected Outcome
KDCO1Initiate a successful Klarna Deposit
(create a successful Klarna session)
1. Specify the shopping cart with all required data
2. Provide customer and shipping information
3. Navigate to the Checkout detail page for Klarna Deposit payment method using getRedirectData request containing all required data mentioned in the previous steps
1. Klarna widgets with available payment options are loaded successfully and displayed on the Checkout detail page.
Which payment options will be displayed depends on the country of the user and payment currency.
2. A Klarna Deposit payment is created and is in the state "InitiatedByProvider"
KDCO2Complete a successful Klarna Pay Later Deposit
(create a successful Klarna order)
1. Initiate a successful Klarna Deposit with the Klarna widgets being loaded on the Checkout detail page
2. Select "Pay later" from the available payment options
3. Select one of the available options within "Pay later"
4. Click "Pay Now" button
1. Customer is redirected to the sucess page
2. The already created Klarna Deposit is updated to Klarna Pay Later Deposit payment based on the selected option and is in the state "ExecutedByProvider"
KDCO3Complete a successful Klarna Pay Now Deposit
(create a successful Klarna order)
1. Initiate a successful Klarna Deposit with the Klarna widgets being loaded on the Checkout detail page
2. Select "Direct Payment" from the available payment options
3. Select one of the available options within "Direct Payment"
4. Click "Pay Now" button
5. Follow the instructions provided within the pop up widget based on your selected option.

Note:
If you select the option "Card", you can enter the following card details before clicking "Pay Now" button:
- Card Number: 4111111111111111
- MM/YY: 12/23
- CVC: 123
1. Customer is redirected to the sucess page
2. The already created Klarna Deposit is updated to Klarna Pay Now Deposit payment based on the selected option and is in the state "ExecutedByProvider"
KDCO4Complete a successful Klarna Financing Deposit
(create a successful Klarna order)
1. Initiate a successful Klarna Deposit with the Klarna widgets being loaded on the Checkout detail page
2. Select "Slice it" from the available payment options
3. Select one of the available options within "Slice it"
4. Click "Pay Now" button
1. Customer is redirected to the sucess page
2. The already created Klarna Deposit is updated to Klarna Financing Deposit payment based on the selected option and is in the state "ExecutedByProvider"
KDCO5Unsuccessful initiation of a Klarna Deposit due to an error received from provider Klarna1. Specify the shopping cart with all required data and a total amount of 110 EUR
2. Specify then a payment gross amount of 120 EUR
3. Provide customer and shipping information
4. Navigate to the Checkout detail page for Klarna Deposit payment method using getRedirectData request containing all required data mentioned in the previous steps
1. Customer is redirected to the error page
2. A Klarna Deposit payment is created and is in the state "InitiateErrorReportedByProvider" with the error "Bad value: order_amount"
KDCO6Unsuccessful initiation of a Klarna Deposit due to no payment option received from provider Klarna1. Specify the shopping cart with all required data and a total amount of 110 EUR
2. Provide customer information with a country = SE (Sweden)
3. Provide shipping information
4. Navigate to the Checkout detail page for Klarna Deposit payment method using getRedirectData request containing all required data mentioned in the previous steps
1. Customer is redirected to the error page
2. A Klarna Deposit payment is created and is in the state "ProviderResponseValidationFailed" with no payment option returned in the initiation response
(Klarna does not support the country-currency combination of SE-EUR)
KDCO7A Klarna order has been denied by provider1. Specify the shopping cart with all required data
2. Provide customer information with an email address e.g. {youremail}[email protected]_
3. Provide shipping information
4. Navigate to the Checkout detail page for Klarna Deposit payment method using getRedirectData request containing all required data mentioned in the previous steps
5. Select one of the available payment options.
6. Click "Pay Now" button
1. Customer stays on the Checkout detail page
2. An error message "Your purchase can not be accepted" is displayed
3. The already created Klarna Deposit payment remains in the state "InitiatedByProvider"
KDCO8Option not available1. Specify the shopping cart with all required data
2. Provide customer information with an email address e.g. {youremail}[email protected]_
3. Provide shipping information
4. Navigate to the Checkout detail page for Klarna Deposit payment method using getRedirectData request containing all required data mentioned in the previous steps
5. Select one of the available payment options.
6. Click "Pay Now" button
1. Customer stays on the Checkout detail page
2. An error message "Option not available" is displayed
3. The already created Klarna Deposit payment remains in the state "InitiatedByProvider"
KDCO9Display of the Date of Birth popup widget1. Specify the shopping cart with all required data
2. Provide customer information and do the following:
- specify country = AT
- do not specify Date of Birth
3. Provide shipping information
4. Navigate to the Checkout detail page for Klarna Deposit payment method using getRedirectData request containing all required data mentioned in the previous steps
5. Select one of the available payment options
6. Click "Pay Now" button
1. Customer stays on the Checkout detail page
2. A widget pops up and asks customer to enter the Date of Birth
KDCO10Display of the National Identification Number popup widget1. Specify the shopping cart with all required data
2. Provide customer information and do the following:
- specify country = SE
- do not specify National Identification Number
3. Provide shipping information
4. Navigate to the Checkout detail page for Klarna Deposit payment method using getRedirectData request containing all required data mentioned in the previous steps
5. Select one of the available payment options
6. Click "Pay Now" button
1. Customer stays on the Checkout detail page
2. A widget pops up and asks customer to enter the National Identification Number

Klarna Deposit in Backend2Backend

Detailed information for integrating Klarna Deposit via Backend2Backend can be found in the Klarna Deposit Backend2Backend Integration documentation.

#Test Case NameSteps to ExecuteExpected Outcome
KDB2B1Successful Klarna deposit1. Initiate payment with all data defined in pre-requisites
2. Display Klarna widget
3. Execute action using the actionID "95030"
A Klarna Deposit payment is created and is in the state "ExecutedByProvider"

Note: Based on the selection in the Klarna widget it will be one of the following payment methods: Klarna Pay Now Deposit (370), Klarna Pay Later Deposit (371) or Klarna Financing Deposit (372)
KDB2B2Unsuccessful Klarna deposit due to missing mandatory data1. Initiate payment with some wrong value(s) defined in pre-requisites
2. Display Klarna widget
3. Execute action using the actionID "95030"
A Klarna Deposit payment is created, but is not in the state ExecutedByProvider

Klarna Capture

Detailed information for integrating Klarna Captures can be found in the Capture a Klarna Payment documentation.

#Test Case NameSteps to ExecuteExpected Outcome
KCAP1Successful full Klarna capture1. Create a successful Klarna deposit payment with amount of 10 €
2. Initiate a payment from reference with payment method Klarna capture for above payment with amount 10 €
A Klarna capture payment is created and is in the state "PendingToBeCaptured". The original Klarna deposit payment remains in state "ExecutedByProvider".
KCAP2Successful partial Klarna capture1. Create a successful Klarna deposit payment with amount of 10 €
2. Initiate a payment from reference with payment method Klarna capture for above payment with amount 5 €
A Klarna capture payment is created and is in the state "PendingToBeCaptured" . The original Klarna deposit payment remains in state "ExecutedByProvider".
KCAP3Successful partial Klarna captures resulting in a full capture1. Create a successful Klarna deposit payment with amount of 10 €
2. Initiate a payment from reference for above payment with amount 5 €
3. Initiate a payment from reference with payment method Klarna capture for payment from step 1 with amount 5 €
2 Klarna capture payments are created and the state is "PendingToBeCaptured". The original Klarna deposit payment remains in state "ExecutedByProvider".
KCAP4Unsuccessful Klarna capture due to too high capture amount1. Create a successful Klarna deposit payment with amount of 10 €
2. Initiate a payment from reference with payment method Klarna capture with amount 11 €
The capture payment is not created. An error with errorCode "100" and errorMessage "The capture amount 11.00 EUR must be less or equal to the remaining capturable amount: 10.0000 EUR" is displayed. The original Klarna deposit payment remains in state "ExecutedByProvider".
KCAP5Unsuccessful Klarna capture due to wrong currency1. Create a successful Klarna deposit payment with amount of 10 €
2. Initiate a payment from reference with payment method Klarna capture with amount 10 £
The capture payment is not created. An error with errorCode "100" and errorMessage "The currency GBP of the capture payment must be equal to the currency EUR of the Klarna Deposit Payment" is displayed. The original Klarna deposit payment remains in state "ExecutedByProvider".

Klarna Refund

Detailed information for integrating Klarna Refunds can be found in the Refund a Klarna Payment documentation.

#Test Case NameSteps to ExecuteExpected Outcome
KREF1Successful full refund of a full captured payment1. Create a successful Klarna deposit payment with amount of 10 €
2. Create a corresponding successful Klarna capture payment with amount of 10 € and make sure that the state is "CapturedByProvider"
3. Initiate a payment from reference with payment method Klarna refund from payment from step 1 with amount of 10 €
The Klarna refund payment is in the state "Refunded".
KREF2Successful partial refund of a full captured payment1. Create a successful Klarna deposit payment with amount of 10 €
2. Create a corresponding successful Klarna capture payment with amount of 10 € and make sure that the state is "CapturedByProvider"
3. Initiate a payment from reference with payment method Klarna refund from payment from step 1 with amount of 5 €
The Klarna refund payment is in the state "Refunded".
KREF3Successful partial refund of a partial captured payment1. Create a successful Klarna deposit payment with amount of 10 €
2. Create a corresponding successful Klarna capture payment with amount of 5 € and make sure that the state is "CapturedByProvider"
3. Initiate a payment from reference with payment method Klarna refund from payment from step 1 with amount of 3 €
The Klarna refund payment is in the state "Refunded".
KREF4Successful partial Klarna refunds resulting in a full refund1. Create a successful Klarna deposit payment with amount of 10 €
2. Create a corresponding successful Klarna capture payment with amount of 10 € and make sure that the state is "CapturedByProvider"
3. Initiate a payment from reference with payment method Klarna refund from payment from step 1 with amount of 5 €
4. Initiate a payment from reference with payment method Klarna refund from payment from step 1 with amount of 5 €
2 Klarna refund payments are created and are in the state "Refunded".
KREF5Successful partial Klarna refunds with 2 captures1. Create a successful Klarna deposit payment with amount of 10 €
2. Create a corresponding successful Klarna capture payment with amount of 3 € and make sure that the state is "CapturedByProvider"
3. Create a corresponding successful Klarna capture payment with amount of 6 € and make sure that the state is "CapturedByProvider"
4. Initiate a payment from reference with payment method Klarna refund from payment from step 1 with amount of 2€
5. Initiate a payment from reference with payment method Klarna refund from payment from step 1 with amount of 4 €
2 Klarna refund payments are created and are in the state "Refunded".
KREF6Unsuccessful Klarna refund due to invalid amount1. Create a successful Klarna deposit payment with amount of 10 €
2. Create a corresponding successful Klarna capture payment with amount of 9 € and make sure that the state is "CapturedByProvider".
3. Initiate a payment from reference with payment method Klarna refund from payment from step 1 with amount of 10 €
The refund payment is not created. An error with errorCode "1002" and errorMessage "Refund amount exceeded! Deposit amount = 10.0000; Refunded amount = 0; Max refundable amount = 9.0000, Refund amount = 10.00" is displayed.
KREF7Unsuccessful Klarna refund due to wrong currency1. Create a successful Klarna deposit payment with amount of 10 €
2. Create a corresponding successful Klarna capture payment with amount of 10 € and make sure that the state is "CapturedByProvider".
3. Initiate a payment from reference with payment method Klarna refund from payment from step 1 with amount of 10 £
The refund payment is not created. An error with errorCode "309" and errorMessage "Currencies do not match! Currency of amount = EUR, but expected currency = GBP" is displayed.

Klarna Cancel

Detailed information for integrating Klarna Cancellation can be found in the Cancel/Revert a Klarna Payment documentation.

#Test Case NameSteps to ExecuteExpected Outcome
KCAN1Successful full cancellation of a Klarna deposit1. Create a successful Klarna deposit payment
2. Execute action using the actionID "1"
A Klarna cancellation payment is created and is in the state "Cancelled".

Note:
Test with all three payment methods for Klarna available: Klarna Pay Now Deposit (370), Klarna Pay Later Deposit (371) or Klarna Financing Deposit (372)
KCAN2Successful partial cancellation of a Klarna deposit1. Create a successful Klarna deposit payment with amount of 10 €
2. Create a corresponding successful Klarna capture payment with amount of 4 €
3. Execute action using the actionID "1" for payment from step 1
A Klarna cancellation payment with amount 6 € is created and is in the state "Cancelled".
KCAN3Unsuccessful cancellation of a Klarna deposit if fully captured payment is done1. Create a successful Klarna deposit payment with amount of 10 €
2. Create a corresponding successful Klarna capture payment with amount of 10 €
3. Execute action using the actionID "1" for payment from step 1
The cancellation payment is not created. An error with errorCode "100" and errorMessage "There is no authorized amount left to cancel." is displayed.
KCAN4Unsuccessful cancellation of a Klarna deposit that was already fully cancelled1. Create a successful Klarna deposit payment with amount of 10 €
2. Execute action using actionID "1"
3. Execute once more action using actionID "1"
For step 2: A Klarna cancellation payment is created and is in the state "Cancelled".
For step 3: A second cancellation payment is not created. An error with errorCode "100" and errorMessage "There is no authorized amount left to cancel." is displayed.

Update a Klarna Payment

Extend Authorisation Time for a Klarna Deposit

Detailed information for integrating Extending the Authorisation Time can be found in the Extend Authorisation time documentation.

#Test Case NameSteps to ExecuteExpected Outcome
KEAT1Successful extension of Authorisation Time for a Klarna Deposit1. Create a successful Klarna deposit payment
2. Execute action with actionID "344003"
The Klarna deposit payment Authorisation time is increased with + 28 days. The Klarna deposit payment in PS admin has the detail "LastExpirationResetResult".
KEAT2Successful extension of Authorisation Time for a partially captured Klarna Deposit1. Create a successful Klarna deposit payment over 10 €
2. Create a corresponding successful Klarna capture payment with amount of 5 €
3. Execute action with actionID "344003"
The Klarna deposit payment Authorisation time is increased with + 28 days. The Klarna deposit payment in PS admin has the detail "LastExpirationResetResult".
KEAT3Unsuccesful extension of Authorisation Time for a fully cancelled Klarna Deposit1. Create a successful Klarna deposit pament over 10 €
2. Cancel the above payment with execute action using actionID "1"
3. Exeucte action with actionID "344003"
The Klarna deposit payment Authorisation time is not increased with + 28 days.
The Klarna deposit payment has the detail "LastExpirationResetResult" with the message
"NOT_ALLOWED "Order 8caf4f53-33b3-262f-9201-bd04da2017e6 is canceled. Authorization time cannot be extended.""

Note: Order with ID will be different for every payment

FAQs

How to move a Klarna capture payment from "PendingToBeCaptured" to "CapturedByProvider"

📘

Precondition for testing Refunds

Moving a Klarna capture payment from "PendingToBeCaptured" to "CapturedByProvider" needs to be done before a Klarna payment can be refunded. Refunds can only be created if a Klarna deposit was successfully captured (=has at least one Capture Payment in state "CapturedByProvider")

  1. Create a successful Klarna deposit payment over 10 €
  2. Create a corresponding successful Klarna capture payment with amount of 10 €, the Klarna capture payment is in the state "PendingToBeCaptured"
  3. Log in to the PS admin and open the Klarna capture payment from step 2
  4. If you have sufficient rights you will see in the action area the value "CapturePayment" (See screenshot 1)
  5. Select action "CapturePayment" and click "ExecuteAction"

Expected result: The Klarna capture payment is in the state "CapturedByProvider"

778

Screenshot 1: CapturePayment action

How to cancel a Klarna payment in the PXP Financial Admin Tool

Full cancellation

  1. Create a successful Klarna deposit payment over 10 €
  2. Log in to the PS admin and open the Klarna deposit from step 1
  3. If you have sufficient rights you will see in the action area the value "Cancel" (See screenshot 1)
  4. Select action "CancelPayment" with a reason and click "ExecuteAction"

Expected result: A Klarna cancellation payment with amount of 10 € is created and is in the state cancelled

Partial cancellation

  1. Create a successful Klarna deposit payment over 10 €
  2. Create a successful Klarna capture payment over 4 € and make sure that the capture payment is in the state "CapturedByProvider"
  3. Log in to the PS admin and open the _Klarna deposit_payment from step 1
  4. Select action "CancelPayment" with a reason and click "ExecuteAction"

Expected result: A Klarna cancellation payment with amount of 6 € is created and is in the state cancelled

817

Screenshot 2: CancelPayment action

How to extend the authorisation time of a Klarna payment in the PXP Financial Admin Tool

  1. Create a successful Klarna deposit payment
  2. Log in to the PS admin and open the Klarna deposit payment
  3. If you have sufficient rights you will see in the action area the value "ResetPaymentExpirationDate" (see screenshot 1
  4. Select action "ResetPaymentExpirationDate and click "ExecuteAction"

Expected result: The Klarna deposit payment Authorisation time is increased with + 28 days. The Klarna deposit payment in PS admin has the detail "LastExpirationResetResult". (see screenshot 2)

770

Screenshot 3: ResetPaymentExpirationDate Action area

775

Screenshot 4: LastExpirationResetResult and LastExpirationResetDate details