Socket
Socket
Sign inDemoInstall

nequi

Package Overview
Dependencies
5
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    nequi

Nequi API wrapper


Version published
Maintainers
1
Install size
739 kB
Created

Readme

Source

Libreria Node.js para el API de Nequi

Version Build Status Coveralls github David David Try on RunKit

Proporciona acceso al API de Nequi para aplicaciones Node.js

Tenga en cuenta que esta libreria es para usar del lado del servidor ya que requiere las claves secretas de Nequi. No debe usarse directamente en el browser.

Instalación

Instalar el paquete con:

npm install nequi --save

Servicios soportados

Documentación

Uso

El paquete debe configurarse con las credenciales de su cuenta.

var nequiClient = require('nequi')('Your Access Key', 'Your Secret Key', 'Your API Key');

var payment = await nequiClient.pushPayments.create({
  phoneNumber: '3009871234',
  code: '1',
  value: '5000'
});

O con versiones anteriores a Node.js v7.9

var nequiClient = require('nequi')('Your Access Key', 'Your Secret Key', 'Your API Key');

nequiClient.pushPayments.create(
  {
    phoneNumber: '3009871234',
    code: '1',
    value: '5000'
  },
  function(err, response) {
    err; // null si no hay errores
    response; // respuesta del servicio
  }
);

O usando modulos ES:

import nequi from 'nequi';
const nequiClient = nequi('Your Access Key', 'Your Secret Key', 'Your API Key');
//…

Promesas

Cada método devuelve una promesa encadenable que se puede utilizar en lugar de un callback:

// Crea y consultar una nueva suscripción:
nequi.subscriptionPayments.subscribe({
  phoneNumber: '3009871234',
  code: '1',
  name: 'Company/Service name'
})
.then(function(subscription) {
  return nequi.subscriptionPayments.getSubscription({
    phoneNumber: '3009871234',
    code: '1',
    token: subscription.token
  });
})
.then(function(subscription) {
  // new subscription
}).catch(function(err) {
  // Deal with an error
});

Desarrollo

Ejecutar pruebas:

$ npm install
$ npm test

Ejecutar solo un archivo:

$ npm run mocha -- test/Error.spec.js

Ejecutar un caso de prueba:

$ npm run mocha -- test/Error.spec.js --grep 'Populates with type'

Desarrollo basado en la Libreria Node.js de Stripe

Keywords

FAQs

Last updated on 14 Feb 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc