Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kellerkinderde/klarna-ordermanagement
https://github.com/kellerkinderde/klarna-ordermanagement
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/kellerkinderde/klarna-ordermanagement
- Owner: kellerkinderDE
- License: mit
- Created: 2021-03-29T10:02:22.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-04-04T15:39:00.000Z (7 months ago)
- Last Synced: 2024-06-15T00:02:58.224Z (5 months ago)
- Language: PHP
- Size: 556 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Klarna OrderManagement
[![Latest Version on Packagist][ico-version]][link-packagist]
[![Software License][ico-license]](LICENSE.md)
[![Total Downloads][ico-downloads]][link-downloads]This is a package for [Shopware 5](https://en.shopware.com/) plugins.
It adds support for the [Klarna OrderManagement API](https://developers.klarna.com/api/#order-management-api) and also includes a UI in the shopware backend.
If using this package, you will need to implement Klarna Payments order Klarna Checkout yourself.* [Klarna Payments Docs][link-kp-docs]
* [Klarna Checkout Docs][link-kco-docs]
* [Order Management Docs][link-om-docs]## Install
Via Composer
``` bash
$ composer require k10r/klarna-ordermanagement
```### Registering dependencies
In your Shopware plugin entry file, you need to specify the following container parameters:
* Plugin name
```php
public function build(ContainerBuilder $containerBuilder)
{
parent::build($containerBuilder);$containerBuilder->setParameter('bestit_klarna.plugin_name', 'ExamplePluginName');
}
```And you will also need to register our dependencies:
```php
public function build(ContainerBuilder $containerBuilder)
{
parent::build($containerBuilder);//
$dependencyInjectionExtensions = [
\BestitKlarnaOrderManagement\Components\DependencyInjection\DependencyInjectionExtension::class
];foreach ($dependencyInjectionExtensions as $dependencyInjectionExtension) {
if (!class_exists($dependencyInjectionExtension)) {
continue;
}$dependencyInjectionExtension = new $dependencyInjectionExtension();
if (!$dependencyInjectionExtension instanceof \BestitKlarnaOrderManagement\Components\DependencyInjection\DependencyInjectionExtensionInterface) {
continue;
}$dependencyInjectionExtension->injectDependencies($containerBuilder);
}
}
```Then you can use the `OMInstaller` for any ohter necessary setup:
```php
public function install(InstallContext $context)
{
// ...$this->getOmInstaller()->install($this, $context);
// ...
}public function uninstall(UninstallContext $context)
{
// ...$this->getOmInstaller()->uninstall($this, $context);
// ...
}public function update(UpdateContext $context)
{
// ...$this->getOmInstaller()->update($this, $context);
// ...
}protected function getOmInstaller()
{
if ($this->omInstaller !== null) {
return $this->omInstaller;
}$this->omInstaller = new OmInstaller($this->container->get('shopware.snippet_database_handler'));
return $this->omInstaller;
}
```## Usage
See the [docs][link-om-docs] for more information.
## Change log
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
[ico-version]: https://img.shields.io/packagist/v/k10r/klarna-ordermanagement.svg?style=flat-square
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
[ico-downloads]: https://img.shields.io/packagist/dt/k10r/klarna-ordermanagement.svg?style=flat-square[link-packagist]: https://packagist.org/packages/k10r/klarna-ordermanagement
[link-downloads]: https://packagist.org/packages/k10r/klarna-ordermanagement
[link-om-docs]: https://klarna.kellerkinder.de/sw5/de/3-ko/index.html
[link-kp-docs]: https://klarna.kellerkinder.de/sw5/de/1-kp/index.html
[link-kco-docs]: https://klarna.kellerkinder.de/sw5/de/2-kc/index.html