[PEPr] Comment on Payment::PagamentoCerto
| From: | Pedro Padron | Date: | Mon, 22 Dec 2008 16:04:57 +0000 |
| Subject: | [PEPr] Comment on Payment::PagamentoCerto | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-51343@lists.php.net to get a copy of this message | ||
Pedro Padron (http://pear.php.net/user/ppadron) has commented on the proposal for
Payment::PagamentoCerto.
Comment:
Thanks for all the comments so far. Finally I've managed to dedicate some
time to this package again, so here is what I've done:
About Michael Gauthier's comments:
1) You should tun the code through phpcs. It will turn up several minor
errors which should be easy to fix.
The coding standards errors that are reported by phpcs aren't really
errors. This question was discussed in this list a few weeks ago. You can
check it out at http://news.php.net/php.pear.dev/51088 (this is
the last
message, check the references)
2) You should build the XML with the DOM or simplexml methods. This will
automatically handle escaping where it is required.
Good idea, but not done yet. This is in my TODO list... =)
3) Converting values to cents should go in its own method.
Agreed. Now there's a _valueToCents() method.
4) Always return early
This was fixed in a class method. There was only one method with this kind
of issue.
About Till Klampaeckel's comments:
1) Offer an alternative for the user to provide his/hers own SOAP client
This was done just like Till suggested. Good idea.
2) private vs. protected
Private methods are now protected. This is interesting because a Magento
extension will be built based on this package. Only XmlBuilder class has
private methods. I don't see why this class would be extended.
3) Public methods must be declared as public
Public methods are now explicitly declared as such
4) Package exception class must extend PEAR_Exception.
Done. PEAR_Exception > Payment_PagamentoCerto_Exception > others
5) Why converting everything to cents?
If a product is sold in cents, it should be represented as 0.40 or 0.99,
for example. I have to convert to cents because that's how the API works. I
really don't see a good motivation for this...
6) If the vendor provides a debug mode, use it
Unfortunately there's no such thing... I know the guys who developed the
payment gateway, and I suggested this to them. We work on the same company,
but I wasn't part of that project. I like PHP, so I thought about offering
them some help by creating this PEAR package.
7) You need a package.xml
I already had one, but it wasn't available on the source code link I
posted. Now the code is hosted at github.com, and the package.xml file is
there.
About Daniel O'Connor's comments:
1) Add an AllTests.php to run all the unit tests
My next step is to increase test coverage. This is in my TODO list =)
Proposal information:
http://pear.php.net/pepr/pepr-proposal-show.php?id=583
--
Sent by PEPr, the automatic proposal system at http://pear.php.net