QRIS Transaction Fetcher is a PHP library that allows merchants to retrieve transaction history from the QRIS (Quick Response Code Indonesian Standard) merchant portal. This library simplifies the process of fetching transaction data through automated login and data extraction.
- 🔐 Secure login to QRIS merchant portal
- 📅 Flexible date range selection for transactions
- 🔢 Transaction amount filtering
- 🧩 Comprehensive error handling
- 📊 Parsed transaction details
- PHP 7.4+
- Symfony DomCrawler Component
- cURL Extension
- Composer
Install the library using Composer:
composer require wahidin/mutasi
<?php
use Wahidin\Mutasi\QrisTransactionFetcher;
try {
// Initialize the transaction fetcher
$fetcher = new QrisTransactionFetcher(
'your_username', // Merchant portal username
'your_password', // Merchant portal password
100000, // Optional: Filter transactions above this amount
'2023-01-01', // Optional: Start date
'2023-02-01', // Optional: End date
50 // Optional: Limit number of transactions (default: 20)
);
// Fetch transactions
$transactions = $fetcher->fetchTransactions();
// Process transactions
foreach ($transactions as $transaction) {
echo "Transaction ID: " . $transaction['id'] . "\n";
echo "Amount: Rp " . number_format($transaction['nominal']) . "\n";
echo "Customer: " . $transaction['nama_costumer'] . "\n";
echo "---\n";
}
} catch (Exception $e) {
echo "Error: " . $e->getMessage();
}
Each transaction is an associative array with the following keys:
id
: Transaction internal IDtimestamp
: Unix timestamp of transactiontanggal
: Transaction datenominal
: Transaction amountstatus
: Transaction statusinv_id
: Invoice IDtanggal_settlement
: Settlement dateasal_transaksi
: Transaction originnama_costumer
: Customer namerrn
: Reference number
The library throws specific exceptions for various scenarios:
InvalidArgumentException
: For incorrect input parametersRuntimeException
: For login failures or network issues
$username
(required): Merchant portal username$password
(required): Merchant portal password$filter
(optional): Minimum transaction amount filter$fromDate
(optional): Start date for transaction history$toDate
(optional): End date for transaction history$limit
(optional): Maximum number of transactions to fetch (10-300)
- Requires active internet connection
- Depends on the current structure of the QRIS merchant portal
- Maximum of 300 transactions per request
- Stores temporary cookies for authentication
- Recommends using environment variables for credentials
- Implements basic input validation