This module adds a new payment method to the Commerce module based on Drupal 7.
It's allows to pay with the CM-CIC payement system (Crédit Mutuel - CIC).

My sandbox : http://drupal.org/sandbox/olmetadavid/1550282

To clone :

git clone --recursive --branch 7.x-1.x olmetadavid@git.drupal.org:sandbox/olmetadavid/1550282.git commerce_cm_cic
cd commerce_cm_cic

Reviews of other projects :
http://drupal.org/node/1535698#comment-5979512
http://drupal.org/node/1535574#comment-5979458
http://drupal.org/node/1567572#comment-5977000
http://drupal.org/node/1553604#comment-5979232

CommentFileSizeAuthor
#15 drupalcs-result.txt2.46 KBklausi

Comments

patrickd’s picture

welcome,

As installation and usage instructions are quite important for us to review, please take a moment to make your project page follow the tips for a great project page. Also create a README.txt that follows the guidelines for in-project documentation.

These points have to be fixed for now:

  • Remove "version" from the info file, it will be added by drupal.org packaging automatically.
  • The "?>" PHP delimiter at the end of files is discouraged, see http://drupal.org/node/318#phptags
    ./kit/CMCIC_Tpe.inc.php
    

while waiting for an in-depht review of your module you can start out fixing some coding style issues detected by automated tools:
http://ventral.org/pareview/httpgitdrupalorgsandboxolmetadavid1550282git

We do really need more hands in the application queue and highly recommend to get a review bonus so we can come back to your application sooner.

regards

olmeta.david’s picture

Thank you for your recommendation,

I didn't received the notification so that's why I reply late.

Since my last post, I corrected a lot of things about my module.
The problem is about the CMCIC_Tpe.inc.php that is largely based on the payment kit given by the bank.

I wanted, at the beginning, to let user to choose the process file (CMCIC_Tpe.inc.php or other) which will be used by the module, and that's why I didn't want to change all the code conventions used, but now, I wonder if it was a good idea...

So, I will rewrite as soon as possible this file to correspond to the Drupal notations.

olmeta.david’s picture

Hello,

I've just finished to correct all recommendation by ventral (good tool !).

I will review some other modules now.

Thanks again.

cprouvot’s picture

Your sandbox project is empty! I need this payment method for Drupal Commerce so I can contrib to this module. Can you post a version of your module in your sandbox repository?

olmeta.david’s picture

Hello,

I confirm that the sandbox is not empty.
Are you sure that you try to get files of the correct branch ?

The command line to get them :

git clone --recursive --branch 7.x-1.x http://git.drupal.org/sandbox/olmetadavid/1550282.git commerce_cmcic

Let me know,

cprouvot’s picture

Ok, It's better with the right branch! I check the module and I give you my feedback.

olmeta.david’s picture

Issue tags: +PAreview: review bonus

Add the "PAReview: review bonus" tag after making the 3 reviews.

klausi’s picture

Status: Needs review » Needs work
Issue tags: -PAreview: review bonus +PAreview: security

First: the "package" key in info files is not required and it is perfectly fine if modules live in the "Other" caegory. And please be more verbose in your reviews, just posting that the package is missing is not enough. When finishing your review comment also set the issue status either to "needs work" (you found some problems with the project) or "reviewed & tested by the community" (you found no flaws).

manual review:

  1. "die("Erreur paramétre " . $constants[$i] . " indèfini");": do not use die(), you should stop the execution gracefully and log errors. Also in English please.
  2. commerce_cmcic_schema(): dates are normally stored as unix timestamps in drupal, are you sure you want to store strings?
  3. "watchdog('commerce_cmcic', sprintf('The data received from bank server are %s', var_export($payment_data, TRUE)));": do not use sprintf() here, just pass the dynamic value as third parameterin an array to watchdog(). Also elsewhere.
  4. "require_once 'includes/commerce_cmcic.inc';": does that work? This is a relative path, better use require_once dirname(__FILE__) . '/mymodule.inc';
  5. commerce_cmcic_response(): currently anyone can POST arbitrary data to that function which is logged in the database. As soon as an administrator accesses the log via the web interface malicious scripts could be executed leading to XSS vulnerabilities. You should use watchdog() as I already said with the "@" or "%" placeholder to sanitize the dynamic POST data. And you should check for a valid order early and deny access if necessary.

Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

olmeta.david’s picture

OK, thanks for your recommendations.

I apply modifications and will be more attentive next time.

olmeta.david’s picture

Just for commerce_cmcic_schema(): the table is only used to store the informations that the bank server send (unfortunately, the dates is not a timestamps).
I store the informations as is.

For the "require_once" use, yes it works but you're right about the dirname(__FILE__) use. I will change this.

Thanks again,

olmeta.david’s picture

OK,

I've made all changes and all has been committed.

