This module provides IBIS payment system for Drupal Commerce, but only for First Data Latvia transactions. There is no such module for this purpose yet.
http://drupal.org/sandbox/maris.abols/1908244
git clone --recursive --branch master maris.abols@git.drupal.org:sandbox/maris.abols/1908244.git commerce_ibis
Drupal 7
Comments
Comment #1
vaibhavjainWelcome maris to the community,
Firstly, you are working on a Master branch, you should be using a version specific branch.
More about this here - http://drupal.org/node/1127732
Comment #2
monymirzaComment #3
maris.abols commentedMoved to 7.x-1.x branch.
Comment #4
klausiWe are currently quite busy with all the project applications and I can only review projects with a review bonus. Please help me reviewing and I'll take a look at your project right away :-)
Comment #5
muhleder commentedHi Maris,
the PHP code looks good but there are a few Drupal specific things which could be improved.
1. Getting the commerce_order
At the moment you are doing
which works but isn't very portable. Commerce module gets the order like
which can be used in any function.
2. Use of user input to get order details
This is a possible security issue and really needs to be fixed.
Eg stuff like
You need to use the Form API to submit your forms.
At the moment you are doing
and defining the 'cart/ibis/make/dms' route in hook_menu().
What you need to do is instead
and then make the commerce_ibis_make_dms($form, &$form_state) callback available without having to load the separate file.
Convention is to name the submit function FORM_CALLBACK_NAME_submit, so in this case you would rename commerce_ibis_make_dms to commerce_ibis_make_dms_form_submit.
If you need to do validation you can do
and commerce_ibis_make_dms_form_validate will return a form_error() if validation fails.
Form API reference
http://api.drupal.org/api/drupal/developer!topics!forms_api_reference.ht...
Couple of articles on why we need to use the Form API to protect against CSRF attacks.
http://pixeljets.com/blog/csrf-avoid-security-holes-your-drupal-forms
http://crackingdrupal.com/blog/greggles/protecting-your-drupal-module-ag...
3. Setting correct status for watchdog and drupal_set_message
You've got few error checks which is great to see, but you should set the correct type and status for the watchdog and message respectively.
Eg
http://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/watch...
http://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/drupa...
4. Debug code present in module
I think this debug code should probably be removed
You could leave a comment in saying how to debug if you want, but the commented out code line means that every dev who looks at this is going to have to work out what it's for and why it's been commented out. Makes reviewing the code a little bit harder.
5. Use of drupal_goto
You should avoid using this function if at all possible
http://xkcd.com/292/
If you use the Form API as suggested in (3) you can set $form['#redirect] to set where the user will be redirected to after the form submit callback has completed. There is a bunch of stuff that Drupal does after the callback has completed that won't happen if you issue an immediate redirect with drupal_goto().
Comment #6
PA robot commentedClosing due to lack of activity. Feel free to reopen if you are still working on this application.
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #6.0
PA robot commentedForgot to add git clone link and drupal version.