0.2.1 • Published 11 months ago

mi-pago v0.2.1

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

npm npm install size

NPM

🧐 About

Un módulo que te permite conectar a la plataforma de MiPago a través de la API que proveen para realizar consultas, recargas y pago de otros servicios.

NOTA: Este módulo no es oficial, y está en modo de prueba, sin embargo, lo mencionado aquí sí está funcional.

⚙️ Usage

const MiPago = require('mi-pago');
const mipago = new MiPago(key)

Where key is a object with the propertiesusuario and clave.

📎Quick Links

📄Content

🏷️ Properties

Theses are properties of the rec, you should use the then/catch or async/await for these.

PropertyDescription
balanceQuery the balance into your account
gainQuery the gain actually into your account

Example to get the balance

console.log(await mipago.balance);

// Or you can use too

console.log(
    mipago.balance.then( a => a)
    .catch(err => err)
    );

🔎 Query methods

With these methods you can make your queries for get to the balance and the sell orders.

MethodDescription
queryBalance(string)Where string is optional or could be saldo or ganancia the balance or gain of account, return a String or Object
querySell(queryToken)Consulta la venta realizadas mediante el token dado en cada transacción, return a Object
queryPack(operator, filter)Query the pakages of operator, filter (optional) could be minutes, internet or TI, return a Array

Query examples

const data = mipago.queryBalance().then( ans => ans).catch( err => err);

console.log(data); // Result expected, Object with saldo and ganancia

------------------------------------------

const data = mipago.queryBalance("saldo").then( ans => ans).catch( err => err);

console.log(data); // Result expected, String

📲 To recharge

With theses methods you can realize recharge normally or recharge packages. Every method will return a object with data, which contains the details, reference, token of transaction, and data associated.

For each method contain, the following structure, where: number is a phone number, operator is a the type of operator chip into phone, value is the cost or value to recharge, package is the ID of package to recharge (you can use queryPack() for get the ID), view the and charge is a the type of charge only could be saldo or ganancia

MethodDescription
recarga(number, operator, value, charge)Realize a recharge normally to phone.
recargaPaq(number, operador, package, charge)Realize a recharge of package
0.2.1

11 months ago

0.2.0

11 months ago

0.1.0

11 months ago