KlarnaCheckOut.confirmOrder()

Usage

Hover over inputs/exits for more info.

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


KlarnaCheckOut.confirmOrder({

eid: 1234,

secret: 'dsfsdgfdnghgesr435t5',

id: 'sjdasd76a8d68asiu',

live: false,

country: 'SE',

currency: 'NOK',

locale: 'nb-no',

order_ref: 'order2016-45',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

eid required

1234
secret required

'dsfsdgfdnghgesr435t5'
id required

Order ID

'sjdasd76a8d68asiu'
live

false
country

'SE'
currency

'NOK'
locale

'nb-no'
order_ref

Order id

'order2016-45'

Exits

error

An unexpected error occurred.

success

OK.

{ id: 'FZKNGFQAO4JN2731K8ALWU8CH0P',
  merchant_reference: { orderid1: 'order666FTW' },
  purchase_country: 'se',
  purchase_currency: 'sek',
  locale: 'sv-se',
  status: 'created',
  reference: 'FZKNGFQAO4JN2731K8ALWU8CH0P',
  reservation: '1220307000',
  started_at: '2016-01-23T15:17:35+01:00',
  completed_at: '2016-01-23T15:18:02+01:00',
  created_at: '2016-01-23T23:16:23+01:00',
  last_modified_at: '2016-01-23T23:16:23+01:00',
  expires_at: '2016-02-06T15:18:02+01:00',
  cart: 
   { items: 
      [ { discount_rate: 0,
          name: 'test',
          quantity: 10,
          reference: '1234',
          tax_rate: 2500,
          total_price_excluding_tax: 80000,
          total_price_including_tax: 100000,
          total_tax_amount: 20000,
          type: 'physical',
          unit_price: 10000 } ],
     total_price_excluding_tax: 80000,
     total_tax_amount: 20000,
     total_price_including_tax: 100000 },
  customer: { type: 'person', date_of_birth: '1941-03-21', gender: 'female' },
  shipping_address: 
   { given_name: 'Testperson-se',
     family_name: 'Approved',
     street_address: 'Stårgatan 1',
     postal_code: '12345',
     city: 'Ankeborg',
     country: 'se',
     email: 'checkout-se@testdrive.klarna.com',
     phone: '070 111 11 11' },
  billing_address: 
   { given_name: 'Testperson-se',
     family_name: 'Approved',
     street_address: 'Stårgatan 1',
     postal_code: '12345',
     city: 'Ankeborg',
     country: 'se',
     email: 'checkout-se@testdrive.klarna.com',
     phone: '070 111 11 11' },
  gui: { layout: 'desktop', snippet: '>html snippet>' },
  merchant: 
   { id: '1045',
     terms_uri: 'http://www.example.com',
     checkout_uri: 'http://www.example.com',
     confirmation_uri: 'http://localhost:1337/confirmation?klarna_order_id=FZKNGFQAO4JN2731K8ALWU8CH0P',
     push_uri: 'http://www.example.com',
     cancellation_terms_uri: 'http://www.example.com' },
  cart_update_allowed: true }