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

@nicotordev/flowcl-pagos

v10.2.2

Published

SDK en TypeScript para integrar pagos con la API de Flow.cl de manera sencilla y segura.

Readme

Flow.cl - Cliente API para Node.js

Flow.cl

NPM Version License Build Tests

Descripción

Este paquete proporciona un Cliente API en TypeScript para integrar:

  • Pagos
  • Clientes
  • Planes de suscripción
  • Suscripciones e ítems de suscripción
  • Reembolsos
  • Cupones
  • Facturas (Invoices)
  • Liquidaciones (Settlements)
  • Información del comercio (Merchant)

con la API de Flow.cl de manera sencilla y segura.

Instalación

npm install @nicotordev/flowcl-pagos
yarn add @nicotordev/flowcl-pagos

Uso

Importar y configurar el cliente

import Flow from '@nicotordev/flowcl-pagos';

const flow = new Flow(
  'tu_api_key',
  'tu_secret_key',
  'sandbox', // o 'production'
);

Funcionalidades principales

1. Pagos

Crear una orden de pago

const order = await flow.payments.create({
  commerceOrder: '123456',
  subject: 'Compra de producto',
  amount: 10000,
  email: '[email protected]',
  urlReturn: 'https://tusitio.com/retorno',
  urlConfirmation: 'https://tusitio.com/confirmacion',
});

console.log('URL de pago:', order.url + '?token=' + order.token);

// Redireccionar al usuario a order.url + '?token=' + order.token || redirectUrl

Consultar el estado de un pago

const status = await flow.payments.status.byToken('token_de_transaccion');
console.log('Estado del pago:', status.status);

// Se puede usar status.status o status.statusStr

2. Clientes

Crear un cliente

const customer = await flow.customers.create{
  email: '[email protected]',
  name: 'Juan Pérez',
  externalId: '123123',
});
console.log('Cliente creado:', customer);

3. Planes de suscripción

Crear un plan

const plan = await flow.plans.create({
  name: 'Plan Mensual',
  amount: 5000,
  currency: 'CLP',
  interval: 3, // Monthly,
});
console.log('Plan creado:', plan);

4. Suscripciones

Crear una suscripción

const subscription = await flow.subscriptions.createToPlan({
  planId: '1234',
  customerId: '5678',
});
console.log('Suscripción creada:', subscription);

5. Reembolsos

Solicitar un reembolso

const refund = await flow.refunds.create({
  refundCommerceOrder: '98765',
  receiverEmail: '[email protected]',
  amount: 5000,
  urlCallBack: 'https://tusitio.com/callback',
});
console.log('Reembolso solicitado:', refund);

6. Cupones

Crear un cupón

const coupon = await flow.coupons.create({
  name: 'SomeCouponName',
  amount: 5000,
});
console.log('Cupón creado:', coupon);

7. Ítems de suscripción

Agregar un ítem a una suscripción

const subscriptionItem = await flow.subscriptionsItems.create({
  name: 'SomeItemName',
  currency: 'CLP',
  amount: 1000,
});
console.log('Ítem agregado a la suscripción:', subscriptionItem);

8. Facturas (Invoices)

Obtener una Factura

const invoice = await flow.invoices.get.normal('someUniqueUUid');
console.log('Factura creada:', invoice);

9. Liquidaciones (Settlements)

Obtener una liquidación por ID

const settlement = await flow.settlements.getLiquidationById('stl_12345');
console.log('Liquidación:', settlement);

10. Información del comercio (Merchant)

Obtener información de comercios

const merchantInfo = await flow.merchants.getAssociatedMerchants();
console.log('Información del comercio:', merchantInfo);

Requisitos

  • Node.js 16+
  • TypeScript 5+

Contribuciones

Las contribuciones son bienvenidas. Por favor, abre un issue o un pull request en el repositorio de GitHub.

Licencia

Este proyecto está bajo la licencia MIT. Ver el archivo LICENSE para más detalles.