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 🙏

© 2026 – Pkg Stats / Ryan Hefner

id-payment

v1.0.17-alpha

Published

[![NPM Version](https://img.shields.io/npm/v/id-payment.svg)](https://www.npmjs.com/package/id-payment) [![License](https://img.shields.io/npm/l/id-payment.svg)](https://github.com/yourusername/id-payment/blob/master/LICENSE)

Downloads

225

Readme

ID Payment

NPM Version License

Componente Angular para integración de pagos en aplicaciones web de forma sencilla y segura.

Requisitos Previos

  • Angular 14.0.0 o superior
  • Node.js 16.0.0 o superior
  • Cuenta en ID Payment (website.com)

Instalación

npm install id-payment

Configuración

Módulo Angular

import { IdPaymentModule } from 'id-payment';

@NgModule({
  imports: [IdPaymentModule]
})
export class AppModule { }

Componente Standalone

import { IdPaymentComponent } from 'id-payment';

@Component({
  imports: [IdPaymentComponent]
})

Uso

Implementación Básica

<id-payment 
  [token]="paymentToken"
  [amount]="totalAmount"
  (result)="handlePaymentResult($event)">
</id-payment>

API

Propiedades de Entrada

| Propiedad | Tipo | Requerido | Descripción | |------------|--------|-----------|--------------------------------| | token | string | Sí | Token de autorización | | amount | number | Sí | Monto a pagar | | commerce | string | No | Nombre del comercio | | concept | string | No | Concepto de la transacción | | nit | string | No | NIT del comercio |

Eventos de Salida

| Evento | Tipo | Descripción | |---------|-------------------------------------------|------------------------| | result | {status: string, transactionId: string} | Resultado del pago |

Flujo de Pago

  1. Ingreso de datos del usuario (documento, nombre, contacto)
  2. Validación de datos
  3. Procesamiento en servidores ID Payment
  4. Transacción bancaria
  5. Respuesta del proceso (estado 1: aprobado, 1000: rechazado)

Despliegue

  1. Compilar el proyecto:
ng build
  1. Iniciar sesión en npm:
npm login
  1. Configurar package.json:
{
  "name": "id-payment",
  "version": "0.0.7-alpha"
}
  1. Generar versión:
npm version 0.0.7-alpha

El alpha indica que es una versión preliminar. Cambia a beta o release según corresponda.

  1. Publicar:
npm publish

Uso en html

Para el uso en html puedes usar el siguiente código:

  <!DOCTYPE html>
<html>
<head>
  <title>Chalets</title>
  <!-- Importar el script del componente -->
  <script src="https://unpkg.com/id-payment/bundle.js" type="module"></script>
</head>
<body>
  <div id="loading">Cargando componente...</div>
  <div id="result"></div>

  <!-- Usar el componente como un elemento web -->
  <id-payment token="token" nit="901227175" [amount]="100" commerce="IDPAY" url="https://mipatito.com" concept="Pago de chalet"></id-payment>

  <script type="module">
    // Esperar a que el componente esté definido
    if (!customElements.get('id-payment')) {
      customElements.whenDefined('id-payment').then(() => {
        console.log('Componente id-payment registrado correctamente');
        document.getElementById('loading').style.display = 'none';

        const paymentComponent = document.querySelector('id-payment');

        // Escuchar el resultado del pago
        paymentComponent.addEventListener('result', (e) => {
          console.log('Payment initiated');
          console.log(e.detail);
        });
      }).catch(error => {
        console.error('Error al cargar el componente:', error);
        document.getElementById('loading').textContent = 'Error al cargar el componente';
      });
    }
  </script>
</body>
</html>

Licencia

MIT - Ver LICENSE para más detalles.