Description:The "Commerce Greek Banks" module is a set of modules that provides Drupal Commerce the ability to communicate with Greek banks and handle payments through them. It uses the redirection method and future releases/additions will deal with the redirection method only.
At the moment no other module provide such functionallity on drupal.org.
There are modules providing XML communication with the bank but these require certified servers to work and aren't always an option.
The module has been tested with Alphabank and is working correctly.
More banks will be added soon, each as a submodule inside this project.
Project Link: http://drupal.org/sandbox/xaristsimpouris/1400956
Clone from Git: git clone --branch 7.x-1.x http://git.drupal.org/sandbox/xaristsimpouris/1400956.git commerce_greek_banks
Version: This module is to be used with Drupal 7 and Commerce
| Comment | File | Size | Author |
|---|---|---|---|
| #29 | drupalcs-result.txt | 2.01 KB | klausi |
Comments
Comment #0.0
xaris.tsimpouris commentedMinor change
Comment #0.1
xaris.tsimpouris commentedMinor fix 2
Comment #0.2
bserem commentedadded information about other modules providing the same functionality (none exist)
Comment #1
misc commentedHi there,
You have some coding standards issues to take care about: http://ventral.org/pareview/httpgitdrupalorgsandboxxaristsimpouris140095...
Also it appears that you have code ine the master branch, and no 7.x-1.x branch, more information here: http://drupal.org/node/1127732
Coding issues should be taken care about before in depth review of the module.
Comment #2
xaris.tsimpouris commentedhttp://ventral.org/pareview/httpgitdrupalorgsandboxxaristsimpouris140095...
All errors have been corrected.
However, function names are already prefixed as it is shown :(
Can it be possible that it is confused because the function it mentions are in a submodule?
Comment #3
bserem commentedAlso all warnings have been removed.
Active branch is now 7.x-1.x and not 7.x-1.x-dev as it was before.
Master branch is empty.
Comment #3.0
bserem commentedchanged git clone command to use 7.x-1.x-dev instead of master
Comment #4
bserem commentedThe module has been updated to not empty the cart when the users cancels the payment.
Alphabank submodule has been, once again, throughly tested in every possible way (success, fail, cancellation) and is functional.
It has been tested alongside the paypal module too, to ensure that there won't be any complications on the later since it is common for greek e-commerce sites to accept paypal payments too.
Comment #5
bserem commentedSince it has been a long time since the last reply I'm marking this as major.
I do not wish to mark it as RTBC by myself, although I've already tested it and deployed it to one site, because I've helped xaris.tsimpouris with it in a few issues and one could say that I'm a co-maintainer of the project.
Comment #6
bserem commentedPromoting this to critical.
Comment #7
jordojuice commentedJust gave the code a quick look to help move this along. A couple recommendations:
I.e.
$my_var[ $key ]should be$my_var[$key]$k,$v, or$i- everyone knows what those are. But variables like$t,$l,$md, and$mcan be confusing and ultimately retard the process of contributing. Descriptive variable names can go a long way towards the readability of code and thus cut down on development time and debugging. Otherwise, developers might have to follow that variable around different functions to figure out what it's supposed to be.Comment #8
xaris.tsimpouris commentedA new commit has been pushed to git, with all the above changes.
For some reason, code have missed to mention the spaces inside brackets
Comment #9
targoo commentedHi
Here is my manual review. Good work by the way.
1) commerce_greek_banks.module
your are missing some t() in your form like :
56 '#description' => 'Use the following links when you contact your bank.',
2) commerce_greek_banks.module
You have different variable '$default_text' that can no be translated.
3) commerce_alphabank/commerce_alphabank.pages.inc
watchdog('commerce_alphabank', 'Receiving new order notification for order !order_id.', array('!order_id' => $order_id));
Why are you using the ! placeholders ? instead of the @ ?
4) commerce_alphabank/commerce_alphabank.pages.inc
why are you running check_plain() on $_POST items if you never print them? Do not filter on input, filter on output only. "the golden rule is to store exactly what the user typed. When a user edits a post they created earlier, the form should contain the same things as it did when they first submitted it. This means that conversions are performed when content is output, not when saved to the database." See http://drupal.org/node/28984
5) $delta_pay_id = -1; is never user. Do you need it ?
Comment #10
targoo commentedComment #11
bserem commented1 and 2 are fixed in the latest code. We are looking into The rest ASAP.
Comment #12
xaris.tsimpouris commented3 and 5 have been pushed to the git.
For 4 you are correct, however input is not given from user but from the bank to verify/cancel/proceed the transfer. So we check it to avoid any sql injection attack.
Comment #13
ParisLiakos commentedcheck_plain() is not used against sql injections, (you are safe from them if you use prepared statements => PDO), it is used for XSS or CSRF attacks.
http://en.wikipedia.org/wiki/Prepared_statement
http://en.wikipedia.org/wiki/Cross-site_request_forgery
http://en.wikipedia.org/wiki/Cross-site_scripting
Comment #14
xaris.tsimpouris commentedOk then.
Just removed check_plain from $_POST, from bank. All values are also transfered to the commerce system (commerce_payment_transaction_new, commerce_payment_transaction_save), so I assume commerce is in charge to avoid SQL injection by using db_* functions.
Comment #15
ParisLiakos commentedbtw are you aware of http://drupal.org/project/Commerce_eurobank?
have you talked with yannis, to merge his module into yours?
Back to the review:
Any reason why not hardcode it to TRUE?seems like a wasted function call to me, if it is intended to always be TRUE
Comment #16
bserem commented@rootatwc: The project of yannisc you are mentioning uses the XML API to communicate with the bank.
Our modules uses the redirection method. Those two are completely different and as we say in our documendation we do not intend to expand to the XML method (it is more expensive for the site because it requires a PCI DSS certificate which costs ~1000euros).
To quote myself from the project description:
As you can see these are two different methods and their modules have nothing in common. We have to override URLS and send and receive POST data, validation happens on the bank server. The XML method stores credit-cards and validates them.
Our intentions are to gather all possible banks (including eurobank) that use the redirection method under one module, but only redirection.
So the idea is that there will be two eurobank modules, one that uses XML and one that uses Redirection. It will be up to the developer to decide which one fits his needs.
Back to the review, I'll let xaris.tsimpouris see into this as he is better acquainted with the code. I deal with the translations and the ease of use more and I wouldn't like to say something invalid.
Comment #17
ParisLiakos commentedi am so sorry, i should bother reading it before asking.you are perfectly clear, thanks
Comment #18
bserem commentedNo problem. It actually took me quite some time to clear out all the differences myself back in 2009 when I first dealt with all the aspect of electronic-commerce and the greek banks
Comment #19
xaris.tsimpouris commented@rootatwc: Yes, and no, for the *extra* function.
The idea is to have a function so as to avoid hardcoded values. Just like global constants.
You create a function and then forget where this value is needed. You just have only one point to check, to make module-wide changes.
However, because it is a function about access, it is better to be already there for future development.
Comment #20
xaris.tsimpouris commentedPromoting to major after 4 weeks of no response.
Comment #21
patrickd commentedHi,
I'm sorry for the delay!
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.
Comment #22
bserem commentedReview:
http://drupal.org/node/1431424 Not exactly a review but I've taken part in this project application. Alas the original poster of that application never contacted me.
Comment #23
xaris.tsimpouris commentedPromoting to critical after 2 weeks of inactivity
Comment #24
kaido.toomingas commented1. Very little problem with coding standard.
FILE: ...es/commerce_greek_banks/commerce_alphabank/commerce_alphabank.pages.inc
--------------------------------------------------------------------------------
FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
58 | ERROR | There must be no blank line following an inline comment
2. Security?
Maybe you could provide API manual in English because I have serious doubts about security!
How can you know this payment is done?
I mean by that.. You can not be sure that $_POST query came from bank, because there is no validation.
Because of that You couldn't be sure that payment is really done.
Comment #25
bserem commented#1 by kaido: Fixed
Comment #26
xaris.tsimpouris commented#2 As much as I may agree, this how alpha banks protocol is supposed to work
Comment #27
kaido.toomingas commentedI just couldn't stay quiet :D..
I would think about that.
1. Admin form () could be at admin.inc or some like that..
2. Why not?
3. Also I would put alfabank settings to different file and include this only if really needed.
function commerce_alphabank_commerce_payment_method_info() {
include 'alfabank_settings_form.inc';
....
These are not problems or anything.. I just think this would be nice way to handle these things ;).
But as far I see this module could be a project :).
Comment #28
bserem commentedkaido24 thank you for your suggestions, Xaris is away right but I'm pretty sure he'll see all three of them.
As for number 3, it is supposed to be loaded from the modules page in drupal if the drupal-admin enables it. It isn't loaded by default.
I'll se to it with Xaris ASAP!
Thanks
Comment #29
klausiSorry for the delay, but you have not listed any reviews of other project applications in your issue summary as strongly recommended in the application documentation.
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. Get a review bonus and we will come back to your application sooner.
manual review:
Comment #30
xaris.tsimpouris commentedComment #31
dianikol commentedWhere is the module? it isn't in the git repository
Comment #31.0
dianikol commentedgit clone is now pointing to 7.x-1.x