MobilePrepaid

MobilePrepaid

Encapsulates all the mobile rechage functionalities.

Constructor

new MobilePrepaid()

Source:

Methods

(async, static) AllOperators(creds)

Fetches a list of all mobile rechage operators supported by the Rocket in Pocket API. The result is an array of Operator types.

Parameters:
Name Type Description
creds

Merchant credentials to connect with Rocket in Pocket API

Source:
Returns:

An array of operators

(async, static) CheckStatus(transactionID)

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.

Parameters:
Name Type Description
transactionID

Magic Batua transaction ID of the recharge request

Source:

(async, static) FindOperator(phone, creds)

Fetches operator and telecom circle info for the given phone number.

Parameters:
Name Type Description
phone

Phone number to be queried

creds

Merchant credentials to access Rocket in Pocket API

Source:
Returns:

Operator and circle codes for the given mobile number

(async, static) GetPlans(phone, creds)

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.

Parameters:
Name Type Description
phone

Phone number to be recharged

creds

Merchant credentials for accessing Rocket in Pocket API

Source:

(async) Recharge(creds, transactionID)

Carries out the mobile recharge operation as specified.

Parameters:
Name Type Description
creds

Merchant credentials to access Rocket in Pocket API

transactionID

Transaction ID set by the Magic Transaction module

Source: