This module is a payment method for Drupal Commerce that integrates Bluepay's Secure Hosted Forms payment method.

BluePay’s hosted payment forms allow merchants to accept and process credit
cards online through a Web form hosted on BluePay’s secure server.

Allows merchants to:

Accept convenient and secure online payments with a reduced risk of liability.
Cut paper billing costs with online recurring payment capabilities.
Reduce PCI scope through BluePay’s secure, PCI compliant databases.

Project Page:
https://drupal.org/sandbox/tallosoft/2144659

Git Repository:
http://git.drupal.org/sandbox/tallosoft/2144659.git

Manual reviews of other projects:
https://drupal.org/comment/8287107#comment-8287107
https://drupal.org/comment/8287207#comment-8287207
https://drupal.org/node/2169481
https://drupal.org/node/2114199

Comments

PA robot’s picture

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

th_tushar’s picture

Hi tallosoft,
I have manually reviewed the code and looks fine, but not installed in drupal. There are couple of warnings from the pareview test which can be fixed.

In commerce_bluepay_hosted_forms.module file,
On line 183, there is a warning from pareview.sh,
183 | WARNING | Only string literals should be passed to t() where possible.
Try concatenating the variable in drupal_set_message() with the quotes which might fix this warning.

In README.txt file,
52 | ERROR | Files must end in a single new line character
Enter the new empty line at the end of the file.

tallosoft’s picture

Hey th_tushar!

First off, thanks for the review! I can definitely fix the error in the readme file by adding the newline and will complete that today.

