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 🙏

© 2025 – Pkg Stats / Ryan Hefner

unified-client

v1.0.0

Published

UP Node Client

Downloads

4

Readme

up-client

This module helps to simplify the process of integrating with unified payments platform.

Description

Admittedly, having to deal with XML data has become less common in recent years. But xml is extensively used while integrating with unified payments, so this helps to minimize the effort required to achieve smooth and swift integration.

Installation

For now the module is a local. so to install just copy the module directory to the same as your application and then type npm link ../up-client in your projects root folder and your good to go.

or copy the module package up-client-1.0.0.tgz (note the module version) to any location and then install using npm install path-to-package. if in the same location as the project then just type npm install ../up-client-1.0.0.tgz

Configuration

You can pass configuration options into the up client middleware. IMPORTANT: Currently it is advisable to include the approve, decline and cancel url while creating the order instead of adding it globally in the setup.



var opts = {
    merchantId: 'MERCHANT ID', // provision by unified payments
    endpoint:'Up Endpoint',
    port : 'PORT',
    path : '/Exec',
    key : '/path/to/key',
    cert : 'path/to/cert',
     approved: 'Approve Url',
     canceled: 'Cancel Url',
      declined: 'Decline Url'
};

Usage

In using this module you are expected to set the basic none changing options like the unified payments endpoint, path and port. It is also advisable to include your merchant Id at this point.

Here is an example of an express application with options:


var express = require('express'),
    app = express(),
    http = require('http'),
    server = http.createServer(app),

var opts = {
    merchantId: 'MERCHANT ID', // provision by unified payments
    endpoint:'Up Endpoint',
    port : 'PORT',
    path : '/Exec',
    key : '/path/to/key',
    cert : 'path/to/cert',
     approved: 'Approve Url',
     canceled: 'Cancel Url',
      declined: 'Decline Url'
};


// .. other middleware ...
app.use(express.json());
app.use(express.urlencoded());
require('up-client')(app, opts);
// ... other middleware ...

server.listen(1337);

CreateOrder action

the following fields are required to successfully perform the create order. Just pass the amount, description and respective return url and a callback to process the result.

var client = require('up-client').client;
app.post('/createOrder', function(req, res, next) {
 client.createOrder({
    amount: 200,
    description: 'Sample Description',
    approved: 'http://......../approved',
    declined: 'http://......../declined',
    canceled: 'http://......../canceled',
 }, function(e, data){
    // e is the error, if the process fails or the response status code is not  successful '00',
    // data is an object of the necessary values, look bellow
 });
});

// The object passed into the callback is in the following format:

{
    OrderID: '', //The OrderID
    SessionID: '', //The sessionID
    URL: '', //The base url,
    mpi: '', // The Url, concatenated with the session and order ids.
    xml: '', // The xml response to the create order.
    co_xml: '' //The create order xml

}