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

ligdicash

v1.0.2

Published

SDK javascript pour l'API Ligdicash

Readme

Librairie Node.js LigdiCash

Ce projet est une librairie Node.js qui permet de manipuler l'API de LigdiCash. Vous pourrez éffectuer des Payins, Payouts, des vérifications de transactions et des retraits.

Vous retrouverez la documentation de l'API de LigdiCash sur https://developers.ligdicash.com/.

Installation

npm install ligdicash

Initialisation

L'initialisation de la librairie LigdiCash nécessite une clé API et un jeton d'authentification. Vous pouvez obtenir ces informations en créant un projet API sur la plateforme LigdiCash.

import Ligdicash from "ligdicash";

var client = new Ligdicash({
    apiKey: "REV...4I4O",
    authToken: "eyJ0eXAiOiJKV...BJuAY",
    platform: "live",
});

Payin

Le Payin est une transaction qui permet à un client de payer pour un produit ou un service. Il existe deux types de Payin : avec rédirection et sans rédirection.

Remplir la facture

// Décrire la facture et le client
let invoice = client.Invoice({
    currency: "xof",
    description: "Facture pour l'achat de vêtements sur MaSuperBoutique.com",
    customer_firstname: "Cheik",
    customer_lastname: "Cissé",
    customer_email: "[email protected]",
    store_name: "MaSuperBoutique",
    store_website_url: "masuperboutique.com",
});

// Ajouter des articles à la facture
invoice.addItem({
    name: "Jogging Adidas noir",
    description: "__description_du_produit__",
    quantity: 3,
    unit_price: 3500,
});

invoice.addItem({
    name: "Veste Gucci motif serpent",
    description: "__description_du_produit__",
    quantity: 1,
    unit_price: 5000,
});

invoice.addItem({
    name: "TVA",
    description: "__description_du_produit__",
    quantity: 1,
    unit_price: 1000,
});

Payin avec rédirection

Le Payin avec rédirection permet de rediriger le client vers une page de paiement sécurisée, conçue par LigdiCash.

const response = await invoice.payWithRedirection({
    return_url: "https://masuperboutique.com/success",
    cancel_url: "https://masuperboutique.com/cancel",
    callback_url: "https://backend.masuperboutique.com/callback",
    custom_data: {
        "order_id": "ORD-1234567890",
        "customer_id": "CUST-1234567890",
    },
});

const payment_url = response.response_text;
redirect_user(payment_url);

Payin sans rédirection

Le Payin sans rédirection permet de payer directement sur la page de la boutique, sans être redirigé vers une page de paiement.

const response = await invoice.payWithoutRedirection({
    otp: "101353", // OTP reçu par SMS par le client
    customer: "226XXXXXXXX", // Numéro de téléphone utilisé pour générer l'OTP
    callback_url: "https://backend.masuperboutique.com/callback",
    custom_data: {
        "order_id": "ORD-1234567890",
        "customer_id": "CUST-1234567890",
    },
});

const token = response.token;
check_payment_status(token);

Payout

Le Payout est une transaction qui permet à un marchand de rembourser un client ou de lui envoyer de l'argent.

const withdrawal = client.Withdrawal(
    100,
    "Remboursement de la commande ORD-1234567890",
    "226XXXXXXXX"
);
const response = await withdrawal.send({
    type: "client",
    to_wallet: true, // true si l'argent doit rester dans le wallet du client, false si l'argent doit être envoyé sur son compte mobile money
    callback_url: "https://backend.masuperboutique.com/callback-payout",
});

const token = response.token;
check_payment_status(token);

Vérification de transaction

La vérification de transaction permet de vérifier l'état d'une transaction. Vous devez toujours vérifier l'état d'une transaction avant de livrer un produit ou de valider une commande.

Pour obtenir une transaction, vous devez fournir le token de la transaction.

const transaction_token = "eyJ0eXAiOiJ...pZCI6IjY"
const transaction = await client.getTransaction(transaction_token, "payin"); // "payin" ou "client_payout" ou "merchant_payout"
const status = transaction.status;
if (status === "completed") {
    // La transaction a été effectuée avec succès
} else if (status === "pending") {
    // La transaction est en cours de traitement
} else {
    // La transaction a échouée
}