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

stancerv2

v1.0.0

Published

TypeScript client for Stancer payment API v2

Readme

StancerV2

Client TypeScript officieux pour l'API Stancer v2. Ce package permet d'intégrer facilement les paiements Stancer dans vos applications TypeScript/JavaScript.

🚀 Installation

npm install stancerv2
# ou
yarn add stancerv2

📋 Prérequis

  • Node.js 12+
  • Clés API Stancer (disponibles dans votre dashboard Stancer)

🔧 Configuration

import { StancerClient } from "stancerv2";

const stancer = new StancerClient({
  apiKey: "votre_api_key",
  secretKey: "votre_secret_key",
  // baseURL: 'https://api.stancer.com/v2' // optionnel, par défaut
});

💳 Fonctionnalités principales

Paiements par carte

// Créer un paiement par carte
const payment = await stancer.payments.create({
  amount: 1000, // 10.00 EUR
  currency: "eur",
  card: {
    number: "4242424242424242",
    exp_month: 12,
    exp_year: 2025,
    cvc: "123",
  },
});

// Paiement avec une carte existante
const payment = await stancer.payments.create({
  amount: 1000,
  currency: "eur",
  card: "card_existing_id",
});

Prélèvements SEPA

// Créer un prélèvement SEPA
const sepa = await stancer.sepa.create({
  name: "John Doe",
  iban: "FR7630006000011234567890189",
  bic: "BNPAFRPP",
});

const payment = await stancer.payments.create({
  amount: 1000,
  currency: "eur",
  sepa: sepa.id,
});

Gestion des clients

// Créer un client
const customer = await stancer.customers.create({
  email: "[email protected]",
  name: "John Doe",
});

// Ajouter une carte à un client
const card = await stancer.cards.createForCustomer(customer.id, {
  number: "4242424242424242",
  exp_month: 12,
  exp_year: 2025,
  cvc: "123",
});

Payment Intents

// Créer un payment intent
const intent = await stancer.paymentIntents.create({
  amount: 1000,
  currency: "eur",
  description: "Test payment",
});

// Capturer un payment intent
await stancer.paymentIntents.capture(intent.id);

📚 API Complète

Cartes (Cards)

// Créer une carte
const card = await stancer.cards.create({...});

// Récupérer une carte
const card = await stancer.cards.get('card_id');

// Mettre à jour une carte
const card = await stancer.cards.update('card_id', {...});

// Supprimer une carte
await stancer.cards.delete('card_id');

// Lister les cartes
const cards = await stancer.cards.list();

Prélèvements SEPA

// Créer un SEPA
const sepa = await stancer.sepa.create({...});

// Récupérer un SEPA
const sepa = await stancer.sepa.get('sepa_id');

// Lister les SEPAs
const sepas = await stancer.sepa.list();

// Créer un mandat
const mandate = await stancer.mandates.create({
  sepa: 'sepa_id'
});

Remboursements

// Créer un remboursement
const refund = await stancer.refunds.create({
  payment: "payment_id",
  amount: 1000,
});

// Lister les remboursements
const refunds = await stancer.refunds.list();

Litiges

// Récupérer un litige
const dispute = await stancer.disputes.get("dispute_id");

// Lister les litiges
const disputes = await stancer.disputes.list();

Payouts

// Créer un payout
const payout = await stancer.payouts.create({
  payments: ["payment_id"],
});

// Récupérer les détails d'un payout
const payout = await stancer.payouts.get("payout_id");

🔍 Types TypeScript

Le package inclut des définitions de types complètes pour TypeScript. Tous les objets et paramètres sont entièrement typés.

import { CardIn, SepaIn, PaymentIntentCreate } from "stancerv2";

⚠️ Gestion des erreurs

Le package utilise des exceptions standards pour la gestion des erreurs :

try {
  const payment = await stancer.payments.create({...});
} catch (error) {
  if (error.response) {
    // Erreur API Stancer
    console.error(error.response.data);
  } else {
    // Autre erreur
    console.error(error);
  }
}

📦 Mode Test

Pour utiliser l'API en mode test, utilisez vos clés API de test :

const stancer = new StancerClient({
  apiKey: "votre_api_key_test",
  secretKey: "votre_secret_key_test",
});

🔒 Sécurité

  • Ne partagez jamais vos clés API
  • Utilisez des variables d'environnement pour stocker vos clés
  • Vérifiez toujours les montants et les devises
  • Validez les données utilisateur avant de les envoyer à l'API

🤝 Contribution

Les contributions sont les bienvenues ! N'hésitez pas à ouvrir une issue ou une pull request.

📄 Licence

MIT

📧 Support

Pour toute question ou problème :

🔄 Changelog

1.0.0

  • Version initiale
  • Support complet de l'API Stancer v2
  • Types TypeScript
  • Documentation complète