4

我一直在尝试添加 klarna 结帐网关,但没有任何运气...我在管理 UI 中看不到 Klarna 结帐!

不知道我在这里遗漏了什么,但我理解我所要做的就是通过 composer 安装网关支付,然后在 config.yml 文件中添加字段

我需要制作 KlarnaGatewayConfigurationType.php 文件吗?如果是,那么我应该在哪里添加它,我还应该做什么?

这些是我遵循的步骤: 安装 Klarna:composer require klarna/checkout

然后我在app\config\config.yml这段代码中添加:

payum:
    gateways:
        klarna_checkout:
            factory: klarna_checkout
            secret:  'required'
            merchant_id: 'required'
            terms_uri: ''
            checkout_uri: ''
            sandbox: true

sylius_payment:
     gateways:
            klarna_checkout: klarna_checkout

php bin/console payum:gateway:debug了我这个:

Order of actions, apis, extensions matters 
Found 3 gateways 

offline (Payum\Core\Gateway): 
        ........................................................................

klarna_checkout (Payum\Core\Gateway): 
        Actions: 
        Payum\Core\Bridge\Symfony\Action\GetHttpRequestAction 
        Payum\Core\Bridge\Symfony\Action\ObtainCreditCardAction 
        Sylius\Bundle\PayumBundle\Action\CapturePaymentAction 
        Sylius\Bundle\PayumBundle\Action\ExecuteSameRequestWithPaymentDetailsAction 
        Sylius\Bundle\PayumBundle\Action\ResolveNextRouteAction 
        Payum\Core\Action\CapturePaymentAction 
        Payum\Core\Action\AuthorizePaymentAction 
        Payum\Core\Action\PayoutPayoutAction 
        Payum\Core\Action\ExecuteSameRequestWithModelDetailsAction 
        Payum\Core\Bridge\Twig\Action\RenderTemplateAction 
        Payum\Core\Action\GetCurrencyAction 
        Payum\Core\Action\GetTokenAction 
        Payum\Klarna\Checkout\Action\AuthorizeRecurringAction 
        Payum\Klarna\Checkout\Action\AuthorizeAction 
        Payum\Klarna\Checkout\Action\NotifyAction 
        Payum\Klarna\Checkout\Action\StatusAction 
        Payum\Klarna\Checkout\Action\SyncAction 
        Payum\Klarna\Checkout\Action\ConvertPaymentAction 
        Payum\Klarna\Checkout\Action\Api\CreateOrderAction 
        Payum\Klarna\Checkout\Action\Api\UpdateOrderAction 
        Payum\Klarna\Checkout\Action\Api\FetchOrderAction 

        Extensions: 
        Sylius\Bundle\PayumBundle\Extension\UpdatePaymentStateExtension 
        Payum\Bundle\PayumBundle\Profiler\PayumCollector 
        Payum\Core\Extension\GenericTokenFactoryExtension 
        Payum\Core\Bridge\Psr\Log\LoggerExtension 
        Payum\Core\Bridge\Psr\Log\LogExecutedActionsExtension 
        Payum\Core\Extension\StorageExtension 
                Storage: Payum\Core\Bridge\Doctrine\Storage\DoctrineStorage 
                Model: Sylius\Component\Core\Model\Order 
        Payum\Core\Extension\StorageExtension 
                Storage: Payum\Core\Bridge\Doctrine\Storage\DoctrineStorage 
                Model: Sylius\Component\Core\Model\Payment 
        Payum\Core\Extension\EndlessCycleDetectorExtension 

        Apis: 
        Payum\Core\Bridge\Httplug\HttplugClient 
        Payum\Klarna\Checkout\Config 

Offline (Payum\Core\Gateway): 
        ........................................................................

最后一步:php bin/console cache:clear

我在这里做错了什么?

4

2 回答 2

3

是的,您还应该添加网关配置类型表单,如下所示app/config/services.yml

sylius.form.type.gateway_configuration.swipe:
    class: Payum\Swipe\Type\SwipeGatewayConfigurationType
    tags:
        - { name: sylius.gateway_configuration_type, type: swipe, label: Swipe }
        - { name: form.type }

包含的类应包含 Sylius Admin 中的配置表单。您可以在Sylius\Bundle\PayumBundle\Form\Type命名空间中找到它的另一个示例。

于 2017-12-27T10:20:15.070 回答
-1

最近 Klarna API 版本已从旧的 V2 升级到最新的 V3。所以我为 Klarna Checkout 和 Klarna Payment 实现了相同的功能。

于 2021-01-09T14:23:25.907 回答