Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No suitable parser found. #50

Open
bangash-92 opened this issue Sep 4, 2023 · 1 comment
Open

No suitable parser found. #50

bangash-92 opened this issue Sep 4, 2023 · 1 comment

Comments

@bangash-92
Copy link

$xml = '{1:F01INMASARI9XXX3816963020}{2:I940INMASAR0XXXXN}{3:{108:381696302011020}}{4:
:20:20380617-85
:25:68200059703000
:28C:85/1
:60F:C380616SAR17457739841,32
:61:3806160617DR1228,75NTRFNONREF//1FT381679WS1G
Outward Telex Payment
:61:3806160617DR678,75NTRFNONREF//1FT38167ZTDT8
Outward Telex Payment
:61:3806170617DR150,00NTRFNONREF//1604FT38168SZ6
AC Transfer
:62F:C380617SAR17457737783,82
:64:C380617SAR17457737783,82
-}';

$reader = new Reader();

// Parse the ING bank statement content
$statements = $reader->getStatements($xml);

// Loop through the parsed statements
foreach ($statements as $statement) {
// Access statement data
echo "Account Number: " . $statement->getAccountNumber() . PHP_EOL;
echo "Start Date: " . $statement->getStartDate()->format('Y-m-d') . PHP_EOL;
echo "End Date: " . $statement->getEndDate()->format('Y-m-d') . PHP_EOL;

// Loop through transactions
foreach ($statement->getTransactions() as $transaction) {
    echo "Transaction Date: " . $transaction->getDate()->format('Y-m-d') . PHP_EOL;
    echo "Description: " . $transaction->getDescription() . PHP_EOL;
    echo "Amount: " . $transaction->getAmount() . PHP_EOL;
    echo PHP_EOL;
}

}

@bangash-92
Copy link
Author

$xml = '{1:F01INMASARI9XXX3816963020}{2:I940INMASAR0XXXXN}{3:{108:381696302011020}}{4: :20:20380617-85 :25:68200059703000 :28C:85/1 :60F:C380616SAR17457739841,32 :61:3806160617DR1228,75NTRFNONREF//1FT381679WS1G Outward Telex Payment :61:3806160617DR678,75NTRFNONREF//1FT38167ZTDT8 Outward Telex Payment :61:3806170617DR150,00NTRFNONREF//1604FT38168SZ6 AC Transfer :62F:C380617SAR17457737783,82 :64:C380617SAR17457737783,82 -}';

$reader = new Reader();

// Parse the ING bank statement content $statements = $reader->getStatements($xml);

// Loop through the parsed statements foreach ($statements as $statement) { // Access statement data echo "Account Number: " . $statement->getAccountNumber() . PHP_EOL; echo "Start Date: " . $statement->getStartDate()->format('Y-m-d') . PHP_EOL; echo "End Date: " . $statement->getEndDate()->format('Y-m-d') . PHP_EOL;

// Loop through transactions
foreach ($statement->getTransactions() as $transaction) {
    echo "Transaction Date: " . $transaction->getDate()->format('Y-m-d') . PHP_EOL;
    echo "Description: " . $transaction->getDescription() . PHP_EOL;
    echo "Amount: " . $transaction->getAmount() . PHP_EOL;
    echo PHP_EOL;
}

}

I am unable to parse this example file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant