PHP code example of wahidin / mutasi-qris

1. Go to this page and download the library: Download wahidin/mutasi-qris library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wahidin / mutasi-qris example snippets



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();
}