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

fersaku

v1.0.0

Published

Official Fersaku QRIS Payment Gateway SDK for Node.js

Readme

Fersaku Node.js SDK

Official Node.js SDK untuk Fersaku QRIS Payment Gateway.

Instalasi

npm install fersaku

Atau copy file index.js langsung ke project Anda.

Quick Start

const Fersaku = require('fersaku');

const fersaku = new Fersaku('sk_live_your_secret_key');

// Buat pembayaran
const payment = await fersaku.createPayment({
  amount: 50000,
  customer_name: 'John Doe',
  customer_email: '[email protected]',
  description: 'Pembelian Produk A',
  external_id: 'order-123',
  expired_minutes: 30,
});

console.log(payment.checkout_url); // Redirect customer ke sini
console.log(payment.qr_string);   // Atau tampilkan QR langsung

API Methods

createPayment(params)

Buat pembayaran QRIS baru.

const payment = await fersaku.createPayment({
  amount: 100000,           // Wajib, min 1000
  customer_name: 'Budi',   // Opsional
  customer_email: '[email protected]', // Opsional
  description: 'Order #123', // Opsional
  external_id: 'my-order-123', // Opsional, ID dari sistem Anda
  expired_minutes: 30,      // Opsional, default 30
});

getPayment(id)

Ambil detail pembayaran.

const detail = await fersaku.getPayment('payment_id_here');

listPayments(params)

List pembayaran dengan filter.

const list = await fersaku.listPayments({ status: 'paid', limit: 10 });

cancelPayment(id)

Batalkan pembayaran pending.

await fersaku.cancelPayment('payment_id_here');

checkStatus(id)

Cek status terbaru.

const result = await fersaku.checkStatus('payment_id_here');

simulate(paymentId, action) (Sandbox only)

Simulasi pembayaran di sandbox.

const sandbox = new Fersaku('sk_test_your_sandbox_key');
await sandbox.simulate('payment_id', 'pay'); // pay, expire, fail, cancel

Webhook Verification

const Fersaku = require('fersaku');

// Express handler
app.post('/webhook', (req, res) => {
  const signature = req.headers['x-webhook-signature'];
  const isValid = Fersaku.verifyWebhook(req.body, signature, 'whsec_your_secret');

  if (!isValid) {
    return res.status(401).send('Invalid signature');
  }

  const { event, payment_id, status, amount } = req.body;

  if (event === 'payment.paid') {
    // Proses pembayaran berhasil
  }

  res.status(200).send('OK');
});

Sandbox vs Production

// Production
const live = new Fersaku('sk_live_xxx');

// Sandbox (testing)
const sandbox = new Fersaku('sk_test_xxx');

Error Handling

try {
  const payment = await fersaku.createPayment({ amount: 500 });
} catch (error) {
  console.log(error.message); // "Amount must be at least Rp 1.000"
  console.log(error.status);  // 400
}

Publish ke NPM

npm login
npm publish

License

MIT