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

ipaymu-nodejs-api

v1.0.1

Published

Node.js package for iPaymu.com Indonesia payment gateway.

Downloads

2

Readme

The Official iPaymu library exported as Node.js modules.

Installation

Using npm:

$ npm i -g npm
$ npm i --save ipaymu-nodejs-api

Import iPaymu Package First:

import * as ipaymu from "ipaymu-nodejs-api";

Then , add the credentials ( Va & apiKey):

ipaymu.setVa("1179000899");
ipaymu.setApiKey("QbGcoO0Qds9sQFDmY0MWg1Tq.xtuh1");

Set mode production true or false:

ipaymu.setProd(false);

Direct Payment Example:

// Load the ipaymu module.
import * as ipaymu from "ipaymu-nodejs-api";
// set iPaymuVA & ApiKey.
ipaymu.setVa("1179000899");
ipaymu.setApiKey("QbGcoO0Qds9sQFDmY0MWg1Tq.xtuh1");
ipaymu.setProd(false); // false if staging , true if production
// set cart Items
let carts = {
  product: ["product 1 ", "product2"],
  quantity: ["1", "2"],
  price: ["10000", "50000"],
  description: ["product-desc", "product-desc 2"],
  weight: [1, 2],
  height: [10, 10],
  length: [30, 40],
  width: [10, 50],
};
// add items to Carts Array
ipaymu.addCart(carts);
// set Return URL
ipaymu.setURL({
  ureturn: "https://google.com",
  ucancel: "https://google.com",
  unotify: "https://google.com",
});

// set User Identity & Payment Method
let userData = {
  name: "Gusmang Asmara",
  email: "[email protected]",
  phone: "081936384166",
  amount: "40000",
  paymentMethod: "va",
  paymentChannel: "bca",
};

// Finally call directPayment methods with userData jsonArrays
ipaymu
  .directPayment(userData)
  .then((res) => console.log(res))
  .catch((err) => console.log(err));

ReDirect Payment Example:

import * as ipaymu from "ipaymu";

ipaymu.setVa("1179000899");
ipaymu.setApiKey("QbGcoO0Qds9sQFDmY0MWg1Tq.xtuh1");

let carts = {
    product: ["product 1 ", "product2 "],
    quantity: ["1", "2"],
    price: ["10000", "50000"],
    description: ["product-desc", "product-desc 2"],
    weight: [1, 2],
    height: [10, 10],
    length: [30, 40],
    width: [10, 50],
};

ipaymu.addCart(carts);
ipaymu.setURL({
    ureturn: "https://google.com",
    ucancel: "https://google.com",
    unotify: "https://google.com",
});


let userData = {"buyerName" : "Gusmang Asmara" , "buyerEmail" : "[email protected]" , "buyerPhone" : "081936384166" , "amount" : "60000",  "pickupArea" : "Denpasar",  "pickupAddress" : "jl. wiku no.1",  "paymentMethod" : "va", "paymentChannel" : "bca"};

ipaymu.redirectPayment(userData)
    .then((res) => console.log(res))
    .catch((err) => console.log(err));

Check Balance Example:

import * as ipaymu from "ipaymu";

ipaymu.setVa("1179000899");
ipaymu.setApiKey("QbGcoO0Qds9sQFDmY0MWg1Tq.xtuh1");

ipaymu.checkBalance()
    .then((res) => console.log(res))
    .catch((err) => console.log(err));

Check Payment Method Example:

ipaymu.setVa("1179000899");
ipaymu.setApiKey("QbGcoO0Qds9sQFDmY0MWg1Tq.xtuh1");

ipaymu.checkPaymentMethods()
    .then((res) => console.log(res))
    .catch((err) => console.log(err));

Check Payment Method Example:

ipaymu.setVa("1179000899");
ipaymu.setApiKey("QbGcoO0Qds9sQFDmY0MWg1Tq.xtuh1");


//Your Transaction ID 
let transactionId = "96748";

ipaymu.checkTransaction(transactionId)
    .then((res) => console.log(res))
    .catch((err) => console.log(err));

Check History Transaction Example:

ipaymu.setVa("1179000899");
ipaymu.setApiKey("QbGcoO0Qds9sQFDmY0MWg1Tq.xtuh1");
ipaymu.setProd(false);

let data = {
    "id" : null,  // set null if no spesific transaction id
    "status" : "1", 
    "date" : "created_at", 
    "startdate" : "2023-03-01", 
    "enddate" : "2023-05-20", 
    "page" : "1", 
    "type" : "0",
    "orderBy" : "id", 
    "order" : "DESC", 
    "lang" : "en", 
    "limit" : "20",
    "bulkId" : null, // set null if no more than one spesific transaction id ex , if yes use array [96748,96749,96750]
    "account" : "1179000899", 
    "lockStatus" : "0"
};

ipaymu.historyTransaction(data)
    .then((res) => console.log(res))
    .catch((err) => console.log(err));