This project adds support to the Commerce module for payment via the Paymill payment service:
I've put the code through PAReview already:
http://ventral.org/pareview/httpgitdrupalorgsandboxgazoakley1840226git
There are a couple of issues showing up for "all functions should be prefixed with your module/theme name to avoid name clashes" - this appears to be a result of including another module purely to provide libraries support for Paymill's PHP library - details of how to install this are available in the included README.txt. I'd probably split an actual release up so that other modules can take advantage of Paymill's API without need for the Commerce module.
One unusual design choice is that in commerce_paymill_submit_form I render a form out and then include it again as a markup element. This is done so that the originally rendered form does not have name attributes for input elements - this prevents credit card details from being sent back when the form is submitted (card details are instead sent to Paymill directly from the client using Javascript). There might be a better way of doing this, but I couldn't find one myself.
Summary
Project page:
http://drupal.org/sandbox/gazoakley/1840226
GIT link:
http://git.drupal.org/sandbox/gazoakley/1840226.git
GIT clone:
git clone http://git.drupal.org/sandbox/gazoakley/1840226.git commerce_paymill
Reviews of other projects
- http://drupal.org/node/1840842#comment-6737818
- http://drupal.org/node/1842600#comment-6740510
- http://drupal.org/node/1842600#comment-6741030
- http://drupal.org/node/1840842#comment-6741074
- http://drupal.org/node/1846814#comment-6758996
- http://drupal.org/node/1845192#comment-6760618
- http://drupal.org/node/1818974#comment-6760702
- http://drupal.org/node/1846732#comment-6760738
- http://drupal.org/node/1847550#comment-6762262
- http://drupal.org/node/1850092#comment-6773918
- http://drupal.org/node/1850102#comment-6773982
- http://drupal.org/node/1845192#comment-6778450
I'm planning on reviewing other projects to qualify for the review bonus as time permits. I'll edit this as I carry out reviews.
Comments
Comment #1
grisendo commentedThere is something on commerce_paymill.module in line 276:
Why 3? It looks like it's specific value in most drupal installation (since it's OK initially), but not for general purpose... What if anyone accidentally deletes that action and later recreates it? It won't be 3.
"Configure" link for this module in Module list page (admin/modules) sends to a wrong page when Payment UI or Commerce UI are not enabled. Please, show a warning message in that case telling the user that for configuring options, Payment UI and Commerce UI are required to be enabled. Right now I can't remember if Rules UI is also required for configuring, please, check it also.
Comment #2
grisendo commentedComment #3
gazoakley commentedHi grisendo,
Thanks for your code review :-).
I've committed changes which:
It's possible a user could have replaced the first rule with a completely different action - but I don't think this will happen often and I've raised an issue to filter for the first payment action: http://drupal.org/node/1842642
PAReview should be clean once again as well.
Comment #3.0
gazoakley commentedAdding referred code review
Comment #3.1
gazoakley commentedAdding another peer review
Comment #3.2
gazoakley commentedAdded another project review
Comment #4
gazoakley commentedOther reviews showing in issue, adding review bonus tag
Comment #5
gazoakley commentedThis should also have the commerce tag
Comment #6
klausimanual review:
5'; alert('XSS'); var x = '5as public test key I get a nasty javascript popup on the checkout page. You need to sanitize user provided text before printing. And this case you should use Drupal.settings to pass down PHP variables to javascript, which will automatically escape malicious text.Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #7
gazoakley commentedHi Klaus,
Thanks for your review. I've gone through and made changes as requested:
I've merged the code from paymill_api to commerce_paymill.
Done - commerce_paymill.js has been updated.
Done - commerce_paymill.module has been updated.
No longer required - I'm now using ['#attached']['js'] to pass the settings across.
Now uses check_plain.
Whilst these settings are only editable by those with the "administer payment methods" permission (normally only given to User 1) this should be resolved by using Drupal.settings to set up this variable on the client.
Comment #7.0
gazoakley commentedAdded another project review
Comment #7.1
gazoakley commentedAdding more reviews
Comment #8
gazoakley commentedRe-adding review bonus (see original issue for review links)
Comment #8.0
gazoakley commentedAdded another review
Comment #8.1
gazoakley commentedAdding another review
Comment #9
klausimanual review:
commerce_paymill_transaction(): @return doc is missing, see http://drupal.org/node/1354#functions
But otherwise looks RTBC to me now! Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #10
gazoakley commentedCheers Klausi, I'll try and get that tweaked shortly :-)
Comment #11
gazoakley commentedFixed - will work to review bonus tag again
Comment #11.0
gazoakley commentedAdding another review
Comment #12
gazoakley commentedRe-adding review bonus (see original issue for review links)
Comment #12.0
gazoakley commentedAdding more code reviews
Comment #13
klausiThe Git commits are not connected to your user account. You need to specify an email address. See http://drupal.org/node/1022156 and http://drupal.org/node/1051722
But otherwise there were no objections for more than a week, so ...
Thanks for your contribution, gazoakley!
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.
Comment #14.0
(not verified) commentedAdding another code review