◉ Pulse
ahmadzakiyox avatar
#30 today ▼ 1

ahmadzakiyox/gopay-api-gateaway

JavaScript AI #gopay #gopay-merchant #gopay-qris #payment-gateway

API Gateway mandiri (Autonomous) berkinerja tinggi untuk memantau mutasi transaksi GoPay Merchant dan men-generate QRIS Dinamis (EMVCo) secara otomatis.

Created Jul 21, 2026
Stars
31
Today
+10
Forks
8
Quality
90/100
Momentum
19

README

Fetched from GitHub on Oct 30, 2026, 9:24 PM UTC · README.md

View original on GitHub

Third-party content — Open Source Pulse is not the owner of this repository.

This README belongs to ahmadzakiyox/gopay-api-gateaway and its contributors. We fetch it directly from the project’s public GitHub repository and display it for reference only. All text, code, images and trademarks remain the property of their respective authors. See the repository for its license terms. Copyright / takedown policy.

GoPay Merchant Gateway

Node.js Express OTP Auth QRIS Deploy Options

Chat Owner   Channel

API Gateway self-hosted berbasis Node.js untuk otomatisasi cek transaksi dan cetak QRIS dinamis dari akun GoPay / GoFood Merchant kamu.


Note

💬 HUBUNGI OWNER & BERGABUNG CHANNEL:

Tip

📣 PENGUMUMAN & UPDATE TERBARU: Sistem Login OTP Terminal & Auto-Refresh Token Gateway ini sekarang menggunakan sistem autentikasi OTP Terminal (node login.js). Kamu tidak perlu lagi copy-paste cookie browser atau memasukkan password. Cukup masukkan nomor HP GoBiz & kode OTP 1 kali saja — token akan tersimpan dan otomatis di-refresh oleh server di background setiap 6 jam tanpa perlu login ulang!

Caution

🚨 PERSYARATAN DEPLOYMENT (VPS / cPanel / Pterodactyl Panel) Gateway ini dapat di-deploy di VPS, cPanel Hosting, maupun Pterodactyl Panel (Node.js Egg v18.x/v20.x) yang memiliki penyimpanan permanen 24/7. DILARANG MENGGUNAKAN HOSTING SERVERLESS GRATISAN (seperti Render Free, Vercel, Netlify) karena container akan sleep dan menghapus file sesi (.GOPAY_SESI_JANGAN_DIHAPUS.json), yang mengakibatkan sesi hangus dan harus login OTP ulang.

Warning

⚠️ DISCLAIMER PROYEK TIDAK RESMI: Project ini tidak berafiliasi dengan PT GoTo Gojek Tokopedia Tbk / GoPay. Gunakan dengan bijak. Polling yang terlalu agresif bisa memicu pembatasan akun. Risiko ditanggung pengguna sepenuhnya. Seluruh data berjalan 100% aman di server Anda sendiri tanpa dikirim ke pihak ketiga.


✨ Fitur Utama

  • 🔐 Login OTP Terminal — Login resmi via SMS/WA (node login.js) menggunakan nomor HP GoBiz.
  • 🔄 Auto-Refresh Token (Set-and-Forget) — Token diperbarui otomatis di background. Login cukup 1 kali saja.
  • 🧾 QRIS Dinamis (EMVCo) — Generate QRIS nominal custom dari QRIS statis merchant secara lokal dengan parser EMVCo presisi tinggi (CRC16).
  • 📱 Halaman Checkout QRIS Interaktif — UI web modern siap pakai dengan timer hitung mundur 5 menit, tombol cek manual anti-banned, & auto-polling opsional (8s).
  • ✅ Cek Pembayaran Real-Time — Cocokkan nominal + waktu transaksi secara otomatis. Setiap payment memiliki trx_id unik sehingga dua payment nominal sama tidak akan saling klaim (anti duplikat klaim per TRX-ID).
  • 📋 Riwayat Mutasi Transaksi — Ambil daftar mutasi QRIS/GoPay/Kartu dalam rentang waktu tertentu.
  • 🌐 Dua Cara Request (GET & POST) — Bisa dipanggil via URL query di browser atau JSON body dari backend web store.
  • 🔒 Proteksi API Key & Public QR API — Endpoint backend dilindungi API_KEY rahasia, serta mendukung endpoint check status public aman untuk frontend UI.
  • 🐳 Docker, PM2 & Pterodactyl Ready — Siap di-deploy ke VPS Linux, cPanel, atau Pterodactyl Panel dalam hitungan menit.

