asgoodasnu/klarna-checkout-api-bundle

Integrates the Klarna Checkout API into a symfony2 bundle

This package's canonical repository appears to be gone and the package has been frozen as a result.

v1.0.0 2016-12-05 11:12 UTC

This package is not auto-updated.

Last update: 2019-12-08 14:26:08 UTC


README

Build Status Total Downloads Latest Stable Version SensioLabsInsight

This bundle wraps the Klarna Checkout SDK as a Symfony Bundle

Installation

Require the bundle and its dependencies with composer:

$ composer require asgoodasnu/klarna-checkout-api-bundle

Register the bundle:

// app/AppKernel.php
public function registerBundles()
{
    $bundles = array(
        new Wk\KlarnaCheckoutApiBundle\WkKlarnaCheckoutApiBundle(),
    );
}

Configure your Klarna settings in your config.yml:

# config.yml
services:
    wk_klarna_checkout_api:
        client:
            de:
                merchant_id: 1234567    # merchant id of the German shop
                shared_secret: mySecret # shared secret for the German shop
                region: EU              # for europe set 'EU' and for North America set 'NA' 
                use_sandbox: false      # use sandbox (set to true) or live system (set to false)
            us: 
                merchant_id: 2345671    # merchant id of the American shop
                shared_secret: aSecret  # shared secret for the American shop 
                region: NA              # for europe set 'EU' and for North America set 'NA' 
                use_sandbox: false      # use sandbox (set to true) or live system (set to false)

Usage

You can get a configured client object from the container:

$client = $this->get('wk_klarna_checkout_api.client.de')

Read the Klarna documentation for more information about this object.

Dependencies

  • symfony/framework-bundle - Symfony FrameworkBundle
  • klarna/kco_rest:2.2 - Klarna Checkout SDK

PHPUnit Tests

You can run the tests using the following command:

$ composer test 

Code Analysis

You can analyze the code using the following command:

$ composer analyze 

Resources

Symfony 2

http://symfony.com

Klarna Checkout API

https://developers.klarna.com/api/

Klarna Checkout SDK

https://developers.klarna.com/en/gb/kco-v3/download/php