@magic.batua/utility
Version:
The Utility module manages all the utility bills functionalities of the Magic Batua platform.
704 lines (181 loc) • 10.3 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>Electricity - Postman Documentation</title>
<script src="scripts/prettify/prettify.js"></script>
<script src="scripts/prettify/lang-css.js"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/ionicons.min.css">
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
<div class="navicon"></div>
</label>
<label for="nav-trigger" class="overlay"></label>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Electricity.html">Electricity</a><ul class='methods'><li data-type='method'><a href="Electricity.html#.CheckStatus">CheckStatus</a></li><li data-type='method'><a href="Electricity.html#.GetProviders">GetProviders</a></li><li data-type='method'><a href="Electricity.html#Pay">Pay</a></li><li data-type='method'><a href="Electricity.html#Validate">Validate</a></li></ul></li><li><a href="Gas.html">Gas</a><ul class='methods'><li data-type='method'><a href="Gas.html#.CheckStatus">CheckStatus</a></li><li data-type='method'><a href="Gas.html#.GetProviders">GetProviders</a></li><li data-type='method'><a href="Gas.html#Pay">Pay</a></li></ul></li><li><a href="Insurance.html">Insurance</a><ul class='methods'><li data-type='method'><a href="Insurance.html#.CheckStatus">CheckStatus</a></li><li data-type='method'><a href="Insurance.html#.GetProviders">GetProviders</a></li><li data-type='method'><a href="Insurance.html#Pay">Pay</a></li></ul></li><li><a href="Provider.html">Provider</a><ul class='methods'><li data-type='method'><a href="Provider.html#.InitList">InitList</a></li><li data-type='method'><a href="Provider.html#.WithCode">WithCode</a></li></ul></li><li><a href="UtilityBill.html">UtilityBill</a></li></ul><h3>Modules</h3><ul><li><a href="module-UtilityError.html">UtilityError</a><ul class='methods'><li data-type='method'><a href="module-UtilityError.html#~Check">Check</a></li></ul></li></ul>
</nav>
<div id="main">
<h1 class="page-title">Electricity</h1>
<section>
<header>
<h2>
Electricity
</h2>
<div class="class-description"><p>Manages electricity bill payments.</p></div>
</header>
<article>
<div class="container-overview">
<h2>Constructor</h2>
<h4 class="name" id="Electricity"><span class="type-signature"></span>new Electricity<span class="signature">()</span><span class="type-signature"></span></h4>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Source_Electricity.js.html">Source/Electricity.js</a>, <a href="Source_Electricity.js.html#line15">line 15</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id=".CheckStatus"><span class="type-signature">(async, static) </span>CheckStatus<span class="signature">(transactionID)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Checks status of a previously submitted bill payment request. We make use of Rocket in
Pocket callbacks for status updates. So this is largely implemented as a backup in
case RIP callback systems fail.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>transactionID</code></td>
<td class="type">
</td>
<td class="description last"><p>Magic Batua transaction ID of the recharge request</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Source_Electricity.js.html">Source/Electricity.js</a>, <a href="Source_Electricity.js.html#line140">line 140</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".GetProviders"><span class="type-signature">(async, static) </span>GetProviders<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
<p>Returns a list of all electricity providers supported by Rocket in Pocket
API.</p>
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Source_Electricity.js.html">Source/Electricity.js</a>, <a href="Source_Electricity.js.html#line112">line 112</a>
</li></ul></dd>
</dl>
<h4 class="name" id="Pay"><span class="type-signature">(async) </span>Pay<span class="signature">(creds, amount, extra)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Makes the bill payment of electricity connection.</p>
<p> In case of MSEDC - MAHARASHTRA provider, you must send <code>billUnit</code> and <code>processingCycle</code> information
too through the optional <code>extra</code> parameter.</p>
<p> In case of Reliance Energy - MUMBAI provider, you must send <code>cycleNumber</code> information through the
optional <code>extra</code> parameter.</p>
<p> In case of Torrent Power provider, you must send <code>city</code> name through the <code>extra</code> parameter.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>creds</code></td>
<td class="type">
</td>
<td class="description last"><p>Merchant credentials to access Rocket in Pocket API</p></td>
</tr>
<tr>
<td class="name"><code>amount</code></td>
<td class="type">
</td>
<td class="description last"><p>In Rupees. Must be exact due amount.</p></td>
</tr>
<tr>
<td class="name"><code>extra</code></td>
<td class="type">
</td>
<td class="description last"><p>Any optional parameters.</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Source_Electricity.js.html">Source/Electricity.js</a>, <a href="Source_Electricity.js.html#line79">line 79</a>
</li></ul></dd>
</dl>
<h4 class="name" id="Validate"><span class="type-signature">(async) </span>Validate<span class="signature">(creds, extra)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Returns the current due amount of the account. Since utility APIs,
expect exact bill amount you must call this API before calling the payment API.</p>
<p> In case of MSEDC - MAHARASHTRA provider, you must send <code>billUnit</code> and <code>processingCycle</code> information
too through the optional <code>extra</code> parameter.</p>
<p> In case of Reliance Energy - MUMBAI provider, you must send <code>cycleNumber</code> information through the
optional <code>extra</code> parameter.</p>
<p> In case of Torrent Power provider, you must send <code>city</code> name through the <code>extra</code> parameter.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>creds</code></td>
<td class="type">
</td>
<td class="description last"><p>Merchant credentials to connect to Rocket in Pocket API</p></td>
</tr>
<tr>
<td class="name"><code>extra</code></td>
<td class="type">
</td>
<td class="description last"><p>Optional parameters only required for some parameters</p></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Source_Electricity.js.html">Source/Electricity.js</a>, <a href="Source_Electricity.js.html#line36">line 36</a>
</li></ul></dd>
</dl>
</article>
</section>
</div>
<br class="clear">
<footer>
Documentation generated at Tue Mar 20 2018 03:29:29 GMT+0530 (IST)
</footer>
<script>prettyPrint();</script>
<script src="scripts/linenumber.js"></script>
</body>
</html>