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:
- Send correct country and currency combination Country and Currency supported
- Send the proper customer and billing information that can be found here Customer and Billing Information
- Send the correct shopping card information that can be found here Shopping Cart/Basket information
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 Name | Steps to Execute | Expected Outcome |
---|---|---|---|
KDCO1 | Initiate 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" |
KDCO2 | Complete 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" |
KDCO3 | Complete 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" |
KDCO4 | Complete 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" |
KDCO5 | Unsuccessful initiation of a Klarna Deposit due to an error received from provider Klarna | 1. 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" |
KDCO6 | Unsuccessful initiation of a Klarna Deposit due to no payment option received from provider Klarna | 1. 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) |
KDCO7 | A Klarna order has been denied by provider | 1. 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" |
KDCO8 | Option not available | 1. 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" |
KDCO9 | Display of the Date of Birth popup widget | 1. 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 |
KDCO10 | Display of the National Identification Number popup widget | 1. 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 Name | Steps to Execute | Expected Outcome |
---|---|---|---|
KDB2B1 | Successful Klarna deposit | 1. 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) |
KDB2B2 | Unsuccessful Klarna deposit due to missing mandatory data | 1. 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 Name | Steps to Execute | Expected Outcome |
---|---|---|---|
KCAP1 | Successful full Klarna capture | 1. 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". |
KCAP2 | Successful partial Klarna capture | 1. 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". |
KCAP3 | Successful partial Klarna captures resulting in a full capture | 1. 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". |
KCAP4 | Unsuccessful Klarna capture due to too high capture amount | 1. 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". |
KCAP5 | Unsuccessful Klarna capture due to wrong currency | 1. 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 Name | Steps to Execute | Expected Outcome |
---|---|---|---|
KREF1 | Successful full refund of a full captured payment | 1. 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". |
KREF2 | Successful partial refund of a full captured payment | 1. 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". |
KREF3 | Successful partial refund of a partial captured payment | 1. 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". |
KREF4 | Successful partial Klarna refunds resulting in a full refund | 1. 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". |
KREF5 | Successful partial Klarna refunds with 2 captures | 1. 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". |
KREF6 | Unsuccessful Klarna refund due to invalid amount | 1. 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. |
KREF7 | Unsuccessful Klarna refund due to wrong currency | 1. 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 Name | Steps to Execute | Expected Outcome |
---|---|---|---|
KCAN1 | Successful full cancellation of a Klarna deposit | 1. 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) |
KCAN2 | Successful partial cancellation of a Klarna deposit | 1. 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". |
KCAN3 | Unsuccessful cancellation of a Klarna deposit if fully captured payment is done | 1. 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. |
KCAN4 | Unsuccessful cancellation of a Klarna deposit that was already fully cancelled | 1. 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 Name | Steps to Execute | Expected Outcome |
---|---|---|---|
KEAT1 | Successful extension of Authorisation Time for a Klarna Deposit | 1. 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". |
KEAT2 | Successful extension of Authorisation Time for a partially captured Klarna Deposit | 1. 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". |
KEAT3 | Unsuccesful extension of Authorisation Time for a fully cancelled Klarna Deposit | 1. 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")
- Create a successful Klarna deposit payment over 10 €
- Create a corresponding successful Klarna capture payment with amount of 10 €, the Klarna capture payment is in the state "PendingToBeCaptured"
- Log in to the PS admin and open the Klarna capture payment from step 2
- If you have sufficient rights you will see in the action area the value "CapturePayment" (See screenshot 1)
- Select action "CapturePayment" and click "ExecuteAction"
Expected result: The Klarna capture payment is in the state "CapturedByProvider"
How to cancel a Klarna payment in the PXP Financial Admin Tool
Full cancellation
- Create a successful Klarna deposit payment over 10 €
- Log in to the PS admin and open the Klarna deposit from step 1
- If you have sufficient rights you will see in the action area the value "Cancel" (See screenshot 1)
- 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
- Create a successful Klarna deposit payment over 10 €
- Create a successful Klarna capture payment over 4 € and make sure that the capture payment is in the state "CapturedByProvider"
- Log in to the PS admin and open the _Klarna deposit_payment from step 1
- 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
How to extend the authorisation time of a Klarna payment in the PXP Financial Admin Tool
- Create a successful Klarna deposit payment
- Log in to the PS admin and open the Klarna deposit payment
- If you have sufficient rights you will see in the action area the value "ResetPaymentExpirationDate" (see screenshot 1
- 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)
Updated about 4 years ago