olmeta.david’s picture

For information, I replace the 'require_once' by 'module_load_include() function, finally.

regards,

jygastaud’s picture

Status: Needs work » Needs review

According to post #9, #10, #11, #12, I think status of the issue has been forgot to change to "need review".
So I switch it back.

jygastaud’s picture

Category: feature » task
klausi’s picture

Status: Needs review » Postponed (maintainer needs more info)
StatusFileSize
new2.46 KB

Sorry for the delay. Make sure to review more project applications and get a new review bonus and this will get finished faster.

There is still a master branch, make sure to set the correct default branch: http://drupal.org/node/1659588 . Then remove the master branch, see also step 6 and 7 in http://drupal.org/node/1127732
Review of the 7.x-1.x branch:

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.

manual review:

  1. "define("CMCIC_CLE", $settings['security_key']);": do not use global constants to pass things to your class. Use constructor parameters to do that, or one parameter that is the settings array. Not sure if you provided the class and are able to change that?
  2. commerce_cmcic_response(): the "@" placeholder will run check_plain() for you, so no need to do that extra check_plain() in the foreach loop beforehand. Double escaping is bad.
  3. "exit(0);": do not use exit(), use drupal_exit() instead.

Is CmcicTpe.inc.php third party provided code or did you write that yourself? If the former, is it licensed under the GPL or GPL-compatible?

klausi’s picture

Issue tags: -commerce +PAReview: Commerce
olmeta.david’s picture

Status: Postponed (maintainer needs more info) » Needs work

Thank you !

I know for the review bonus but I didn't have time to review more project. I reviewed 2 new projects for the moment... I try to do the third today ;-)

Okay, I fixed coding standards.

Now, I have to :

  • Define the default branch and delete the master
  • Fix manual review

For information, yes, CmcicTpe.inc.php is a third party provided code.
This is provided by the bank and that's explains why things are not compatible with Drupal coding standards. I guess there is no problem with the licence (the bank provides mainly some examples of use of the API and not a file wich must be absolutely used by the system) but I check that.

klausi’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. Feel free to reopen if you are still working on this application.

olmeta.david’s picture

Status: Closed (won't fix) » Needs review
klausi’s picture

Status: Needs review » Needs work
Issue tags: -PAreview: review bonus

Please add all your reviews to the issue summary so that we can track them.

manual review:

  1. commerce_cmcic.info: dependencies to commerce modules are missing?
  2. theme_cmcic_icons_title(): all user facing text must run through t() for translation.
  3. "module_load_include('inc', 'commerce_cmcic', 'includes/commerce_cmcic');": no need to use module_load_include as you are including files from your own module which you already know where they are. Use something like require_once 'mymodule.inc';. Also elsewhere.
  4. License.txt: Remove that, all code on drupal.org is GPLv2 only and a license file will be automatically added for module downlaods.
  5. "exit(0);": do not use exit, use drupal_exit() instead.
  6. commerce_cmcic_history_load(): Do not use db_select() for simple static queries, use db_query() instead. See http://drupal.org/node/310075

The license file is a blocker, otherwise looks nearly ready to me. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

olmeta.david’s picture

Status: Needs work » Needs review

Hi,

All corrections have been applied except for the point 2, for which I don't understand where you want I add the t() function because for me, all text use it.

I'm reviewing 3 modules of the issue queue.

garphy’s picture

I think the best option to integrate the required CM/CIC classes would be to use the Libraries API and require the user to put that code somewhere under sites/all/libraries.

olmeta.david’s picture

Hello,

I think about it at the beggining of the project.
The main idea was to pick up the library supplied by the bank and put it into the sites/all/libraries but the file doesn't respect the Drupal notation.

I rewrite all the file to have clean code, that's why the library is currently located in the module.

++

jygastaud’s picture

Status: Needs review » Reviewed & tested by the community

@garphy Your request make sense in case of other bank can have a different structure but it's look like the class provided is enough to work well for both banks targeted by the project.

I saw you put your request and patch in issue queue of the project so these is just a suggest and not a blocker to a full project review.

Also all comments (and the license files blocker point) looks to have been corrected.

Then I've seen a good comment in the issue queue #1898832: Order status should not be updated when payment is completed which says "I have been using the module in production for a few months and all works well, thanks a lot for your contribution! I think it is time you turn it into a full project."

I also think it's time for these module after 9 months!

garphy’s picture

I saw you put your request and patch in issue queue of the project so these is just a suggest and not a blocker to a full project review.

This is obviously a suggest and by no means a blocker.
I've mostly completed the review in both cases. I just have to review the callback invocation from the bank.

I thought externalizing that piece of code would somehow make the licensing issues easier to manage.

I'll be more than happy to see that module officially promoted as a project !

klausi’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for your contribution, olmeta.david!

I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Add the reviews made.