Commerce DirectPay is a [Drupal
Commerce](https://drupal.org/project/commerce) module that integrates
the [DirecPay](http://www.direcpay.com/direcpay/home.jsp) payment gateway into
your Drupal Commerce shop.
Project Page
Module sandbox: https://www.drupal.org/sandbox/sagarramgade/2378955
Git
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/SagarRamgade/2378955.git commerce_direcpay
cd commerce_direcpay
pareview.sh
See: http://pareview.sh/pareview/httpgitdrupalorgsandboxsagarramgade2378955git
Resolved all :-)
Review Bonus
https://www.drupal.org/node/2381597#comment-9382857
https://www.drupal.org/node/2275511#comment-9382633
https://www.drupal.org/node/2378799#comment-9382003
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | DirecPay-Integration-Document.pdf | 274.66 KB | sagar ramgade |
Comments
Comment #1
sagar ramgade commentedComment #2
PA robot commentedProject 1: https://www.drupal.org/node/2382569
Project 2: https://www.drupal.org/node/2338629
As successful completion of the project application process results in the applicant being granted the 'Create Full Projects' permission, there is no need to take multiple applications through the process. Once the first application has been successfully approved, then the applicant can promote other projects without review. Because of this, posting multiple applications is not necessary, and results in additional workload for reviewers ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).
If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #3
sagar ramgade commentedComment #4
sagar ramgade commentedComment #5
ruchirapingale+1
I required these module for my project.
Comment #6
archanayadav commentedI was seaching for this module.
Thank you so much :)
+1
Comment #7
sagar ramgade commentedComment #8
sagar ramgade commentedComment #9
sagar ramgade commentedComment #10
sendinblue commentedFor review by me
Comment #11
sendinblue commentedManual Reviews
- Remove the packaging lins from the .info. These will be added when the module is published.
- Drupal prefer drupal_base64_encode() over base64_encode(). Please use drupal_base64_encode() instead of base64_encode() function.
Comment #12
sendinblue commentedComment #13
sagar ramgade commented@sendinblue thank you for the review, The "package = Commerce (payment)" is required to group the module under commerce payments which i think is not a concern (https://www.drupal.org/node/161085#packaging). I haven't mentioned any packing information which is added by Drupal.org packaging script. Secondly, drupal_base64_encode() doesn't work in our case as Direcpay gateway doesn't decode the information if we use drupal_base64_encode(). Hope that clarifies your points.
Comment #14
mpdonadioAssigning to myself for next review.
Comment #15
mpdonadioAutomated Review
Review of the 7.x-1.x branch (commit 273c017):
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
(*) #value is not plained by the Form API (#defaul_value) is. The addresses in commerce_direcpay_order_form() need to be run through check_plain(), as these are use input going
to output. See https://www.drupal.org/node/28984
I am assuming that the transaction message is using !arg placeholders because this just gets saved in the database? If so, this is not a problem, but I am unfamiliar with this exact mechanism.
(*) commerce_direcpay_redirect_form_validate() is using a !arg placeholder in 234. This should really be an @arg or %arg (and a print_r of the whole response is likely overkill).
It is always best to use @arg or %arg placeholders unless you are know you are *positive* dealing with safe HTML that needs to be shown as HTML.
commerce_direcpay_redirect_form() doesn't have a proper docblock. Do the stock Commerce gateways have ones for this function?
You are explicitly using the Entity API in your module. Though commerce required this, I think it is best to add this to the .info file, too.
Why the urldecode() in commerce_direcpay_order_form? Comment needed.
$requestparameter is ununsed in commerce_direcpay_order_form().
Why does commerce_direcpay_redirect_form_validate() access $_POST directly? Comment needed.
Is there a DirecPay API guide? You should probably have a @see somewhere that references it. Also a little surprised
that this is direct form posting, and not drupal_http_reqquest() or cURL based, as most payment gateway modules are.
In commerce_direcpay_redirect_form_validate(), I am not seeing $mode go to HTML output, so I think the check_plain() is superfluous. It was also coming from an option, which was validated by the Form API.
In commerce_direcpay_encode_string(), comment why drupal_base64_encode() can't be used.
The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.
If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.
This review uses the Project Application Review Template.
Comment #16
sagar ramgade commented@mpdonadio Thank you for your review, I had attached the integration doc here for your reference. Please find my comments below for your inputs:
Secure code
(*) #value is not plained by the Form API (#defaul_value) is. The addresses in commerce_direcpay_order_form() need to be run through check_plain(), as these are use input going
Done, added check plain on line no 183.
I am assuming that the transaction message is using !arg placeholders because this just gets saved in the database? If so, this is not a problem, but I am unfamiliar with this exact mechanism.
Transaction messages are visible when the user views the payment, so I had changed ! with @.
(*) commerce_direcpay_redirect_form_validate() is using a !arg placeholder in 234. This should really be an @arg or %arg (and a print_r of the whole response is likely overkill).
I had changeed it to @, the response which comes from direcpay is a small string which pipe seperated for e.g ("responseparams=1000001xxxxxxxxx|ERROR|wrongdirecpayreferenceid
Error") which will not be an overkill.
Coding style & Drupal API usage
(+) Where did the merchant ID in commerce_direcpay_settings_form() come from? Comment needed (preferable w/ source if this is a test ID from DirecPay).
It is the staging merchant id which direcpay provides, I had mentioned in the comment.
commerce_direcpay_redirect_form() doesn't have a proper docblock. Do the stock Commerce gateways have ones for this function?
Added the comment
You are explicitly using the Entity API in your module. Though commerce required this, I think it is best to add this to the .info file, too.
Added dependency for entity module
Why the urldecode() in commerce_direcpay_order_form? Comment needed.
Remove as it was needed.
$requestparameter is ununsed in commerce_direcpay_order_form().
It is being used at line no 177, to send 'requestparameter' parameter value.
Is there a DirecPay API guide? You should probably have a @see somewhere that references it. Also a little surprised
There is no Api guide as such, however mentioned url of other shopping cart implementations, I had attached the doc here.
In commerce_direcpay_encode_string(), comment why drupal_base64_encode() can't be used.
Added the comment
Comment #17
klausiThank you for your reviews. When finishing your review comment also set the issue status either to "needs work" (you found some problems with the project) or "reviewed & tested by the community" (you found no major flaws).
Review of the 7.x-1.x branch (commit f8497d4):
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:
Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #18
sagar ramgade commentedHi Klausi,
Thank you for your feedback, I will certainly set the issue status after my reviews. I had solved #1 of your feedback, however for #2 we are using payment redirect key in the return url which commerce module provides, the code is shown below :
The payment redirect key makes sure that url is only accessible if the redirect key is valid on which direct pay sends POST. Also I had seen other modules like commerce_paypal_wps_redirect_form_validate, which do not validate POST requests if they are coming from paypal.
We could have used "otherdetails" for sending the hashed value however the "otherdetails" is not being returned in case of failed or error response. If you have any other solution for this please suggest.
Comment #19
mayurjadhav commentedReview of the 7.x-1.x branch (commit 60fc39c):
I've just checked your project with pareview.sh and coder as well as did manual review.
Done some successful and failed transactions too, it works smoothly.
It looks RTBC to me.
Comment #20
sagar ramgade commentedComment #21
klausiSorry for the delay. Reviewing more project applications and a new review bonus makes project applications go faster.
I didn't know about the payment_redirect_key that commerce_payment provides for you, so that seems to be in order.
Thanks for your contribution, Sagar Ramgade!
I updated your account so you can 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 stay 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 #22
sagar ramgade commentedThank you all for reviewing my code and providing the feedback. Thank you klausi for giving me git vetted access :-)