💻 Persyaratan System

  • VPS / Dedicated Server dengan Linux (Ubuntu 20.04/22.04, Debian, AlmaLinux, dll) & Node.js ≥ 18.
  • Akun GoBiz / GoFood Merchant aktif yang terdaftar dengan nomor HP.
  • QRIS statis dari aplikasi GoBiz (untuk fitur generate QRIS dinamis).

🛠️ Quick Start (Pengujian Lokal)

1. Clone & Install Dependencies

git clone https://github.com/ahmadzakiyox/gopay-api-gateaway.git
cd gopay-api-gateaway
npm install

2. Konfigurasi .env

Salin template .env.example ke .env:

cp .env.example .env

Isi variabel di file .env:

PORT=3000
API_KEY=YOUR_API_KEY_HERE
QRIS_STATIC=YOUR_QRIS_STATIC_HERE
GOPAY_MERCHANT_ID=YOUR_MERCHANT_ID_HERE

3. Login OTP di Terminal (1 Kali Saja)

node login.js
  • Masukkan nomor HP GoBiz (contoh: 085119772671).
  • Masukkan kode OTP (4 digit) yang dikirimkan via SMS/WA.
  • Sesi login akan disimpan secara permanen di file .GOPAY_SESI_JANGAN_DIHAPUS.json.

🚀 Panduan Deploy Lengkap ke VPS (Production Setup)

Untuk memastikan gateway berjalan 24/7 non-stop di VPS dan token auto-refresh bekerja dengan baik, ikuti langkah deploy di bawah ini:

📍 Langkah 1: Install Node.js & Git di VPS

Jalankan perintah ini di terminal VPS kamu (contoh untuk Ubuntu/Debian):

# Update package list & install Git
sudo apt update && sudo apt install -y git curl

# Install Node.js v20 LTS via NodeSource
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs

📍 Langkah 2: Setup Project & Login OTP Pertama Kali

# Clone repository
git clone https://github.com/ahmadzakiyox/gopay-api-gateaway.git
cd gopay-api-gateaway

# Install dependencies
npm install

# Buat & sesuaikan .env
cp .env.example .env
nano .env   # (isi API_KEY & QRIS_STATIC kamu)

# Jalankan login OTP (masukkan no HP & OTP)
node login.js

📍 Langkah 3: Pilih Metode Deploy Production

Kamu bisa memilih salah satu dari 2 metode deploy production berikut:

🟢 Metode A: Deploy Menggunakan PM2 (Sangat Direkomendasikan)

PM2 adalah Process Manager untuk Node.js agar server otomatis hidup kembali jika terjadi crash atau VPS di-reboot.

  1. Install PM2 secara global:

    sudo npm install -g pm2
  2. Jalankan gateway dengan PM2:

    pm2 start server.js --name "gopay-gateway"
  3. Simpan agar otomatis jalan saat VPS di-reboot:

    pm2 save
    pm2 startup

    (Jalankan perintah yang dimunculkan oleh pm2 startup jika ada).

  4. Perintah Berguna PM2:

    • Cek status server: pm2 status
    • Cek log real-time: pm2 logs gopay-gateway
    • Restart server: pm2 restart gopay-gateway

🐳 Metode B: Deploy Menggunakan Docker & Docker Compose

Jika VPS kamu sudah terinstall Docker:

  1. Pastikan file .env dan .GOPAY_SESI_JANGAN_DIHAPUS.json sudah ada.
  2. Jalankan container di background:
    docker compose up -d
  3. Cek status & log container:
    docker compose logs -f

🔒 (Opsional) Langkah 4: Setup Nginx Reverse Proxy & SSL HTTPS

