
It's hard to believe that it's already time for mid-term reviews. The project has been coming along at a nice pace. Here's an update.
I've created a basic architecture for gateway drivers. Gateway modules can define new gateways by implentating a hook called hook_smsframework_info(). This hook was based on the node modules hook_node_info(). An implementation returns an array that contains several pieces of information about the gateway driver. Below is the hook's implementation for the Clickatell driver module.
<?php
function gateway_clickatell_smsframework_info() {
$options['ssl'] = array(
'#type' => 'checkbox',
'#title' => t('Use SSL Encyption'),
'#description' => t('Drupal\'s built-in HTTP client only supports SSL on PHP 4.3 compiled with OpenSSL.'),
'#default_value' => variable_get('gateway_clickatell_ssl', 0),
);
$options['api_id'] = array(
'#type' => 'textfield',
'#title' => t('API ID'),
'#description' => t('Clickatell issues this number upon addition of an HTTP sub-product to your account.'),
'#size' => 40,
'#maxlength' => 255,
'#default_value' => variable_get('gateway_clickatell_api_id', ''),
);
$options['user'] = array(
'#type' => 'textfield',
'#title' => t('User'),
'#description' => t('The username of your Clickatell account.'),
'#size' => 40,
'#maxlength' => 255,
'#default_value' => variable_get('gateway_clickatell_user', ''),
);
$options['password'] = array(
'#type' => 'textfield',
'#title' => t('Password'),
'#description' => t('The current password on your Clickatell account.'),
'#size' => 30,
'#maxlength' => 64,
'#default_value' => variable_get('gateway_clickatell_password', ''),
);
return array(
'clickatell' => array(
'name' => 'Clickatell',
'identifier' => 'clickatell',
'options' => $options,
'validate' => 'gateway_clickatell_validate',
'send' => 'gateway_clickatell_send',
'delivery_status' => 'gateway_clickatell_status',
),
);
}
?>In this snippet, the driver's option form is built first. This is standard usage of Form API. The form is put into $options, where it will be put inside the settings array returned. The return array is associative. The array's key is a machine-readable identifier for the gateway. The name and options are added. The 'validate', 'send', and 'delivery_status', keys specify driver callbacks that are used to validate the submission of the options form, send an SMS message, and handle a delivery status callback from the gateway (if available).
hook_smsframework_info() and the callbacks it specifies are the most important part of building a gateway module. The rest of the Clickatell module consists of internal or "private" functions that only the module itself needs.
I'm expecting to get some feedback from my mentors on this architecture this week. I also hope to get more advice about using e-mail gateways.
My next steps are:
* Get code review and make any necessary architecture changes
* Submit code to CVS sandbox
* Complete API code
* Complete use case modules
* Clean up and complete documentation

Comments
hmm
so will you be adding the option to use different payment gateways like onebip.com or other companys?
I think implementing payment
I think implementing payment gateway is outside of the scope of this project, but it may be a possibility in the future. As of now, I will be implementing Clickatell's gateway, and e-mail gateways from several wireless providers.
--
Will White
--
Will White
SMS payment gateway for Drupal eCommerce
this may be of interest....its a new module I just released...
SMS payment gateway for Drupal eCommerce
http://groups.drupal.org/node/16214
Do you have any more details on onebip.com?
cheers
dub
For a test, I now enrolled
For a test, I now enrolled from clickatell developers api, Now, i'm trying the clickatell as my sms gateway here in the Philippines.
When I'm trying to finalize all things drupal said that: "A Clickatell gateway error occured: Invalid or missing API ID" What's this mean? I don't have a Clickatell API?
Login Central Clickatell
Log in your Clickatell Central account, create a connection: Manage my Products, From "dd Connection" selection, select which API you want to add- HTTP, FTP, SMTP, XML, SMPP, etc.
For each connection you add, you will get an API ID for it that you can use in your application.