Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Overriding Payum Stripe Bundle templates

Tags:

php

symfony

payum

I'm trying to customise the templates of StripeBundle, respectively the checkout template vendor\payum\stripe\Payum\Stripe\Resources\views\Action\obtain_checkout_token.html.twig.

This is because I want the Stripe popup to appear in the same page as the object that is paid for and not on a separate page with a single button. Say, I want to pay for a Product, I press 'pay' at the checkout page, and want the Stripe popup to appear there.

I took a look at another similar question but I can't seem to get it working. I've tried every single combination of folder names in app/Resources with PayumStripeBundle, Payum, Payum/Stripe, but none of them seem to override the used template.

The bundle's structure is also pretty strange, as its namespace is Payum\Bundle\PayumBundle, but the Stripe component which is not a bundle that contains the template is in another folder.

The value is set here, so maybe Symfony never looks in the folder because of that?

How should the folder structure in app/Resources be, if it works this way? Or if it's another way to do it.

like image 561
George Irimiciuc Avatar asked Jan 26 '16 14:01

George Irimiciuc


1 Answers

Try this in your config.yml, and put an Action folder in that path with the templates you need.

twig:
    debug:            "%kernel.debug%"
    strict_variables: ~
    paths:
        "%kernel.root_dir%/../app/Resources/PayumBundle/Stripe/views": PayumStripe
like image 152
Sergio Enrique Vargas Avatar answered Sep 25 '22 10:09

Sergio Enrique Vargas