KlarnaCheckOut.placeOrder()

Usage

Hover over inputs/exits for more info.

var KlarnaCheckOut = require('machinepack-klarnacheckout');


KlarnaCheckOut.placeOrder({

eid: '123a',

secret: 'ART238ureXkz561',

live: true,

cart: { items: [ { name: 'Tin of spam', reference: '1234', quantity: 2, unit_price: 3400, tax_rate: 2500 } ] },

confirmationURL: 'http://localhost:1337/confirmation?klarna_order_id={checkout.order.id}',

country: 'NO',

currency: 'NOK',

locale: 'nb-no',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

eid required

'123a'
secret required

'ART238ureXkz561'
live required

Live transactions

true
cart required

{ items: 
   [ { name: 'Tin of spam',
       reference: '1234',
       quantity: 2,
       unit_price: 3400,
       tax_rate: 2500 } ] }
confirmationURL required

'http://localhost:1337/confirmation?klarna_order_id={checkout.order.id}'
country

Klarna Country Supported languages: https://developers.klarna.com/en/se+php/kco-v2/checkout-api#supported-locales

'NO'
currency

Klarna currency Supported languages: https://developers.klarna.com/en/se+php/kco-v2/checkout-api#supported-locales

'NOK'
locale

Klarna locale Supported languages: https://developers.klarna.com/en/se+php/kco-v2/checkout-api#supported-locales

'nb-no'

Exits

error

An unexpected error occurred.

success

OK.

'<html> "html code" </html>'