CCBill is a service that handles credit card transactions instead of the website itself having to deal with any financial information. I am not an employee of CCBill, I am just using the CCBill service on a high-traffic site and wasn't able to find a module that integrates Drupal with CCBill, so I created one myself. I would like to share that module with the Drupal community.
CCBill provides an ancient cgi-script integration (which is NOT used in this module), and a relatively convoluted API to integrate with their service, which I am making use of. The unique identifier at CCBill is a subscription ID. This module ties a CCBill subscription ID to a Drupal User ID. The workflow looks as following:
1. User clicks on a link to get to CCBill, passing its User ID
2. User enters credit card information on CCBill
3. If credit card was verified, CCBill passes back subscription information, including Drupal User ID
4. The CCBill module stores subscription information in Drupal database and exposes this action using a custom hook (hook_ccbill($op = 'add', $ccbill)) to other modules
In regards to security, this module verifies that the data is actually passed by a CCBill server by looking at the IP address of the server posting the data.
Once a subscription expires, CCBill unfortunately doesn't pass back any data. Instead, this module is using CCBill's DataLink API. Once daily (run on cron), the module connects to the CCBill server, downloads all expirations for the previous day and processes the data, exposing it to other modules using a custom hook (hook_ccbill($op = 'expire', $ccbill)).
For Drupal site administrators, the module provides a settings section that allows site admins to enter their CCBill API account number and credentials. It also provides a test mode that will test the DataLink integration.
The module in the current state is fully functional, but knowledge of the Drupal hook system is required to integrate it with one's custom module. Moving forward, I am planning to release an add-on module that makes use of the provided hooks and integrates the CCBill module with the Rules module (so site admins can easily create a custom action once a user's subscription gets activated, such as changing that user's role) as well as the Views module (to expose a user's subscription details in a view easily).
Thanks for your consideration, I am eager to start becoming active in the Drupal community.
Daniel Hanold (a.k.a. haagendazs)
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | ccbill.zip | 8.21 KB | haagendazs |
| #6 | ccbill.zip | 8.15 KB | haagendazs |
| #4 | ccbill.zip | 13.86 KB | haagendazs |
| #3 | ccbill.zip | 13.45 KB | haagendazs |
| #1 | ccbill.zip | 6.41 KB | haagendazs |
Comments
Comment #1
haagendazs commentedComment #2
avpadernoComment #3
haagendazs commentedI added a README.txt file to the module. Please review this latest version. Thank you!
Comment #4
haagendazs commentedI wanted to follow-up and find out long it usually takes before a module for a CVS application gets reviewed. I would love to get started contributing to the community as soon as possible. Thanks a lot for the volunteer work of reviewing modules.
Also: I improved the README.txt file and uploaded a new version of the CCBill module.
Comment #5
mdorman commentedAs I mentioned in IRC this is my first review, but I did find a few things you'll want to address. Clearly you've got a solid development background, and overall this module is quite good. I did some research, and there have been quite a few requests for CCBill integration with Drupal. Ubercart, or commerce integration would be great additions in the future.
Comment #6
haagendazs commentedmdorman: Thanks a lot for looking over the code and thanks for the feedback. I looked over your points:
I looked at a few other modules that integrate with an external service to find out how they handle password storage. The reCaptcha module, for example, also stores their API keys as plain text in the variables tables, presumably for the same reason.
The CCBill Settings page is only accessible with the 'administer ccbill' permission, so I think that I'm following the general Drupal standards in this regard.
Again: thanks a lot for creating this initial review and for taking the time to post your comments. I hope one of the maintainers will be able to look over this again and help me with the CVS application.
Comment #7
mdorman commentedCan someone pick this up that has approval permission? I'm quite happy with what haagendazs has submitted, but I can't take it any further.
Thanks!
Comment #8
avpadernot().The second argument passed to the function is not correct.
Why isn't the code using
drupal_write_record()?Comment #9
haagendazs commentedHi kiamlaluno,
Thanks a lot for your partial review, I'm excited that there is progress on my CVS application.
kiamlaluno: Thanks again for taking the time to look over my module. Please let me know if there's anything additional I can do to get approved for a CVS account. Danny
Comment #10
avpaderno