bestit/klarna-ordermanagement

此包已被废弃且不再维护。作者建议使用k10r/klarna-ordermanagement包。

Klarna订单管理作为一个Klarna插件包。


README

Latest Version on Packagist Software License Total Downloads

这是一个为shopware插件提供的包。它增加了对Klarna订单管理API的支持,并在shopware后端中包含了一个用户界面。如果使用此包,您需要自己实现Klarna付款订单的Klarna Checkout。

// TODO: 一旦准备好,添加Klarna Checkout链接

安装

通过Composer

$ composer require bestit/klarna-ordermanagement

注册依赖项

在您的Shopware插件入口文件中,您需要指定以下容器参数

  • 插件名称
  • 插件版本
public function build(ContainerBuilder $containerBuilder)
{
    parent::build($containerBuilder);

    $containerBuilder->setParameter('bestit_klarna.plugin_name', 'ExamplePluginName');
    $containerBuilder->setParameter('bestit_klarna.plugin_version', '1.0.0');
}

并且您还需要注册我们的依赖项

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);
    }
}

然后您可以使用OMInstaller进行任何其他必要的设置

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;
}

用法

有关更多信息,请参阅文档

变更日志

请参阅变更日志以获取有关最近更改的更多信息。

贡献

请参阅贡献指南行为准则以获取详细信息。

安全性

如果您发现任何安全相关的问题,请通过电子邮件best it联系。

许可证

MIT许可证(MIT)。请参阅许可证文件以获取更多信息。