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

cardpay-headway

v1.0.0

Published

CardPay nodejs implementation.

Downloads

11

Readme

CardPay

Installation

$ npm install cardpay-sdk --save

Documentation

configure(configObj);

Configuration global parameters.

Arguments

  • configObj
    • production - true for production and false for sandbox (Default false)
    • g_type - grant_type (Should be password as stated in OAuth specification)
    • t_code - terminal_code (Unique terminal code used by the Cardpay payment system)
    • pwd - password (Terminal password)
    • c_secret - callback secret (Callback secret is also generated by Cardpay and received by Merchant with terminal code)

Usage

const cardpay = require('cardpay-sdk')
let configObj = {
   production: false,
   g_type: '',
   t_code: '',
   pwd: '',
   c_secret: ''
}
cardpay.configure(configObj);

pay(paymentParams, [configObj]);

Create redirect url

Arguments

  • paymentParams

    • m_id - Merchant Order ID Required
    • m_desc - Merchant Order Description Required or global config
    • p_method - Payment Method Required or global config
    • pd_currency - Payment Currency Optional or global config
    • pd_amount - Payment Amount Required
    • c_id - Unique Customer ID Required
    • c_email - Customer Email Address Required
    • c_locale - Customer Language Optional or global config
    • ru_success - Return Success URL Required or global config
    • ru_decline - Return Decline URL Required or global config
    • ru_cancel - Return Cancel URL Required or global config
    • ru_inprocess - Return In Process URL Required or global config
  • configObj - Optional - use global config first

Usage

let paymentData = {
    m_id: "00b46e01-3994-4ac2-939e-2d5052a65961",
    m_desc: 'sdasda',
    p_method: 'BANKCARD',
    pd_currency: 'EUR',
    pd_amount: "5.01",
    c_email: "[email protected]",
    c_id: "5sad3e123",
    c_locale: "en",
    ru_success: "http://70e47cb2.ngrok.io/success",
    ru_decline: "http://70e47cb2.ngrok.io/decline",
    ru_cancel: "http://70e47cb2.ngrok.io/cancel",
    ru_inprocess: "http://70e47cb2.ngrok.io/process",
};

let options = {
    test: true
}

// using async/await
try{
let payment = await cardpay.pay(paymentData, options);
}
catch(e){
// catch errors
}

// using promises
cardpay.pay(paymentData)
.then(success => {
// redirect URL
};
.error(err => {
}}

verify(options);

Verify callback signature middleware

Arguments

  • options - Optional - ["domain"]

Usage

app.post('/callback' , cardpay.verify(['ngrok.io']), async function(req, res, next) {
// your code here
}