k10r / klarna-ordermanagement
Klarna ordermanagement as a package for our Klarna plugins.
Requires
- php: >=7.2 <8.3
Requires (Dev)
- k10r/codestyle: ^2.0
- dev-master
- 0.6.5
- 0.6.4
- 0.6.3
- 0.6.2
- 0.6.1
- 0.6.0
- 0.5.1
- 0.5.0
- 0.4.0
- 0.3.3
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.29
- 0.2.28
- 0.2.27
- 0.2.26
- 0.2.25
- 0.2.24
- 0.2.23
- 0.2.22
- 0.2.21
- 0.2.20
- 0.2.19
- 0.2.18
- 0.2.17
- 0.2.16
- 0.2.15
- 0.2.14
- 0.2.13
- 0.2.12
- 0.2.11
- 0.2.10
- 0.2.9
- 0.2.8
- 0.2.7
- 0.2.6
- 0.2.5
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.5
- 0.1.4
- 0.1.3
- 0.1.2
- 0.1.1
- 0.1.0
- dev-feature/KLARNASUPPORT-925
This package is auto-updated.
Last update: 2024-12-04 17:00:25 UTC
README
This is a package for Shopware 5 plugins. It adds support for the Klarna OrderManagement 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.
Install
Via Composer
$ composer require k10r/klarna-ordermanagement
Registering dependencies
In your Shopware plugin entry file, you need to specify the following container parameters:
- Plugin name
public function build(ContainerBuilder $containerBuilder) { parent::build($containerBuilder); $containerBuilder->setParameter('bestit_klarna.plugin_name', 'ExamplePluginName'); }
And you will also need to register our dependencies:
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:
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 for more information.
Change log
Please see CHANGELOG for more information on what has changed recently.
License
The MIT License (MIT). Please see License File for more information.