ETSGlobal / ETSPaymentOgoneBundle

An Ogone provider for JMSPaymentCoreBundle
12 stars 16 forks source link

How to pass additional parameters ? #10

Closed qdelettre closed 10 years ago

qdelettre commented 10 years ago

I would like to use a dynamic template. I have to provide to ogone a TP variable containing the absolute url of my template.

What is the correct way to do it ?

ch3ric commented 10 years ago

Hello,

I don't think we support this parameter 'TP' for now. It can be added in the node 'design' of the configuration 'ets_payment_ogone', if you want to send a pull request.

qdelettre commented 10 years ago

Thanks for the quick reply.

In fact, i would like to put this parameter at form creation,

$form = $this->getFormFactory()->create('jms_choose_payment_method', null, array(
        'amount'   => $order->getAmount(),
        'currency' => 'EUR',
        'default_method' => 'ogone_gateway', // Optional
        'predefined_data' => array(
            'ogone_gateway' => array(
                'TP'        => $ogoneFormUrl, // OGONE FORM TEMPLATE PARAMETER
                'lang'      => $request->getLocale(),
            ),
        ),
    ));

I saw that the form generated by this code does not contain the TP parameter, so what is the best way to implement this ?

ch3ric commented 10 years ago

Why do you need to add this parameter when you create the form?

The template URL is the same for all the request to Ogone, right? That's why I suggested to add it in the configuration of the bundle instead: see ETS\Payment\OgoneBundle\Plugin\Configuration\Design and ETS\Payment\OgoneBundle\DependencyInjection\Configuration Moreover, even if this variable is set in the configuration, it can still be overridden when the form is created.