Jika kamu ingin mengakses gateway via domain HTTPS (misal https://gopay.domainkamu.com):

server {
    server_name gopay.domainkamu.com;

    location / {
        proxy_pass http://127.0.0.1:3000;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Gunakan Certbot untuk SSL gratis:

sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d gopay.domainkamu.com

🌐 Panduan Deploy ke cPanel Hosting (Setup Node.js App)

Bagi kamu yang menggunakan cPanel Shared Hosting / Web Hosting (seperti Niagahoster, Hostinger cPanel, DomaiNesia, JagoanHosting, dll), ikuti panduan setup berikut:

Important

⚠️ WAJIB MENGGUNAKAN NODE.JS VERSION 18.x DI CPANEL! Jangan memilih Node.js 20.x di cPanel karena fitur internal WebAssembly (undici) di Node 20 akan menyebabkan error RangeError: WebAssembly.instantiate(): Out of memory akibat pembatasan Virtual Memory CloudLinux cPanel. Gunakan versi Node.js 18.x.

📍 Langkah 1: Upload File ke cPanel

  1. Masuk ke cPanel -> File Manager.
  2. Buat folder baru (misal gopay-gateway) atau upload seluruh source code ke folder yang diinginkan.
  3. Pastikan file .env sudah ada dan diisi (salin dari .env.example).
    • ⚠️ Perhatian Port: Jangan menyetel PORT=443 atau PORT=80 di .env. Biarkan PORT=3000 atau hapus baris PORT. cPanel akan secara otomatis menangani SSL HTTPS domain kamu.

📍 Langkah 2: Setup Aplikasi di cPanel

  1. Buka menu Setup Node.js App di cPanel.
  2. Klik Create Application.
  3. Isi konfigurasi sebagai berikut:
    • Node.js version: Pilih 18.x (Wajib 18.x)
    • Application mode: Production
    • Application root: Nama folder tempat upload (contoh: gopay-gateway)
    • Application URL: Domain/subdomain kamu (contoh: gopay.domainkamu.com)
    • Application startup file: server.js (Wajib diubah dari default app.js)
  4. Klik Create di pojok kanan atas.

📍 Langkah 3: Install Dependencies & Login OTP via Terminal cPanel

  1. Masuk ke menu Terminal di cPanel (atau SSH ke cPanel).

  2. Copy perintah pengaktifan virtualenv dari bagian atas halaman Setup Node.js App (contoh: source /home/user/nodevenv/gopay-gateway/18/bin/activate && cd /home/user/gopay-gateway).

  3. Jalankan script otomatisasi setup.sh:

    bash setup.sh

    Script ini akan otomatis meng-install dependencies dan memandu login OTP GoPay (node login.js).

  4. Kembali ke menu Setup Node.js App di cPanel, lalu klik tombol Restart.

  5. Cek aplikasi di browser: https://gopay.domainkamu.com/health.


🦖 Panduan Deploy ke Pterodactyl Panel (Bot / App Hosting)

Bagi kamu yang menggunakan Pterodactyl Panel (panel hosting yang umum digunakan untuk Discord bot / server Node.js), ikuti langkah-langkah berikut:

Important

💡 TIPS LOGIN OTP UNTUK PTERODACTYL: Karena konsol web Pterodactyl terkadang kurang responsif untuk input interaktif terminal (node login.js), disarankan untuk melakukan login OTP 1x di PC lokal / VPS terlebih dahulu, kemudian mengunggah file .GOPAY_SESI_JANGAN_DIHAPUS.json yang dihasilkan ke File Manager Pterodactyl.

📍 Langkah 1: Persiapkan Sesi Login (Lokal / VPS)

  1. Jalankan npm install dan node login.js di komputer lokal atau VPS kamu.
  2. Masukkan nomor HP GoBiz & kode OTP 4-digit.
  3. Setelah berhasil login, file .GOPAY_SESI_JANGAN_DIHAPUS.json akan otomatis dibuat.

📍 Langkah 2: Upload Files ke Pterodactyl

  1. Buka Pterodactyl Panel -> Pilih Server kamu -> Masuk ke File Manager.
  2. Upload seluruh file project (termasuk server.js, sessionManager.js, package.json, dll).
  3. Upload juga file .GOPAY_SESI_JANGAN_DIHAPUS.json yang sudah dibuat pada Langkah 1.
  4. Buat file .env di File Manager Pterodactyl:
    PORT=3000
    API_KEY=API_KEY_RAHASIA_KAMU
    QRIS_STATIC=00020101021126...
    GOPAY_MERCHANT_ID=MERCHANT_ID_KAMU
    (Pterodactyl akan menyesuaikan port secara otomatis sesuai alokasi port server kamu).

📍 Langkah 3: Konfigurasi Startup & Console

  1. Masuk ke menu Startup di Pterodactyl Panel:
    • Set Startup Command: node server.js atau npm start
    • Set JS File / Entry File: server.js
  2. Masuk ke menu Console Pterodactyl.
  3. Jalankan npm install jika package belum terinstall otomatis.
  4. Klik Start / Restart server.

📍 Langkah 4: Cek Status Server

Lihat log pada Console. Jika berhasil, akan muncul:

[SERVER] Gateway running on port 3000
[GOPAY-SESSION] Verification successful. Merchant name: TOKO KAMU

Kamu bisa mengakses endpoint health melalui URL server Pterodactyl kamu (misal: http://IP_PANEL:PORT/health).


📡 API Reference

Semua endpoint memerlukan autentikasi. Bisa lewat Header atau Query Parameter:

Header   : X-Api-Key: <API_KEY>
Query    : ?api_key=<API_KEY>

GET /token-status — Cek Status Sesi Token

Memverifikasi apakah token GoPay Merchant masih aktif dan valid.

GET http://vps-ip:3000/token-status?api_key=RAHASIA

Respon Sukses:

{
  "success": true,
  "data": {
    "token_status": "valid",
    "message": "Token dan Sesi GoPay Merchant Aktif"
  }
}

GET /create-qris — Buat QRIS Dinamis

Membuat QRIS nominal custom dari QRIS statis secara in-memory (lokal). QR aktif selama 5 menit.

GET http://vps-ip:3000/create-qris?amount=25000&api_key=RAHASIA
Parameter Tipe Keterangan
amount number Nominal transaksi dalam Rupiah (wajib)
api_key string API Key kamu

Respon Sukses:

{
  "success": true,
  "data": {
    "qris_id": "abc123xyz",
    "trx_id": "TRX-A3F8K2M9",
    "qris_url": "http://vps-ip:3000/qr/abc123xyz",
    "qris_code": "00020101021126...",
    "amount": 25000,
    "expires_at": "2026-07-24T00:20:00.000Z",
    "expires_in": "5 menit"
  }
}

Tip

Simpan trx_id yang dikembalikan. Gunakan nilai ini sebagai parameter trx_id saat memanggil /check-payment agar dua payment dengan nominal sama tidak saling klaim transaksi satu sama lain.

GET /qr/:id — Halaman Pembayaran QRIS Interaktif (Web UI)

Membuka halaman HTML pembayaran QRIS yang interaktif. Dilengkapi dengan:

  • Tombol Cek Manual ("🔄 Cek Status Pembayaran") — (Paling Aman / Anti-Banned) Pengecekan 1x klik instan setelah pembeli transfer.
  • Hitung Mundur Kedaluwarsa 5 Menit — Countdown visual batas waktu transaksi.
  • Checkbox Toggle Auto-Polling (Opsional) — Off secara default untuk proteksi rate-limit. Jika dicentang pembeli, mengecek status setiap 8 detik di background.
  • Format gambar mentah bisa diakses dengan query ?format=raw atau ?raw=1.

GET /api/qr-status/:id — Status Check Public (Tanpa API Key)

Endpoint public yang digunakan oleh halaman HTML /qr/:id untuk memeriksa status pembayaran tanpa perlu mengekspos API_KEY di browser pembeli.

GET http://vps-ip:3000/api/qr-status/abc123xyz

GET /check-payment — Cek Pembayaran Masuk (Backend / Server-to-Server)

Mencari transaksi yang cocok berdasarkan nominal dan timestamp. Setiap transaksi hanya bisa diklaim 1x per trx_id (anti klaim ganda, termasuk untuk dua payment dengan nominal sama).

GET http://vps-ip:3000/check-payment?amount=25000&trx_id=TRX-A3F8K2M9&api_key=RAHASIA
Parameter Tipe Default Keterangan
amount number — Nominal transaksi yang dicari (wajib)
trx_id string — TRX-ID dari /create-qris — scope klaim agar tidak tabrakan dengan payment nominal sama (sangat direkomendasikan)
startTime string 24 jam lalu Timestamp ISO awal pencarian
api_key string — API Key kamu

Respon Sukses (Lunas):

{
  "success": true,
  "paid": true,
  "transaction": {
    "transaction_id": "gopay-internal-tx-id",
    "order_id": "GOPAY-1234567890",
    "amount": 25000,
    "payer_issuer": "GoPay / BCA",
    "payment_type": "QRIS",
    "transaction_time": "2026-07-24T00:15:12.000Z"
  }
}

GET /transactions — Riwayat Mutasi Transaksi

GET http://vps-ip:3000/transactions?api_key=RAHASIA
Parameter Tipe Default Keterangan
startTime unix timestamp 3 hari lalu Waktu awal (dalam detik)
endTime unix timestamp Sekarang Waktu akhir (dalam detik)
pageSize number 20 Jumlah transaksi yang diambil

GET /api/logs — Log Aktivitas Gateway

GET http://vps-ip:3000/api/logs?api_key=RAHASIA

🌐 Cara Request: GET vs POST

Gateway ini sangat fleksibel untuk diintegrasikan ke sistem toko online (PHP, Laravel, Node.js, Python, WordPress, dll):

Metode Contoh Pemanggilan
GET (URL Query) http://vps-ip:3000/create-qris?amount=25000&api_key=RAHASIA
POST (JSON Body) POST /create-qris dengan Body: {"amount": 25000} & Header X-Api-Key

📁 Struktur Project

gopay-gateway/
├── server.js                         # Express API Server & Logika Gateway
├── login.js                          # CLI Login OTP Interaktif Terminal (Encrypted)
├── sessionManager.js                 # Auto-Refresh Sesi & Token Manager (Encrypted)
├── setup.sh                          # Script Omatisasi Install & Setup (Linux/cPanel)
├── .env                              # File Konfigurasi Rahasia (Local)
├── .env.example                      # Template Konfigurasi
├── .GOPAY_SESI_JANGAN_DIHAPUS.json   # File Sesi Aktif (Wajib Ada di VPS/cPanel)
├── Dockerfile                        # Konfigurasi Docker
└── docker-compose.yml                # Konfigurasi Docker Compose

💬 Kontak & Komunitas

Ada pertanyaan, error, atau mau diskusi? Hubungi langsung:

Chat Owner   Channel


☕ Dukung Project Ini

Kalau project ini bermanfaat buat kamu, traktir saya kopi ya! ☕

QRIS Donasi ahmadzakiyo
Nominal bebas — terima kasih banyak! 🙏

Rendered by GitHub from the repository’s README. Scroll to read the full file.
First trending

Jul 22, 2026

first spotted on the list

Best rank

#11

highest position reached

Appearances

2

times on the trending list

Quality score

90

out of 100

Momentum

19

trend strength indicator

Star velocity

0.31

stars per day since creation

Activity — last 60 days

daily counts, collected every 6 hours
  • Stars
  • Forks
  • Merged PRs
  • Issues
  • Closed issues

Collecting activity data since launch — check back in a few days.

Star history

total stars per snapshot
1520253035ahmadzakiyox/gopay-api-gateaway · Jul 22, 8 AM UTC: 21 starsahmadzakiyox/gopay-api-gateaway · Jul 22, 2 PM UTC: 31 stars8:34 AM11:19 AM2:04 PM

Rank history

position on trending · lower is better
#1#10#15#20#25#30Jul 22, 8 AM UTC: rank #11Jul 22, 2 PM UTC: rank #308:34 AM11:19 AM2:04 PM

3D card for your website

Live HTML card with a glass surface and pointer tilt. Paste the iframe on any website.

<iframe src="https://www.notionpulse.cc/embed/ahmadzakiyox/gopay-api-gateaway" width="420" height="240" style="border:0;max-width:100%;background:transparent" loading="lazy" title="ahmadzakiyox/gopay-api-gateaway — trending on Open Source Pulse"></iframe>

Stars badge

Show current stars in your README or profile. Auto-updates every 6 hours.

ahmadzakiyox/gopay-api-gateaway stars badge
Markdown
[![ahmadzakiyox/gopay-api-gateaway](https://www.notionpulse.cc/api/badge/ahmadzakiyox/gopay-api-gateaway.svg)](https://www.notionpulse.cc/repo/ahmadzakiyox/gopay-api-gateaway)
HTML
<a href="https://www.notionpulse.cc/repo/ahmadzakiyox/gopay-api-gateaway"><img src="https://www.notionpulse.cc/api/badge/ahmadzakiyox/gopay-api-gateaway.svg" alt="ahmadzakiyox/gopay-api-gateaway stars badge" /></a>

Repository of the Day

#11 Repository of the Day

Repository of the Week

#11 Repository of the Week

Repository of the Month

#11 Repository of the Month