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

@12-apps/payments-backend

v4.25.0

Published

Server half of the vendor-agnostic payments platform: normalized charge/refund/webhook model behind per-provider adapters (Stone, InfinitePay, Stripe, ...), merchant-scoped credential settings with masking, fetch-native HTTP handlers, hexagonal storage po

Readme

@12-apps/payments-backend

The server half of the payments surface: a provider-agnostic gateway, the adapters behind it, the credential and charge stores, the webhook pipeline, and the background reconciliation that catches what a webhook missed.

Four providers ship today — PagBank, Stripe, Stone and InfinitePay — behind one adapter contract. Adding a fifth is a catalog entry and an adapter; it is not a change to any host.

The rule this package exists to enforce

A host keeps mounts and config. Everything else is the package's.

That means the host supplies who is calling (the resolved actor and its permission ids), where the data lives (the DB seam), and its own commercial policy — plan ceilings, retry ladders, the words a buyer reads. The package owns the mechanism: which API to call, how to shape the request, how to read the response, when a charge may be reused, what a webhook meant, and the double-charge rules around retrying.

If a host finds itself parsing a provider payload, mapping a status, branching on a vendor's name, or restating a vendor's hostname, that code belongs here.

Where to start

../ADOPTING.md is the integration guide — database, backend wiring, frontend wiring, migrating an existing PagBank integration, completing a live adapter, and consuming the package from another repository. Read it before wiring anything; this file is only the orientation.

The two mounts it points you at:

  • mountPayments — the provider credential/settings surface, given host auth, tenant resolution and the DB seam.
  • createPaymentFlowsBE — the buyer checkout.

A few exports worth knowing by name

These are the seams hosts most often re-implement by accident:

| export | answers | |---|---| | pagbankApiBase(environment) | PagBank's Orders API host. Required argument — a helper that guesses when asked about "no environment" is one that can route money at the wrong host silently. | | reconcilePendingCharges | the sweep that re-reads charges the provider never called back about, so a dropped webhook does not strand a paid order | | createPrismaChargeStore | the charge store the gateway and the sweep share | | classifyReversalEvent | which reversal shape a delivery is — chargeback, refund, dispute | | chargeDeadlinePassed, pixChargePayable, hostedChargePayable | whether a charge already raised is still payable | | attemptIdempotencyKey | the per-attempt key that keeps a repriced order from being handed the old amount |

Nothing here decides what a payment means to your domain. Orders, stock, subscription cycles and the copy a buyer reads stay in the host, on its own vocabulary.

Server-only

This package reads credentials and calls provider APIs. It is never imported into a browser bundle; the browser half is @12-apps/payments-frontend, whose subpaths are types-only where they cross the boundary.