gpt4 book ai didi

symfony - 如何使用 Sylius 实现 Klarna 支付网关?

转载 作者:行者123 更新时间:2023-12-03 18:26:48 34 4
gpt4 key购买 nike

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

不知道我在这里遗漏了什么,但我理解它的方式是我所要做的就是通过 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
我在这里做错了什么?

最佳答案

是的,您还应该添加网关配置类型表单,在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 中找到另一个例子。命名空间。

关于symfony - 如何使用 Sylius 实现 Klarna 支付网关?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47961158/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com