简体   繁体   English

Symfony错误无法找到模板

[英]Symfony error Unable to find template

After setting up paypal express checkout I am now setting up the stripe payment gateway as per the instructions provided here but yet I am getting an error of 设置Paypal Express结帐后,我现在按照此处提供的说明设置条形支付网关,但出现错误

Unable to find template "@PayumStripe/Action/obtain_checkout_token.html.twig" : "Bundle "PayumStripe" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() method of your AppKernel.php file?"

As per the instructions I have added the following in AppKernel what else do I need to add? 按照说明,我已在AppKernel添加了以下内容,还需要添加什么?

new Payum\\Bundle\\PayumBundle\\PayumBundle(),

I was looking at the documentation that was under development, after looking at the stable version of documtation i found out that i was missing the mapping of path in config.yml 在查看了文档的稳定版本之后,我在查看正在开发的文档,发现我在config.yml中缺少路径映射。

According to the documentation the path is supposed to be 根据文档,路径应该是

paths:
    %kernel.root_dir%/../vendor/payum/payum/src/Payum/Core/Resources/views: PayumCore
    %kernel.root_dir%/../vendor/payum/payum/src/Payum/Stripe/Resources/views: PayumStripe

However I feel that is incorrect as those directory do not exist and this is the error one sees, so those paths have to be corrected and the following worked for me 但是我觉得这是不正确的,因为这些目录不存在,这是一个人看到的错误,因此必须更正那些路径,以下内容对我有用

paths:
    %kernel.root_dir%/../vendor/payum/core/Payum/Core/Resources/views: PayumCore
    %kernel.root_dir%/../vendor/payum/core/Payum/Core/Bridge/Symfony/Resources/views: PayumSymfonyBridge
    %kernel.root_dir%/../vendor/payum/stripe/Payum/Stripe/Resources/views: PayumStripe 

You will need to add this to your routing.yml: 您将需要将此添加到您的routing.yml:

# app/config/routing.yml

payum_capture:
    resource: "@PayumBundle/Resources/config/routing/capture.xml"

payum_authorize:
    resource: "@PayumBundle/Resources/config/routing/authorize.xml"

payum_notify:
    resource: "@PayumBundle/Resources/config/routing/notify.xml"

taken from here: http://payum.org/doc/0.14/PayumBundle/get_it_started 取自此处: http : //payum.org/doc/0.14/PayumBundle/get_it_started

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM