fadhila36 / pakasir-sdk
Laravel Package for Pakasir Payment Gateway
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^7.0
- illuminate/support: ^10.0|^11.0|^12.0
Requires (Dev)
- orchestra/testbench: ^8.0
- pestphp/pest: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
README
SDK Laravel ringan untuk integrasi pembayaran digital Indonesia pakasir.com. Dukung QRIS, Virtual Account multi-bank & PayPal dengan kalkulasi fee otomatis.
Installation · Quick Start · Configuration · Payment Methods · API Reference · Documentation
📚 Documentation
📦 Installation
Requires PHP 8.1+
Install fadhila36/pakasir-sdk using composer:
composer require fadhila36/pakasir-sdk
⚡ Quick Start
Using Enum (Recommended)
use Fadhila36\Pakasir\Enums\PaymentMethod; use Fadhila36\Pakasir\Facades\Pakasir; // Create QRIS Payment $transaction = Pakasir::createPayment( PaymentMethod::QRIS, 'ORDER-' . time(), 10000, 'https://yourwebsite.com/callback' // Optional Redirect URL ); print_r($transaction);
Using String
$transaction = Pakasir::createPayment('qris', 'ORDER-123', 10000);
🛠️ Configuration
Publish the config file:
php artisan vendor:publish --provider="Fadhila36\Pakasir\PakasirServiceProvider" --tag="config"
Then add your configuration to .env:
PAKASIR_PROJECT=your-slug PAKASIR_API_KEY=your-api-key
💰 Payment Methods
Supported methods in Fadhila36\Pakasir\Enums\PaymentMethod:
| Method | Code | Fee |
|---|---|---|
| All Methods | all |
Varies |
| QRIS | qris |
0.7% - 1% |
| PayPal | paypal |
1% (min Rp3.000) |
| BNI VA | bni_va |
Rp3.500 |
| BRI VA | bri_va |
Rp3.500 |
| CIMB Niaga VA | cimb_niaga_va |
Rp3.500 |
| Maybank VA | maybank_va |
Rp3.500 |
| Permata VA | permata_va |
Rp3.500 |
| BNC VA | bnc_va |
Rp3.500 |
| ATM Bersama VA | atm_bersama_va |
Rp3.500 |
| Sampoerna VA | sampoerna_va |
Rp2.000 |
| Artha Graha VA | artha_graha_va |
Rp2.000 |
See PaymentMethod Enum for full list.
📖 API Reference
1. Create Payment
Trigger API request to create a transaction.
Pakasir::createPayment( string|PaymentMethod $method, string $orderId, int|float $amount, ?string $redirectUrl = null ): array
2. Get Payment Data
Get full payment details locally (fee calculation, expiration, URL) without calling the API (except for createPayment usage).
Pakasir::getPaymentData( string|PaymentMethod $method, string $orderId, int|float $amount, ?string $redirectUrl = null ): array
3. Get Payment URL
Shortcut to get just the payment URL.
$url = Pakasir::getPaymentUrl(PaymentMethod::QRIS, 'ORD-01', 50000);
4. Check Status
Check payment status from API.
$status = Pakasir::detailPayment('ORD-01', 50000);
5. Simulation (Sandbox)
Simulate logic for testing.
Pakasir::simulationPayment('ORD-01', 50000);
🤝 Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create new branch:
git checkout -b feature/my-feature. - Commit your changes:
git commit -m 'Add some feature'. - Push to the branch:
git push origin feature/my-feature. - Open Pull Request.
📜 License
Distributed under the MIT License. See LICENSE for details.
