@crediblemark/buayar 0.7.0 → 0.8.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 +74 -75
- package/dist/cli/index.js +1 -1
- package/dist/index.d.mts +139 -4
- package/dist/index.d.ts +139 -4
- package/dist/index.js +273 -137
- package/dist/index.mjs +273 -137
- package/docs/guide.md +53 -50
- package/docs/ipaymu.md +295 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -30,32 +30,32 @@
|
|
|
30
30
|
|
|
31
31
|
#### 🇮🇩 Indonesian (10)
|
|
32
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` |
|
|
33
|
+
| Provider | Status | Redirect | Direct API | Webhook | Client |
|
|
34
|
+
|---|:---:|:---:|:---:|:---:|:---:|
|
|
35
|
+
| Midtrans | - | ✅ Snap | ✅ Core API | SHA-512 | `MidtransClient` |
|
|
36
|
+
| Duitku | - | ✅ | ✅ | MD5 | `DuitkuClient` |
|
|
37
|
+
| iPaymu | Tested | ✅ | ✅ | 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
45
|
|
|
46
46
|
#### 🌍 International (9)
|
|
47
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` |
|
|
48
|
+
| Provider | Status | 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
59
|
|
|
60
60
|
### ⚙️ Environment Variables
|
|
61
61
|
|
|
@@ -93,30 +93,31 @@ buayar.supports("xendit", "checkBalance"); // true
|
|
|
93
93
|
buayar.supportsMethod("qris", "stripe"); // true
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
-
####
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
| `
|
|
101
|
-
|
|
|
102
|
-
|
|
|
103
|
-
|
|
|
104
|
-
|
|
|
105
|
-
|
|
|
106
|
-
|
|
|
107
|
-
|
|
|
108
|
-
|
|
|
109
|
-
|
|
|
110
|
-
|
|
|
111
|
-
|
|
|
112
|
-
|
|
|
113
|
-
|
|
|
114
|
-
|
|
|
115
|
-
|
|
|
116
|
-
|
|
|
117
|
-
|
|
|
118
|
-
|
|
|
119
|
-
|
|
|
96
|
+
#### Universal Credential Mapping (`BUAYAR_*`)
|
|
97
|
+
|
|
98
|
+
You don't need provider-specific variable names. Simply use unified **`BUAYAR_*`** variables:
|
|
99
|
+
|
|
100
|
+
| Provider | `BUAYAR_PROVIDER` | `BUAYAR_API_KEY` | `BUAYAR_MERCHANT_CODE` | `BUAYAR_CLIENT_KEY` / Extra |
|
|
101
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
102
|
+
| **Midtrans** | `midtrans` | Server Key | *(optional)* | Client Key |
|
|
103
|
+
| **Duitku** | `duitku` | API Key | Merchant Code | *(not needed)* |
|
|
104
|
+
| **iPaymu** | `ipaymu` | API Key | Virtual Account (VA) | *(not needed)* |
|
|
105
|
+
| **Xendit** | `xendit` | Secret Key | *(optional)* | Webhook Token (`BUAYAR_WEBHOOK_SECRET`) |
|
|
106
|
+
| **DOKU Jokul** | `doku` | Secret Key | Client ID / Merchant ID | Client ID |
|
|
107
|
+
| **PrismaLink** | `prismalink` | Secret Key | Merchant ID | *(not needed)* |
|
|
108
|
+
| **Faspay** | `faspay` | Password | Merchant ID | User ID |
|
|
109
|
+
| **Finpay** | `finpay` | Merchant Key | Merchant ID | *(not needed)* |
|
|
110
|
+
| **Nicepay** | `nicepay` | Server Key | I-MID | *(not needed)* |
|
|
111
|
+
| **OY! Bisnis** | `oy` | API Key | Username | Username |
|
|
112
|
+
| **Stripe** | `stripe` | Secret Key | *(not needed)* | Publishable Key / Webhook Secret |
|
|
113
|
+
| **PayPal** | `paypal` | Client Secret | Client ID | Client ID |
|
|
114
|
+
| **Adyen** | `adyen` | API Key | Merchant Account | Client Key / HMAC Key |
|
|
115
|
+
| **Checkout.com** | `checkoutcom` | Secret Key | *(not needed)* | Public Key / Webhook Secret |
|
|
116
|
+
| **Razorpay** | `razorpay` | Key Secret | Key ID | Key ID |
|
|
117
|
+
| **Square** | `square` | Access Token | App ID | Location ID (`BUAYAR_PROJECT_ID`) |
|
|
118
|
+
| **PayU** | `payu` | MD5 Key | POS ID | POS ID |
|
|
119
|
+
| **Braintree** | `braintree` | Private Key | Merchant ID | Public Key |
|
|
120
|
+
| **2Checkout** | `twocheckout` | Secret Key | Merchant Code | Secret Word (`BUAYAR_WEBHOOK_SECRET`) |
|
|
120
121
|
|
|
121
122
|
### 📖 Usage
|
|
122
123
|
|
|
@@ -225,7 +226,7 @@ BUAYAR_WEBHOOK_SECRET=whsec_...
|
|
|
225
226
|
|
|
226
227
|
* **Midtrans** — Snap API (Redirect/Popup) & Core API Direct Charge. Verifikasi SHA-512. `MidtransClient`.
|
|
227
228
|
* **Duitku** — Redirect Checkout & Direct Inquiry API. Verifikasi MD5. `DuitkuClient` (Disbursement, Inquiry Rekening, Saldo).
|
|
228
|
-
* **iPaymu** — Redirect & Direct Payment API v2. Verifikasi HMAC-SHA256. `IpaymuClient` (Cek Saldo, Cek Transaksi).
|
|
229
|
+
* **iPaymu** `[Tested]` — Redirect & Direct Payment API v2. Verifikasi HMAC-SHA256. `IpaymuClient` (Cek Saldo, Cek Transaksi, Histori, Bank List, Dynamic Methods, COD).
|
|
229
230
|
* **Xendit** — Invoice v2 & Payment Requests v3. Webhook Token. `XenditClient` (Saldo, Expire Invoice, Disbursement).
|
|
230
231
|
* **DOKU Jokul** — Checkout v1 & Direct API v2. HMAC-SHA256 + Digest. `DokuClient`.
|
|
231
232
|
* **PrismaLink** — Checkout Page & Direct API. SHA-256. `PrismalinkClient`.
|
|
@@ -266,33 +267,31 @@ BUAYAR_CALLBACK_URL=https://myapp.com/api/payment/webhook
|
|
|
266
267
|
BUAYAR_RETURN_URL=https://myapp.com/payment/finish
|
|
267
268
|
```
|
|
268
269
|
|
|
269
|
-
####
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
| `
|
|
274
|
-
|
|
|
275
|
-
|
|
|
276
|
-
|
|
|
277
|
-
|
|
|
278
|
-
|
|
|
279
|
-
|
|
|
280
|
-
| `
|
|
281
|
-
|
|
|
282
|
-
|
|
|
283
|
-
|
|
|
284
|
-
|
|
|
285
|
-
|
|
|
286
|
-
|
|
|
287
|
-
|
|
|
288
|
-
|
|
|
289
|
-
|
|
|
290
|
-
|
|
|
291
|
-
| `
|
|
292
|
-
|
|
|
293
|
-
|
|
|
294
|
-
| `BRAINTREE_MERCHANT_ID` / `BRAINTREE_PUBLIC_KEY` / `BRAINTREE_PRIVATE_KEY` | Braintree | Merchant ID, Public Key & Private Key |
|
|
295
|
-
| `TWOCHECKOUT_MERCHANT_CODE` / `TWOCHECKOUT_SECRET_KEY` / `TWOCHECKOUT_SECRET_WORD` | 2Checkout | Merchant Code, Secret Key & Secret Word (IPN) |
|
|
270
|
+
#### Pemetaan Kredensial ke Variabel Universal `BUAYAR_*`
|
|
271
|
+
|
|
272
|
+
Anda **tidak perlu** membuat nama variabel khusus per provider. Cukup gunakan set variabel seragam **`BUAYAR_*`**. Tabel berikut menunjukkan data apa dari dashboard masing-masing payment gateway yang perlu Anda masukkan ke variabel `BUAYAR_*`:
|
|
273
|
+
|
|
274
|
+
| Provider | `BUAYAR_PROVIDER` | `BUAYAR_API_KEY` | `BUAYAR_MERCHANT_CODE` | `BUAYAR_CLIENT_KEY` / Tambahan |
|
|
275
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
276
|
+
| **Midtrans** | `midtrans` | Server Key | *(opsional)* | Client Key |
|
|
277
|
+
| **Duitku** | `duitku` | API Key | Merchant Code | *(tidak perlu)* |
|
|
278
|
+
| **iPaymu** | `ipaymu` | API Key | Nomor Virtual Account (VA) | *(tidak perlu)* |
|
|
279
|
+
| **Xendit** | `xendit` | Secret Key | *(opsional)* | Webhook Token (`BUAYAR_WEBHOOK_SECRET`) |
|
|
280
|
+
| **DOKU Jokul** | `doku` | Secret Key | Client ID / Merchant ID | Client ID |
|
|
281
|
+
| **PrismaLink** | `prismalink` | Secret Key | Merchant ID | *(tidak perlu)* |
|
|
282
|
+
| **Faspay** | `faspay` | Password | Merchant ID | User ID |
|
|
283
|
+
| **Finpay** | `finpay` | Merchant Key | Merchant ID | *(tidak perlu)* |
|
|
284
|
+
| **Nicepay** | `nicepay` | Server Key | I-MID | *(tidak perlu)* |
|
|
285
|
+
| **OY! Bisnis** | `oy` | API Key | Username | Username |
|
|
286
|
+
| **Stripe** | `stripe` | Secret Key | *(tidak perlu)* | Publishable Key / Webhook Secret |
|
|
287
|
+
| **PayPal** | `paypal` | Client Secret | Client ID | Client ID |
|
|
288
|
+
| **Adyen** | `adyen` | API Key | Merchant Account | Client Key / HMAC Key |
|
|
289
|
+
| **Checkout.com** | `checkoutcom` | Secret Key | *(tidak perlu)* | Public Key / Webhook Secret |
|
|
290
|
+
| **Razorpay** | `razorpay` | Key Secret | Key ID | Key ID |
|
|
291
|
+
| **Square** | `square` | Access Token | App ID | Location ID (`BUAYAR_PROJECT_ID`) |
|
|
292
|
+
| **PayU** | `payu` | MD5 Key | POS ID | POS ID |
|
|
293
|
+
| **Braintree** | `braintree` | Private Key | Merchant ID | Public Key |
|
|
294
|
+
| **2Checkout** | `twocheckout` | Secret Key | Merchant Code | Secret Word (`BUAYAR_WEBHOOK_SECRET`) |
|
|
296
295
|
|
|
297
296
|
### 📖 Panduan Penggunaan
|
|
298
297
|
|
package/dist/cli/index.js
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type CanonicalPaymentMethod = "bca_va" | "mandiri_va" | "bni_va" | "bri_va" | "permata_va" | "cimb_va" | "danamon_va" | "bsi_va" | "seabank_va" | "muamalat_va" | "artajasa_va" | "qris" | "gopay_qris" | "shopeepay_qris" | "nobu_qris" | "gopay" | "shopeepay" | "ovo" | "dana" | "linkaja" | "jenius" | "alfamart" | "indomaret" | "pos" | "credit_card" | "kredivo" | "akulaku" | "indodana" | string;
|
|
1
|
+
type CanonicalPaymentMethod = "bca_va" | "mandiri_va" | "bni_va" | "bri_va" | "permata_va" | "cimb_va" | "danamon_va" | "bsi_va" | "seabank_va" | "muamalat_va" | "bag_va" | "artajasa_va" | "qris" | "gopay_qris" | "shopeepay_qris" | "nobu_qris" | "gopay" | "shopeepay" | "ovo" | "dana" | "linkaja" | "jenius" | "alfamart" | "indomaret" | "pos" | "credit_card" | "kredivo" | "akulaku" | "indodana" | string;
|
|
2
2
|
|
|
3
3
|
interface CustomerDetails {
|
|
4
4
|
name: string;
|
|
@@ -24,8 +24,39 @@ interface CreateInvoiceParams {
|
|
|
24
24
|
* Contoh: 'idr', 'usd', 'sgd'
|
|
25
25
|
*/
|
|
26
26
|
currency?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Pilihan pembebanan biaya transaksi (didukung iPaymu dll).
|
|
29
|
+
* 'MERCHANT' = biaya transaksi dipotong dari omset merchant (default).
|
|
30
|
+
* 'BUYER' = biaya transaksi ditambahkan ke total tagihan pembeli.
|
|
31
|
+
*/
|
|
32
|
+
feeDirection?: "MERCHANT" | "BUYER";
|
|
33
|
+
/**
|
|
34
|
+
* Mengaktifkan sistem Escrow (Rekening Bersama) jika didukung provider.
|
|
35
|
+
*/
|
|
36
|
+
escrow?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Rincian item produk (opsional, untuk multi-item cart / logistik).
|
|
39
|
+
*/
|
|
40
|
+
items?: Array<{
|
|
41
|
+
id?: string;
|
|
42
|
+
name: string;
|
|
43
|
+
price: number;
|
|
44
|
+
quantity: number;
|
|
45
|
+
description?: string;
|
|
46
|
+
weight?: number;
|
|
47
|
+
length?: number;
|
|
48
|
+
width?: number;
|
|
49
|
+
height?: number;
|
|
50
|
+
}>;
|
|
51
|
+
/**
|
|
52
|
+
* Nomor sub-account / child account tujuan split payment (didukung iPaymu dll).
|
|
53
|
+
* Pada iPaymu, diisi nomor Virtual Account (VA) child account milik agen / reseller / mitra.
|
|
54
|
+
*/
|
|
55
|
+
subAccountId?: string;
|
|
27
56
|
/** Parameter kustom tambahan untuk provider spesifik (opsional) */
|
|
28
57
|
providerParams?: any;
|
|
58
|
+
/** Konfigurasi atau data kustom tambahan untuk provider (opsional) */
|
|
59
|
+
extra?: Record<string, any>;
|
|
29
60
|
}
|
|
30
61
|
interface MandiriBillInfo {
|
|
31
62
|
billerCode?: string;
|
|
@@ -159,15 +190,16 @@ interface PaymentMethodItem {
|
|
|
159
190
|
/** Status ketersediaan channel */
|
|
160
191
|
isOnline: boolean;
|
|
161
192
|
/** Kategori grup untuk Accordion UI */
|
|
162
|
-
category: "Virtual Account" | "QRIS" | "E-Wallet" | "Retail / Gerai" | "Kartu Kredit" | "Paylater / Cicilan" | "Lainnya";
|
|
193
|
+
category: "Virtual Account" | "QRIS" | "E-Wallet" | "Retail / Gerai" | "Kartu Kredit" | "Paylater / Cicilan" | "Lainnya" | string;
|
|
163
194
|
}
|
|
164
195
|
interface PaymentMethod {
|
|
165
196
|
paymentMethod: string;
|
|
166
197
|
paymentName: string;
|
|
167
198
|
paymentImage: string;
|
|
168
199
|
totalFee: string;
|
|
169
|
-
category: "Virtual Account" | "QRIS" | "E-Wallet" | "Retail / Gerai" | "Kartu Kredit" | "Paylater / Cicilan" | "Lainnya";
|
|
200
|
+
category: "Virtual Account" | "QRIS" | "E-Wallet" | "Retail / Gerai" | "Kartu Kredit" | "Paylater / Cicilan" | "Lainnya" | string;
|
|
170
201
|
code?: string;
|
|
202
|
+
extra?: any;
|
|
171
203
|
feeDetail?: {
|
|
172
204
|
flat: number;
|
|
173
205
|
percent: number;
|
|
@@ -628,7 +660,110 @@ declare class IpaymuClient {
|
|
|
628
660
|
/**
|
|
629
661
|
* Cek detail transaksi iPaymu
|
|
630
662
|
*/
|
|
631
|
-
checkTransaction(transactionId: string): Promise<any>;
|
|
663
|
+
checkTransaction(transactionId: string | number): Promise<any>;
|
|
664
|
+
/**
|
|
665
|
+
* Ambil daftar channel pembayaran aktif milik merchant (Official v2: GET /payment-channels)
|
|
666
|
+
*/
|
|
667
|
+
getPaymentMethods(): Promise<any>;
|
|
668
|
+
/**
|
|
669
|
+
* Alias untuk getPaymentMethods (Official v2)
|
|
670
|
+
*/
|
|
671
|
+
getPaymentChannels(): Promise<any>;
|
|
672
|
+
/**
|
|
673
|
+
* Ambil riwayat transaksi merchant berpaginasi (Official v2: POST /history)
|
|
674
|
+
*/
|
|
675
|
+
getHistory(params?: {
|
|
676
|
+
page?: number;
|
|
677
|
+
limit?: number;
|
|
678
|
+
status?: number;
|
|
679
|
+
date?: string;
|
|
680
|
+
start_date?: string;
|
|
681
|
+
end_date?: string;
|
|
682
|
+
bulkId?: string[];
|
|
683
|
+
[key: string]: any;
|
|
684
|
+
}): Promise<any>;
|
|
685
|
+
/**
|
|
686
|
+
* Ambil daftar seluruh bank di Indonesia (Official v2: POST /banklist)
|
|
687
|
+
*/
|
|
688
|
+
getBankList(): Promise<any>;
|
|
689
|
+
/**
|
|
690
|
+
* Cari jangkauan area pengiriman COD (Official v2: GET /cod/area?area=keyword)
|
|
691
|
+
*/
|
|
692
|
+
getCodArea(area: string): Promise<any>;
|
|
693
|
+
/**
|
|
694
|
+
* Hitung tarif ongkir pengiriman COD (Official v2: POST /cod/shipping-calculate)
|
|
695
|
+
*/
|
|
696
|
+
getCodRate(params: {
|
|
697
|
+
pickup_area_id?: string | number;
|
|
698
|
+
destination_area_id?: string | number;
|
|
699
|
+
pickupArea?: string | number;
|
|
700
|
+
deliveryArea?: string | number;
|
|
701
|
+
weight: number;
|
|
702
|
+
amount?: number;
|
|
703
|
+
[key: string]: any;
|
|
704
|
+
}): Promise<any>;
|
|
705
|
+
/**
|
|
706
|
+
* Request pickup kurir COD (Official v2: POST /cod/pickup)
|
|
707
|
+
*/
|
|
708
|
+
getCodPickup(params: {
|
|
709
|
+
transaction_id?: string | number;
|
|
710
|
+
transactionId?: string | number;
|
|
711
|
+
pickup_date: string;
|
|
712
|
+
pickup_time: string;
|
|
713
|
+
pickup_vehicle: "Motor" | "Mobil" | string;
|
|
714
|
+
[key: string]: any;
|
|
715
|
+
}): Promise<any>;
|
|
716
|
+
/**
|
|
717
|
+
* Unduh label pengiriman / AWB COD (Official v2: GET /cod/download-label/:transaction_id)
|
|
718
|
+
*/
|
|
719
|
+
getCodAwb(transactionId: string | number): Promise<any>;
|
|
720
|
+
/**
|
|
721
|
+
* Lacak status pengiriman kurir COD berdasarkan no resi / AWB (Official v2: POST /cod/tracking)
|
|
722
|
+
*/
|
|
723
|
+
getCodTracking(params: string | {
|
|
724
|
+
awb: string;
|
|
725
|
+
transaction_id?: string | number;
|
|
726
|
+
transactionId?: string | number;
|
|
727
|
+
}): Promise<any>;
|
|
728
|
+
/**
|
|
729
|
+
* Ambil daftar seluruh provinsi di Indonesia
|
|
730
|
+
*/
|
|
731
|
+
getAreasProvince(): Promise<any>;
|
|
732
|
+
/**
|
|
733
|
+
* Ambil daftar kota / kabupaten berdasarkan ID provinsi
|
|
734
|
+
*/
|
|
735
|
+
getAreasCity(provinceId: string | number): Promise<any>;
|
|
736
|
+
/**
|
|
737
|
+
* Ambil daftar kecamatan berdasarkan ID kota / kabupaten
|
|
738
|
+
*/
|
|
739
|
+
getAreasDistrict(cityId: string | number): Promise<any>;
|
|
740
|
+
/**
|
|
741
|
+
* Ambil daftar kelurahan berdasarkan ID kecamatan
|
|
742
|
+
*/
|
|
743
|
+
getAreasVillage(districtId: string | number): Promise<any>;
|
|
744
|
+
/**
|
|
745
|
+
* Daftarkan agen / reseller / mitra baru untuk Split Payment (Single Register API: POST /api/v2/register)
|
|
746
|
+
* Mengembalikan VA child account yang siap digunakan untuk parameter `subAccountId` saat membuat transaksi.
|
|
747
|
+
*/
|
|
748
|
+
registerUser(params: {
|
|
749
|
+
name: string;
|
|
750
|
+
email: string;
|
|
751
|
+
phone: string;
|
|
752
|
+
password?: string;
|
|
753
|
+
[key: string]: any;
|
|
754
|
+
}): Promise<{
|
|
755
|
+
Status: number;
|
|
756
|
+
Success: boolean;
|
|
757
|
+
Message: string;
|
|
758
|
+
Data: {
|
|
759
|
+
Email: string;
|
|
760
|
+
Phone: string;
|
|
761
|
+
Va: string;
|
|
762
|
+
VaName: string;
|
|
763
|
+
IsNewUser: boolean;
|
|
764
|
+
Notes?: string;
|
|
765
|
+
};
|
|
766
|
+
}>;
|
|
632
767
|
}
|
|
633
768
|
|
|
634
769
|
interface XenditDisbursementParams {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type CanonicalPaymentMethod = "bca_va" | "mandiri_va" | "bni_va" | "bri_va" | "permata_va" | "cimb_va" | "danamon_va" | "bsi_va" | "seabank_va" | "muamalat_va" | "artajasa_va" | "qris" | "gopay_qris" | "shopeepay_qris" | "nobu_qris" | "gopay" | "shopeepay" | "ovo" | "dana" | "linkaja" | "jenius" | "alfamart" | "indomaret" | "pos" | "credit_card" | "kredivo" | "akulaku" | "indodana" | string;
|
|
1
|
+
type CanonicalPaymentMethod = "bca_va" | "mandiri_va" | "bni_va" | "bri_va" | "permata_va" | "cimb_va" | "danamon_va" | "bsi_va" | "seabank_va" | "muamalat_va" | "bag_va" | "artajasa_va" | "qris" | "gopay_qris" | "shopeepay_qris" | "nobu_qris" | "gopay" | "shopeepay" | "ovo" | "dana" | "linkaja" | "jenius" | "alfamart" | "indomaret" | "pos" | "credit_card" | "kredivo" | "akulaku" | "indodana" | string;
|
|
2
2
|
|
|
3
3
|
interface CustomerDetails {
|
|
4
4
|
name: string;
|
|
@@ -24,8 +24,39 @@ interface CreateInvoiceParams {
|
|
|
24
24
|
* Contoh: 'idr', 'usd', 'sgd'
|
|
25
25
|
*/
|
|
26
26
|
currency?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Pilihan pembebanan biaya transaksi (didukung iPaymu dll).
|
|
29
|
+
* 'MERCHANT' = biaya transaksi dipotong dari omset merchant (default).
|
|
30
|
+
* 'BUYER' = biaya transaksi ditambahkan ke total tagihan pembeli.
|
|
31
|
+
*/
|
|
32
|
+
feeDirection?: "MERCHANT" | "BUYER";
|
|
33
|
+
/**
|
|
34
|
+
* Mengaktifkan sistem Escrow (Rekening Bersama) jika didukung provider.
|
|
35
|
+
*/
|
|
36
|
+
escrow?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Rincian item produk (opsional, untuk multi-item cart / logistik).
|
|
39
|
+
*/
|
|
40
|
+
items?: Array<{
|
|
41
|
+
id?: string;
|
|
42
|
+
name: string;
|
|
43
|
+
price: number;
|
|
44
|
+
quantity: number;
|
|
45
|
+
description?: string;
|
|
46
|
+
weight?: number;
|
|
47
|
+
length?: number;
|
|
48
|
+
width?: number;
|
|
49
|
+
height?: number;
|
|
50
|
+
}>;
|
|
51
|
+
/**
|
|
52
|
+
* Nomor sub-account / child account tujuan split payment (didukung iPaymu dll).
|
|
53
|
+
* Pada iPaymu, diisi nomor Virtual Account (VA) child account milik agen / reseller / mitra.
|
|
54
|
+
*/
|
|
55
|
+
subAccountId?: string;
|
|
27
56
|
/** Parameter kustom tambahan untuk provider spesifik (opsional) */
|
|
28
57
|
providerParams?: any;
|
|
58
|
+
/** Konfigurasi atau data kustom tambahan untuk provider (opsional) */
|
|
59
|
+
extra?: Record<string, any>;
|
|
29
60
|
}
|
|
30
61
|
interface MandiriBillInfo {
|
|
31
62
|
billerCode?: string;
|
|
@@ -159,15 +190,16 @@ interface PaymentMethodItem {
|
|
|
159
190
|
/** Status ketersediaan channel */
|
|
160
191
|
isOnline: boolean;
|
|
161
192
|
/** Kategori grup untuk Accordion UI */
|
|
162
|
-
category: "Virtual Account" | "QRIS" | "E-Wallet" | "Retail / Gerai" | "Kartu Kredit" | "Paylater / Cicilan" | "Lainnya";
|
|
193
|
+
category: "Virtual Account" | "QRIS" | "E-Wallet" | "Retail / Gerai" | "Kartu Kredit" | "Paylater / Cicilan" | "Lainnya" | string;
|
|
163
194
|
}
|
|
164
195
|
interface PaymentMethod {
|
|
165
196
|
paymentMethod: string;
|
|
166
197
|
paymentName: string;
|
|
167
198
|
paymentImage: string;
|
|
168
199
|
totalFee: string;
|
|
169
|
-
category: "Virtual Account" | "QRIS" | "E-Wallet" | "Retail / Gerai" | "Kartu Kredit" | "Paylater / Cicilan" | "Lainnya";
|
|
200
|
+
category: "Virtual Account" | "QRIS" | "E-Wallet" | "Retail / Gerai" | "Kartu Kredit" | "Paylater / Cicilan" | "Lainnya" | string;
|
|
170
201
|
code?: string;
|
|
202
|
+
extra?: any;
|
|
171
203
|
feeDetail?: {
|
|
172
204
|
flat: number;
|
|
173
205
|
percent: number;
|
|
@@ -628,7 +660,110 @@ declare class IpaymuClient {
|
|
|
628
660
|
/**
|
|
629
661
|
* Cek detail transaksi iPaymu
|
|
630
662
|
*/
|
|
631
|
-
checkTransaction(transactionId: string): Promise<any>;
|
|
663
|
+
checkTransaction(transactionId: string | number): Promise<any>;
|
|
664
|
+
/**
|
|
665
|
+
* Ambil daftar channel pembayaran aktif milik merchant (Official v2: GET /payment-channels)
|
|
666
|
+
*/
|
|
667
|
+
getPaymentMethods(): Promise<any>;
|
|
668
|
+
/**
|
|
669
|
+
* Alias untuk getPaymentMethods (Official v2)
|
|
670
|
+
*/
|
|
671
|
+
getPaymentChannels(): Promise<any>;
|
|
672
|
+
/**
|
|
673
|
+
* Ambil riwayat transaksi merchant berpaginasi (Official v2: POST /history)
|
|
674
|
+
*/
|
|
675
|
+
getHistory(params?: {
|
|
676
|
+
page?: number;
|
|
677
|
+
limit?: number;
|
|
678
|
+
status?: number;
|
|
679
|
+
date?: string;
|
|
680
|
+
start_date?: string;
|
|
681
|
+
end_date?: string;
|
|
682
|
+
bulkId?: string[];
|
|
683
|
+
[key: string]: any;
|
|
684
|
+
}): Promise<any>;
|
|
685
|
+
/**
|
|
686
|
+
* Ambil daftar seluruh bank di Indonesia (Official v2: POST /banklist)
|
|
687
|
+
*/
|
|
688
|
+
getBankList(): Promise<any>;
|
|
689
|
+
/**
|
|
690
|
+
* Cari jangkauan area pengiriman COD (Official v2: GET /cod/area?area=keyword)
|
|
691
|
+
*/
|
|
692
|
+
getCodArea(area: string): Promise<any>;
|
|
693
|
+
/**
|
|
694
|
+
* Hitung tarif ongkir pengiriman COD (Official v2: POST /cod/shipping-calculate)
|
|
695
|
+
*/
|
|
696
|
+
getCodRate(params: {
|
|
697
|
+
pickup_area_id?: string | number;
|
|
698
|
+
destination_area_id?: string | number;
|
|
699
|
+
pickupArea?: string | number;
|
|
700
|
+
deliveryArea?: string | number;
|
|
701
|
+
weight: number;
|
|
702
|
+
amount?: number;
|
|
703
|
+
[key: string]: any;
|
|
704
|
+
}): Promise<any>;
|
|
705
|
+
/**
|
|
706
|
+
* Request pickup kurir COD (Official v2: POST /cod/pickup)
|
|
707
|
+
*/
|
|
708
|
+
getCodPickup(params: {
|
|
709
|
+
transaction_id?: string | number;
|
|
710
|
+
transactionId?: string | number;
|
|
711
|
+
pickup_date: string;
|
|
712
|
+
pickup_time: string;
|
|
713
|
+
pickup_vehicle: "Motor" | "Mobil" | string;
|
|
714
|
+
[key: string]: any;
|
|
715
|
+
}): Promise<any>;
|
|
716
|
+
/**
|
|
717
|
+
* Unduh label pengiriman / AWB COD (Official v2: GET /cod/download-label/:transaction_id)
|
|
718
|
+
*/
|
|
719
|
+
getCodAwb(transactionId: string | number): Promise<any>;
|
|
720
|
+
/**
|
|
721
|
+
* Lacak status pengiriman kurir COD berdasarkan no resi / AWB (Official v2: POST /cod/tracking)
|
|
722
|
+
*/
|
|
723
|
+
getCodTracking(params: string | {
|
|
724
|
+
awb: string;
|
|
725
|
+
transaction_id?: string | number;
|
|
726
|
+
transactionId?: string | number;
|
|
727
|
+
}): Promise<any>;
|
|
728
|
+
/**
|
|
729
|
+
* Ambil daftar seluruh provinsi di Indonesia
|
|
730
|
+
*/
|
|
731
|
+
getAreasProvince(): Promise<any>;
|
|
732
|
+
/**
|
|
733
|
+
* Ambil daftar kota / kabupaten berdasarkan ID provinsi
|
|
734
|
+
*/
|
|
735
|
+
getAreasCity(provinceId: string | number): Promise<any>;
|
|
736
|
+
/**
|
|
737
|
+
* Ambil daftar kecamatan berdasarkan ID kota / kabupaten
|
|
738
|
+
*/
|
|
739
|
+
getAreasDistrict(cityId: string | number): Promise<any>;
|
|
740
|
+
/**
|
|
741
|
+
* Ambil daftar kelurahan berdasarkan ID kecamatan
|
|
742
|
+
*/
|
|
743
|
+
getAreasVillage(districtId: string | number): Promise<any>;
|
|
744
|
+
/**
|
|
745
|
+
* Daftarkan agen / reseller / mitra baru untuk Split Payment (Single Register API: POST /api/v2/register)
|
|
746
|
+
* Mengembalikan VA child account yang siap digunakan untuk parameter `subAccountId` saat membuat transaksi.
|
|
747
|
+
*/
|
|
748
|
+
registerUser(params: {
|
|
749
|
+
name: string;
|
|
750
|
+
email: string;
|
|
751
|
+
phone: string;
|
|
752
|
+
password?: string;
|
|
753
|
+
[key: string]: any;
|
|
754
|
+
}): Promise<{
|
|
755
|
+
Status: number;
|
|
756
|
+
Success: boolean;
|
|
757
|
+
Message: string;
|
|
758
|
+
Data: {
|
|
759
|
+
Email: string;
|
|
760
|
+
Phone: string;
|
|
761
|
+
Va: string;
|
|
762
|
+
VaName: string;
|
|
763
|
+
IsNewUser: boolean;
|
|
764
|
+
Notes?: string;
|
|
765
|
+
};
|
|
766
|
+
}>;
|
|
632
767
|
}
|
|
633
768
|
|
|
634
769
|
interface XenditDisbursementParams {
|