asgoodasnu/klarna-api-bundle

Integrates the Klarna RPC XML API into a symfony2 bundle

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

v1.1.0 2016-02-19 10:08 UTC

This package is not auto-updated.

Last update: 2019-12-08 13:36:50 UTC


README

Build Status Total Downloads Latest Stable Version SensioLabsInsight

The WkKlarnaApiBundle wraps the Klarna PHPXML Api as a Symfony Bundle

Installation

Require the bundle and its dependencies with composer:

$ composer require asgoodasnu/klarna-api-bundle

Register the bundle:

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

Configure your Klarna settings in your parameters.yml:

# parameters.yml
wk_klarna_api.merchant_id: 1234567 #My Merchant ID
wk_klarna_api.secret: mySecret #My Secret
wk_klarna_api.country: 81 # see valid country codes below
wk_klarna_api.language: 28 # see valid languages below
wk_klarna_api.currency: 2 # see valid currencies below 
wk_klarna_api.use_sandbox: 0 # use sandbox (set to 1) or live system (set to 0)

Valid country codes

Valid languages

Valid currencies

Usage

You can get a configured Klarna object from the container:

$klarna = $this->get('wk_klarna_api')

Read the Klarna documentation for more information about this object.

Dependencies

  • symfony/framework-bundle - Symfony FrameworkBundle
  • klarna/php-xmlrpc:4.0 - Klarna XML API

PHPUnit Tests

You can run the tests using the following command:

$ vendor/bin/phpunit

Resources

Symfony 2

http://symfony.com

Klarna RPC API

https://developers.klarna.com/sdk-references/xmlrpc_php/package-KlarnaAPI.html