@crediblemark/buayar 0.3.0 โ 0.3.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.
- package/README.md +292 -251
- package/dist/index.d.mts +21 -4
- package/dist/index.d.ts +21 -4
- package/dist/index.js +113 -61
- package/dist/index.mjs +99 -47
- package/package.json +43 -2
package/README.md
CHANGED
|
@@ -2,322 +2,363 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@crediblemark/buayar)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://www.typescriptlang.org/)
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
> ๐ก **Zero-Code PG Switcher:** Berganti provider payment gateway (misal dari Midtrans ke Duitku atau sebaliknya) **tanpa perlu merombak kode controller/service aplikasi**. Cukup ubah kredensial di file `.env`!
|
|
7
|
+
> ๐ฎ๐ฉ [Baca dalam Bahasa Indonesia](#-bahasa-indonesia) ยท ๐ฌ๐ง [Read in English](#-english)
|
|
9
8
|
|
|
10
9
|
---
|
|
11
10
|
|
|
12
|
-
##
|
|
11
|
+
## ๐ฌ๐ง English
|
|
12
|
+
|
|
13
|
+
**`@crediblemark/buayar`** is a **Unified Payment Gateway SDK** for Node.js and TypeScript, supporting **19 payment providers** (10 Indonesian + 9 International) through a single, consistent API.
|
|
14
|
+
|
|
15
|
+
> ๐ก **Zero-Code PG Switcher:** Switch your active payment provider โ e.g. from Midtrans to Stripe โ **without changing a single line in your controller or service layer**. Just update the credentials in your `.env` file.
|
|
16
|
+
|
|
17
|
+
### ๐ Key Features
|
|
18
|
+
|
|
19
|
+
- ๐ **Zero-Code PG Switcher** โ Swap providers via `.env` only. No code refactoring needed.
|
|
20
|
+
- โก **Semi & Full Integration**:
|
|
21
|
+
- ๐ก **Semi (Redirect/Hosted)** โ Returns a `paymentUrl` to redirect customers to the PG's hosted checkout.
|
|
22
|
+
- ๐ข **Full (Custom Native UI)** โ Returns raw data (`vaNumber`, EMVCo `qrString`, `paymentCode`, `deeplink`) to render a completely custom payment UI.
|
|
23
|
+
- ๐ท๏ธ **Canonical Payment Methods** โ Use universal codes (`bca_va`, `qris`, `gopay`, etc.) and the SDK maps them automatically to each provider's internal format.
|
|
24
|
+
- ๐ **Accordion-Ready Categorization** โ Payment methods are pre-grouped by category (`Virtual Account`, `QRIS`, `E-Wallet`, `Retail`, `Credit Card`, `Paylater`) with fees and icon URLs included.
|
|
25
|
+
- ๐ช **Universal Webhook Verifier** โ One endpoint to verify and normalize callbacks from any supported provider. Auto-detects the provider from the payload structure.
|
|
26
|
+
- ๐ก๏ธ **Strong TypeScript Types** โ Fully typed request and response interfaces to catch errors at compile time.
|
|
27
|
+
- ๐ **Multi-Currency** โ Supports `currency` field for international providers (USD, EUR, GBP, INR, etc.).
|
|
28
|
+
|
|
29
|
+
### ๐ฆ Supported Providers
|
|
30
|
+
|
|
31
|
+
#### ๐ฎ๐ฉ Indonesian (10)
|
|
32
|
+
|
|
33
|
+
| Provider | Redirect | Direct API | Webhook | Client |
|
|
34
|
+
|---|:---:|:---:|:---:|:---:|
|
|
35
|
+
| Midtrans | โ
Snap | โ
Core API | SHA-512 | `MidtransClient` |
|
|
36
|
+
| Duitku | โ
| โ
| MD5 | `DuitkuClient` |
|
|
37
|
+
| iPaymu | โ
| โ
| HMAC-SHA256 | `IpaymuClient` |
|
|
38
|
+
| Xendit | โ
Invoice v2 | โ
Payments v3 | Token | `XenditClient` |
|
|
39
|
+
| DOKU Jokul | โ
v1 | โ
v2 | HMAC-SHA256 | `DokuClient` |
|
|
40
|
+
| PrismaLink | โ
| โ
| SHA-256 | `PrismalinkClient` |
|
|
41
|
+
| Faspay | โ
| โ
| SHA1(MD5) | `FaspayClient` |
|
|
42
|
+
| Finpay | โ
| โ
| HMAC-SHA512 | `FinpayClient` |
|
|
43
|
+
| Nicepay | โ
| โ
| SHA-256 | `NicepayClient` |
|
|
44
|
+
| OY! Bisnis | โ
| โ
| Header Auth | `OyClient` |
|
|
45
|
+
|
|
46
|
+
#### ๐ International (9)
|
|
47
|
+
|
|
48
|
+
| Provider | Redirect | Direct API | Webhook | Client |
|
|
49
|
+
|---|:---:|:---:|:---:|:---:|
|
|
50
|
+
| Stripe | โ
Checkout Sessions | โ
Payment Intents | HMAC-SHA256 | `StripeClient` |
|
|
51
|
+
| PayPal | โ
Orders v2 | โ
Capture | OAuth2 | `PaypalClient` |
|
|
52
|
+
| Adyen | โ
Sessions v68 | โ
Payments v68 | HMAC-SHA256 | `AdyenClient` |
|
|
53
|
+
| Checkout.com | โ
Payment Links | โ
Payments API | HMAC-SHA256 | `CheckoutComClient` |
|
|
54
|
+
| Razorpay | โ
Payment Links | โ
Orders API | HMAC-SHA256 | `RazorpayClient` |
|
|
55
|
+
| Square | โ
Payment Links | โ
Payments API | HMAC-SHA256 | `SquareClient` |
|
|
56
|
+
| PayU | โ
Orders v2.1 | โ
Pay Methods | MD5/SHA-256 | `PayuClient` |
|
|
57
|
+
| Braintree | โ
Drop-in UI Token | โ
Transaction API | SHA1 HMAC | `BraintreeClient` |
|
|
58
|
+
| 2Checkout | โ
REST v6.0 | โ
REST v6.0 | IPN MD5 | `TwoCheckoutClient` |
|
|
59
|
+
|
|
60
|
+
### โ๏ธ Environment Variables
|
|
61
|
+
|
|
62
|
+
#### Universal (Recommended)
|
|
63
|
+
```env
|
|
64
|
+
# Active provider: any of the 19 supported names
|
|
65
|
+
PROVIDER_PG=midtrans
|
|
13
66
|
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
- ๐ท๏ธ **Canonical Payment Method Mapping**: Gunakan kode universal (`bca_va`, `mandiri_va`, `qris`, `gopay`, `shopeepay`, `alfamart`, `indomaret`), SDK otomatis memetakannya ke format internal provider aktif.
|
|
19
|
-
- ๐ **Pre-Categorization (Accordion Ready)**: Pengelompokan channel pembayaran bawaan (`Virtual Account`, `QRIS`, `E-Wallet`, `Retail / Gerai`, `Kartu Kredit`, `Paylater / Cicilan`) lengkap dengan fee dan icon URL untuk mempermudah pembuatan UI accordion.
|
|
20
|
-
- ๐ช **Universal Webhook Verifier**: Endpoint webhook tunggal untuk memverifikasi signature (SHA-512 Midtrans / MD5 Duitku) dan menormalisasi status (`isPaid`, `isPending`, `isFailed`, `isExpired`).
|
|
21
|
-
- ๐ก๏ธ **Tipe Data Kuat (TypeScript)**: Tipe data deklaratif dan ketat untuk mencegah *runtime error*.
|
|
67
|
+
# Universal credentials (auto-mapped per provider)
|
|
68
|
+
BUAYAR_API_KEY=your-server-key-or-secret
|
|
69
|
+
BUAYAR_MERCHANT_CODE=your-merchant-id-or-username
|
|
70
|
+
BUAYAR_SANDBOX=true
|
|
22
71
|
|
|
23
|
-
|
|
72
|
+
# Callback & Return URLs
|
|
73
|
+
BUAYAR_CALLBACK_URL=https://myapp.com/api/payment/webhook
|
|
74
|
+
BUAYAR_RETURN_URL=https://myapp.com/payment/finish
|
|
75
|
+
```
|
|
24
76
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
* ๐๏ธ **[Integrasi Midtrans (docs/midtrans.md)](file:///media/rasyiqi/7653717A1C07B131/Buayar/docs/midtrans.md)**
|
|
28
|
-
* Snap API (Redirect Checkout / Popup JS Modal).
|
|
29
|
-
* Core API Direct Charge (BCA, BNI, BRI, Mandiri Bill, Permata, CIMB, QRIS Gopay/ShopeePay, E-Wallet deeplinks, Kartu Kredit 3DS, Alfamart/Indomaret, Paylater).
|
|
30
|
-
* Verifikasi callback otomatis (SHA-512).
|
|
31
|
-
* Ekstensi `MidtransClient` (Refund, Cancel, Subscription, Recurring, Payment Link).
|
|
32
|
-
|
|
33
|
-
* ๐๏ธ **[Integrasi Duitku (docs/duitku.md)](file:///media/rasyiqi/7653717A1C07B131/Buayar/docs/duitku.md)**
|
|
34
|
-
* Redirect Checkout (Duitku Hosted Page).
|
|
35
|
-
* Direct Inquiry API (VA BCA, Mandiri, BNI, BRI, Permata, QRIS ShopeePay/Nobu, Gerai Retail).
|
|
36
|
-
* Dynamic Payment Methods API (Query channel aktif + dynamic fee).
|
|
37
|
-
* Verifikasi callback otomatis (MD5).
|
|
38
|
-
* Ekstensi `DuitkuClient` (Disbursement / Payout, Inquiry Rekening Bank, Saldo Merchant).
|
|
39
|
-
|
|
40
|
-
* ๐๏ธ **[Integrasi iPaymu (docs/ipaymu.md)](file:///media/rasyiqi/7653717A1C07B131/Buayar/docs/ipaymu.md)**
|
|
41
|
-
* Redirect Checkout (iPaymu Hosted Page).
|
|
42
|
-
* Direct Payment API (VA BCA, Mandiri, BNI, BRI, CIMB, Permata, Danamon, BSI, QRIS, Alfamart, Indomaret, CC, Akulaku).
|
|
43
|
-
* Verifikasi callback otomatis & signature HMAC-SHA256.
|
|
44
|
-
* Ekstensi `IpaymuClient` (Cek Saldo, Cek Status Transaksi).
|
|
45
|
-
|
|
46
|
-
* ๐๏ธ **[Integrasi Xendit (docs/xendit.md)](file:///media/rasyiqi/7653717A1C07B131/Buayar/docs/xendit.md)**
|
|
47
|
-
* Invoice v2 API (Redirect Checkout).
|
|
48
|
-
* Payment Requests API v3 Direct Charge (VA BCA, Mandiri, BNI, BRI, Permata, CIMB, Danamon, BSI, QRIS, OVO, DANA, ShopeePay, LinkAja, Alfamart, Indomaret).
|
|
49
|
-
* Verifikasi webhook callback token.
|
|
50
|
-
* Ekstensi `XenditClient` (Cek Saldo, Expire Invoice, Disbursement / Payout).
|
|
51
|
-
|
|
52
|
-
* ๐๏ธ **[Integrasi DOKU Jokul (docs/doku.md)](file:///media/rasyiqi/7653717A1C07B131/Buayar/docs/doku.md)**
|
|
53
|
-
* Jokul Checkout v1 (Redirect Payment Page).
|
|
54
|
-
* Direct Payment API v2 (VA BCA, Mandiri, BNI, BRI, Permata, CIMB, Danamon, BSI, QRIS, Alfamart, Indomaret, OVO, DANA, ShopeePay).
|
|
55
|
-
* Verifikasi signature HMAC-SHA256 & Digest otomatis.
|
|
56
|
-
* Ekstensi `DokuClient` (Cek Status Pesanan).
|
|
57
|
-
|
|
58
|
-
* ๐๏ธ **[Integrasi PrismaLink (docs/prismalink.md)](file:///media/rasyiqi/7653717A1C07B131/Buayar/docs/prismalink.md)**
|
|
59
|
-
* Checkout Payment Page (Redirect).
|
|
60
|
-
* Direct Payment API (VA BCA, Mandiri, BNI, BRI, Permata, CIMB, Danamon, BSI, QRIS, Alfamart, Indomaret, E-Wallet, CC).
|
|
61
|
-
* Verifikasi signature SHA-256 otomatis.
|
|
62
|
-
* Ekstensi `PrismalinkClient` (Cek Status Transaksi).
|
|
63
|
-
|
|
64
|
-
* ๐๏ธ **[Integrasi Faspay (docs/faspay.md)](file:///media/rasyiqi/7653717A1C07B131/Buayar/docs/faspay.md)**
|
|
65
|
-
* Post Data Transaction (Payment Page & Direct VA/QRIS/Retail).
|
|
66
|
-
* Channel lengkap (VA BCA, Mandiri, BNI, BRI, Permata, CIMB, Danamon, BSI, QRIS, Alfamart, Indomaret, OVO, DANA, ShopeePay, LinkAja, Kredivo, Akulaku, CC).
|
|
67
|
-
* Verifikasi signature SHA1(MD5()) otomatis.
|
|
68
|
-
* Ekstensi `FaspayClient` (Inquiry Status & Cancel Transaction).
|
|
69
|
-
|
|
70
|
-
* ๐๏ธ **[Integrasi Finpay (docs/finpay.md)](file:///media/rasyiqi/7653717A1C07B131/Buayar/docs/finpay.md)**
|
|
71
|
-
* Payment Initiate & Checkout Link (Redirect).
|
|
72
|
-
* Direct Payment API (VA BCA, Mandiri, BNI, BRI, Permata, CIMB, Danamon, BSI, QRIS, Pos Indonesia, Alfamart, Indomaret, E-Wallet, CC).
|
|
73
|
-
* Verifikasi signature HMAC-SHA512 otomatis.
|
|
74
|
-
* Ekstensi `FinpayClient` (Inquiry Status Pembayaran).
|
|
75
|
-
|
|
76
|
-
* ๐๏ธ **[Integrasi Nicepay (docs/nicepay.md)](file:///media/rasyiqi/7653717A1C07B131/Buayar/docs/nicepay.md)**
|
|
77
|
-
* Order Regist & Hosted Checkout (Redirect).
|
|
78
|
-
* Direct One-Step API (VA BCA BBBB, Mandiri BMRI, BNI BNIN, BRI BRIN, Permata BBBA, CIMB BNIA, Danamon BDIN, BSI BBSI, QRIS, Alfamart, Indomaret, E-Wallet, Paylater, CC).
|
|
79
|
-
* Verifikasi merchantToken SHA-256 otomatis.
|
|
80
|
-
* Ekstensi `NicepayClient` (Inquiry Status & Cancel Transaction).
|
|
81
|
-
|
|
82
|
-
* ๐๏ธ **[Integrasi OY! Bisnis (docs/oy.md)](file:///media/rasyiqi/7653717A1C07B131/Buayar/docs/oy.md)**
|
|
83
|
-
* Payment Checkout v2 (Payment Link / Redirect).
|
|
84
|
-
* Direct API (Static/Dynamic VA BCA 014, Mandiri 008, BNI 009, BRI 002, Permata 013, CIMB 022, Danamon 011, BSI 451, QRIS, E-Wallet).
|
|
85
|
-
* Verifikasi Header & Webhook otomatis.
|
|
86
|
-
* Ekstensi `OyClient` (Inquiry Status, Saldo Merchant & Kirim Uang/Disbursement).
|
|
87
|
-
|
|
88
|
-
* ๐๏ธ **[Integrasi Stripe (docs/stripe.md)](file:///media/rasyiqi/7653717A1C07B131/Buayar/docs/stripe.md)**
|
|
89
|
-
* Checkout Sessions API (Redirect Hosted Page, multi-currency).
|
|
90
|
-
* Payment Intents API Direct Charge (Kartu Kredit, Debit, Google Pay, Apple Pay, dll).
|
|
91
|
-
* Verifikasi webhook signature HMAC-SHA256 otomatis.
|
|
92
|
-
* Ekstensi `StripeClient` (Retrieve Session, Retrieve Intent, Refund, Saldo Merchant).
|
|
93
|
-
* โ ๏ธ **Catatan**: Stripe tidak mendukung Virtual Account lokal Indonesia. Cocok untuk pembayaran internasional / kartu kredit global.
|
|
77
|
+
#### Provider-Specific Variables
|
|
94
78
|
|
|
95
|
-
|
|
79
|
+
| Variable | Provider | Description |
|
|
80
|
+
| :--- | :--- | :--- |
|
|
81
|
+
| `MIDTRANS_SERVER_KEY` | Midtrans | Server Key |
|
|
82
|
+
| `MIDTRANS_CLIENT_KEY` | Midtrans | Client Key (frontend) |
|
|
83
|
+
| `DUITKU_API_KEY` / `DUITKU_MERCHANT_CODE` | Duitku | API Key & Merchant Code |
|
|
84
|
+
| `IPAYMU_API_KEY` / `IPAYMU_VA` | iPaymu | API Key & VA number |
|
|
85
|
+
| `XENDIT_SECRET_KEY` / `XENDIT_WEBHOOK_TOKEN` | Xendit | Secret Key & Webhook Token |
|
|
86
|
+
| `DOKU_CLIENT_ID` / `DOKU_SECRET_KEY` | DOKU | Client ID & Secret Key |
|
|
87
|
+
| `PRISMALINK_MERCHANT_ID` / `PRISMALINK_SECRET_KEY` | PrismaLink | Merchant ID & Secret Key |
|
|
88
|
+
| `FASPAY_MERCHANT_ID` / `FASPAY_USER_ID` / `FASPAY_PASSWORD` | Faspay | Merchant ID, User ID & Password |
|
|
89
|
+
| `FINPAY_MERCHANT_ID` / `FINPAY_MERCHANT_KEY` | Finpay | Merchant ID & Key |
|
|
90
|
+
| `NICEPAY_IMID` / `NICEPAY_KEY` | Nicepay | iMid & Merchant Key |
|
|
91
|
+
| `OY_USERNAME` / `OY_API_KEY` | OY! Bisnis | Username & API Key |
|
|
92
|
+
| `STRIPE_SECRET_KEY` / `STRIPE_WEBHOOK_SECRET` / `STRIPE_PUBLIC_KEY` | Stripe | Secret, Webhook Secret, Publishable Key |
|
|
93
|
+
| `PAYPAL_CLIENT_ID` / `PAYPAL_CLIENT_SECRET` / `PAYPAL_WEBHOOK_ID` | PayPal | OAuth2 Credentials & Webhook ID |
|
|
94
|
+
| `ADYEN_API_KEY` / `ADYEN_MERCHANT_ACCOUNT` / `ADYEN_HMAC_KEY` | Adyen | API Key, Merchant Account & HMAC Key |
|
|
95
|
+
| `CHECKOUTCOM_SECRET_KEY` / `CHECKOUTCOM_PUBLIC_KEY` / `CHECKOUTCOM_WEBHOOK_SECRET` | Checkout.com | Secret, Public Key & Webhook Secret |
|
|
96
|
+
| `RAZORPAY_KEY_ID` / `RAZORPAY_KEY_SECRET` / `RAZORPAY_WEBHOOK_SECRET` | Razorpay | Key ID, Key Secret & Webhook Secret |
|
|
97
|
+
| `SQUARE_ACCESS_TOKEN` / `SQUARE_APPLICATION_ID` / `SQUARE_LOCATION_ID` | Square | Access Token, App ID & Location ID |
|
|
98
|
+
| `PAYU_POS_ID` / `PAYU_MD5_KEY` / `PAYU_OAUTH_CLIENT_ID` / `PAYU_OAUTH_CLIENT_SECRET` | PayU | POS ID, MD5 Key & OAuth2 Credentials |
|
|
99
|
+
| `BRAINTREE_MERCHANT_ID` / `BRAINTREE_PUBLIC_KEY` / `BRAINTREE_PRIVATE_KEY` | Braintree | Merchant ID, Public & Private Key |
|
|
100
|
+
| `TWOCHECKOUT_MERCHANT_CODE` / `TWOCHECKOUT_SECRET_KEY` / `TWOCHECKOUT_SECRET_WORD` | 2Checkout | Merchant Code, Secret Key & IPN Word |
|
|
101
|
+
|
|
102
|
+
### ๐ Usage
|
|
103
|
+
|
|
104
|
+
#### 1. Initialize (Zero-Config)
|
|
105
|
+
```typescript
|
|
106
|
+
import { buayar } from "@crediblemark/buayar";
|
|
107
|
+
// Reads config automatically from process.env
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
#### 2. Semi Integration โ Redirect / Hosted Checkout
|
|
111
|
+
```typescript
|
|
112
|
+
const invoice = await buayar.createInvoice({
|
|
113
|
+
orderId: "ORDER-1001",
|
|
114
|
+
amount: 150000,
|
|
115
|
+
productDetails: "Pro Plan Subscription",
|
|
116
|
+
customer: { name: "John Doe", email: "john@example.com" },
|
|
117
|
+
returnUrl: "https://myapp.com/orders/ORDER-1001",
|
|
118
|
+
// No paymentMethod = redirect to PG hosted page
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
if (invoice.success) {
|
|
122
|
+
redirect(invoice.paymentUrl!); // redirect user here
|
|
123
|
+
}
|
|
124
|
+
```
|
|
96
125
|
|
|
97
|
-
|
|
126
|
+
#### 3. Full Integration โ Custom Native UI
|
|
127
|
+
```typescript
|
|
128
|
+
// Step A: Get available payment methods (accordion-ready)
|
|
129
|
+
const { categories } = await buayar.getPaymentMethods({ amount: 150000 });
|
|
130
|
+
// categories: { "Virtual Account": [...], "QRIS": [...], "E-Wallet": [...] }
|
|
131
|
+
|
|
132
|
+
// Step B: Charge with canonical method code
|
|
133
|
+
const vaInvoice = await buayar.createInvoice({
|
|
134
|
+
orderId: "ORDER-1002",
|
|
135
|
+
amount: 150000,
|
|
136
|
+
paymentMethod: "bca_va", // canonical code โ works across all providers
|
|
137
|
+
productDetails: "Wallet Top-up",
|
|
138
|
+
customer: { name: "John", email: "john@example.com" },
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
console.log(vaInvoice.vaNumber); // "123456789012"
|
|
142
|
+
console.log(vaInvoice.vaBank); // "bca"
|
|
98
143
|
|
|
99
|
-
|
|
144
|
+
// QRIS
|
|
145
|
+
const qrisInvoice = await buayar.createInvoice({
|
|
146
|
+
orderId: "ORDER-1003",
|
|
147
|
+
amount: 50000,
|
|
148
|
+
paymentMethod: "qris",
|
|
149
|
+
productDetails: "Coffee",
|
|
150
|
+
customer: { name: "John", email: "john@example.com" },
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
console.log(qrisInvoice.qrString); // Raw EMVCo string for QR rendering
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
#### 4. Universal Webhook Handler
|
|
157
|
+
```typescript
|
|
158
|
+
// Works with Express, Elysia, Hono, Next.js App Router, etc.
|
|
159
|
+
app.post("/api/payment/webhook", async (req, res) => {
|
|
160
|
+
const result = await buayar.verifyWebhook(req.body, req.headers);
|
|
161
|
+
// Auto-detects the provider from payload โ no manual routing needed
|
|
162
|
+
|
|
163
|
+
if (!result.isValid) return res.status(400).json({ error: "Invalid signature" });
|
|
164
|
+
|
|
165
|
+
if (result.isPaid) {
|
|
166
|
+
// โ
Payment confirmed โ activate subscription, deliver product
|
|
167
|
+
console.log(`Order ${result.orderId} paid โ Amount: ${result.amount}`);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return res.status(200).json({ status: "OK" });
|
|
171
|
+
});
|
|
172
|
+
```
|
|
100
173
|
|
|
101
|
-
|
|
174
|
+
#### 5. Zero-Code PG Switch
|
|
102
175
|
```env
|
|
103
|
-
#
|
|
176
|
+
# Switch from Midtrans to Stripe โ zero code change required
|
|
104
177
|
PROVIDER_PG=stripe
|
|
178
|
+
STRIPE_SECRET_KEY=sk_live_...
|
|
179
|
+
STRIPE_WEBHOOK_SECRET=whsec_...
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## ๐ฎ๐ฉ Bahasa Indonesia
|
|
185
|
+
|
|
186
|
+
**`@crediblemark/buayar`** adalah **Unified Payment Gateway SDK** untuk Node.js dan TypeScript yang mendukung **19 payment provider** (10 Indonesia + 9 Internasional) melalui satu arsitektur API yang seragam.
|
|
187
|
+
|
|
188
|
+
> ๐ก **Zero-Code PG Switcher:** Berganti provider payment gateway (misal dari Midtrans ke Duitku atau sebaliknya) **tanpa perlu merombak kode controller/service aplikasi**. Cukup ubah kredensial di file `.env`!
|
|
105
189
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
190
|
+
### ๐ Fitur Utama
|
|
191
|
+
|
|
192
|
+
- ๐ **Zero-Code PG Switcher** โ Ganti provider hanya via `.env`, tanpa refactoring kode.
|
|
193
|
+
- โก **Dukungan Spektrum Integrasi Penuh**:
|
|
194
|
+
- ๐ก **Semi Integrasi (Redirect/Hosted)** โ Menghasilkan `paymentUrl` untuk redirect ke halaman checkout PG.
|
|
195
|
+
- ๐ข **Full Integrasi (Custom Native UI)** โ Mengembalikan data mentah (`vaNumber`, `qrString` EMVCo, `paymentCode`, `deeplink`) untuk dirender di UI custom.
|
|
196
|
+
- ๐ท๏ธ **Canonical Payment Method Mapping** โ Gunakan kode universal (`bca_va`, `qris`, `gopay`), SDK memetakannya otomatis ke format internal provider aktif.
|
|
197
|
+
- ๐ **Pre-Kategorisasi (Accordion Ready)** โ Channel pembayaran sudah dikelompokkan per kategori (`Virtual Account`, `QRIS`, `E-Wallet`, `Retail`, `Kartu Kredit`, `Paylater`) lengkap dengan fee dan icon URL.
|
|
198
|
+
- ๐ช **Universal Webhook Verifier** โ Satu endpoint untuk verifikasi dan normalisasi callback dari provider manapun. Provider terdeteksi otomatis dari struktur payload.
|
|
199
|
+
- ๐ก๏ธ **TypeScript Strong-Typed** โ Interface request & response terdeklarasi penuh untuk mencegah runtime error.
|
|
200
|
+
- ๐ **Multi-Currency** โ Field `currency` untuk provider internasional (USD, EUR, GBP, dll).
|
|
201
|
+
|
|
202
|
+
### ๐ฆ Provider yang Didukung
|
|
203
|
+
|
|
204
|
+
#### ๐ฎ๐ฉ Lokal Indonesia (10)
|
|
205
|
+
|
|
206
|
+
* **Midtrans** โ Snap API (Redirect/Popup) & Core API Direct Charge. Verifikasi SHA-512. `MidtransClient`.
|
|
207
|
+
* **Duitku** โ Redirect Checkout & Direct Inquiry API. Verifikasi MD5. `DuitkuClient` (Disbursement, Inquiry Rekening, Saldo).
|
|
208
|
+
* **iPaymu** โ Redirect & Direct Payment API v2. Verifikasi HMAC-SHA256. `IpaymuClient` (Cek Saldo, Cek Transaksi).
|
|
209
|
+
* **Xendit** โ Invoice v2 & Payment Requests v3. Webhook Token. `XenditClient` (Saldo, Expire Invoice, Disbursement).
|
|
210
|
+
* **DOKU Jokul** โ Checkout v1 & Direct API v2. HMAC-SHA256 + Digest. `DokuClient`.
|
|
211
|
+
* **PrismaLink** โ Checkout Page & Direct API. SHA-256. `PrismalinkClient`.
|
|
212
|
+
* **Faspay** โ Post Data Transaction (Redirect & Direct). SHA1(MD5()). `FaspayClient`.
|
|
213
|
+
* **Finpay** โ Payment Initiate & Direct API. HMAC-SHA512. `FinpayClient`.
|
|
214
|
+
* **Nicepay** โ Order Regist & One-Step API. SHA-256 merchantToken. `NicepayClient`.
|
|
215
|
+
* **OY! Bisnis** โ Payment Checkout v2 & Direct VA/QRIS. Header Auth. `OyClient` (Inquiry, Saldo, Disbursement).
|
|
216
|
+
|
|
217
|
+
#### ๐ Internasional (9)
|
|
218
|
+
|
|
219
|
+
* **Stripe** โ Checkout Sessions (redirect) & Payment Intents (direct). HMAC-SHA256. `StripeClient`.
|
|
220
|
+
* **PayPal** โ Orders API v2 + OAuth2 auto-token. `PaypalClient` (Capture, Refund, Saldo).
|
|
221
|
+
* **Adyen** โ Sessions v68 (redirect) & Payments v68 (direct). HMAC-SHA256. `AdyenClient`.
|
|
222
|
+
* **Checkout.com** โ Payment Links & Payments API. HMAC-SHA256. `CheckoutComClient`.
|
|
223
|
+
* **Razorpay** โ Payment Links & Orders API. HMAC-SHA256. `RazorpayClient`.
|
|
224
|
+
* **Square** โ Payment Links & Payments API. HMAC-SHA256. `SquareClient`.
|
|
225
|
+
* **PayU** โ Orders API v2.1 + OAuth2. Verifikasi MD5/SHA-256. `PayuClient`.
|
|
226
|
+
* **Braintree** โ Drop-in UI Client Token & Transaction API. SHA1 HMAC. `BraintreeClient`.
|
|
227
|
+
* **2Checkout/Verifone** โ REST API 6.0. IPN MD5. `TwoCheckoutClient`.
|
|
228
|
+
|
|
229
|
+
### โ๏ธ Konfigurasi Environment Variables (`.env`)
|
|
230
|
+
|
|
231
|
+
#### Universal (Direkomendasikan)
|
|
232
|
+
```env
|
|
233
|
+
# Provider aktif (19 pilihan tersedia)
|
|
234
|
+
PROVIDER_PG=midtrans
|
|
235
|
+
|
|
236
|
+
# Kredensial Universal (dipetakan otomatis per provider)
|
|
237
|
+
BUAYAR_API_KEY=server-key-atau-secret
|
|
238
|
+
BUAYAR_MERCHANT_CODE=merchant-id-atau-username
|
|
109
239
|
BUAYAR_SANDBOX=true
|
|
110
240
|
|
|
111
|
-
# Callback & Return URL
|
|
241
|
+
# Callback & Return URL
|
|
112
242
|
BUAYAR_CALLBACK_URL=https://myapp.com/api/payment/webhook
|
|
113
243
|
BUAYAR_RETURN_URL=https://myapp.com/payment/finish
|
|
114
244
|
```
|
|
115
245
|
|
|
116
|
-
|
|
246
|
+
#### Kamus Variabel Lengkap Spesifik Provider
|
|
117
247
|
|
|
118
248
|
| Variabel `.env` | Provider | Keterangan |
|
|
119
249
|
| :--- | :--- | :--- |
|
|
120
|
-
| `
|
|
121
|
-
| `
|
|
122
|
-
| `
|
|
123
|
-
| `
|
|
124
|
-
| `
|
|
125
|
-
| `
|
|
126
|
-
| `
|
|
127
|
-
| `
|
|
128
|
-
| `
|
|
129
|
-
| `
|
|
130
|
-
| `
|
|
131
|
-
| `
|
|
132
|
-
| `
|
|
133
|
-
| `
|
|
134
|
-
| `
|
|
135
|
-
| `
|
|
136
|
-
| `
|
|
137
|
-
| `
|
|
138
|
-
| `
|
|
139
|
-
| `
|
|
140
|
-
| `
|
|
141
|
-
| `
|
|
142
|
-
| `
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
| `STRIPE_WEBHOOK_SECRET` | Stripe | Webhook Signing Secret Stripe (`whsec_...`). Wajib untuk verifikasi callback. |
|
|
148
|
-
| `STRIPE_PUBLIC_KEY` | Stripe | Publishable Key Stripe (`pk_test_...` / `pk_live_...`). Opsional, untuk frontend. |
|
|
149
|
-
| `BUAYAR_API_KEY` / `PG_API_KEY` / `PAYMENT_API_KEY` | Semua | API Key / Server Key universal. |
|
|
150
|
-
| `BUAYAR_MERCHANT_CODE` / `PG_MERCHANT_CODE` | Duitku / Umum | Kode merchant dari dashboard payment gateway. |
|
|
151
|
-
| `BUAYAR_SANDBOX` / `PG_SANDBOX` / `PAYMENT_SANDBOX` | Semua | Mode sandbox (`true` / `false`). |
|
|
152
|
-
| `MIDTRANS_SERVER_KEY` | Midtrans | Server key rahasia Midtrans. |
|
|
153
|
-
| `MIDTRANS_CLIENT_KEY` | Midtrans | Client key publik Midtrans. |
|
|
154
|
-
| `MIDTRANS_MERCHANT_ID` | Midtrans | Merchant ID Midtrans (opsional). |
|
|
155
|
-
| `MIDTRANS_IS_PRODUCTION` | Midtrans | `true` untuk production, `false` untuk sandbox. |
|
|
156
|
-
| `DUITKU_API_KEY` | Duitku | API Key merchant Duitku. |
|
|
157
|
-
| `DUITKU_MERCHANT_CODE` | Duitku | Kode Merchant Duitku (misal: `D1234`). |
|
|
158
|
-
| `DUITKU_SANDBOX` | Duitku | `true` untuk sandbox Duitku. |
|
|
159
|
-
| `BUAYAR_PROJECT_ID` / `PG_PROJECT_ID` | Custom / Extra | Project ID untuk provider masa depan yang membutuhkan project scoping. |
|
|
160
|
-
| `BUAYAR_PUBLIC_KEY` / `BUAYAR_PRIVATE_KEY` | Custom / Extra | Public / Private asymmetric key jika dibutuhkan. |
|
|
161
|
-
|
|
162
|
-
---
|
|
163
|
-
|
|
164
|
-
## ๐ Panduan Penggunaan
|
|
165
|
-
|
|
166
|
-
### 1. Inisialisasi Klien (Zero-Config)
|
|
250
|
+
| `MIDTRANS_SERVER_KEY` / `MIDTRANS_CLIENT_KEY` | Midtrans | Server Key & Client Key |
|
|
251
|
+
| `DUITKU_API_KEY` / `DUITKU_MERCHANT_CODE` | Duitku | API Key & Merchant Code |
|
|
252
|
+
| `IPAYMU_API_KEY` / `IPAYMU_VA` | iPaymu | API Key & Nomor VA Merchant |
|
|
253
|
+
| `XENDIT_SECRET_KEY` / `XENDIT_WEBHOOK_TOKEN` | Xendit | Secret Key & Webhook Token |
|
|
254
|
+
| `DOKU_CLIENT_ID` / `DOKU_SECRET_KEY` | DOKU | Client ID & Secret Key |
|
|
255
|
+
| `PRISMALINK_MERCHANT_ID` / `PRISMALINK_SECRET_KEY` | PrismaLink | Merchant ID & Secret Key |
|
|
256
|
+
| `FASPAY_MERCHANT_ID` / `FASPAY_USER_ID` / `FASPAY_PASSWORD` | Faspay | Merchant ID, User ID & Password |
|
|
257
|
+
| `FASPAY_MERCHANT_NAME` | Faspay | Nama display merchant di halaman Faspay |
|
|
258
|
+
| `FINPAY_MERCHANT_ID` / `FINPAY_MERCHANT_KEY` | Finpay | Merchant ID & Merchant Key |
|
|
259
|
+
| `NICEPAY_IMID` / `NICEPAY_KEY` | Nicepay | iMid & Merchant Key |
|
|
260
|
+
| `OY_USERNAME` / `OY_API_KEY` | OY! Bisnis | Username & API Key |
|
|
261
|
+
| `STRIPE_SECRET_KEY` / `STRIPE_WEBHOOK_SECRET` / `STRIPE_PUBLIC_KEY` | Stripe | Secret Key, Webhook Secret & Publishable Key |
|
|
262
|
+
| `PAYPAL_CLIENT_ID` / `PAYPAL_CLIENT_SECRET` / `PAYPAL_WEBHOOK_ID` | PayPal | Client ID, Client Secret & Webhook ID |
|
|
263
|
+
| `ADYEN_API_KEY` / `ADYEN_MERCHANT_ACCOUNT` / `ADYEN_HMAC_KEY` | Adyen | API Key, Merchant Account & HMAC Key |
|
|
264
|
+
| `ADYEN_CLIENT_KEY` / `ADYEN_LIVE_URL_PREFIX` | Adyen | Client Key (frontend) & Live URL prefix (production) |
|
|
265
|
+
| `CHECKOUTCOM_SECRET_KEY` / `CHECKOUTCOM_PUBLIC_KEY` / `CHECKOUTCOM_WEBHOOK_SECRET` | Checkout.com | Secret Key, Public Key & Webhook Secret |
|
|
266
|
+
| `RAZORPAY_KEY_ID` / `RAZORPAY_KEY_SECRET` / `RAZORPAY_WEBHOOK_SECRET` | Razorpay | Key ID, Key Secret & Webhook Secret |
|
|
267
|
+
| `SQUARE_ACCESS_TOKEN` / `SQUARE_APPLICATION_ID` / `SQUARE_LOCATION_ID` | Square | Access Token, App ID & Location ID |
|
|
268
|
+
| `SQUARE_WEBHOOK_SIGNATURE_KEY` | Square | Signature Key untuk verifikasi webhook |
|
|
269
|
+
| `PAYU_POS_ID` / `PAYU_MD5_KEY` | PayU | POS ID (Merchant ID) & MD5 Key untuk webhook |
|
|
270
|
+
| `PAYU_OAUTH_CLIENT_ID` / `PAYU_OAUTH_CLIENT_SECRET` | PayU | OAuth2 Client ID & Secret untuk Bearer Token |
|
|
271
|
+
| `BRAINTREE_MERCHANT_ID` / `BRAINTREE_PUBLIC_KEY` / `BRAINTREE_PRIVATE_KEY` | Braintree | Merchant ID, Public Key & Private Key |
|
|
272
|
+
| `TWOCHECKOUT_MERCHANT_CODE` / `TWOCHECKOUT_SECRET_KEY` / `TWOCHECKOUT_SECRET_WORD` | 2Checkout | Merchant Code, Secret Key & Secret Word (IPN) |
|
|
273
|
+
|
|
274
|
+
### ๐ Panduan Penggunaan
|
|
275
|
+
|
|
276
|
+
#### 1. Inisialisasi (Zero-Config)
|
|
167
277
|
```typescript
|
|
168
278
|
import { buayar } from "@crediblemark/buayar";
|
|
169
|
-
|
|
170
279
|
// Otomatis membaca konfigurasi dari process.env
|
|
171
280
|
```
|
|
172
281
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
### 2. Mode Semi Integrasi (Redirect / Hosted Checkout)
|
|
176
|
-
Jika Anda ingin menyerahkan antarmuka pembayaran kepada halaman checkout bawaan Payment Gateway, cukup kosongkan parameter `paymentMethod`:
|
|
177
|
-
|
|
282
|
+
#### 2. Mode Semi Integrasi (Redirect / Hosted Checkout)
|
|
178
283
|
```typescript
|
|
179
|
-
import { buayar } from "@crediblemark/buayar";
|
|
180
|
-
|
|
181
284
|
const invoice = await buayar.createInvoice({
|
|
182
285
|
orderId: "ORDER-1001",
|
|
183
286
|
amount: 150000,
|
|
184
287
|
productDetails: "Langganan Paket Pro 1 Bulan",
|
|
185
|
-
customer: {
|
|
186
|
-
name: "Budi Santoso",
|
|
187
|
-
email: "budi@example.com",
|
|
188
|
-
phone: "081234567890",
|
|
189
|
-
},
|
|
288
|
+
customer: { name: "Budi Santoso", email: "budi@example.com" },
|
|
190
289
|
returnUrl: "https://myapp.com/orders/ORDER-1001",
|
|
290
|
+
// Tanpa paymentMethod = redirect ke halaman checkout PG
|
|
191
291
|
});
|
|
192
292
|
|
|
193
293
|
if (invoice.success) {
|
|
194
|
-
|
|
195
|
-
console.log("Redirect URL:", invoice.paymentUrl);
|
|
294
|
+
redirect(invoice.paymentUrl!);
|
|
196
295
|
}
|
|
197
296
|
```
|
|
198
297
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
### 3. Mode Full Integrasi (Custom Native UI / Direct API)
|
|
202
|
-
Jika Anda ingin membangun halaman checkout sendiri di dalam aplikasi tanpa redirect ke halaman luar:
|
|
203
|
-
|
|
204
|
-
#### Langkah A: Ambil Daftar Metode Pembayaran (Accordion-Ready)
|
|
298
|
+
#### 3. Mode Full Integrasi (Custom Native UI)
|
|
205
299
|
```typescript
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
//
|
|
209
|
-
console.log(result.categories);
|
|
210
|
-
/*
|
|
211
|
-
{
|
|
212
|
-
"Virtual Account": [
|
|
213
|
-
{ code: "bca_va", paymentName: "BCA Virtual Account", paymentImage: "...", totalFee: "IDR 4,000" },
|
|
214
|
-
{ code: "mandiri_va", paymentName: "Mandiri Bill Payment", ... }
|
|
215
|
-
],
|
|
216
|
-
"QRIS": [
|
|
217
|
-
{ code: "qris", paymentName: "QRIS Universal", paymentImage: "...", totalFee: "0.7%" }
|
|
218
|
-
],
|
|
219
|
-
"E-Wallet": [
|
|
220
|
-
{ code: "gopay", paymentName: "GoPay", ... },
|
|
221
|
-
{ code: "shopeepay", paymentName: "ShopeePay", ... }
|
|
222
|
-
]
|
|
223
|
-
}
|
|
224
|
-
*/
|
|
225
|
-
```
|
|
300
|
+
// Langkah A: Ambil daftar metode pembayaran (Accordion-Ready)
|
|
301
|
+
const { categories } = await buayar.getPaymentMethods({ amount: 150000 });
|
|
302
|
+
// categories: { "Virtual Account": [...], "QRIS": [...], "E-Wallet": [...] }
|
|
226
303
|
|
|
227
|
-
|
|
228
|
-
```typescript
|
|
229
|
-
// Contoh 1: Direct Virtual Account (BCA)
|
|
304
|
+
// Langkah B: Direct Charge dengan kode canonical
|
|
230
305
|
const vaInvoice = await buayar.createInvoice({
|
|
231
306
|
orderId: "ORDER-1002",
|
|
232
307
|
amount: 150000,
|
|
233
|
-
paymentMethod: "bca_va", //
|
|
308
|
+
paymentMethod: "bca_va", // kode canonical โ berlaku di semua provider
|
|
234
309
|
productDetails: "Topup Saldo",
|
|
235
310
|
customer: { name: "Budi", email: "budi@example.com" },
|
|
236
311
|
});
|
|
237
312
|
|
|
238
|
-
console.log("Nomor VA:", vaInvoice.vaNumber);
|
|
239
|
-
console.log("Bank:", vaInvoice.vaBank);
|
|
240
|
-
console.log("
|
|
241
|
-
|
|
242
|
-
// Contoh 2: Direct QRIS (Render ke Canvas / SVG QR)
|
|
243
|
-
const qrisInvoice = await buayar.createInvoice({
|
|
244
|
-
orderId: "ORDER-1003",
|
|
245
|
-
amount: 50000,
|
|
246
|
-
paymentMethod: "qris", // Canonical ID
|
|
247
|
-
productDetails: "Kopi Kenangan",
|
|
248
|
-
customer: { name: "Budi", email: "budi@example.com" },
|
|
249
|
-
});
|
|
250
|
-
|
|
251
|
-
console.log("Raw QRIS String (EMVCo):", qrisInvoice.qrString);
|
|
252
|
-
console.log("URL Gambar QR:", qrisInvoice.qrCodeUrl);
|
|
253
|
-
|
|
254
|
-
// Contoh 3: Gerai Retail (Indomaret / Alfamart)
|
|
255
|
-
const retailInvoice = await buayar.createInvoice({
|
|
256
|
-
orderId: "ORDER-1004",
|
|
257
|
-
amount: 100000,
|
|
258
|
-
paymentMethod: "indomaret",
|
|
259
|
-
productDetails: "Voucher Game",
|
|
260
|
-
customer: { name: "Budi", email: "budi@example.com" },
|
|
261
|
-
});
|
|
262
|
-
|
|
263
|
-
console.log("Kode Bayar Kasir:", retailInvoice.paymentCode);
|
|
313
|
+
console.log("Nomor VA:", vaInvoice.vaNumber); // "123456789012"
|
|
314
|
+
console.log("Bank:", vaInvoice.vaBank); // "bca"
|
|
315
|
+
console.log("QRIS:", vaInvoice.qrString); // Raw EMVCo string
|
|
264
316
|
```
|
|
265
317
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
### 4. Universal Webhook Handler
|
|
269
|
-
Tangani callback notifikasi dari PG manapun hanya dengan 1 endpoint universal:
|
|
270
|
-
|
|
318
|
+
#### 4. Universal Webhook Handler
|
|
271
319
|
```typescript
|
|
272
|
-
//
|
|
320
|
+
// Bekerja dengan Express, Elysia, Hono, Next.js App Router, dll.
|
|
273
321
|
app.post("/api/payment/webhook", async (req, res) => {
|
|
274
322
|
const result = await buayar.verifyWebhook(req.body, req.headers);
|
|
323
|
+
// Provider terdeteksi otomatis dari struktur payload
|
|
275
324
|
|
|
276
|
-
if (!result.isValid) {
|
|
277
|
-
return res.status(400).json({ error: "Invalid signature" });
|
|
278
|
-
}
|
|
325
|
+
if (!result.isValid) return res.status(400).json({ error: "Invalid signature" });
|
|
279
326
|
|
|
280
327
|
if (result.isPaid) {
|
|
281
|
-
console.log(`โ
Order ${result.orderId} senilai
|
|
282
|
-
//
|
|
283
|
-
} else if (result.isExpired) {
|
|
284
|
-
console.log(`โฐ Order ${result.orderId} telah kedaluwarsa.`);
|
|
328
|
+
console.log(`โ
Order ${result.orderId} senilai ${result.amount} telah LUNAS!`);
|
|
329
|
+
// Aktifkan langganan / kirim produk
|
|
285
330
|
}
|
|
286
331
|
|
|
287
|
-
// Balas respons OK ke gateway
|
|
288
332
|
return res.status(200).json({ status: "OK" });
|
|
289
333
|
});
|
|
290
334
|
```
|
|
291
335
|
|
|
292
|
-
|
|
336
|
+
#### 5. Zero-Code PG Switch
|
|
337
|
+
```env
|
|
338
|
+
# Ganti dari Midtrans ke Stripe โ tanpa ubah satu baris kode pun
|
|
339
|
+
PROVIDER_PG=stripe
|
|
340
|
+
STRIPE_SECRET_KEY=sk_live_...
|
|
341
|
+
STRIPE_WEBHOOK_SECRET=whsec_...
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
### ๐ท๏ธ Daftar Canonical Payment Methods
|
|
293
345
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
|
297
|
-
|
|
|
298
|
-
| **
|
|
299
|
-
| | `
|
|
300
|
-
|
|
|
301
|
-
| | `
|
|
302
|
-
| | `
|
|
303
|
-
| | `cimb_va` | `B1` | `bank_transfer (cimb)` |
|
|
304
|
-
| | `danamon_va` | `DM` | `bank_transfer (danamon)` |
|
|
305
|
-
| | `bsi_va` | `BS` | `bank_transfer (bsi)` |
|
|
306
|
-
| | `seabank_va` | `S1` | `bank_transfer (seabank)` |
|
|
307
|
-
| **QRIS** | `qris` | `SP` / `NQ` | `qris` |
|
|
308
|
-
| **E-Wallet** | `gopay` | `GP` | `gopay` |
|
|
309
|
-
| | `shopeepay` | `SA` | `shopeepay` |
|
|
310
|
-
| | `ovo` | `OV` | `ovo` |
|
|
311
|
-
| | `dana` | `DA` | `dana` |
|
|
312
|
-
| | `linkaja` | `LA` | `linkaja` |
|
|
313
|
-
| **Retail** | `alfamart` | `AL` | `cstore (alfamart)` |
|
|
314
|
-
| | `indomaret` | `IR` | `cstore (indomaret)` |
|
|
315
|
-
| **Kartu** | `credit_card` | `VC` | `credit_card` |
|
|
316
|
-
| **Paylater** | `kredivo` | `KV` | `kredivo` |
|
|
317
|
-
| | `akulaku` | `AT` | `akulaku` |
|
|
346
|
+
| Kategori | Canonical Code | Keterangan |
|
|
347
|
+
| :--- | :--- | :--- |
|
|
348
|
+
| **Virtual Account** | `bca_va`, `mandiri_va`, `bni_va`, `bri_va`, `permata_va`, `cimb_va`, `danamon_va`, `bsi_va`, `seabank_va` | Transfer bank via VA |
|
|
349
|
+
| **QRIS** | `qris`, `gopay_qris`, `shopeepay_qris`, `nobu_qris` | QRIS standar EMVCo |
|
|
350
|
+
| **E-Wallet** | `gopay`, `shopeepay`, `ovo`, `dana`, `linkaja`, `jenius` | Dompet digital |
|
|
351
|
+
| **Retail** | `alfamart`, `indomaret`, `pos` | Bayar di gerai retail |
|
|
352
|
+
| **Kartu Kredit** | `credit_card` | Visa, Mastercard, JCB, Amex |
|
|
353
|
+
| **Paylater** | `kredivo`, `akulaku`, `indodana` | Cicilan & paylater |
|
|
354
|
+
| **International** | `apple_pay`, `google_pay`, `paypal`, `klarna`, `sepa` | Metode internasional |
|
|
318
355
|
|
|
319
356
|
---
|
|
320
357
|
|
|
321
|
-
## ๐ Lisensi
|
|
358
|
+
## ๐ License / Lisensi
|
|
359
|
+
|
|
360
|
+
MIT License โ Copyright ยฉ 2026 Rasyiqi Crediblemark.
|
|
361
|
+
|
|
362
|
+
This project is licensed under the **MIT License**. You are free to use, modify, and distribute it in personal and commercial projects.
|
|
322
363
|
|
|
323
|
-
Proyek ini dilisensikan di bawah **MIT License**.
|
|
364
|
+
Proyek ini dilisensikan di bawah **MIT License**. Bebas digunakan, dimodifikasi, dan didistribusikan untuk keperluan personal maupun komersial.
|