Payum Bundle: how to change capture action view in symfony2

I use the PAYUM Bundle to integrate payment gateways, and its basic example works fine. But now I want to integrate the payum package into the application, changing the layout of the payy capture action and adding additional detail to the payment details.

PAYUM BUNDLE with AUTHORIZE.NET GATEWAY.

Please someone can help me.

Thanks to everyone in advance.

+3
source share
2 answers

Payment templates are not stored in the bundle, but in the lib package itself. Inheriting standard templates does not work here.

There is no easy way to do this in version 0.9 (which comes with Sylius right now). You must overwrite the entire CaptureAction class. At 0.10, you can change the templates by overwriting the container settings, for example, the layout or stripe js page .

In the sandbox you can find an example of changing the layout

+1
source

You need to override PayumBundle .

How to do it?

You need to reproduce the folder structure of the package that you want to override inside your /src/Path/To/Your/Bundle/Resources/views , and place the branch file that you want to override inside it.

Example

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

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

Symfony2 will first look in your package for overridden views: if someone takes yours and ignores the packages alone. Otherwise, he will need a package.

0
source

Source: https://habr.com/ru/post/1241514/


All Articles