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 🙏

© 2024 – Pkg Stats / Ryan Hefner

cmi-payment-nodejs

v1.1.3

Published

npm package to communicate with the CMI payment plateform in Morocco

Downloads

57

Readme

codecov

Installation

Install cmi-node with npm

  npm i cmi-payment-nodejs

Usage/Examples using Express.js

const express = require('express');
const cmi = require('cmi-payment-nodejs');

const app = express();
const port = 3000;

// Define a route to initiate a CMI payment
app.get('/pay', (req, res) => {
  // Extract necessary information from the request query parameters
  const { amount, email, tel, BillToName } = req.query;

  // Initialize the CMI payment client with your configuration
  const CmiClient = new cmi.default({
    storekey: 'YOUR_STOREKEY', // Your CMI Store Key
    clientid: 'YOUR_CLIENTID', // Your CMI Client ID
    oid: 'UNIQUE_COMMAND_ID', // A unique command ID
    shopurl: 'https://your-shop-url.com', // Your shop's URL for redirection
    okUrl: 'https://your-success-redirect-url.com', // Redirection after a successful payment
    failUrl: 'https://your-failure-redirect-url.com', // Redirection after a failed payment
    email, // email for CMI platform
    BillToName, // name as it should appear on the CMI platform
    amount, // The amount to be paid
    callbackURL: 'https://your-callback-url.com', // Callback URL for payment confirmation
    tel, // phone number for the CMI platform
  });

  // Generate an HTML form for the CMI payment
  const htmlForm = CmiClient.redirect_post();

  // Send the HTML form as the response
  res.send(htmlForm);
});

app.listen(port, () => {
  console.log(`App is listening on port ${port}`);
});

App Screenshot

Basic test card numbers

Credit Card information cannot be used in test mode. instead, use any of the following test card numbers, a valid expiration date in the future, and any random CVC number, to create a successful payment.

Branch : visa, PAN: 4000000000000010, Expired date: make any date CVC: 000

Branch : MasterCard, PAN: 5453010000066100, Expired date: make any date CVC: 000

3D Secure test card numbers

The following card information try to tests local payments such as Strong Customer Authentication SCA

Branch : MasterCard, PAN: 5191630100004896, Authentication code: 123 Expired date: make any date CVC: 000