Crystallize
Smooth payments with Node Klarna

Smooth payments with Node Klarna

Node Klarna SDK for easy Klarna integration.

NPM logoSmooth payments with Node Klarna

Setup for Node Klarna

The folling env variables needs to be set KLARNA_MODE KLARNA_MERCHANT_ID KLARNA_SHARED_SECRET KLARNA_TERMS_URI KLARNA_STORE_NAME

Usage Klarna V2 with Node

Klarna version 2 documentation. 

const Klarna = require('@crystallize/node-klarna/v2');

// Create order
const { success, order } = Klarna.createOrder(klarnaCheckoutModel);

// Confirm order
const { success } = Klarna.confirmOrder(order.id);

// Capture order
const { success } = Klarna.captureOrder(order.id);

// Transform a Crystallize basket model (from @crystallize/react-basket) to a Klarna model
const klarnaCart = Klarna.crystallizeBasketToKlarnaCart(crystallizeBasket.state);