Download the PHP package centarro/kco_rest without Composer
On this page you can find all versions of the php package centarro/kco_rest. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download centarro/kco_rest
More information about centarro/kco_rest
Files in centarro/kco_rest
Package kco_rest
Short Description Community maintained Klarna PHP SDK
License Apache-2.0
Homepage https://github.com/centarro/kco_rest_php
Informations about the package kco_rest
Introduction
This is an unofficial, community maintained fork of the deprecated official Klarna PHP SDK.
Shop now. Pay later.
Shop at your favorite stores today and experience the freedom to pay later with Klarna.
Getting started
SDK covers all of Klarna API: https://developers.klarna.com/api/
Prerequisites
- PHP 8.1 or above
- API credentials
- Composer (optional)
API Credentials
Before getting a production account you can get a playground one. Register here to be able to test your SDK integration before go live:
- https://playground.eu.portal.klarna.com/developer-sign-up - for EU countries
- https://playground.us.portal.klarna.com/developer-sign-up - for the US
PHP SDK Installation and Usage
Install via Composer
To install the PHP SDK from the Central Composer repository use composer:
Highly recommended to use version tag when installing SDK.
Detailed information about the PHP SDK package and a list of available versions can be found here: https://packagist.org/packages/klarna/kco_rest
Include the SDK into your PHP file using the Composer autoloader:
Manual installation
To install the PHP SDK manually you need to clone the repo to any folder on your machine:
Include the SDK into your PHP file using the SDK autoloader:
⚠️Warning: Using manually installed SDK requires you to use the CURLTransport instance to send HTTP requests.
Read more about How to use HTTP Transport
Documentation and Examples
Klarna API documentation: https://developers.klarna.com/api/
SDK References: https://klarna.github.io/kco_rest_php/
Example files can be found in the docs/ directory.
Additional documentation can be found at https://developers.klarna.com.
Logging and Debugging
PHP SDK logs information to STDOUT/STDERR. To enable debug mode, set DEBUG_SDK environment variable:
or
Another way to enable Debugging Mode is define
the DEBUG_SDK inside your script:
Be aware, the SDK just checks if the DEBUG_SDK
is defined! It means you will see the debug information
by using define('DEBUG_SDK', false);
or export DEBUG_SDK=no
More information about the DEBUG_SDK flag can be found here: https://github.com/klarna/kco_rest_php/issues/32
The output will look like: