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

@filanodev/paygate-core

v0.1.2

Published

PayGateGlobal JavaScript SDK - Core package for FLOOZ and T-Money payments

Readme

@filanodev/paygate-core

npm version

SDK JavaScript pour l'intégration de PayGateGlobal - Support FLOOZ et T-Money.

📝 Package communautaire développé par Filano pour aider les développeurs à intégrer plus rapidement PayGateGlobal dans leurs applications JavaScript.

Installation

npm install @filanodev/paygate-core
# ou
yarn add @filanodev/paygate-core
# ou
pnpm add @filanodev/paygate-core

Usage rapide

import { PayGateClient } from '@filanodev/paygate-core'

const paygate = new PayGateClient({
  authToken: 'your-paygate-token',
  verifySSL: false // pour le développement local uniquement
})

// Initier un paiement
try {
  const payment = await paygate.initiatePayment({
    phoneNumber: '+22890123456',
    amount: 1000,
    identifier: 'ORDER_123',
    network: 'FLOOZ', // ou 'TMONEY'
    description: 'Achat produit XYZ'
  })
  
  console.log('Paiement initié:', payment.txReference)
} catch (error) {
  console.error('Erreur:', error.message)
}

API Reference

Constructor

new PayGateClient(config: PayGateConfig)

PayGateConfig:

  • authToken: string - Votre token d'authentification PayGate (obligatoire)
  • verifySSL?: boolean - Vérification SSL (défaut: true, false pour dev local)
  • timeout?: number - Timeout des requêtes en ms (défaut: 30000)

Méthodes

initiatePayment(params)

Initie un paiement direct via l'API.

await paygate.initiatePayment({
  phoneNumber: '+22890123456',
  amount: 1000,
  identifier: 'ORDER_123',
  network: 'FLOOZ', // ou 'TMONEY'
  description?: 'Description optionnelle'
})

generatePaymentUrl(params)

Génère une URL de paiement pour redirection.

const { url, identifier } = paygate.generatePaymentUrl({
  amount: 5000,
  identifier: 'ORDER_456',
  description?: 'Description',
  successUrl?: 'https://monsite.com/success',
  phoneNumber?: '+22890123456',
  network?: 'FLOOZ'
})

checkPaymentStatus(txReference)

Vérifie le statut d'un paiement par référence PayGate.

const status = await paygate.checkPaymentStatus('TX_REFERENCE')

checkPaymentStatusByIdentifier(identifier)

Vérifie le statut d'un paiement par identifier personnalisé.

const status = await paygate.checkPaymentStatusByIdentifier('ORDER_123')

checkStatus(reference)

Vérifie le statut automatiquement (détecte le type de référence).

const status = await paygate.checkStatus('ORDER_123') // ou 'TX_REFERENCE'

disburse(params)

Effectue un remboursement.

await paygate.disburse({
  phoneNumber: '+22890123456',
  amount: 1000,
  reason: 'Remboursement commande',
  network: 'FLOOZ',
  reference?: 'REF_123'
})

checkBalance()

Consulte les soldes disponibles.

const balance = await paygate.checkBalance()
console.log('FLOOZ:', balance.flooz, 'T-Money:', balance.tmoney)

Gestion des erreurs

import { PayGateError } from '@filanodev/paygate-core'

try {
  const payment = await paygate.initiatePayment(params)
} catch (error) {
  if (error instanceof PayGateError) {
    console.error('Erreur PayGate:', {
      message: error.message,
      status: error.status,
      code: error.code
    })
  } else {
    console.error('Erreur inattendue:', error)
  }
}

Types TypeScript

Le package inclut tous les types TypeScript nécessaires :

import type { 
  PayGateConfig,
  InitiatePaymentParams,
  PaymentResponse,
  PaymentStatus,
  PayGateNetwork 
} from '@filanodev/paygate-core'

Statuts de paiement

  • 0 - Paiement réussi
  • 1 - En attente
  • 2 - Initialisé
  • 3 - En cours de traitement
  • 4 - Fonds insuffisants
  • 5 - Numéro invalide
  • 6 - Échec
  • 7 - Expiré

Support

Pour toute question sur ce package, créez une issue sur GitHub.

Pour le support PayGateGlobal officiel :

Licence

MIT