npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@sptdev/itpv

v1.0.20

Published

Reimplementación ITPV

Downloads

43

Readme

@sptdev/itpv

Módulo nativo de React Native para procesamiento de pagos con terminales MITM POS. Compatible con Android (Kotlin) e iOS (Swift), e implementado con la nueva arquitectura de React Native.


✨ Características

  • Login bancario con validación de usuario bloqueado
  • Conexión a dispositivos vía Bluetooth
  • Selección de dispositivos emparejados
  • Procesamiento de pagos con múltiples métodos:
    • Contado
    • Meses sin intereses (MSI)
    • Meses con intereses (MCI)
  • Lectura de tarjeta (chip/contactless)
  • Emisión de voucher vía email
  • Soporte para firma digital
  • Soporte para múltiples merchant IDs y monedas

🚀 Instalación

npm install @sptdev/itpv

ó con yarn:

yarn add @sptdev/itpv

⚙️ Uso básico

import Itpv from '@sptdev/itpv';

// Login
await Itpv.loginUser({
  user: 'usuario123',
  password: 'claveSegura',
  reference: 'Ref001',
  amount: '100.00',
  currency: 'mxn',
  email: '[email protected]',
  usrTrx: '',
  useMSI: false,
  activeMonths: '',
  company: 'ecompany',
  branch: 'ebranch',
  merchant: 'merchantMode',
});

// Inicializar dispositivo
await Itpv.initDevice({
  reader: 'DEVICE_NAME',
  amount: 12345,
  reference: 'Ref001',
  mcurrency: 'MXN',
  user: 'usuario123',
  email: '[email protected]',
  companyEmail: '[email protected]',
  useMSI: true,
  activeMonths: ['3', '6', '12'],
});

// Procesar pago
await Itpv.startTransaction();

// Desconectar dispositivo
await Itpv.disconnectDevice();

📋 API Métodos

loginUser(params: LoginParams): Promise<void>

Autentica al usuario en el sistema de pagos.

Parámetros:

  • user: string - Usuario de acceso
  • password: string - Contraseña de acceso
  • reference: string - Referencia de la transacción
  • amount: string - Monto de la transacción
  • currency: string - Moneda (ej: 'mxn', 'usd')
  • email: string - Email del cliente
  • company: string - Empresa
  • branch: string - Sucursal
  • merchant: string - Modo de merchant

initDevice(params: DeviceParams): Promise<void>

Inicializa y configura el dispositivo de pago.

startTransaction(): Promise<void>

Inicia el proceso de transacción de pago. El dispositivo debe estar conectado y configurado previamente.

disconnectDevice(): Promise<void>

Desconecta el dispositivo de pago.


📡 Eventos disponibles

Puedes escuchar eventos emitidos por el módulo:

import { NativeEventEmitter, NativeModules } from 'react-native';

const eventEmitter = new NativeEventEmitter(NativeModules.Itpv);

eventEmitter.addListener('loginStatus', (status) => {
  console.log('Login:', status);
});

eventEmitter.addListener('deviceState', (state) => {
  console.log('Dispositivo:', state); // 'connected' o 'disconnected'
});

eventEmitter.addListener('transactionStatus', (statusData) => {
  console.log('Estado transacción:', statusData.message); // Actualizaciones en tiempo real
});

eventEmitter.addListener('transactionResult', (data) => {
  console.log('Transacción aprobada:', data);
});

eventEmitter.addListener('transactionResultError', (error) => {
  console.error('Error en transacción:', error);
});

eventEmitter.addListener('voucherResult', (mensaje) => {
  console.log('Voucher:', mensaje);
});

🛠️ Requisitos

  • React Native >= 0.70
  • Permisos Bluetooth habilitados en Android (BLUETOOTH_CONNECT y BLUETOOTH_SCAN)
  • Android SDK 31+ para permisos dinámicos
  • iOS con soporte para Swift

🧪 En desarrollo

Este módulo está en fase inicial y se encuentra en evolución activa. Se recomienda probar en ambientes controlados antes de implementarlo en producción.


📄 Licencia

MIT © sptdev