Logs into the account. Returns true if successful.
Logs out of the current account. Returns true if successful.
All the methods prefixed with 'get' are used to fetch a page from ATH Móvil, scrape it and then return the desired content. All of these methods are asynchronous.
Returns a string with the name of the account owner.
Returns a number with the current account balance (for now only only for the first/default card)
Returns a string with the phone number associated with the current account.
Returns a string with the email associated with the current account.
Returns an object with the name, balance and first card associated with the current account. The advantage of this method is that it gets all of this information with a single GET request. The structure of the returned object is as follows: { name, balance, firstCard }.
Returns an object with all the received transactions. The individual transactions are returned as objects with the following structure: { date, phone, amount }.
Returns an object with all the sent transactions. The individual transactions are returned as objects with the following structure: { date, phone, amount }.
Returns a string with the name of the first card.
Return an object with the name, hash and balance of the main card. The object structure is as follows: { name, hash, balance }.
Returns an object with all the available cards in the account and their respective hashes. The individual cards are returned as objects with the following structure: { cardName, cardHash }.
Returns true if successful and false if something went wrong.
Required parameters:
-
phone: The number of the person to whom you want to send the money.
-
amount: The amount of money that you want to send.
Optional parameters:
-
message: The message that will be attached to the transaction. By default it is an empty string.
-
cardHash: This parameter is used to specify the card from which the transaction will be initiated. By default
cardHashis the same as the hash from the main card.
.fetchPage(route)
Will make a GET request to the given route/resource and return the response. The complete path will be: https://www.athmovil.com/web/ + route
.fetchMainPage()
Will make a GET request to https://www.athmovil.com/web/mainMenu.htm and return the response.
.postData(data, route)
Will make a POST request with the given data to the specified endpoint and return the response. The complete path will be: https://www.athmovil.com/web/ + endpoint.