4

I have been trying to add klarna checkout gateway without any luck... I don't see Klarna Checkout in the Admin UI!

No idea what I'm missing here but the way I understood it that all I have to do is install the gateway payment through composer then add the fields in the config.yml file

Do I need to make KlarnaGatewayConfigurationType.php file? if yes then where should I add it and what else should I do?

These are the steps I followed: Installed Klarna: composer require klarna/checkout

Then I added in app\config\config.yml this code:

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

The php bin/console payum:gateway:debug gave me this:

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): 
        ........................................................................

Last step: php bin/console cache:clear

What am I doing wrong here?

user3808955
  • 337
  • 1
  • 2
  • 10

2 Answers2

3

Yes, you should also add the Gateway configuration type form, it looks like this in 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 }

Included class should contain form for configuration in Sylius Admin. You can find another examples of it in Sylius\Bundle\PayumBundle\Form\Type namespace.

Dr.X
  • 853
  • 9
  • 15
-1

Recently Klarna API version has been upgraded from old V2 to latest V3. So I have implemented the same for Klarna Checkout and Klarna Payment.