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

cashify-js

v1.1.0

Published

Cashify JS - Lightweight Cashify QRIS Payment Gateway API Client Library

Readme

Cashify SDK

SDK TypeScript ringan untuk integrasi Cashify Payment Gateway di Node.js & Bun. Mendukung QRIS Dinamis, Statis, dan E-Wallet monitoring.

📦 Installation

npm install cashify-js
# or
pnpm add cashify-js
# or
bun add cashify-js

⚡ Quick Start

import { Cashify } from 'cashify-js';

const cashify = new Cashify({
  licenseKey: 'YOUR_LICENSE_KEY_FROM_DASHBOARD',
});

// Generate Dynamic QRIS
const transaction = await cashify.generateQRISv2({
  qr_id: 'YOUR_QRIS_ID',
  amount: 10000,
  useUniqueCode: true,
  packageIds: ['id.dana'],
  paymentMethod: 'qris',
  qrType: 'dynamic',
  useQris: true,
});

console.log('Scan QR ini:', transaction.data.qr_string);

📚 Features

  • QRIS v1 & v2: Support generate QRIS statis dan dinamis.
  • E-Wallet Monitoring: Tanpa QR, hanya monitoring saldo masuk.
  • Complete Management: Cek status, cancel, history, dan delete transaksi.
  • TypeScript Support: Full typing untuk request & response.

📖 API Reference

Configuration

Inisialisasi Cashify dengan license key dari dashboard.

const cashify = new Cashify({
  licenseKey: 'xyz...',
});

Generate QRIS (v2)

Method paling lengkap untuk membuat transaksi.

const response = await cashify.generateQRISv2({
  qr_id: '...', // Wajib untuk QRIS
  amount: 50000,
  useUniqueCode: true, // Tambah kode unik (misal Rp50.003)
  packageIds: ['id.dana', 'id.ovo'], // App yang dimonitor
  expiredInMinutes: 30,
  paymentMethod: 'qris', // 'qris' atau 'ewallet'
  qrType: 'dynamic', // 'dynamic' atau 'static'
  useQris: true, // Return QR string?
});

E-Wallet (Tanpa QR)

Mode ini untuk monitoring transfer manual (tanpa scan QR).

const ewallet = await cashify.generateQRISv2({
  amount: 50000,
  useUniqueCode: true, // Wajib ON agar nominal unik
  packageIds: ['id.dana'],
  paymentMethod: 'ewallet',
  useQris: false, // Tidak perlu QR
});

// Tampilkan instruksi transfer manual ke user sesuai 'ewallet.data.totalAmount'

Wallet Shortcuts 🚀

Cara cepat generate QRIS untuk e-wallet tertentu.

// Monitor GoPay
const gopay = await cashify.generateQRGopay(50000, { qr_id: 'QR_ID' });

// Monitor DANA
const dana = await cashify.generateQRDana(20000, { qr_id: 'QR_ID' });

// Monitor ShopeePay
const shopee = await cashify.generateQRShopee(15000, { qr_id: 'QR_ID' });

// Monitor Bank (BCA, Mandiri, BNI, BRI, CIMB)
const bca = await cashify.generateQRBca(100000);
const mandiri = await cashify.generateQRMandiri(100000);

Check Payment Status

Cek status transaksi (pending/paid/expired).

const status = await cashify.checkStatus('transaction-id-uuid');
console.log(status.data.status); // 'paid'

Cancel Transaction

Batalkan transaksi yang masih pending.

await cashify.cancelPayment('transaction-id-uuid');

Watch Payment (Real-time)

Monitoring status pembayaran secara otomatis (real-time). SDK akan melakukan polling berkala.

cashify.watchPayment('transaction-id-uuid', {
  interval: 3000, // Cek setiap 3 detik
  timeout: 600000, // Stop otomatis setelah 10 menit
  onStatusChange: (status, response) => {
    console.log('Status berubah:', status);

    if (status === 'paid') {
      console.log('Pembayaran Berhasil! Nominal:', response.data.amount);
    }
  },
  onError: (error) => console.error('Error:', error),
});

Wait For Payment (Async/Await) 🆕

Cara modern (Promise-based) untuk menunggu pembayaran tanpa callback.

try {
  console.log('Menunggu user membayar...');
  const successResponse = await cashify.waitForPayment('transaction-id');
  console.log('PEMBAYARAN LUNAS! ✅');
} catch (err) {
  console.log('Gagal/Timeout/Expired ❌');
}

Stop Watching

Berhenti memonitor transaksi manual.

cashify.stopWatch('transaction-id-uuid');

List Payments

Lihat history transaksi dengan filter & pagination.

const history = await cashify.listPayments({
  page: 1,
  limit: 10,
  status: 'success', // Opsional
  sort: 'newest',
});

Delete Payment History

Hapus riwayat transaksi.

// Hapus satu
await cashify.deletePayment({ transactionId: 'transaction-id-uuid' });

// Hapus banyak
await cashify.deletePayment({ transactionIds: ['id-1', 'id-2'] });

// Hapus SEMUA history (Hati-hati!)
await cashify.deletePayment({ clearAll: true });

QR Generator Utility

Helper untuk membuat link gambar QR Code yang stylish.

const qrUrl = cashify.getQRImageURL({
  data: 'https://cashify.my.id', // String / URL konten QR
  size: '500x500', // Ukuran
  style: 2, // Style: 1, 2, atau 3
  color: 'ea580c', // Warna (Hex tanpa #)
});

console.log(qrUrl);
// Output: https://larabert-qrgen.hf.space/v1/create-qr-code?...

💡 Best Practices

Alur integrasi yang direkomendasikan:

  1. Backend Apps: Server kamu create transaksi via cashify.generateQRISv2().
  2. Database: Simpan transactionId + totalAmount di database kamu.
  3. Frontend: Tampilkan QR/instruksi bayar sesuai totalAmount (termasuk kode unik jika ada).
  4. Monitoring: Lakukan polling watchPayment di client atau server side (background job).
  5. Completion: Set order jadi "PAID" ketika status berubah menjadi paid atau success.

[!IMPORTANT] Jangan pernah menaruh LICENSE_KEY di frontend (React/Vue/Next.js Client Component). Selalu gunakan SDK ini di sisi Server (Node.js/Bun).

🤝 Contributing

Contributions are welcome!

  1. Fork repo
  2. Create feature branch
  3. Commit changes
  4. Push & PR

📄 License

MIT License