<?php

if (!function_exists('SnapBi')) {
    /**
     * Get SnapBi instance
     * 
     * Usage:
     * - SnapBi() - Returns instance without bank (backward compatible)
     * - SnapBi('ocbc') - Returns instance with OCBC bank
     * - SnapBi('bca') - Returns instance with BCA bank
     *
     * @param string|null $bankName Bank name (ocbc, bca, mandiri, etc.)
     * @return \Gaco\SnapBi\SnapBi
     */
    function SnapBi(?string $bankName = null): \Gaco\SnapBi\SnapBi
    {
        if ($bankName) {
            return \Gaco\SnapBi\SnapBi::for($bankName);
        }
        
        // Backward compatible: return instance without bank
        return new \Gaco\SnapBi\SnapBi();
    }
}

