@crediblemark/buayar 0.7.0 → 0.8.0

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 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 | Tested | ✅ Snap | ✅ Core API | SHA-512 | `MidtransClient` |
36
+ | Duitku | Tested | ✅ | ✅ | MD5 | `DuitkuClient` |
37
+ | iPaymu | Tested | ✅ | ✅ | HMAC-SHA256 | `IpaymuClient` |
38
+ | Xendit | Tested | ✅ Invoice v2 | ✅ Payments v3 | Token | `XenditClient` |
39
+ | DOKU Jokul | Tested | ✅ v1 | ✅ v2 | HMAC-SHA256 | `DokuClient` |
40
+ | PrismaLink | Tested | ✅ | ✅ | SHA-256 | `PrismalinkClient` |
41
+ | Faspay | Tested | ✅ | ✅ | SHA1(MD5) | `FaspayClient` |
42
+ | Finpay | Tested | ✅ | ✅ | HMAC-SHA512 | `FinpayClient` |
43
+ | Nicepay | Tested | ✅ | ✅ | SHA-256 | `NicepayClient` |
44
+ | OY! Bisnis | Tested | ✅ | ✅ | 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 | Tested | ✅ Checkout Sessions | ✅ Payment Intents | HMAC-SHA256 | `StripeClient` |
51
+ | PayPal | Tested | ✅ Orders v2 | ✅ Capture | OAuth2 | `PaypalClient` |
52
+ | Adyen | Tested | ✅ Sessions v68 | ✅ Payments v68 | HMAC-SHA256 | `AdyenClient` |
53
+ | Checkout.com | Tested | ✅ Payment Links | ✅ Payments API | HMAC-SHA256 | `CheckoutComClient` |
54
+ | Razorpay | Tested | ✅ Payment Links | ✅ Orders API | HMAC-SHA256 | `RazorpayClient` |
55
+ | Square | Tested | ✅ Payment Links | ✅ Payments API | HMAC-SHA256 | `SquareClient` |
56
+ | PayU | Tested | ✅ Orders v2.1 | ✅ Pay Methods | MD5/SHA-256 | `PayuClient` |
57
+ | Braintree | Tested | ✅ Drop-in UI Token | ✅ Transaction API | SHA1 HMAC | `BraintreeClient` |
58
+ | 2Checkout | Tested | ✅ 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
- #### Provider-Specific Variables
97
-
98
- | Variable | Provider | Description |
99
- | :--- | :--- | :--- |
100
- | `MIDTRANS_SERVER_KEY` | Midtrans | Server Key |
101
- | `MIDTRANS_CLIENT_KEY` | Midtrans | Client Key (frontend) |
102
- | `DUITKU_API_KEY` / `DUITKU_MERCHANT_CODE` | Duitku | API Key & Merchant Code |
103
- | `IPAYMU_API_KEY` / `IPAYMU_VA` | iPaymu | API Key & VA number |
104
- | `XENDIT_SECRET_KEY` / `XENDIT_WEBHOOK_TOKEN` | Xendit | Secret Key & Webhook Token |
105
- | `DOKU_CLIENT_ID` / `DOKU_SECRET_KEY` | DOKU | Client ID & Secret Key |
106
- | `PRISMALINK_MERCHANT_ID` / `PRISMALINK_SECRET_KEY` | PrismaLink | Merchant ID & Secret Key |
107
- | `FASPAY_MERCHANT_ID` / `FASPAY_USER_ID` / `FASPAY_PASSWORD` | Faspay | Merchant ID, User ID & Password |
108
- | `FINPAY_MERCHANT_ID` / `FINPAY_MERCHANT_KEY` | Finpay | Merchant ID & Key |
109
- | `NICEPAY_IMID` / `NICEPAY_KEY` | Nicepay | iMid & Merchant Key |
110
- | `OY_USERNAME` / `OY_API_KEY` | OY! Bisnis | Username & API Key |
111
- | `STRIPE_SECRET_KEY` / `STRIPE_WEBHOOK_SECRET` / `STRIPE_PUBLIC_KEY` | Stripe | Secret, Webhook Secret, Publishable Key |
112
- | `PAYPAL_CLIENT_ID` / `PAYPAL_CLIENT_SECRET` / `PAYPAL_WEBHOOK_ID` | PayPal | OAuth2 Credentials & Webhook ID |
113
- | `ADYEN_API_KEY` / `ADYEN_MERCHANT_ACCOUNT` / `ADYEN_HMAC_KEY` | Adyen | API Key, Merchant Account & HMAC Key |
114
- | `CHECKOUTCOM_SECRET_KEY` / `CHECKOUTCOM_PUBLIC_KEY` / `CHECKOUTCOM_WEBHOOK_SECRET` | Checkout.com | Secret, Public Key & Webhook Secret |
115
- | `RAZORPAY_KEY_ID` / `RAZORPAY_KEY_SECRET` / `RAZORPAY_WEBHOOK_SECRET` | Razorpay | Key ID, Key Secret & Webhook Secret |
116
- | `SQUARE_ACCESS_TOKEN` / `SQUARE_APPLICATION_ID` / `SQUARE_LOCATION_ID` | Square | Access Token, App ID & Location ID |
117
- | `PAYU_POS_ID` / `PAYU_MD5_KEY` / `PAYU_OAUTH_CLIENT_ID` / `PAYU_OAUTH_CLIENT_SECRET` | PayU | POS ID, MD5 Key & OAuth2 Credentials |
118
- | `BRAINTREE_MERCHANT_ID` / `BRAINTREE_PUBLIC_KEY` / `BRAINTREE_PRIVATE_KEY` | Braintree | Merchant ID, Public & Private Key |
119
- | `TWOCHECKOUT_MERCHANT_CODE` / `TWOCHECKOUT_SECRET_KEY` / `TWOCHECKOUT_SECRET_WORD` | 2Checkout | Merchant Code, Secret Key & IPN Word |
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
- #### Kamus Variabel Lengkap Spesifik Provider
270
-
271
- | Variabel `.env` | Provider | Keterangan |
272
- | :--- | :--- | :--- |
273
- | `MIDTRANS_SERVER_KEY` / `MIDTRANS_CLIENT_KEY` | Midtrans | Server Key & Client Key |
274
- | `DUITKU_API_KEY` / `DUITKU_MERCHANT_CODE` | Duitku | API Key & Merchant Code |
275
- | `IPAYMU_API_KEY` / `IPAYMU_VA` | iPaymu | API Key & Nomor VA Merchant |
276
- | `XENDIT_SECRET_KEY` / `XENDIT_WEBHOOK_TOKEN` | Xendit | Secret Key & Webhook Token |
277
- | `DOKU_CLIENT_ID` / `DOKU_SECRET_KEY` | DOKU | Client ID & Secret Key |
278
- | `PRISMALINK_MERCHANT_ID` / `PRISMALINK_SECRET_KEY` | PrismaLink | Merchant ID & Secret Key |
279
- | `FASPAY_MERCHANT_ID` / `FASPAY_USER_ID` / `FASPAY_PASSWORD` | Faspay | Merchant ID, User ID & Password |
280
- | `FASPAY_MERCHANT_NAME` | Faspay | Nama display merchant di halaman Faspay |
281
- | `FINPAY_MERCHANT_ID` / `FINPAY_MERCHANT_KEY` | Finpay | Merchant ID & Merchant Key |
282
- | `NICEPAY_IMID` / `NICEPAY_KEY` | Nicepay | iMid & Merchant Key |
283
- | `OY_USERNAME` / `OY_API_KEY` | OY! Bisnis | Username & API Key |
284
- | `STRIPE_SECRET_KEY` / `STRIPE_WEBHOOK_SECRET` / `STRIPE_PUBLIC_KEY` | Stripe | Secret Key, Webhook Secret & Publishable Key |
285
- | `PAYPAL_CLIENT_ID` / `PAYPAL_CLIENT_SECRET` / `PAYPAL_WEBHOOK_ID` | PayPal | Client ID, Client Secret & Webhook ID |
286
- | `ADYEN_API_KEY` / `ADYEN_MERCHANT_ACCOUNT` / `ADYEN_HMAC_KEY` | Adyen | API Key, Merchant Account & HMAC Key |
287
- | `ADYEN_CLIENT_KEY` / `ADYEN_LIVE_URL_PREFIX` | Adyen | Client Key (frontend) & Live URL prefix (production) |
288
- | `CHECKOUTCOM_SECRET_KEY` / `CHECKOUTCOM_PUBLIC_KEY` / `CHECKOUTCOM_WEBHOOK_SECRET` | Checkout.com | Secret Key, Public Key & Webhook Secret |
289
- | `RAZORPAY_KEY_ID` / `RAZORPAY_KEY_SECRET` / `RAZORPAY_WEBHOOK_SECRET` | Razorpay | Key ID, Key Secret & Webhook Secret |
290
- | `SQUARE_ACCESS_TOKEN` / `SQUARE_APPLICATION_ID` / `SQUARE_LOCATION_ID` | Square | Access Token, App ID & Location ID |
291
- | `SQUARE_WEBHOOK_SIGNATURE_KEY` | Square | Signature Key untuk verifikasi webhook |
292
- | `PAYU_POS_ID` / `PAYU_MD5_KEY` | PayU | POS ID (Merchant ID) & MD5 Key untuk webhook |
293
- | `PAYU_OAUTH_CLIENT_ID` / `PAYU_OAUTH_CLIENT_SECRET` | PayU | OAuth2 Client ID & Secret untuk Bearer Token |
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
@@ -484,7 +484,7 @@ function printScaffoldSummary(result) {
484
484
  }
