2.1.0 • Published 26 days ago

artwerk-payment-klarna v2.1.0

Weekly downloads
-
License
-
Repository
github
Last release
26 days ago

Klarna plugin for Medusa.js

Receive payments on your Medusa commerce application using Klarna.

Features

  • Authorize payments on orders from any sales channel.
  • Creates Medusa Order on /push callback
  • Retrieve Cart by Klarna Order Id
  • Capture payments from the admin dashboard.
  • Support for Webhooks.

Prerequisites


How to Install

1. Run the following command in the directory of the Medusa backend:

npm

npm install artwerk-payment-klarna

yarn

yarn add artwerk-payment-klarna

2. Set the following environment variables in .env:

STORE_CORS=<YOUR_STORE_FRONT_URL>
KLARNA_BACKEND_URL=<YOUR_KLARNA_BACKEND_URL>
KLARNA_URL=<YOUR_KLARNA_URL>
KLARNA_USER=<YOUR_KLARNA_USER>
KLARNA_PASSWORD=<YOUR_KLARNA_PASSWORD>
KLARNA_TERMS_URL=<YOUR_KLARNA_TERMS_URL>
KLARNA_CHECKOUT_URL=<YOUR_KLARNA_CHECKOUT_URL>
KLARNA_CONFIRMATION_URL=<YOUR_KLARNA_CONFIRMATION_URL>

3. In medusa-config.js add the following at the end of the plugins array:

const plugins = [
  // other plugins...
  {
    resolve: `medusa-payment-klarna`,
    options: {
      backend_url: process.env.KLARNA_BACKEND_URL,
      url: process.env.KLARNA_URL,
      user: process.env.KLARNA_USER,
      password: process.env.KLARNA_PASSWORD,
      store_cors: process.env.STORE_CORS,
      merchant_urls: {
        terms: process.env.KLARNA_TERMS_URL,
        checkout: process.env.KLARNA_CHECKOUT_URL,
        confirmation: process.env.KLARNA_CONFIRMATION_URL,
      },
    },
  },
];

Test the Plugin

1. Run the following command in the directory of the Medusa backend to run the backend:

npm run start

2. Enable Klarna in a region in the admin. You can refer to this User Guide to learn how to do that. Alternatively, you can use the Admin APIs.

3. Place an order using a storefront or the Store APIs. You should be able to use Klarna as a payment method.


Additional Resources

2.0.3

27 days ago

2.0.2

27 days ago

2.0.13

27 days ago

2.0.5

27 days ago

2.0.14

26 days ago

2.0.4

27 days ago

2.0.11

27 days ago

2.0.7

27 days ago

2.0.12

27 days ago

2.0.6

27 days ago

2.0.9

27 days ago

2.0.10

27 days ago

2.0.8

27 days ago

2.1.0

26 days ago

2.0.1

27 days ago

2.0.0

1 month ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago