GSoC 2012: Improve SilverStripe Payment module
Name:
Dao Duy Duc Duong
(Ryan Dao)
Country: Singapore
Email: daoduyducduong@gmail.com
Skype: duong_d3
SilverStripe
forum name: ryandao
Phone: +6583754308
About me
I am a second-year Computer Science student from the National
University of Singapore specializing in Software Engineering. I was born and
grew up in Vietnam before coming to Singapore for undergraduate study. Despite
the short 2 years of university life, I have been fully exposed to
industry-standard software development. I am proficient in software engineering
practices and have extensive experience developing web (Java, PHP, Javascript, MySQL) and mobile (Android, iOS)
applications.
My open source contribution
I
have been a strong supporter for the open source community but not yet a
contributor. However, I have worked extensively with Drupal for a project called
Teamie (refer to below details), but due to the
corporate environment, I was not allowed to contribute my code. Therefore, I am
very looking forward to GSOC when I can make my very first meaningful open
source contribution.
My SilverStripe experience
This
will the first time I work with SilverStripe. I have gone through the code base
and built a few websites to get myself familiar with the framework. I have also
been involved in GSOC discussions on SilverStripe Google group and got to know
the community and GSOC mentors. With my experience in web technologies and Content
Management System, and I am confident that I can be a
good SilverStripe developer.
My PHP, MySQL, HTML, CSS,
and JavaScript experience
I have been developing websites and web applications
using the above technologies for almost 4 years. Some major projects I have
done include:
á
An online collaboration platform for
teachers and students called Teamie: www.theteamie.com
á
A Facebook application
called Status Time Capsule: https://github.com/ryandao/Facebook-Status-Time-Capsule
á
An HTML5 application
called Carpool@NUS written in HTML5 and Javascript with RESTful PHP
backend. The app has been taken down but its code can be downloaded here http://ryandao.net/code/carpool.zip
á
A mobile app called
Cab.SG written completely in Javascript and wrapped
as an Android apk using PhoneGap:
https://play.google.com/store/apps/details?id=com.cabsg
Among
the above projects, Teamie is the biggest one and the
one provided me with the most learning experience. Teamie
was built on Drupal, but some of the Drupal functionality did not fit
into the project specifications. Therefore, I was required to review and
customize Drupal core and contributed modules to make them more suitable for
the platform.
It helped me gain extensive experience in PHP and Content Management System
(CMS) as well as experience in working with large code bases.
My summer plan that may interfere with
GSOC
I
only plan to go on a one-week vacation some time around the end of June. Other
than that, I am fully committed to working on GSOC. Please refer to the
detailed timeline in the project section below.
Blogs, websites, or other resources
My Curriculum Vitae
provides the most information about my background and experience. I have only
one public blog which I wrote
during the time I took a course called CS3216: Software Development in Evolving
Platform, which is considered one of the best and toughest Software Engineering
courses offered by my university. More information about the course can be
found here.
Some of my code can be found on my GitHub: https://github.com/ryandao
Proposed project: Improve SilverStripe payment
module
Abstract
The Payment module is an essential part of many SilverStripe
e-commerce solutions. It is a powerful stand-alone module, which can be
incorporated to SilverStripe websites to enable processing payment for any DataObject. However, despite being widely used, the Payment
module is currently facing some limitations such as the lack of unit testing
and unstandardized API. This project aims to address those limitations.
Project
details
The project comprises of the following main objectives:
- API and structure improvement: The very first task of the project is
to migrate the module to SilverStripe 3.0 with a new structure. Each payment
gateway provider will be put in a separate submodule. This will reduce the
number of unnecessary classes and keep the functionality of the core Payment
module minimal. SilverStripe developers will then be able to install the
specific payment gateways for their websites. The gateway provider objects will
be injected to the Payment object using the Dependency Injection pattern when a
payment is about to be processed. The Payment class API will be improved to
support such pattern.
- Comprehensive payment gateway testing: Testing is utmost important
when it comes to ecommerce payment. However, most of the payment gateways in
the Payment module currently do not apply any testing strategy to verify
working code. This project provides a comprehensive testing framework that enables
easy testing of the payment gateways. The framework structure is as followed:
á
Each gateway submodule has three
implementations: Production, APITesting, and UnitTesting. Production handles real transactions used in
production deployment; APITesting is used for manual
test environment (like the Paypal Sanbox)
to test the remote connection and API; UnitTesting
mimics the HTTP responses/requests of the remote providers to provide unit testing capability.
á
Using the Dependency Injection pattern, each
implementation can be injected to the Payment object when it comes to handling
payment. The Payment object does not need to know which implementation is being
used, which leads to low code coupling and high cohesion.
- More payment gateway: More payment gateways like Google Checkout,
Amazon Payments, Dwolla, etc
will be added. Google Checkout is the minimal deliverable; other gateways will
be implemented if time allows.
- Recurring payment improvement: If a gateway supports recurring
payment (e.g. Paypal), there will be an
implementation class in the gateway submodule to handle the feature. It will be
dependency-injected to RecurringPayment, which is a
subclass of Payment, in the Payment module when the web admin enables recurring
payment. The current RecurringPayment API will be
revamped to handle errors, reminders, and notifications more effectively.
Timeline
My final examinations will take place from April 23th to
May 5th. I will start working on the project right after the exams on
May 7th. The following timeline provides a rough guideline on how
the project will be done.
May 7th
– 13th: Familiarize myself with the code and the
community; discuss implementation plan with the mentors.
May 14th
– 20th: Refactor the Payment API and separate the
gateway providers to submodules. Ensure that all gateways work after
separation.
May 21th
– June 3rd: Study all
payment gatewaysÕ API and test environments. Implement a generic testing
framework for all gateways.
June 4th
– 17th: Implement specific testing strategies for each gateway,
which includes setting up API test environments and unit testing.
June 18th
– June 24th: Ensure all test cases work correctly and
all aspects of the payment gateway handlers are tested thoroughly.
June 25th
– July 8th: Integrate Google Checkout and other
gateways.
July 9th
– July 22nd: Refactor the recurring payment API.
Implement Paypal recurring payment.
July 23rd
– July 29th: Do more
testing and refactoring. Make sure all payment gateways work perfectly.
July 30st
– August 13th: Further refine tests and documentation
for the whole project.
The above is a rough estimation of the timeline. It is subjected to
change as I go along. I am going to spend at least 30 hours per week on the
project. However, I will have a one-week vacation some time near the end of
June. August 13th is the GSOCÕs suggested Òpencil downÓ date, but I
will continue working until August 22nd if any aspect of the project
still needs to be done.
Are you okay for us to
do an interview with you before, during, and after GSOC, so we can write about what
youÕre doing and thank you on our silverstripe.org blog?
Yes, I am willing to give out any information if requested by
SilverStripe.
PHP Coding Test
URL: http://ryandao.net/ss-coding-test/
Code: http://ryandao.net/code/ss-coding-test.zip
PHPMyAdmin: http://web321.webfaction.com/static/phpMyAdmin/
(username and password are the same with the database settings in /includes/db.php)