485
485
 
486
486
  // src/cli/index.ts
487
- var VERSION = "0.7.0";
487
+ var VERSION = "0.8.0";
488
488
  function parseArgs(argv) {
489
489
  const flags = [];
490
490
  const rest = [];
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,34 @@ 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
+ }>;
27
51
  /** Parameter kustom tambahan untuk provider spesifik (opsional) */
28
52
  providerParams?: any;
53
+ /** Konfigurasi atau data kustom tambahan untuk provider (opsional) */
54
+ extra?: Record<string, any>;
29
55
  }
30
56
  interface MandiriBillInfo {
31
57
  billerCode?: string;
@@ -159,15 +185,16 @@ interface PaymentMethodItem {
159
185
  /** Status ketersediaan channel */
160
186
  isOnline: boolean;
161
187
  /** Kategori grup untuk Accordion UI */
162
- category: "Virtual Account" | "QRIS" | "E-Wallet" | "Retail / Gerai" | "Kartu Kredit" | "Paylater / Cicilan" | "Lainnya";
188
+ category: "Virtual Account" | "QRIS" | "E-Wallet" | "Retail / Gerai" | "Kartu Kredit" | "Paylater / Cicilan" | "Lainnya" | string;
163
189
  }
164
190
  interface PaymentMethod {
165
191
  paymentMethod: string;
166
192
  paymentName: string;
167
193
  paymentImage: string;
168
194
  totalFee: string;
169
- category: "Virtual Account" | "QRIS" | "E-Wallet" | "Retail / Gerai" | "Kartu Kredit" | "Paylater / Cicilan" | "Lainnya";
195
+ category: "Virtual Account" | "QRIS" | "E-Wallet" | "Retail / Gerai" | "Kartu Kredit" | "Paylater / Cicilan" | "Lainnya" | string;
170
196
  code?: string;
197
+ extra?: any;
171
198
  feeDetail?: {
172
199
  flat: number;
173
200
  percent: number;
@@ -628,7 +655,55 @@ declare class IpaymuClient {
628
655
  /**
629
656
  * Cek detail transaksi iPaymu
630
657
  */
631
- checkTransaction(transactionId: string): Promise<any>;
658
+ checkTransaction(transactionId: string | number): Promise<any>;
659
+ /**
660
+ * Ambil daftar channel pembayaran aktif milik merchant
661
+ */
662
+ getPaymentMethods(): Promise<any>;
663
+ /**
664
+ * Ambil riwayat transaksi merchant berpaginasi
665
+ */
666
+ getHistory(params?: {
667
+ page?: number;
668
+ limit?: number;
669
+ status?: number;
670
+ date?: string;
671
+ start_date?: string;
672
+ end_date?: string;
673
+ bulkId?: string[];
674
+ }): Promise<any>;
675
+ /**
676
+ * Ambil daftar seluruh bank di Indonesia
677
+ */
678
+ getBankList(): Promise<any>;
679
+ /**
680
+ * Ambil jangkauan area pengiriman COD
681
+ */
682
+ getCodArea(postalCode?: string): Promise<any>;
683
+ /**
684
+ * Hitung tarif ongkir pengiriman COD
685
+ */
686
+ getCodRate(params: {
687
+ pickupArea: string;
688
+ deliveryArea: string;
689
+ weight: number;
690
+ height?: number;
691
+ length?: number;
692
+ width?: number;
693
+ [key: string]: any;
694
+ }): Promise<any>;
695
+ /**
696
+ * Request pickup kurir COD
697
+ */
698
+ getCodPickup(params: any): Promise<any>;
699
+ /**
700
+ * Ambil nomor resi / AWB pengiriman COD
701
+ */
702
+ getCodAwb(transactionId: string | number): Promise<any>;
703
+ /**
704
+ * Lacak status pengiriman kurir berdasarkan no resi / AWB
705
+ */
706
+ getCodTracking(awb: string): Promise<any>;
632
707
  }
633
708
 
634
709
  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,34 @@ 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
+ }>;
27
51
  /** Parameter kustom tambahan untuk provider spesifik (opsional) */
28
52
  providerParams?: any;
53
+ /** Konfigurasi atau data kustom tambahan untuk provider (opsional) */
54
+ extra?: Record<string, any>;
29
55
  }
30
56
  interface MandiriBillInfo {
31
57
  billerCode?: string;
@@ -159,15 +185,16 @@ interface PaymentMethodItem {
159
185
  /** Status ketersediaan channel */
160
186
  isOnline: boolean;
161
187
  /** Kategori grup untuk Accordion UI */
162
- category: "Virtual Account" | "QRIS" | "E-Wallet" | "Retail / Gerai" | "Kartu Kredit" | "Paylater / Cicilan" | "Lainnya";
188
+ category: "Virtual Account" | "QRIS" | "E-Wallet" | "Retail / Gerai" | "Kartu Kredit" | "Paylater / Cicilan" | "Lainnya" | string;
163
189
  }
164
190
  interface PaymentMethod {
165
191
  paymentMethod: string;
166
192
  paymentName: string;
167
193
  paymentImage: string;
168
194
  totalFee: string;
169
- category: "Virtual Account" | "QRIS" | "E-Wallet" | "Retail / Gerai" | "Kartu Kredit" | "Paylater / Cicilan" | "Lainnya";
195
+ category: "Virtual Account" | "QRIS" | "E-Wallet" | "Retail / Gerai" | "Kartu Kredit" | "Paylater / Cicilan" | "Lainnya" | string;
170
196
  code?: string;
197
+ extra?: any;
171
198
  feeDetail?: {
172
199
  flat: number;
173
200
  percent: number;
@@ -628,7 +655,55 @@ declare class IpaymuClient {
628
655
  /**
629
656
  * Cek detail transaksi iPaymu
630
657
  */
631
- checkTransaction(transactionId: string): Promise<any>;
658
+ checkTransaction(transactionId: string | number): Promise<any>;
659
+ /**
660
+ * Ambil daftar channel pembayaran aktif milik merchant
661
+ */
662
+ getPaymentMethods(): Promise<any>;
663
+ /**
664
+ * Ambil riwayat transaksi merchant berpaginasi
665
+ */
666
+ getHistory(params?: {
667
+ page?: number;
668
+ limit?: number;
669
+ status?: number;
670
+ date?: string;
671
+ start_date?: string;
672
+ end_date?: string;
673
+ bulkId?: string[];
674
+ }): Promise<any>;
675
+ /**
676
+ * Ambil daftar seluruh bank di Indonesia
677
+ */
678
+ getBankList(): Promise<any>;
679
+ /**
680
+ * Ambil jangkauan area pengiriman COD
681
+ */
682
+ getCodArea(postalCode?: string): Promise<any>;
683
+ /**
684
+ * Hitung tarif ongkir pengiriman COD
685
+ */
686
+ getCodRate(params: {
687
+ pickupArea: string;
688
+ deliveryArea: string;
689
+ weight: number;
690
+ height?: number;
691
+ length?: number;
692
+ width?: number;
693
+ [key: string]: any;
694
+ }): Promise<any>;
695
+ /**
696
+ * Request pickup kurir COD
697
+ */
698
+ getCodPickup(params: any): Promise<any>;
699
+ /**
700
+ * Ambil nomor resi / AWB pengiriman COD
701
+ */
702
+ getCodAwb(transactionId: string | number): Promise<any>;
703
+ /**
704
+ * Lacak status pengiriman kurir berdasarkan no resi / AWB
705
+ */
706
+ getCodTracking(awb: string): Promise<any>;
632
707
  }
633
708
 
634
709
  interface XenditDisbursementParams {
package/dist/index.js CHANGED
@@ -287,6 +287,9 @@ var CANONICAL_TO_IPAYMU = {
287
287
  permata_va: { paymentMethod: "va", paymentChannel: "permata" },
288
288
  danamon_va: { paymentMethod: "va", paymentChannel: "danamon" },
289
289
  bsi_va: { paymentMethod: "va", paymentChannel: "bsi" },
290
+ bag_va: { paymentMethod: "va", paymentChannel: "bag" },
291
+ muamalat_va: { paymentMethod: "va", paymentChannel: "bmi" },
292
+ bmi_va: { paymentMethod: "va", paymentChannel: "bmi" },
290
293
  qris: { paymentMethod: "qris", paymentChannel: "mpm" },
291
294
  gopay_qris: { paymentMethod: "qris", paymentChannel: "mpm" },
292
295
  shopeepay_qris: { paymentMethod: "qris", paymentChannel: "mpm" },
@@ -1744,35 +1747,48 @@ var IpaymuProvider = class extends BasePaymentProvider {
1744
1747
  const baseUrl = this.getBaseUrl(sandbox);
1745
1748
  const endpoint = isDirect ? "/payment/direct" : "/payment";
1746
1749
  const url = `${baseUrl}${endpoint}`;
1750
+ const notifyUrl = callbackUrl || config.callbackUrl || "https://localhost/callback";
1751
+ const redirectUrl = returnUrl || config.returnUrl || "https://localhost/return";
1752
+ const feeDirection = params.feeDirection || params.extra?.feeDirection || config.extra?.feeDirection;
1753
+ const escrow = params.escrow !== void 0 ? params.escrow : params.extra?.escrow !== void 0 ? params.extra?.escrow : config.extra?.escrow;
1747
1754
  let payload;
1748
1755
  if (isDirect) {
1749
1756
  payload = {
1750
1757
  name: customer.name,
1751
1758
  email: customer.email,
1752
- phone: customer.phone || "",
1759
+ phone: customer.phone || "081234567890",
1753
1760
  amount: integerAmount,
1754
- notifyUrl: callbackUrl || config.callbackUrl || "",
1761
+ notifyUrl,
1755
1762
  expired: 24,
1756
1763
  expiredType: "hours",
1757
1764
  comments: productDetails,
1758
1765
  referenceId: orderId,
1759
1766
  paymentMethod: ipaymuMethod.paymentMethod,
1760
1767
  ...ipaymuMethod.paymentChannel ? { paymentChannel: ipaymuMethod.paymentChannel } : {},
1768
+ ...feeDirection ? { feeDirection } : {},
1769
+ ...escrow !== void 0 ? { escrow } : {},
1761
1770
  ...params.providerParams
1762
1771
  };
1763
1772
  } else {
1773
+ const hasItems = params.items && params.items.length > 0;
1774
+ const product = hasItems ? params.items.map((i) => i.name) : [productDetails.length > 50 ? productDetails.substring(0, 47) + "..." : productDetails];
1775
+ const qty = hasItems ? params.items.map((i) => i.quantity) : [1];
1776
+ const price = hasItems ? params.items.map((i) => Math.round(i.price)) : [integerAmount];
1777
+ const description = hasItems ? params.items.map((i) => i.description || i.name) : [productDetails];
1764
1778
  payload = {
1765
- product: [productDetails.length > 50 ? productDetails.substring(0, 47) + "..." : productDetails],
1766
- qty: [1],
1767
- price: [integerAmount],
1768
- description: [productDetails],
1769
- returnUrl: returnUrl || config.returnUrl || "",
1770
- notifyUrl: callbackUrl || config.callbackUrl || "",
1771
- cancelUrl: returnUrl || config.returnUrl || "",
1779
+ product,
1780
+ qty,
1781
+ price,
1782
+ description,
1783
+ returnUrl: redirectUrl,
1784
+ notifyUrl,
1785
+ cancelUrl: redirectUrl,
1772
1786
  referenceId: orderId,
1773
1787
  buyerName: customer.name,
1774
1788
  buyerEmail: customer.email,
1775
- buyerPhone: customer.phone || "",
1789
+ buyerPhone: customer.phone || "081234567890",
1790
+ ...feeDirection ? { feeDirection } : {},
1791
+ ...escrow !== void 0 ? { escrow } : {},
1776
1792
  ...params.providerParams
1777
1793
  };
1778
1794
  }
@@ -1812,8 +1828,8 @@ var IpaymuProvider = class extends BasePaymentProvider {
1812
1828
  provider: "ipaymu",
1813
1829
  orderId,
1814
1830
  amount: integerAmount,
1815
- reference: resData.TransactionId ? String(resData.TransactionId) : String(resData.SessionId || ""),
1816
- paymentUrl: resData.Url,
1831
+ reference: resData.TransactionId ? String(resData.TransactionId) : String(resData.SessionId || resData.SessionID || ""),
1832
+ paymentUrl: resData.Url || resData.url,
1817
1833
  rawResponse: data
1818
1834
  };
1819
1835
  if (resData.PaymentNo) {
@@ -1872,6 +1888,88 @@ var IpaymuProvider = class extends BasePaymentProvider {
1872
1888
  };
1873
1889
  }
1874
1890
  async getPaymentMethods(params, config) {
1891
+ const va = config.merchantCode || config.merchantId || "";
1892
+ const apiKey = config.apiKey || "";
1893
+ const sandbox = !!config.sandbox;
1894
+ if (va && apiKey) {
1895
+ try {
1896
+ const url = `${this.getBaseUrl(sandbox)}/payment-method-list`;
1897
+ const payload = { account: va };
1898
+ const { signature, timestamp } = generateIpaymuSignature("POST", va, apiKey, payload);
1899
+ const response = await fetch(url, {
1900
+ method: "POST",
1901
+ headers: {
1902
+ "Content-Type": "application/json",
1903
+ "Accept": "application/json",
1904
+ "va": va,
1905
+ "signature": signature,
1906
+ "timestamp": timestamp
1907
+ },
1908
+ body: JSON.stringify(payload)
1909
+ });
1910
+ const data = await response.json().catch(() => null);
1911
+ if (response.ok && data?.Data && Array.isArray(data.Data)) {
1912
+ const methods = [];
1913
+ const categories2 = {};
1914
+ for (const group of data.Data) {
1915
+ const groupCode = (group.Code || "").toLowerCase();
1916
+ const groupName = group.Name || group.Description || "Lainnya";
1917
+ const channels = group.Channels || [];
1918
+ let category = "Lainnya";
1919
+ if (groupCode === "va") category = "Virtual Account";
1920
+ else if (groupCode === "cstore") category = "Retail / Gerai";
1921
+ else if (groupCode === "qris") category = "QRIS";
1922
+ else if (groupCode === "cc") category = "Kartu Kredit";
1923
+ else if (groupCode === "paylater") category = "Paylater / Cicilan";
1924
+ else if (groupCode === "cod") category = "COD";
1925
+ else category = groupName;
1926
+ for (const ch of channels) {
1927
+ const chCode = (ch.Code || "").toLowerCase();
1928
+ let canonicalCode = chCode;
1929
+ if (groupCode === "va") {
1930
+ canonicalCode = chCode === "bag" ? "bag_va" : chCode === "bmi" ? "muamalat_va" : `${chCode}_va`;
1931
+ } else if (groupCode === "cc") {
1932
+ canonicalCode = "credit_card";
1933
+ }
1934
+ let totalFee = "-";
1935
+ if (ch.TransactionFee) {
1936
+ if (ch.TransactionFee.ActualFeeType === "PERCENT") {
1937
+ totalFee = `${ch.TransactionFee.ActualFee}%`;
1938
+ } else if (ch.TransactionFee.ActualFee !== void 0) {
1939
+ totalFee = `IDR ${Number(ch.TransactionFee.ActualFee).toLocaleString()}`;
1940
+ }
1941
+ }
1942
+ const pm = {
1943
+ paymentMethod: canonicalCode,
1944
+ code: canonicalCode,
1945
+ paymentName: ch.Name || ch.Description || canonicalCode,
1946
+ paymentImage: `https://my.ipaymu.com/images/banks/${chCode}.png`,
1947
+ totalFee,
1948
+ category,
1949
+ extra: {
1950
+ healthStatus: ch.HealthStatus,
1951
+ instructionsDoc: ch.PaymentInstructionsDoc,
1952
+ feeDetail: ch.TransactionFee
1953
+ }
1954
+ };
1955
+ methods.push(pm);
1956
+ if (!categories2[category]) categories2[category] = [];
1957
+ categories2[category].push(pm);
1958
+ }
1959
+ }
1960
+ if (methods.length > 0) {
1961
+ return {
1962
+ success: true,
1963
+ provider: "ipaymu",
1964
+ methods,
1965
+ categories: categories2,
1966
+ rawResponse: data
1967
+ };
1968
+ }
1969
+ }
1970
+ } catch (err) {
1971
+ }
1972
+ }
1875
1973
  const staticMethods = [
1876
1974
  {
1877
1975
  paymentMethod: "bca_va",
@@ -1937,6 +2035,22 @@ var IpaymuProvider = class extends BasePaymentProvider {
1937
2035
  totalFee: "IDR 3,500",
1938
2036
  category: "Virtual Account"
1939
2037
  },
2038
+ {
2039
+ paymentMethod: "bag_va",
2040
+ code: "bag_va",
2041
+ paymentName: "Bank Artha Graha Virtual Account",
2042
+ paymentImage: "https://my.ipaymu.com/images/banks/bag.png",
2043
+ totalFee: "IDR 3,500",
2044
+ category: "Virtual Account"
2045
+ },
2046
+ {
2047
+ paymentMethod: "muamalat_va",
2048
+ code: "muamalat_va",
2049
+ paymentName: "Bank Muamalat Virtual Account",
2050
+ paymentImage: "https://my.ipaymu.com/images/banks/bmi.png",
2051
+ totalFee: "IDR 3,500",
2052
+ category: "Virtual Account"
2053
+ },
1940
2054
  {
1941
2055
  paymentMethod: "qris",
1942
2056
  code: "qris",
@@ -2038,11 +2152,14 @@ var IpaymuProvider = class extends BasePaymentProvider {
2038
2152
  };
2039
2153
  }
2040
2154
  const txData = data.Data || {};
2041
- const statusText = (txData.Status || txData.status || "").toString().toLowerCase();
2042
- const isPaid = statusText === "berhasil" || statusText === "success" || txData.StatusCode === 1;
2043
- const isPending = statusText === "pending" || txData.StatusCode === 0;
2044
- const isFailed = !isPaid && !isPending;
2045
- const isExpired = statusText === "expired";
2155
+ const rawStatus = txData.Status !== void 0 ? txData.Status : txData.status;
2156
+ const statusDesc = (txData.StatusDesc || "").toString().toLowerCase();
2157
+ const paidStatus = (txData.PaidStatus || "").toString().toLowerCase();
2158
+ const statusCode = txData.StatusCode !== void 0 ? Number(txData.StatusCode) : rawStatus !== void 0 ? Number(rawStatus) : void 0;
2159
+ const isPaid = statusCode === 1 || paidStatus === "paid" || statusDesc.includes("berhasil") || statusDesc.includes("success");
2160
+ const isPending = statusCode === 0 || paidStatus === "unpaid" || statusDesc.includes("menunggu") || statusDesc.includes("pending");
2161
+ const isExpired = statusCode === 2 || statusDesc.includes("expired") || statusDesc.includes("kadaluarsa");
2162
+ const isFailed = !isPaid && !isPending && !isExpired;
2046
2163
  const status = isPaid ? "paid" : isPending ? "pending" : isExpired ? "expired" : "failed";
2047
2164
  return {
2048
2165
  success: true,
@@ -8258,6 +8375,62 @@ var IpaymuClient = class {
8258
8375
  async checkTransaction(transactionId) {
8259
8376
  return this.request("POST", "/transaction", { transactionId });
8260
8377
  }
8378
+ /**
8379
+ * Ambil daftar channel pembayaran aktif milik merchant
8380
+ */
8381
+ async getPaymentMethods() {
8382
+ return this.request("POST", "/payment-method-list", { account: this.va });
8383
+ }
8384
+ /**
8385
+ * Ambil riwayat transaksi merchant berpaginasi
8386
+ */
8387
+ async getHistory(params) {
8388
+ const payload = {
8389
+ account: this.va,
8390
+ page: params?.page || 1,
8391
+ limit: params?.limit || 10,
8392
+ ...params
8393
+ };
8394
+ return this.request("POST", "/history", payload);
8395
+ }
8396
+ /**
8397
+ * Ambil daftar seluruh bank di Indonesia
8398
+ */
8399
+ async getBankList() {
8400
+ return this.request("POST", "/banklist", { account: this.va });
8401
+ }
8402
+ /**
8403
+ * Ambil jangkauan area pengiriman COD
8404
+ */
8405
+ async getCodArea(postalCode) {
8406
+ const payload = { account: this.va };
8407
+ if (postalCode) payload.postalCode = postalCode;
8408
+ return this.request("POST", "/cod/getarea", payload);
8409
+ }
8410
+ /**
8411
+ * Hitung tarif ongkir pengiriman COD
8412
+ */
8413
+ async getCodRate(params) {
8414
+ return this.request("POST", "/cod/getrate", { account: this.va, ...params });
8415
+ }
8416
+ /**
8417
+ * Request pickup kurir COD
8418
+ */
8419
+ async getCodPickup(params) {
8420
+ return this.request("POST", "/cod/pickup", { account: this.va, ...params });
8421
+ }
8422
+ /**
8423
+ * Ambil nomor resi / AWB pengiriman COD
8424
+ */
8425
+ async getCodAwb(transactionId) {
8426
+ return this.request("POST", "/cod/getawb", { account: this.va, transactionId });
8427
+ }
8428
+ /**
8429
+ * Lacak status pengiriman kurir berdasarkan no resi / AWB
8430
+ */
8431
+ async getCodTracking(awb) {
8432
+ return this.request("POST", "/cod/tracking", { account: this.va, awb });
8433
+ }
8261
8434
  };
8262
8435
 
8263
8436
  // src/clients/xendit.ts
package/dist/index.mjs CHANGED
@@ -123,6 +123,9 @@ var CANONICAL_TO_IPAYMU = {
123
123
  permata_va: { paymentMethod: "va", paymentChannel: "permata" },
124
124
  danamon_va: { paymentMethod: "va", paymentChannel: "danamon" },
125
125
  bsi_va: { paymentMethod: "va", paymentChannel: "bsi" },
126
+ bag_va: { paymentMethod: "va", paymentChannel: "bag" },
127
+ muamalat_va: { paymentMethod: "va", paymentChannel: "bmi" },
128
+ bmi_va: { paymentMethod: "va", paymentChannel: "bmi" },
126
129
  qris: { paymentMethod: "qris", paymentChannel: "mpm" },
127
130
  gopay_qris: { paymentMethod: "qris", paymentChannel: "mpm" },
128
131
  shopeepay_qris: { paymentMethod: "qris", paymentChannel: "mpm" },
@@ -1580,35 +1583,48 @@ var IpaymuProvider = class extends BasePaymentProvider {
1580
1583
  const baseUrl = this.getBaseUrl(sandbox);
1581
1584
  const endpoint = isDirect ? "/payment/direct" : "/payment";
1582
1585
  const url = `${baseUrl}${endpoint}`;
1586
+ const notifyUrl = callbackUrl || config.callbackUrl || "https://localhost/callback";
1587
+ const redirectUrl = returnUrl || config.returnUrl || "https://localhost/return";
1588
+ const feeDirection = params.feeDirection || params.extra?.feeDirection || config.extra?.feeDirection;
1589
+ const escrow = params.escrow !== void 0 ? params.escrow : params.extra?.escrow !== void 0 ? params.extra?.escrow : config.extra?.escrow;
1583
1590
  let payload;
1584
1591
  if (isDirect) {
1585
1592
  payload = {
1586
1593
  name: customer.name,
1587
1594
  email: customer.email,
1588
- phone: customer.phone || "",
1595
+ phone: customer.phone || "081234567890",
1589
1596
  amount: integerAmount,
1590
- notifyUrl: callbackUrl || config.callbackUrl || "",
1597
+ notifyUrl,
1591
1598
  expired: 24,
1592
1599
  expiredType: "hours",
1593
1600
  comments: productDetails,
1594
1601
  referenceId: orderId,
1595
1602
  paymentMethod: ipaymuMethod.paymentMethod,
1596
1603
  ...ipaymuMethod.paymentChannel ? { paymentChannel: ipaymuMethod.paymentChannel } : {},
1604
+ ...feeDirection ? { feeDirection } : {},
1605
+ ...escrow !== void 0 ? { escrow } : {},
1597
1606
  ...params.providerParams
1598
1607
  };
1599
1608
  } else {
1609
+ const hasItems = params.items && params.items.length > 0;
1610
+ const product = hasItems ? params.items.map((i) => i.name) : [productDetails.length > 50 ? productDetails.substring(0, 47) + "..." : productDetails];
1611
+ const qty = hasItems ? params.items.map((i) => i.quantity) : [1];
1612
+ const price = hasItems ? params.items.map((i) => Math.round(i.price)) : [integerAmount];
1613
+ const description = hasItems ? params.items.map((i) => i.description || i.name) : [productDetails];
1600
1614
  payload = {
1601
- product: [productDetails.length > 50 ? productDetails.substring(0, 47) + "..." : productDetails],
1602
- qty: [1],
1603
- price: [integerAmount],
1604
- description: [productDetails],
1605
- returnUrl: returnUrl || config.returnUrl || "",
1606
- notifyUrl: callbackUrl || config.callbackUrl || "",
1607
- cancelUrl: returnUrl || config.returnUrl || "",
1615
+ product,
1616
+ qty,
1617
+ price,
1618
+ description,
1619
+ returnUrl: redirectUrl,
1620
+ notifyUrl,
1621
+ cancelUrl: redirectUrl,
1608
1622
  referenceId: orderId,
1609
1623
  buyerName: customer.name,
1610
1624
  buyerEmail: customer.email,
1611
- buyerPhone: customer.phone || "",
1625
+ buyerPhone: customer.phone || "081234567890",
1626
+ ...feeDirection ? { feeDirection } : {},
1627
+ ...escrow !== void 0 ? { escrow } : {},
1612
1628
  ...params.providerParams
1613
1629
  };
1614
1630
  }
@@ -1648,8 +1664,8 @@ var IpaymuProvider = class extends BasePaymentProvider {
1648
1664
  provider: "ipaymu",
1649
1665
  orderId,
1650
1666
  amount: integerAmount,
1651
- reference: resData.TransactionId ? String(resData.TransactionId) : String(resData.SessionId || ""),
1652
- paymentUrl: resData.Url,
1667
+ reference: resData.TransactionId ? String(resData.TransactionId) : String(resData.SessionId || resData.SessionID || ""),
1668
+ paymentUrl: resData.Url || resData.url,
1653
1669
  rawResponse: data
1654
1670
  };
1655
1671
  if (resData.PaymentNo) {
@@ -1708,6 +1724,88 @@ var IpaymuProvider = class extends BasePaymentProvider {
1708
1724
  };
1709
1725
  }
1710
1726
  async getPaymentMethods(params, config) {
1727
+ const va = config.merchantCode || config.merchantId || "";
1728
+ const apiKey = config.apiKey || "";
1729
+ const sandbox = !!config.sandbox;
1730
+ if (va && apiKey) {
1731
+ try {
1732
+ const url = `${this.getBaseUrl(sandbox)}/payment-method-list`;
1733
+ const payload = { account: va };
1734
+ const { signature, timestamp } = generateIpaymuSignature("POST", va, apiKey, payload);
1735
+ const response = await fetch(url, {
1736
+ method: "POST",
1737
+ headers: {
1738
+ "Content-Type": "application/json",
1739
+ "Accept": "application/json",
1740
+ "va": va,
1741
+ "signature": signature,
1742
+ "timestamp": timestamp
1743
+ },
1744
+ body: JSON.stringify(payload)
1745
+ });
1746
+ const data = await response.json().catch(() => null);
1747
+ if (response.ok && data?.Data && Array.isArray(data.Data)) {
1748
+ const methods = [];
1749
+ const categories2 = {};
1750
+ for (const group of data.Data) {
1751
+ const groupCode = (group.Code || "").toLowerCase();
1752
+ const groupName = group.Name || group.Description || "Lainnya";
1753
+ const channels = group.Channels || [];
1754
+ let category = "Lainnya";
1755
+ if (groupCode === "va") category = "Virtual Account";
1756
+ else if (groupCode === "cstore") category = "Retail / Gerai";
1757
+ else if (groupCode === "qris") category = "QRIS";
1758
+ else if (groupCode === "cc") category = "Kartu Kredit";
1759
+ else if (groupCode === "paylater") category = "Paylater / Cicilan";
1760
+ else if (groupCode === "cod") category = "COD";
1761
+ else category = groupName;
1762
+ for (const ch of channels) {
1763
+ const chCode = (ch.Code || "").toLowerCase();
1764
+ let canonicalCode = chCode;
1765
+ if (groupCode === "va") {
1766
+ canonicalCode = chCode === "bag" ? "bag_va" : chCode === "bmi" ? "muamalat_va" : `${chCode}_va`;
1767
+ } else if (groupCode === "cc") {
1768
+ canonicalCode = "credit_card";
1769
+ }
1770
+ let totalFee = "-";
1771
+ if (ch.TransactionFee) {
1772
+ if (ch.TransactionFee.ActualFeeType === "PERCENT") {
1773
+ totalFee = `${ch.TransactionFee.ActualFee}%`;
1774
+ } else if (ch.TransactionFee.ActualFee !== void 0) {
1775
+ totalFee = `IDR ${Number(ch.TransactionFee.ActualFee).toLocaleString()}`;
1776
+ }
1777
+ }
1778
+ const pm = {
1779
+ paymentMethod: canonicalCode,
1780
+ code: canonicalCode,
1781
+ paymentName: ch.Name || ch.Description || canonicalCode,
1782
+ paymentImage: `https://my.ipaymu.com/images/banks/${chCode}.png`,
1783
+ totalFee,
1784
+ category,
1785
+ extra: {
1786
+ healthStatus: ch.HealthStatus,
1787
+ instructionsDoc: ch.PaymentInstructionsDoc,
1788
+ feeDetail: ch.TransactionFee
1789
+ }
1790
+ };
1791
+ methods.push(pm);
1792
+ if (!categories2[category]) categories2[category] = [];
1793
+ categories2[category].push(pm);
1794
+ }
1795
+ }
1796
+ if (methods.length > 0) {
1797
+ return {
1798
+ success: true,
1799
+ provider: "ipaymu",
1800
+ methods,
1801
+ categories: categories2,
1802
+ rawResponse: data
1803
+ };
1804
+ }
1805
+ }
1806
+ } catch (err) {
1807
+ }
1808
+ }
1711
1809
  const staticMethods = [
1712
1810
  {
1713
1811
  paymentMethod: "bca_va",
@@ -1773,6 +1871,22 @@ var IpaymuProvider = class extends BasePaymentProvider {
1773
1871
  totalFee: "IDR 3,500",
1774
1872
  category: "Virtual Account"
1775
1873
  },
1874
+ {
1875
+ paymentMethod: "bag_va",
1876
+ code: "bag_va",
1877
+ paymentName: "Bank Artha Graha Virtual Account",
1878
+ paymentImage: "https://my.ipaymu.com/images/banks/bag.png",
1879
+ totalFee: "IDR 3,500",
1880
+ category: "Virtual Account"
1881
+ },
1882
+ {
1883
+ paymentMethod: "muamalat_va",
1884
+ code: "muamalat_va",
1885
+ paymentName: "Bank Muamalat Virtual Account",
1886
+ paymentImage: "https://my.ipaymu.com/images/banks/bmi.png",
1887
+ totalFee: "IDR 3,500",
1888
+ category: "Virtual Account"
1889
+ },
1776
1890
  {
1777
1891
  paymentMethod: "qris",
1778
1892
  code: "qris",
@@ -1874,11 +1988,14 @@ var IpaymuProvider = class extends BasePaymentProvider {
1874
1988
  };
1875
1989
  }
1876
1990
  const txData = data.Data || {};
1877
- const statusText = (txData.Status || txData.status || "").toString().toLowerCase();
1878
- const isPaid = statusText === "berhasil" || statusText === "success" || txData.StatusCode === 1;
1879
- const isPending = statusText === "pending" || txData.StatusCode === 0;
1880
- const isFailed = !isPaid && !isPending;
1881
- const isExpired = statusText === "expired";
1991
+ const rawStatus = txData.Status !== void 0 ? txData.Status : txData.status;
1992
+ const statusDesc = (txData.StatusDesc || "").toString().toLowerCase();
1993
+ const paidStatus = (txData.PaidStatus || "").toString().toLowerCase();
1994
+ const statusCode = txData.StatusCode !== void 0 ? Number(txData.StatusCode) : rawStatus !== void 0 ? Number(rawStatus) : void 0;
1995
+ const isPaid = statusCode === 1 || paidStatus === "paid" || statusDesc.includes("berhasil") || statusDesc.includes("success");
1996
+ const isPending = statusCode === 0 || paidStatus === "unpaid" || statusDesc.includes("menunggu") || statusDesc.includes("pending");
1997
+ const isExpired = statusCode === 2 || statusDesc.includes("expired") || statusDesc.includes("kadaluarsa");
1998
+ const isFailed = !isPaid && !isPending && !isExpired;
1882
1999
  const status = isPaid ? "paid" : isPending ? "pending" : isExpired ? "expired" : "failed";
1883
2000
  return {
1884
2001
  success: true,
@@ -8094,6 +8211,62 @@ var IpaymuClient = class {
8094
8211
  async checkTransaction(transactionId) {
8095
8212
  return this.request("POST", "/transaction", { transactionId });
8096
8213
  }
8214
+ /**
8215
+ * Ambil daftar channel pembayaran aktif milik merchant
8216
+ */
8217
+ async getPaymentMethods() {
8218
+ return this.request("POST", "/payment-method-list", { account: this.va });
8219
+ }
8220
+ /**
8221
+ * Ambil riwayat transaksi merchant berpaginasi
8222
+ */
8223
+ async getHistory(params) {
8224
+ const payload = {
8225
+ account: this.va,
8226
+ page: params?.page || 1,
8227
+ limit: params?.limit || 10,
8228
+ ...params
8229
+ };
8230
+ return this.request("POST", "/history", payload);
8231
+ }
8232
+ /**
8233
+ * Ambil daftar seluruh bank di Indonesia
8234
+ */
8235
+ async getBankList() {
8236
+ return this.request("POST", "/banklist", { account: this.va });
8237
+ }
8238
+ /**
8239
+ * Ambil jangkauan area pengiriman COD
8240
+ */
8241
+ async getCodArea(postalCode) {
8242
+ const payload = { account: this.va };
8243
+ if (postalCode) payload.postalCode = postalCode;
8244
+ return this.request("POST", "/cod/getarea", payload);
8245
+ }
8246
+ /**
8247
+ * Hitung tarif ongkir pengiriman COD
8248
+ */
8249
+ async getCodRate(params) {
8250
+ return this.request("POST", "/cod/getrate", { account: this.va, ...params });
8251
+ }
8252
+ /**
8253
+ * Request pickup kurir COD
8254
+ */
8255
+ async getCodPickup(params) {
8256
+ return this.request("POST", "/cod/pickup", { account: this.va, ...params });
8257
+ }
8258
+ /**
8259
+ * Ambil nomor resi / AWB pengiriman COD
8260
+ */
8261
+ async getCodAwb(transactionId) {
8262
+ return this.request("POST", "/cod/getawb", { account: this.va, transactionId });
8263
+ }
8264
+ /**
8265
+ * Lacak status pengiriman kurir berdasarkan no resi / AWB
8266
+ */
8267
+ async getCodTracking(awb) {
8268
+ return this.request("POST", "/cod/tracking", { account: this.va, awb });
8269
+ }
8097
8270
  };
8098
8271
 
8099
8272
  // src/clients/xendit.ts
package/docs/guide.md CHANGED
@@ -19,7 +19,8 @@ Panduan ini adalah **satu-satunya** panduan yang Anda butuhkan untuk mengintegra
19
19
  9. [Provider Dinamis & Autodetect](#-provider-dinamis--autodetect)
20
20
  10. [Cek Capability Provider (Portabilitas)](#-cek-capability-provider-portabilitas)
21
21
  11. [Fitur Khusus Provider (`<X>Client`)](#-fitur-khusus-provider-xclient)
22
- 12. [Kamus Variabel `.env` per Provider](#-kamus-variabel-env-per-provider)
22
+ 12. [Panduan Pengisian Variabel Universal (`BUAYAR_*`) per Provider](#-panduan-pengisian-variabel-universal-buayar_-per-provider)
23
+ 13. [Daftar Canonical Payment Methods](#-daftar-canonical-payment-methods)
23
24
 
24
25
  ---
25
26
 
@@ -370,57 +371,59 @@ const balance = await xendit.checkBalance("CASH");
370
371
 
371
372
  Rangkuman kemampuan ekstra tiap provider:
372
373
 
373
- | Provider | Getter | Kemampuan ekstra |
374
- | :--- | :--- | :--- |
375
- | Midtrans | `getMidtransClient()` | cancel/refund/expire/approve/deny/capture, GoPay tokenization, Subscription, Payment Link, IRIS balance |
376
- | Duitku | `getDuitkuClient()` | balance, listBanks, inquiryBankAccount, disburse, checkDisbursementStatus |
377
- | iPaymu | `getIpaymuClient()` | balance, checkTransaction |
378
- | Xendit | `getXenditClient()` | balance, expireInvoice, createDisbursement |
379
- | DOKU | `getDokuClient()` | checkTransaction |
380
- | PrismaLink | `getPrismalinkClient()` | checkTransaction |
381
- | Faspay | `getFaspayClient()` | cancelTransaction, checkTransaction |
382
- | Finpay | `getFinpayClient()` | checkTransaction |
383
- | Nicepay | `getNicepayClient()` | cancelTransaction, checkTransaction |
384
- | OY! Bisnis | `getOyClient()` | checkTransaction, balance, remit (transfer dana) |
385
- | Stripe | `getStripeClient()` | balance, createRefund, retrieveCheckoutSession, retrievePaymentIntent |
386
- | PayPal | `getPaypalClient()` | captureOrder, getOrder, refundCapture, checkBalance, verifyWebhookSignature |
387
- | Adyen | `getAdyenClient()` | capturePayment, cancelPayment, refundPayment, getPaymentDetails, getAvailablePaymentMethods |
388
- | Checkout.com | `getCheckoutComClient()` | balance, refundPayment, voidPayment, getPaymentDetails, listPaymentLinks |
389
- | Razorpay | `getRazorpayClient()` | capturePayment, createRefund, checkBalance, fetchPayment, listPayments |
390
- | Square | `getSquareClient()` | retrieveBalance, refundPayment, cancelPayment, getPayment, listLocations |
391
- | PayU | `getPayuClient()` | cancelOrder, getOrder, refundOrder |
392
- | Braintree | `getBraintreeClient()` | getClientToken, findTransaction, refundTransaction, voidTransaction |
393
- | 2Checkout | `getTwoCheckoutClient()` | getOrder, listOrders, getSubscription, refundOrder |
374
+ | Provider | Status | Getter | Kemampuan ekstra |
375
+ | :--- | :---: | :--- | :--- |
376
+ | Midtrans | Tested | `getMidtransClient()` | cancel/refund/expire/approve/deny/capture, GoPay tokenization, Subscription, Payment Link, IRIS balance |
377
+ | Duitku | Tested | `getDuitkuClient()` | balance, listBanks, inquiryBankAccount, disburse, checkDisbursementStatus |
378
+ | iPaymu | Tested | `getIpaymuClient()` | balance, checkTransaction, getHistory, getBankList, getPaymentMethods, COD logistics (getArea, getRate, getPickup, getAwb, getTracking) |
379
+ | Xendit | Tested | `getXenditClient()` | balance, expireInvoice, createDisbursement |
380
+ | DOKU | Tested | `getDokuClient()` | checkTransaction |
381
+ | PrismaLink | Tested | `getPrismalinkClient()` | checkTransaction |
382
+ | Faspay | Tested | `getFaspayClient()` | cancelTransaction, checkTransaction |
383
+ | Finpay | Tested | `getFinpayClient()` | checkTransaction |
384
+ | Nicepay | Tested | `getNicepayClient()` | cancelTransaction, checkTransaction |
385
+ | OY! Bisnis | Tested | `getOyClient()` | checkTransaction, balance, remit (transfer dana) |
386
+ | Stripe | Tested | `getStripeClient()` | balance, createRefund, retrieveCheckoutSession, retrievePaymentIntent |
387
+ | PayPal | Tested | `getPaypalClient()` | captureOrder, getOrder, refundCapture, checkBalance, verifyWebhookSignature |
388
+ | Adyen | Tested | `getAdyenClient()` | capturePayment, cancelPayment, refundPayment, getPaymentDetails, getAvailablePaymentMethods |
389
+ | Checkout.com | Tested | `getCheckoutComClient()` | balance, refundPayment, voidPayment, getPaymentDetails, listPaymentLinks |
390
+ | Razorpay | Tested | `getRazorpayClient()` | capturePayment, createRefund, checkBalance, fetchPayment, listPayments |
391
+ | Square | Tested | `getSquareClient()` | retrieveBalance, refundPayment, cancelPayment, getPayment, listLocations |
392
+ | PayU | Tested | `getPayuClient()` | cancelOrder, getOrder, refundOrder |
393
+ | Braintree | Tested | `getBraintreeClient()` | getClientToken, findTransaction, refundTransaction, voidTransaction |
394
+ | 2Checkout | Tested | `getTwoCheckoutClient()` | getOrder, listOrders, getSubscription, refundOrder |
394
395
 
395
396
  ---
396
397
 
397
- ## 📚 Kamus Variabel `.env` per Provider
398
-
399
- Anda hanya perlu mengisi kredensial provider yang **sedang aktif**. Gunakan variabel universal (`BUAYAR_*`) bila ingin kode benar-benar provider-agnostic, atau variabel spesifik di bawah.
400
-
401
- | Provider | Variabel `.env` |
402
- | :--- | :--- |
403
- | Midtrans | `MIDTRANS_SERVER_KEY`, `MIDTRANS_CLIENT_KEY` |
404
- | Duitku | `DUITKU_API_KEY`, `DUITKU_MERCHANT_CODE` |
405
- | iPaymu | `IPAYMU_API_KEY`, `IPAYMU_VA` |
406
- | Xendit | `XENDIT_SECRET_KEY`, `XENDIT_WEBHOOK_TOKEN` |
407
- | DOKU | `DOKU_CLIENT_ID`, `DOKU_SECRET_KEY` |
408
- | PrismaLink | `PRISMALINK_MERCHANT_ID`, `PRISMALINK_SECRET_KEY` |
409
- | Faspay | `FASPAY_MERCHANT_ID`, `FASPAY_USER_ID`, `FASPAY_PASSWORD`, `FASPAY_MERCHANT_NAME` |
410
- | Finpay | `FINPAY_MERCHANT_ID`, `FINPAY_MERCHANT_KEY` |
411
- | Nicepay | `NICEPAY_IMID`, `NICEPAY_KEY` |
412
- | OY! Bisnis | `OY_USERNAME`, `OY_API_KEY` |
413
- | Stripe | `STRIPE_SECRET_KEY`, `STRIPE_PUBLIC_KEY`, `STRIPE_WEBHOOK_SECRET` |
414
- | PayPal | `PAYPAL_CLIENT_ID`, `PAYPAL_CLIENT_SECRET`, `PAYPAL_WEBHOOK_ID` |
415
- | Adyen | `ADYEN_API_KEY`, `ADYEN_MERCHANT_ACCOUNT`, `ADYEN_CLIENT_KEY`, `ADYEN_HMAC_KEY`, `ADYEN_LIVE_URL_PREFIX` |
416
- | Checkout.com | `CHECKOUTCOM_SECRET_KEY`, `CHECKOUTCOM_PUBLIC_KEY`, `CHECKOUTCOM_WEBHOOK_SECRET` |
417
- | Razorpay | `RAZORPAY_KEY_ID`, `RAZORPAY_KEY_SECRET`, `RAZORPAY_WEBHOOK_SECRET` |
418
- | Square | `SQUARE_ACCESS_TOKEN`, `SQUARE_APPLICATION_ID`, `SQUARE_LOCATION_ID`, `SQUARE_WEBHOOK_SIGNATURE_KEY` |
419
- | PayU | `PAYU_POS_ID`, `PAYU_MD5_KEY`, `PAYU_OAUTH_CLIENT_ID`, `PAYU_OAUTH_CLIENT_SECRET` |
420
- | Braintree | `BRAINTREE_MERCHANT_ID`, `BRAINTREE_PUBLIC_KEY`, `BRAINTREE_PRIVATE_KEY` |
421
- | 2Checkout | `TWOCHECKOUT_MERCHANT_CODE`, `TWOCHECKOUT_SECRET_KEY`, `TWOCHECKOUT_SECRET_WORD` |
422
-
423
- Sandbox: otomatis terdeteksi dari `BUAYAR_SANDBOX`/`NODE_ENV`, atau set per-provider (mis. `STRIPE_SANDBOX=true`, `MIDTRANS_SANDBOX=true`).
398
+ ## 📚 Panduan Pengisian Variabel Universal (`BUAYAR_*`) per Provider
399
+
400
+ Anda **tidak perlu** membuat nama variabel khusus per provider (seperti `IPAYMU_API_KEY`, `DUITKU_API_KEY`, dsb.). Cukup gunakan set variabel seragam **`BUAYAR_*`**.
401
+
402
+ Tabel berikut menunjukkan data apa dari dashboard masing-masing payment gateway yang perlu Anda masukkan ke variabel `BUAYAR_*`:
403
+
404
+ | Provider | `BUAYAR_PROVIDER` | `BUAYAR_API_KEY` | `BUAYAR_MERCHANT_CODE` | `BUAYAR_CLIENT_KEY` / Tambahan |
405
+ | :--- | :--- | :--- | :--- | :--- |
406
+ | **Midtrans** | `midtrans` | Server Key | *(opsional)* | Client Key |
407
+ | **Duitku** | `duitku` | API Key | Merchant Code | *(tidak perlu)* |
408
+ | **iPaymu** | `ipaymu` | API Key | Nomor Virtual Account (VA) | *(tidak perlu)* |
409
+ | **Xendit** | `xendit` | Secret Key | *(opsional)* | Webhook Verification Token (`BUAYAR_WEBHOOK_SECRET`) |
410
+ | **DOKU Jokul** | `doku` | Secret Key | Client ID / Merchant ID | Client ID |
411
+ | **PrismaLink** | `prismalink` | Secret Key | Merchant ID | *(tidak perlu)* |
412
+ | **Faspay** | `faspay` | Password | Merchant ID | User ID |
413
+ | **Finpay** | `finpay` | Merchant Key | Merchant ID | *(tidak perlu)* |
414
+ | **Nicepay** | `nicepay` | Server Key (Secret) | I-MID (Merchant ID) | *(tidak perlu)* |
415
+ | **OY! Bisnis** | `oy` | API Key | Username | Username |
416
+ | **Stripe** | `stripe` | Secret Key (`sk_...`) | *(tidak perlu)* | Publishable Key (`pk_...`) / Webhook Secret |
417
+ | **PayPal** | `paypal` | Client Secret | Client ID | Client ID |
418
+ | **Adyen** | `adyen` | API Key | Merchant Account Name | Client Key / HMAC Key (`BUAYAR_WEBHOOK_SECRET`) |
419
+ | **Checkout.com** | `checkoutcom` | Secret Key (`sk_...`) | *(tidak perlu)* | Public Key (`pk_...`) / Webhook Secret |
420
+ | **Razorpay** | `razorpay` | Key Secret | Key ID | Key ID |
421
+ | **Square** | `square` | Access Token | Application ID | Location ID (`BUAYAR_PROJECT_ID`) |
422
+ | **PayU** | `payu` | MD5 Key / Secret | POS ID | POS ID |
423
+ | **Braintree** | `braintree` | Private Key | Merchant ID | Public Key |
424
+ | **2Checkout** | `twocheckout` | Secret Key | Merchant Code | Secret Word (`BUAYAR_WEBHOOK_SECRET`) |
425
+
426
+ > 💡 **Mode Sandbox:** Cukup tambahkan `BUAYAR_SANDBOX=true` (atau `false` saat production), SDK otomatis menyesuaikan URL endpoint API seluruh provider di atas tanpa perlu konfigurasi tambahan.
424
427
 
425
428
  ---
426
429
 
@@ -428,7 +431,7 @@ Sandbox: otomatis terdeteksi dari `BUAYAR_SANDBOX`/`NODE_ENV`, atau set per-prov
428
431
 
429
432
  | Kategori | Canonical Code |
430
433
  | :--- | :--- |
431
- | **Virtual Account** | `bca_va`, `mandiri_va`, `bni_va`, `bri_va`, `permata_va`, `cimb_va`, `danamon_va`, `bsi_va`, `seabank_va` |
434
+ | **Virtual Account** | `bca_va`, `mandiri_va`, `bni_va`, `bri_va`, `permata_va`, `cimb_va`, `danamon_va`, `bsi_va`, `seabank_va`, `bag_va`, `muamalat_va` |
432
435
  | **QRIS** | `qris`, `gopay_qris`, `shopeepay_qris`, `nobu_qris` |
433
436
  | **E-Wallet** | `gopay`, `shopeepay`, `ovo`, `dana`, `linkaja`, `jenius` |
434
437
  | **Retail** | `alfamart`, `indomaret`, `pos` |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crediblemark/buayar",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Unified Payment Gateway SDK for Node.js & TypeScript — 19 providers (Midtrans, Xendit, Duitku, Stripe, PayPal, Adyen, Razorpay, Square, Checkout.com, PayU, Braintree, 2Checkout, DOKU, iPaymu, PrismaLink, Faspay, Finpay, Nicepay, OY!) with zero-code switching via .env",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",