The warning is a little more hairy :(. If I concat the string directly in drupal_set_message, that warning becomes an ERROR that states concatenation is not permitted for string literals in that function. I had hoped the 'whenever possible' in the warning might be acceptable as an alternative to an error, which would never fly. What do you think?

tallosoft’s picture

I have corrected the README file to end in a newline, and committed the change.

tallosoft’s picture

I have corrected the README file to end in a newline, and committed the change.

alex_sansom’s picture

Hi tallosoft,

I installed your module into a non-kickstart Commerce test site. Here's a couple of things I noticed, that you might want ot take a look at:

  • The payment method is enabled by default, meaning that it's automatically available at the end of the checkout after installing the module. If adding this payment method to a live site, this doesn't give you anytime to configure the module before deploying it.
  • Striaght after enabling I navigated to /admin -> Store -> Configuration -> Payment methods -> Bluepay Host
    ed Forms Integration -> Enable payment method: Bluepay Hosted Forms Integration and I received the following error:

    "Notice: Use of undefined constant BLUEPAY_MODE_TEST - assumed 'BLUEPAY_MODE_TEST' in commerce_bluepay_hosted_forms_settings_form() (line 66 of /home/alex/workspace/commerce/sites/all/modules/2144659/commerce_bluepay_hosted_forms.module)."

  • I also ran the Coder over the module at it produced the following (one of which you're already aware of):
Line 176: Use an indent of 2 spaces, with no tabs [style_indent_spaces]

         $order, $payment_method) {

severity: minorreview: sniffer_semantics_functioncall_notliteralstringLine 183: Only string literals should be passed to t() where possible [sniffer_semantics_functioncall_notliteralstring]

    drupal_set_message(t($not_configured), 'error');

severity: criticalreview: security_3Line 183: Potential problem: drupal_set_message() only accepts filtered text, be sure all !placeholders for $variables in t() are fully sanitized using check_plain(), filter_xss() or similar. (Drupal Docs) [security_3]

    drupal_set_message(t($not_configured), 'error');

severity: normalreview: style_comma_spacingLine 313: missing space after comma [style_comma_spacing]

    ' id="iframe_bluepay" src="' . url($server_url) . '" />',);

severity: minorreview: style_indent_spacesLine 382: Use an indent of 2 spaces, with no tabs [style_indent_spaces]

         ucfirst(strtolower($_REQUEST['MESSAGE'])) . '<br /><br />';

Looks good otherwise.

tallosoft’s picture

Thank you, alex_sansom!

I have now resolved these issues:

I set the 'active' value to FALSE as the default, so that the payment method will no longer be enabled on install.

I modified the way the error message was being set so that I used placeholders, and it can verify that the text is not an XSS attack, etc.

and I corrected the smaller spacing/formatting issues coder was catching.

Thanks for the review!

alex_sansom’s picture

Just re-checked the code and all looks good, except Coder is still grumbling, with the following:

Line 183: Potential problem: drupal_set_message() only accepts filtered text, be sure all !placeholders for $variables in t() are fully sanitized using check_plain(), filter_xss() or similar. (Drupal Docs) [security_3]

    drupal_set_message(t('!notconfigured', array(

Looking at it, you could just change the drupal_set_message() code to be:

drupal_set_message(t('Bluepay Hosted Forms Integration is not configured for use.'), 'error');

Seeing as $not_working isn't used elsewhere.

alex_sansom’s picture

Status: Needs review » Needs work
tallosoft’s picture

Thanks for looking again alex!

Removed the variable, and reformatted the error message....I think it should finally stop cribbing!

tallosoft’s picture

Status: Needs work » Needs review
tallosoft’s picture

Issue summary: View changes
tallosoft’s picture

Issue tags: +PAreview: review bonus
lord_of_freaks’s picture

Hi

The module looks nice, the only thing I think you should change is the invocation of http_bulid_query in .module:304:

$query_string = http_build_query($params);

Changing that one for this one:

$query_string = http_build_query($params, '', '&');

When calling http_build_query(), make sure the third argument is "&". Otherwise, your system may default to "&" which means something completely different to the server processing the request (i.e. apple=red&banana=yellow&pear=green).

lord_of_freaks’s picture

Status: Needs review » Needs work
tallosoft’s picture

This has been updated. I don;t mind updating a function to specifically identify something like the arg separator, but I do have one question, more for my know knowledge. I don't know if it is the comment system, or if I am a bit blind, but you stated:

When calling http_build_query(), make sure the third argument is "&". Otherwise, your system may default to "&" which means something completely different to the server processing the request (i.e. apple=red&banana=yellow&pear=green).

I don't see a difference between the first '&' and the second '&'. In the second case, were you trying to show me the entity code for ampersand? (& amp;)?

Thank you for the feedback!

tallosoft’s picture

Status: Needs work » Needs review
lord_of_freaks’s picture

Hi

Yes that's exactly what happened, the sing for & amp ; was escaped :-D

Good job!!!!

tallosoft’s picture

So, now that I have corrected the various issues, and everyone seems happy :)

What is the actual next step in the approval process? Are there only certain folks that have the privilege to set this to RBTC and good to go? I can't wait to get this into people's hands and see how it helps them :)

klausi’s picture

Issue summary: View changes
Issue tags: -PAreview: review bonus

Removing review bonus tag, you did not all manual reviews, you just repeated the output of an automated review tool. Make sure to read through the source code of the other projects.

xqus’s picture

Status: Needs review » Needs work

I haven't installed your module, but I had a look trough the Git repository.

Take a look at https://api.drupal.org/api/drupal/includes!common.inc/function/l/6, there are a few manually created links.

function commerce_bluepay_hosted_forms_handle_callback($order) {
has a few text strings that are not passed trough t(), and the output here should be in a template (imho).

tallosoft’s picture

I have corrected the links, and the untranslated text.

I did consider a template for what I was doing, but it seemed a bit of overkill for the simple presentation of a message that was already embedded within a template.

Thank you for the feedback!

tallosoft’s picture

Status: Needs work » Needs review
tallosoft’s picture

Issue summary: View changes
Issue tags: +PAreview: review bonus

Added 2 more manual reviews/comments. My apologies for the earlier less-than-manual reviews!

Readded review bonus tag now that this request meets the requirements.

klausi’s picture

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

Review of the 7.x-1.x branch:

  • Coder Sniffer has found some issues with your code (please check the Drupal coding standards).
    
    FILE: /home/klausi/pareview_temp/commerce_bluepay_hosted_forms.module
    --------------------------------------------------------------------------------
    FOUND 0 ERROR(S) AND 1 WARNING(S) AFFECTING 1 LINE(S)
    --------------------------------------------------------------------------------
     381 | WARNING | Only string literals should be passed to t() where possible
    --------------------------------------------------------------------------------
    

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. as the automated review says: t() should be around string literals where possible. You are defining $untranslated just one line before, and that string should run through t().
  2. commerce_bluepay_hosted_forms_handle_callback(): so this has no access protection and I cannot see where you verify the incoming request that it is actually genuine and coming from the payment provider? Looks like anyone that has the order ID can successfully complete the payment with a malicious request? Looks like a security issue to me, can you explain where you verify the request? And please don't remove the security tag, we keep that for statistics and to show examples of security problems.

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

PA robot’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 (see also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.