ussd-builder
Advanced tools
Comparing version 1.0.0 to 1.1.0
{ | ||
"name": "ussd-builder", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Easily compose USSD menus using states, compatible with Africastalking, Hubtel and Interpay Ussd API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,5 +0,5 @@ | ||
# ussd-menu-builder | ||
# ussd-builder | ||
[](https://travis-ci.org/harmonizerblinks/ussd-builder) | ||
[](https://coveralls.io/github/harmonizerblinks/ussd-builder?branch=master) | ||
<!-- [](https://travis-ci.org/harmonizerblinks/ussd-builder) | ||
[](https://coveralls.io/github/harmonizerblinks/ussd-builder?branch=master) --> | ||
@@ -13,7 +13,7 @@ | ||
``` | ||
$ npm install ussd-menu-builder | ||
$ npm install ussd-builder | ||
``` | ||
or | ||
``` | ||
$ yarn add ussd-menu-builder | ||
$ yarn add ussd-builder | ||
``` | ||
@@ -32,3 +32,3 @@ | ||
```javascript | ||
const UssdMenu = require('ussd-menu-builder'); | ||
const UssdMenu = require('ussd-builder'); | ||
let menu = new UssdMenu(); | ||
@@ -103,3 +103,3 @@ | ||
```javascript | ||
const UssdMenu = require('ussd-menu-builder'); | ||
const UssdMenu = require('ussd-builder'); | ||
const menu = new UssdMenu(); | ||
@@ -229,3 +229,5 @@ ``` | ||
let phone = menu.args.phoneNumber; | ||
let network = menu.args.network; | ||
session.set('phone', phone); | ||
session.set('phone', network); | ||
session.set('value', value); | ||
@@ -605,3 +607,3 @@ menu.end('You entered: ' + value); | ||
As of version 1.0.0, ussd-menu-builder has added support for Hubtel's USSD API by providing the `provider` option when creating the **UssdMenu** object. There are no changes to the way states are defined, and the HTTP request parameters sent by Hubtel are mapped as usual to `menu.args`, and the result of `menu.run` is mapped to the HTTP response object expected by Hubtel (`menu.con` returns a _Type: Respons & `menu.end` returns a Type: Release). The additional HTTP request parameters like ClientState, and Sequence are not used. | ||
As of version 1.0.0, ussd-builder has added support for Hubtel's USSD API by providing the `provider` option when creating the **UssdMenu** object. There are no changes to the way states are defined, and the HTTP request parameters sent by Hubtel are mapped as usual to `menu.args`, and the result of `menu.run` is mapped to the HTTP response object expected by Hubtel (`menu.con` returns a _Type: Respons & `menu.end` returns a Type: Release). The additional HTTP request parameters like ClientState, and Sequence are not used. | ||
@@ -608,0 +610,0 @@ The key difference with Hubtel is that the service only sends the most recent response message, rather than the full route string. The library handles that using the Sessions feature, which requires that a SessionConfig is defined in order to store the session's full route. This is stored in the key `route`, so if you use that key in your application it could cause issues. |
91024
628