PHP code example of meita / wps

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

    

meita / wps example snippets


use Meita\Wps\Adapters\{AlRajhiAdapter, RiyadAdapter, AlAhliAdapter, AlinmaAdapter, ArabNationalBankAdapter};
use Meita\Wps\BankAdapterRegistry;
use Meita\Wps\PayrollProtectionManager;
use Meita\Wps\DTO\{Payment, PaymentBatch};

$registry = new BankAdapterRegistry([
    'alrajhi' => new AlRajhiAdapter(),
    'riyad' => new RiyadAdapter(),
    'alahli' => new AlAhliAdapter(),
    'alinma' => new AlinmaAdapter(),
    'anb' => new ArabNationalBankAdapter(),
]);

$batch = new PaymentBatch(
    companyId: '1234567890',
    companyName: 'Meita LLC',
    payrollMonth: '2024-05',
    payments: [
        new Payment('EMP-1', 'Ali Saleh', '1010101010', 'SA123...', 5500.75),
        new Payment('EMP-2', 'Sara Ahmed', '2020202020', 'SA456...', 4300.00, notes: 'Commission 

use Meita\Wps\PayrollProtectionManager;
use Meita\Wps\DTO\{Payment, PaymentBatch};

$batch = /* build your PaymentBatch */;
$file = app(PayrollProtectionManager::class)->generate('riyad', $batch);
Storage::put(\"wps/{$file->filename}\", $file->content);