Payum Bundle : How to change the view of capture action in symfony2

社会主义新天地 提交于 2020-01-04 04:30:14

问题


I am using PAYUM Bundle for the payment gateway integration, and its basic example is working fine, But now I want integrate the payum bundle in application by changing the payum capture action layout and adding extra field payment detail entity.

PAYUM BUNDLE with AUTHORIZE.NET GATEWAY.

Please can anyone help me out.

Thanks all in advance.


回答1:


The payum templates is not kept in the bundle but in the payum lib itself. Standard templates inheritance does not work here.

There is no simple way to do so in version 0.9 (which is shipped with Sylius right now). You have to overwrite the whole CaptureAction class. In 0.10 it is possible to change templates by overwriting container parameters like for layout, or stripe js page.

In the sandbox you can find an example of layout modification




回答2:


You have to override views of PayumBundle.

How to do that?

You have to reproduce the folder structure of the bundle you want to override inside your /src/Path/To/Your/Bundle/Resources/views and place inside it the twig file you want to override.

Example

Let's say your bundle name is FooBundle and you want to override PayumBundle payment.twig.html (I'm just making an example, don't know if there's a file named that way). Let's say, also, that this twig is inside /vendor/Path/To/PayumBundle/Resources/views/Payment/payment.twig.html.

What you have to do is create inside /src/Path/To/Your/Bundle/Resources/views/Payment/payment.twig.html

Symfony2 will look, at first, into your bundle for overrided views: if any will took yours and ignore bundles one. Otherwise It will took bundle's one.



来源:https://stackoverflow.com/questions/24858961/payum-bundle-how-to-change-the-view-of-capture-action-in-symfony2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!