PHP code example of nodev / mutaku

1. Go to this page and download the library: Download nodev/mutaku 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/ */

    

nodev / mutaku example snippets



Nodev\Mutaku\Config;

Config::initialize(); // Load dari .env
// atau
Config::load([
    'authToken' => 'your_auth_token_here',
    'accountUsername' => 'your_username_here',
]);

use Nodev\Mutaku\Core;

$result = Core::getMutations([
  'fromDate' => '01-01-2025', // Tanggal awal mutasi
  'toDate' => '31-01-2025', // Tanggal akhir mutasi
  'page' => 1, // Page
  'filterOut' => true // Hanya menampilkan status transaksi IN
]);

if ($result['error']) {
   echo "Error: " . $result['message'];
} else {
   echo "Data: " . json_encode($result['data']);
}

use Nodev\Mutaku\Core;

$result = Core::getBalance();

if ($result['error']) {
    echo "Error: " . $result['message'];
} else {
    echo "Saldo: " . $result['balance'];
}

use Nodev\Mutaku\Core;

$result = Core::getImage();

if ($result['error']) {
    echo "Error: " . $result['message'];
} else {
    echo "URL Gambar: " . $result['image_url'];
}

// ✅ Benar
$result = Core::getMutations('01-01-2025', '31-01-2025');

// ❌ Salah
$result = Core::getMutations('2025-01-01', '2025-01-31');
$result = Core::getMutations('01/01/2025', '31/01/2025');

[
    'error' => false,
    'data' => [...] // atau 'balance' => '...', 'image_url' => '...'
]

[
    'error' => true,
    'message' => 'Error description'
]

$result = Core::getMutations('31-12-2024', '01-01-2025');

Config::initialize();

ORDERKUOTA_AUTH_TOKEN=
ORDERKUOTA_ACCOUNT_USERNAME=

ORDERKUOTA_AUTH_TOKEN=
ORDERKUOTA_ACCOUNT_USERNAME=
bash
php artisan vendor:publish --tag=mutaku-config