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

@diegomax/pagos360

v0.1.1

Published

TypeScript client for the Pagos360 API.

Readme

@diegomax/pagos360

Cliente TypeScript para la API de Pagos360. Pensado para Node.js 22+.

Instalación

npm install @diegomax/pagos360

Uso

import { createPagos360Client } from '@diegomax/pagos360';

const client = createPagos360Client({
	environment: 'sandbox', // 'sandbox' | 'production'
	apiKey: process.env.PAGOS360_API_KEY!,
	timeoutMs: 25_000
});

const payment = await client.createPaymentRequest({
	payerName: 'Diego Massanti',
	description: 'Pago facturas 123, 124',
	firstTotal: 1234.56,
	firstDueDate: new Date(Date.now() + 30 * 60_000),
	externalReference: 'OP-REF-1',
	backUrlSuccess: 'https://miapp/api/pago/callback/pagos360?flow=ok&ref=OP-REF-1',
	backUrlPending: 'https://miapp/api/pago/callback/pagos360?flow=pending&ref=OP-REF-1',
	backUrlRejected: 'https://miapp/api/pago/callback/pagos360?flow=rejected&ref=OP-REF-1'
});

// payment.checkoutUrl → URL para redirigir al usuario.

const status = await client.getPaymentRequest(payment.id);
// status.state: 'pending' | 'paid' | 'rejected' | 'expired' | 'reverted' | 'refunded' | ...

API

createPagos360Client(config)

Opciones:

| Campo | Tipo | Default | | ------------- | ------------------------------- | ------------------------------------------------------------------ | | environment | 'sandbox' \| 'production' | requerido | | apiKey | string | requerido (Authorization: Bearer <apiKey>) | | apiBaseUrl | string | https://api.sandbox.pagos360.com / https://api.pagos360.com | | fetch | typeof fetch | globalThis.fetch | | timeoutMs | number | 25000 |

client.createPaymentRequest(input)

POST /payment-request. Envía { payment_request: { payer_name, description, first_total, first_due_date, external_reference?, back_url_success?, back_url_pending?, back_url_rejected?, payer_email?, metadata? } }. La fecha se serializa a DD-MM-YYYY (formato esperado por Pagos360).

client.getPaymentRequest(id)

GET /payment-request/{id}. Devuelve el estado actual y los URLs/datos asociados.

Errores

Todas las fallas heredan de Pagos360Error:

  • Pagos360ValidationError — input rechazado por zod o pre-condiciones del cliente.
  • Pagos360HttpError — la API respondió con un status no-2xx.
  • Pagos360ResponseValidationError — la respuesta no coincide con el schema documentado.
  • Pagos360RequestError — fallo de red / timeout / abort.

Desarrollo

npm install
npm run typecheck
npm test
npm run build