node-fortumo is unofficial binding for the Fortumo SMS payment API. You can listen for incoming SMS messages and response to them with ease. See example/server.js for usage.
- Create an account at fortumo.com
- Set up a new Mobile Payments/Premium SMS API service here
- Set
http://yourserver.com/_incoming_sms
as the receiving URL and optionally charset to UTF-8 if you want to use non-latin characters
- install node-fortumo with npm install fortumo
NB! Update service_id
and secret
in the script with the actual tokens of your service.
var FortumoSMSServer = require("fortumo").FortumoSMSServer;
var options = {
service_id: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", // public service ID
secret: "YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY" // secret service token
}
var fortumo = new FortumoSMSServer(options);
fortumo.listen(80);
fortumo.on("sms", function(sms, response){
console.log(sms); // outputs the sms data to the console
response("received!");
});
See example/server.js for a better example