@magic.batua/recharge
Version:
The Recharge module manages all the mobile prepaid, datacard and DTH recharge functionalities of the Magic Batua platform.
885 lines (226 loc) • 12.8 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>MobilePrepaid - 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="Datacard.html">Datacard</a><ul class='methods'><li data-type='method'><a href="Datacard.html#.AllOperators">AllOperators</a></li><li data-type='method'><a href="Datacard.html#.CheckStatus">CheckStatus</a></li><li data-type='method'><a href="Datacard.html#Recharge">Recharge</a></li></ul></li><li><a href="DTH.html">DTH</a><ul class='methods'><li data-type='method'><a href="DTH.html#.AllOperators">AllOperators</a></li><li data-type='method'><a href="DTH.html#.CheckStatus">CheckStatus</a></li><li data-type='method'><a href="DTH.html#Recharge">Recharge</a></li></ul></li><li><a href="Fixedline.html">Fixedline</a><ul class='methods'><li data-type='method'><a href="Fixedline.html#.CheckStatus">CheckStatus</a></li><li data-type='method'><a href="Fixedline.html#.GetOperators">GetOperators</a></li><li data-type='method'><a href="Fixedline.html#Pay">Pay</a></li></ul></li><li><a href="MobilePlan.html">MobilePlan</a></li><li><a href="MobilePostpaid.html">MobilePostpaid</a><ul class='methods'><li data-type='method'><a href="MobilePostpaid.html#.CheckStatus">CheckStatus</a></li><li data-type='method'><a href="MobilePostpaid.html#.GetOperators">GetOperators</a></li><li data-type='method'><a href="MobilePostpaid.html#Pay">Pay</a></li></ul></li><li><a href="MobilePrepaid.html">MobilePrepaid</a><ul class='methods'><li data-type='method'><a href="MobilePrepaid.html#.AllOperators">AllOperators</a></li><li data-type='method'><a href="MobilePrepaid.html#.CheckStatus">CheckStatus</a></li><li data-type='method'><a href="MobilePrepaid.html#.FindOperator">FindOperator</a></li><li data-type='method'><a href="MobilePrepaid.html#.GetPlans">GetPlans</a></li><li data-type='method'><a href="MobilePrepaid.html#Recharge">Recharge</a></li></ul></li><li><a href="Operator.html">Operator</a><ul class='methods'><li data-type='method'><a href="Operator.html#.InitList">InitList</a></li><li data-type='method'><a href="Operator.html#.WithCode">WithCode</a></li></ul></li></ul><h3>Modules</h3><ul><li><a href="module-RechargeError.html">RechargeError</a><ul class='methods'><li data-type='method'><a href="module-RechargeError.html#~Check">Check</a></li></ul></li><li><a href="module-Telecom.html">Telecom</a><ul class='methods'><li data-type='method'><a href="module-Telecom.html#~AllCircles">AllCircles</a></li><li data-type='method'><a href="module-Telecom.html#~CircleWithCode">CircleWithCode</a></li></ul></li></ul>
</nav>
<div id="main">
<h1 class="page-title">MobilePrepaid</h1>
<section>
<header>
<h2>
MobilePrepaid
</h2>
<div class="class-description"><p>Encapsulates all the mobile rechage functionalities.</p></div>
</header>
<article>
<div class="container-overview">
<h2>Constructor</h2>
<h4 class="name" id="MobilePrepaid"><span class="type-signature"></span>new MobilePrepaid<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_Mobile_MobilePrepaid.js.html">Source/Mobile/MobilePrepaid.js</a>, <a href="Source_Mobile_MobilePrepaid.js.html#line20">line 20</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id=".AllOperators"><span class="type-signature">(async, static) </span>AllOperators<span class="signature">(creds)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Fetches a list of all mobile rechage operators supported by the Rocket in Pocket
API. The result is an array of <code>Operator</code> types.</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 with Rocket in Pocket API</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_Mobile_MobilePrepaid.js.html">Source/Mobile/MobilePrepaid.js</a>, <a href="Source_Mobile_MobilePrepaid.js.html#line99">line 99</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>An array of operators</p>
</div>
<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 recharge 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_Mobile_MobilePrepaid.js.html">Source/Mobile/MobilePrepaid.js</a>, <a href="Source_Mobile_MobilePrepaid.js.html#line68">line 68</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".FindOperator"><span class="type-signature">(async, static) </span>FindOperator<span class="signature">(phone, creds)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Fetches operator and telecom circle info for the given phone number.</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>phone</code></td>
<td class="type">
</td>
<td class="description last"><p>Phone number to be queried</p></td>
</tr>
<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>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Source_Mobile_MobilePrepaid.js.html">Source/Mobile/MobilePrepaid.js</a>, <a href="Source_Mobile_MobilePrepaid.js.html#line131">line 131</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
<p>Operator and circle codes for the given mobile number</p>
</div>
<h4 class="name" id=".GetPlans"><span class="type-signature">(async, static) </span>GetPlans<span class="signature">(phone, creds)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Returns plans for the given phone number. To do this, it first looks up the
operator and circle information for the user account. Then it calls Rocket in
Pocket's fetch plan API.</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>phone</code></td>
<td class="type">
</td>
<td class="description last"><p>Phone number to be recharged</p></td>
</tr>
<tr>
<td class="name"><code>creds</code></td>
<td class="type">
</td>
<td class="description last"><p>Merchant credentials for accessing Rocket in Pocket API</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_Mobile_MobilePrepaid.js.html">Source/Mobile/MobilePrepaid.js</a>, <a href="Source_Mobile_MobilePrepaid.js.html#line160">line 160</a>
</li></ul></dd>
</dl>
<h4 class="name" id="Recharge"><span class="type-signature">(async) </span>Recharge<span class="signature">(creds, transactionID)</span><span class="type-signature"></span></h4>
<div class="description">
<p>Carries out the mobile recharge operation as specified.</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>transactionID</code></td>
<td class="type">
</td>
<td class="description last"><p>Transaction ID set by the Magic Transaction module</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_Mobile_MobilePrepaid.js.html">Source/Mobile/MobilePrepaid.js</a>, <a href="Source_Mobile_MobilePrepaid.js.html#line33">line 33</a>
</li></ul></dd>
</dl>
</article>
</section>
</div>
<br class="clear">
<footer>
Documentation generated at Tue Mar 20 2018 03:11:49 GMT+0530 (IST)
</footer>
<script>prettyPrint();</script>
<script src="scripts/linenumber.js"></script>
</body>
</html>