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

@primocaredentgroup/payment-methods-management

v0.4.0

Published

A payment methods component for Convex.

Downloads

540

Readme

Convex Payment Methods

@primocaredentgroup/payment-methods-management is the Convex component that owns payment methods, credit-note compatibility, payment resources, loan institutes, payment modalities and POS configuration.

Installation

npm install @primocaredentgroup/payment-methods-management

Mount the component once in the consuming application's convex.config.ts:

import { defineApp } from "convex/server";
import paymentMethods from "@primocaredentgroup/payment-methods-management/convex.config.js";

const app = defineApp();
app.use(paymentMethods);
export default app;

Typed host boundary

Use exposeApi to publish only authenticated and authorized host functions:

import { components } from "./_generated/api";
import { exposeApi } from "@primocaredentgroup/payment-methods-management";

export const {
  getActivePaymentMethods,
  createPaymentMethod,
  createModalityPayment,
} = exposeApi(components.paymentMethods, {
  auth: async (ctx, operation) => {
    const identity = await ctx.auth.getUserIdentity();
    if (!identity) throw new Error("Unauthorized");
    if (operation.type === "write") {
      // Enforce host-owned RBAC here.
    }
  },
});

Backend orchestration can use PaymentMethodsClient directly. Public argument and response validators are available from the package root and from the ./validators subpath.

Canonical contracts

  • payment modality type is one_only | more_rows;
  • posSettings.clinicId is an external string identifier;
  • timestamps are numeric milliseconds after migration;
  • optional fields are omitted instead of stored as explicit null;
  • payment documents should retain a snapshot of the selected payment method's external id and display name.

Satispay ownership

The component owns non-secret payment-method and payment-resource metadata. Satispay activation codes, tokens and API credentials remain in the consuming host's integration layer and must be stored as protected secrets. They are not part of this component's public contract.

Legacy migration

Version 0.3.x is the widening release for existing installations. After the component has been installed on a development or production deployment, run:

npx convex run --component paymentMethods migrations:normalizeLegacyData '{"dryRun":true}'
npx convex run --component paymentMethods migrations:normalizeLegacyData
npx convex run --component paymentMethods migrations:verifyLegacyData

Run production migrations only after an explicit rollout approval and verify that complete is true before installing the 0.4.x narrowing release. Version 0.4.x no longer exposes the migration functions and rejects legacy timestamps, explicit null optionals, numeric POS clinic ids and free-form payment modality types.

Development

npm ci
npm run verify
npm pack --dry-run