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

mustikapay-node

v1.4.0

Published

SDK Resmi NodeJS untuk MustikaPay API - Mendukung QRIS, VA, dan Payout

Downloads

615

Readme

MustikaPay Node.js SDK (v1.3.1)

SDK resmi untuk integrasi layanan pembayaran MustikaPay pada aplikasi Node.js. Mendukung QRIS, Virtual Account (VA), E-Wallet, Retail Outlet, dan Payout.

Instalasi

npm install mustikapay-node

Inisialisasi & Penggunaan API Key

SDK ini menggunakan API Key sebagai kredensial utama. Anda dapat melakukan inisialisasi dengan 3 cara berbeda:

1. Langsung via Constructor

const MustikaPay = require('mustikapay-node');

const mp = new MustikaPay({
    apiKey: 'MP-USER-XXXXX'
});

2. Menggunakan Objek Konfigurasi (Terpisah)

Sangat berguna jika Anda memisahkan file konfigurasi (misal: config.js).

// config.js
module.exports = {
    apiKey: 'MP-USER-XXXXX',
    baseUrl: 'https://mustikapayment.com'
};

// app.js
const config = require('./config');
const mp = new MustikaPay({ config });

3. Otomatis via Environment Variable

Jika tidak ada parameter yang diberikan, SDK akan mencari process.env.MUSTIKAPAY_API_KEY.

// Set di terminal: export MUSTIKAPAY_API_KEY=MP-USER-XXXXX
const mp = new MustikaPay(); 

Fitur & Cara Penggunaan

1. QRIS (Dinamis)

const res = await mp.createQris(10000);
if (res.status === 'success') {
    console.log("URL QRIS:", res.qr_url);
    console.log("Ref No:", res.ref_no);
}

// Cek status
const status = await mp.checkQrisStatus('REF12345');

2. Link Pembayaran (Reusable Payment Link)

Memungkinkan Anda membuat halaman pembayaran yang dapat dibagikan berkali-kali.

// Buat Link Baru
const newLink = await mp.createPaymentLink({
    title: "Donasi Orang Baik",
    amount: 10000, // Isi 0 untuk nominal bebas
    methods: "QRIS,VA,RETAIL",
    custom_slug: "donasi-kami" // Opsional
});

// Ambil Daftar Link
const allLinks = await mp.getPaymentLinks();

// Hapus Link
await mp.deletePaymentLink("donasi-kami");

3. Virtual Account (VA)

const res = await mp.createVa({
    amount: 50000,
    bankCode: "014", // 014: BCA, 008: Mandiri, 002: BRI, 009: BNI
    name: "Nama Pelanggan"
});

// Cek status
const status = await mp.checkVaStatus('REF12345');

4. E-Wallet (ShopeePay, DANA, OVO, LinkAja)

Membuat tagihan langsung ke nomor HP pelanggan.

const res = await mp.createEwallet({
    amount: 10000,
    productCode: "PAYDANA", // PAYDANA, PAYSHOPEE, PAYOVO, PAYGOPAY, PAYLINKAJA
    phone: "08123456789",
    name: "Budi Santoso", // Opsional
    productName: "Beli Kopi" // Opsional
});

// Cek status
const status = await mp.checkEwalletStatus('REF12345');

5. Retail (Alfamart & Indomaret)

const res = await mp.createRetail({
    amount: 100000,
    retailOutlet: "ALFAMART", // ALFAMART atau INDOMARET
    name: "Budi Santoso",
    productName: "Topup Saldo" // Opsional
});

// Cek status
const status = await mp.checkRetailStatus('REF12345');

6. Payout / Withdraw (Kirim Uang)

// Step 1: Request penarikan
const req = await mp.withdraw({
    tipe: "bank",
    kode: "014",
    rek: "123456789",
    amount: 500000
});

// Step 2: Konfirmasi dengan OTP (Gunakan endpoint yang sama dengan parameter OTP)
const confirm = await mp.withdraw({
    tipe: "bank",
    kode: "014",
    rek: "123456789",
    amount: 500000,
    otp: "123456"
});

6. Informasi Akun & Saldo

const saldo = await mp.getBalance('username_anda');
const bankList = await mp.getBankList();
const transactions = await mp.getTransactions(20); // Ambil 20 transaksi terakhir

7. Verifikasi Webhook (Callback)

Verifikasi keaslian data callback menggunakan API Key Anda untuk memastikan data berasal dari server MustikaPay.

const isValid = mp.verifyCallback(req.body, req.headers['x-signature']);

Keamanan & Praktik Terbaik

  • Backend Only: Jangan pernah menggunakan SDK ini di sisi frontend (React/Vue/Browser) karena API Key Anda akan terlihat oleh publik.
  • Config Separation: Gunakan file konfigurasi terpisah atau environment variable untuk menyimpan API Key.
  • Isolasi Data: Sistem MustikaPay memastikan data antar merchant terisolasi secara aman berdasarkan API Key masing-masing.

Lisensi

ISC License. Copyright (c) 2024 MustikaPay.