Payment method for Drupal Commerce to accept credit card payments through mobilpay.ro redirect.
Install
1.Go to mobilpay.ro and create an account.
2.Go to Implementare -> Exemple implementare and download Exemplu implementare card in PHP.
3.Copy only Mobilpay folder and place it in libraries folder.(so it should be /sites/all/libraries/Mobilpay).
4.Download your keys from Mobilpay, and upload them to admin/commerce/config/mobilpay-keys.
5.Add Merchant Code and urls to the payment method settings and you're ready to go.
Dependencies
You will need Libraries API module.
Testing
For testing use http://sandbox.mobilpay.ro on Post URL field.
Links
Project page: http://drupal.org/sandbox/bogdanru/1905678
Git repository: git clone http://git.drupal.org/sandbox/bogdanru/1905678.git commerce_mobilpay
Manual reviews of other projects
https://drupal.org/node/2020219#comment-7550929
https://drupal.org/node/2023661#comment-7567609
https://drupal.org/node/2022681#comment-7567655
https://drupal.org/node/2034513#comment-7617231
https://drupal.org/node/2034575#comment-7617313
https://drupal.org/node/2033641#comment-7617375
Comments
Comment #1
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://ventral.org/pareview/httpgitdrupalorgsandboxbogdanru1905678git
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.
Comment #2
lexicon commentedHi,
Please check your module on ventral.org. There are so many error in your module. Please resolve it. Checkout this link :
http://ventral.org/pareview/httpgitdrupalorgsandboxbogdanru1905678
Regards
Lexicon
Comment #3
bogdanru commentedHi,
Files under Mobilpay/ ... comes from mobilpay.ro provider ... and ofcourse are not Drupal Coding Standards. I will realy like to not fix that.
Comment #4
bogdanru commentedComment #5
nonzod commentedYou don't include third party code in your module, use instead files[] in .info and you can use the Libraries API module.
Comment #6
bogdanru commentedYeah, wanted to make it easy to install. Removed 3rd party code and updated installation guide.
Comment #7
bogdanru commentedComment #7.0
bogdanru commentedupdated installation guide
Comment #8
bogdanru commentedadded PAReview: review bonus tag.
Comment #8.0
bogdanru commentedReviews of other projects
Comment #9
klausiRemoving review bonus tag, you have not done all manual reviews, you just posted the output of an automated review tool. Make sure to read through the source code of the other projects, as requested on the review bonus page.
I removed the automated review comment links from the issue summary.
Comment #9.0
klausiremoved automated reviews
Comment #10
bogdanru commentedreview bonus
Comment #11
klausimanual review:
So the last point looks like a security blocker, can you elaborate a bit on that? Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #11.0
klausimanual reviews
Comment #12
bogdanru commented1. using explicit list of variables
2. removed commerce_mobilpay_completion_access()
3. billing address is not hardcoded anymore.
4. All string are in english now.
5. Using libraries now.
6. Keys can be placed outside webroot now, so in private folder.
Comment #13
theo_ commentedPrivate key file
Handling your private key file is a critical security point. You should take advantage of the Drupal File API to achieve it, here's some of the advantages :
There's a simple example here.
Learn more about File API.
Comment #13.0
theo_ commentedlibraries support
Comment #14
bogdanru commentedAll of the above are fixed.
Thanks Theo.
Comment #14.0
bogdanru commentedUpdated issue summary.
Comment #15
bogdanru commentedreview bonus.
Comment #16
klausimanual review:
Although you should definitely fix those issues they don't seem to be application blockers, so I think this is RTBC. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Assigning to chx as he might have time to take a final look at this.
Comment #17
bogdanru commented1. post_url is a select box now.
2. removed variable_set() from form and added to a submit callback.
3. removed $default_currency.
4. removed system_settings_form().
Thx klausi.
Comment #18
chx commentedI am usually invoked to nitpick. Well, here it goes -- none of this blocks:
line 59, 'type' => MENU_NORMAL_ITEM is not necessary, it's the default and can be ommitted.
line 69 if (isset($items['admin/commerce/config/advanced-settings'])) { could use a comment. Why this path?
line 119, there's a drupal_map_assoc function to save you from typing the urls twice and to better indicate the key and the value are the same.
line 166 number_format(floatval($total['amount'] / 100), 2, '.', ''); there is no need for floatval.
line 173 $x509_file_path = drupal_realpath($public_key->uri); drupal_realpath is rarely necessary. It says so "The use of drupal_realpath() is discouraged" Did you try without? Same in pages.inc line 87.
line 194 isset($customer_address['first_name']) ? $billing_address->firstName = $customer_address['first_name'] : ''; this is either a superb clever trick here or it's not what you want -- this will run $billing_address->firstName = $customer_address['first_name'] when the first name is set and do nothing when it is not. If this is the desired behaviour, if (isset($customer_address['first_name'])) { $billing_address->firstName = $customer_address['first_name'];} is way more readable than the abuse of an assignment being an expression in and itself.
line 259 echo "{$error_message}"; let's admit, this is not pretty. so many escapes and {}. I recommend printf('%s', $error_type, $error_code, $error_message'); same perhaps for line 256
line 267 although this code does use the id_comanda variable correctly in the following SQL query (great!), is there a way to validate this and die immediately if it is invalid?
Comment #19
bogdanru commentedline 59, 'type' => MENU_NORMAL_ITEM ... removed.
line 69 if (isset($items['admin/commerce/config/advanced-settings'])) { could use a comment. Why this path?
- you are right here, no need for condition, since it's dependant by commerce, anyway.
line 119, there's a drupal_map_assoc function to save you from typing the urls twice and to better indicate the key and the value are the same.
- using drupal_map_assoc() now.
line 166 number_format(floatval($total['amount'] / 100), 2, '.', ''); there is no need for floatval.
- removed.
line 173 $x509_file_path = drupal_realpath($public_key->uri); drupal_realpath is rarely necessary. It says so "The use of drupal_realpath() is discouraged" Did you try without? Same in pages.inc line 87.
- yes, I realy need realpath, otherwise I need to change 3th party code, so I leave it as it is.
line 194 - yes, it's the desired behavior, changed all those conditions in a better readeble code.
line 259 echo "{$error_message}"; let's admit, this is not pretty. so many escapes and {}. I recommend printf('%s', $error_type, $error_code, $error_message'); same perhaps for line 256
- changed to printf. :)
line 267 although this code does use the id_comanda variable correctly in the following SQL query (great!), is there a way to validate this and die immediately if it is invalid?
- added a condition, if id_comanda is not set, the code for checking transaction will not run and will throw an error.
Thanks chx.
Comment #20
klausiGreat, since chx confirmed no blocking issues ...
Thanks for your contribution, bogdanru!
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 #21.0
(not verified) commentedUpdated issue summary.