3

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.

amit
  • 63
  • 8

2 Answers2

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

Maksim Kotlyar
  • 3,821
  • 27
  • 31
  • +1 to overriding the templates via parameters, I think this is probably the best practice method. N.B. there was a bug in v0.15 (and possibly before?) that meant any templates you defined via params got overwritten. This is fixed in v1.0.0 – Matthew Webb Nov 16 '15 at 22:08
0

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.

Community
  • 1
  • 1
DonCallisto
  • 29,419
  • 9
  • 72
  • 100
  • Also you could use `app/Resources/PayumBundle/views/Payment/payment.html.twig` if you are just wanting to change the templates and not create a whole child bundle. – qooplmao Jul 21 '14 at 11:48
  • @Qoop: yes, of course, but is kind of strange to write code without bundles in Symfony2 :) – DonCallisto Jul 21 '14 at 11:49
  • 1
    I guess it depends how you are working. I'm using FOSUserBundle but don't have a child bundle so need to stick the templates in `app/Resource`. – qooplmao Jul 21 '14 at 11:54
  • @Qoop: how do you structure the code of your application? Do you use Symfony2 only as a "firewall" putted in front of another application? I don't think so, so now I'm just curious :D – DonCallisto Jul 21 '14 at 12:00
  • I've used Sylius (https://github.com/Sylius/Sylius) as a base methodology with a load of separate (ideally standalone) bundles with the user stuff in a CoreBundle along with anything that connects and of the bundles and then all views and stuff in a WebBundle (or `app/Resource/views` for things like FOSUserBundle). – qooplmao Jul 21 '14 at 12:22