A very simple module that provides a UK Direct Debit payment method for Drupal Commerce.
When selected at the checkout the module displays fields for account name, bank sort code, and bank account number, all of which are required. Upon successful submission the order is marked as completed and the Direct Debit details are stored with the order.
This module does nothing more with the details, leaving it up to the retailer to process the Direct Debit request.
Drupal 7
http://drupal.org/sandbox/garrettc/1632210
garrettc@git.drupal.org:sandbox/garrettc/1632210.git
Comments
Comment #1
anwar_maxManual Review:
Everything looks good except below
1) All the user provided text should run through the appropriate sanitization function in commerce_directdebit_submit_form().
Please try to resolve automated review.
Comment #2
rszrama commentedAs to the above comment, there's nowhere that I can see that user input is being output in such a way that it would need sanitization. The only place I can see it being used is as the #default_value for form elements, but you shouldn't be sanitizing user input there.
Also, your automated code review is a bit aggressive; it's reporting as errors coding standards that have only been adopted as of Drupal 8. See http://drupal.org/node/1354#param-return-data-type for more info. (But if you're going to document parameter types, the $payment_method instance is actually an array.)
A few other points of review for this module:
Comment #3
garrettc commentedThanks for all the feedback.
Comment #4
garrettc commentedComment #5
rszrama commentedLooking better, Garrett. I'd say the workflow now for transactions in checkout is fine as far as it goes, but it would really be helpful to add a "local action" form on direct debit payment transactions where these could be marked as successful or failed. I wouldn't say that needs to hold up a release, but it should at least be in the roadmap for folks that can't just use a simple Rules based solution. For an example, you can look at the Authorize.Net module's capture form for pending credit card transactions.
Also, this is stylistic, but since your fields for direct debit names / numbers are self-explanatory, you probably don't need the #description text. Up to you, but it just looked like they were restating the field #title.
Comment #6
garrettc commentedThanks Ryan,
I agree that a local action form would be good, but I'm a bit pressed for time to implement it right now. I've added a task for myself in the issue queue so I don't forget.
Comment #7
rszrama commentedCool, not sure how many people need to sign off on these, but it just be RTBC as far as I'm concerned.
Comment #8
patrickd commentedplease keep security tags for statistics
Comment #9
rszrama commentedCan you explain to me what the meaning of that tag is? I assumed it was because there was a security issue detected with the project in question, but it was a false claim. The text comment #1 indicated needed sanitization did not need sanitization - it was for default values in a form field. :-/
Comment #10
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 :-)
Also removing the falsely assigned security tag.
Comment #11
mitchell commentedThanks for your contribution, garrettc!
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 and #drupal-commerce. So, come hang out and get involved!
Thanks rszrama for your awesome review and guidance to garrettc!!