vxgate 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +24 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -82,15 +82,38 @@ const result = await pay.poll('ORDER-001', {
82
82
 
83
83
  ### `.createAndWait(paymentOpts, [pollOpts])` → `Promise<{payment, result}>`
84
84
 
85
- Shortcut: buat + poll sekaligus.
85
+ Shortcut: buat + poll sekaligus. Return object `{ payment, result }` — `payment` berisi data QR dan `result` berisi status akhir.
86
86
 
87
87
  ```js
88
88
  const { payment, result } = await pay.createAndWait(
89
89
  { amount: 15000, referenceId: 'ORDER-001' },
90
90
  { intervalMs: 3000, timeoutMs: 300_000 }
91
91
  );
92
+
93
+ // Data QR & order ada di `payment`:
94
+ console.log(payment.qrisUrl); // URL gambar QR → tampilkan ke customer
95
+ console.log(payment.qrisString); // string QRIS raw (untuk generate QR sendiri)
96
+ console.log(payment.referenceId); // reference ID order
97
+ console.log(payment.amount); // nominal actual (bisa ada suffix unik)
98
+
99
+ // Status pembayaran ada di `result`:
100
+ console.log(result.paid); // true jika lunas
101
+ console.log(result.payerBrand); // 'GOPAY' | 'OVO' | 'DANA' | ...
92
102
  ```
93
103
 
104
+ > **Catatan:** `createAndWait` akan **menunggu** sampai pembayaran `paid` atau `expired`. QR sudah tersedia di `payment` segera setelah fungsi mulai polling — tapi kalau kamu perlu **menampilkan QR dulu** sebelum menunggu, gunakan `.create()` + `.poll()` secara terpisah:
105
+ >
106
+ > ```js
107
+ > // Pattern: tampilkan QR dulu, baru poll
108
+ > const payment = await pay.create({ amount: 15000 });
109
+ > tampilkanQR(payment.qrisUrl); // langsung tampilkan ke user
110
+ >
111
+ > const result = await pay.poll(payment.referenceId, {
112
+ > onPoll: (n, status) => console.log(`[#${n}] ${status}`),
113
+ > });
114
+ > if (result.paid) console.log('Lunas!');
115
+ > ```
116
+
94
117
  ### `.list([opts])` → `Promise<Transaction[]>`
95
118
 
96
119
  Daftar transaksi.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vxgate",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Violetics Payment Gateway SDK — QRIS payment via Orderkuota API",
5
5
  "keywords": ["qris", "payment", "orderkuota", "violetics", "indonesia", "payment-gateway"],
6
6
  "author": "Violetics",