Page 1 of 1

[SOLVED] How to get the parameters of a module ?

Posted: Wed Feb 22, 2012 1:20 pm
by vinc
Hi folks,

I'm trying to make a new payment gateway module.
I've based the module from the PaypalGateway one (by Ted and Calguy) but the behaviour is not exactly the same :
Paypal : create a form and post to paypal website
Citelis : create a form and post to a local php file

The local php have to get some parameters from the module (initially an include of a file).

I've set up these params in the admin section of the module and therefore i can access to them from CitelisGateway.module.php by a $this->GetPreference(...)

-> I can't pass the parameters as POST data (bank_id and password)

How can I do this the 'correct' cmsms way ?

Do i have to register a route to the post.php (action.post.php) to make this possible ?

Code: Select all

 $this->RegisterRoute('/[Cc]itelis\/post\/(?P<returnid>[0-9]+)$/', array('action'=>'post')) 
Any help or suggestion appreciated :)

Re: How to get the parameters of a module ?

Posted: Fri Feb 24, 2012 8:17 pm
by vinc
Registering the route is fine :
As the page receiving the post data is an action of the module, you can access all the vars directly by $this->GetPreference(...)

Auto-Solved :)