Skip to content

Klarna Pay Later

Christian Dangl edited this page Oct 28, 2020 · 11 revisions

Klarna Pay Later allows your customers to order in your shop, and pay the amount later.

Configuration

Klarna Pay Later is integrated like every other payment method in Shopware. So you can set anything you would also configure for other payments.

So start by activating the payment method in Shopware.

Workflow

When a user starts a checkout with Klarna, the Mollie Plugin will send the whole order information (customer + line items) to Klarna for further verification.

This means, there is a chance, that Klarna declines the customer due to some risk and identity checks!

If the customer and order is approved by Klarna, your Shopware shop will get the status "authorized" for the payment.

So why "authorized" and not "paid"?

Klarna works a bit different.

It starts with "authorized".

To get the money as a merchant from Klarna, you need to mark your order as "shipped". This will trigger the rest of the payment workflow which includes the transitioning to "paid" and that you get your money.

Shipping an order

We learned that you need to mark your order as "shipped" to continue with the order flow. There are different ways to mark the order as "shipped". Depending on your setup, you might want to either do it manually or have a custom script or process that does this for you.

1. Manual Shipping

The most convenient way to mark an order as "shipped" is to use the corresponding action in the Shopware backend orders list. If you take a close look, you will see a column for Mollie actions. This column contains a "truck" icon, that helps you to ship your order. As soon as this is executed, your order will transition to "paid" within your Mollie dashboard.

2. Order Status Transition (Single Order)

If you want to automatically mark orders as shipped when you change the "order status", you first have to configure what status the Mollie plugin needs to listen to.

Please set the "Status on which order is marked as sent" in the Plugin Configuration. ...also clear your caches...

If you now open the order in the Shopware backend, and set the status of the order to the one from your configuration, the Mollie plugin will automatically mark the order as "shipped" in your Mollie dashboard.

3. Order Status Transition (Batch Processing)

It's also possible to update multiple orders with the Shopware "batch processing" in the backend to mark orders as shipped.

Please adjust your plugin configuration as described above. If you now start a batch update of orders, the same thing will happen as with the single order transition.

4. CLI Command

Merchants who want to automate their workflows, can also use our provided CLI command to mark orders as shipped.

php bin/console mollie:ship:klarna

This command will look for all Klarna payments.

If they match your configured order status as described above, and their payment status is not OPEN and not CANCELLED, the command will start with the shipping.

Please note, this is only done, if its not already marked as "shipped".

We've also added an "auto-repair" mechanism. This means, if you have marked your orders as "shipped" in Mollie, the CLI command will recognize it and skip that order.

Also, "final" states like "cancelled" or "expired" will be skipped too.

5. Status Transitions (CSV, Plugins, ...)

The Mollie plugin will automatically listen for any status transitions of your order. This can either be, when a CSV import is executed, or when a 3rd party plugin updates your order.

The integration is done using Doctrine Entity "postUpdate" events.

This means, as soon as you or your plugin uses the preffered way of updating an order by using the Entity Manager, the Klarna shipping detection will be triggered. Depending on your plugin configuration, orders are then automatically marked as "shipped" when conditions are met.

Clone this wiki locally