https://github.com/endeken-com/ofx-php-parser
This project consists of a PHP parser for OFX (Open Financial Exchange) files, implemented using PHP 8.2. Our aim is to make the process of importing OFX files as straightforward and hassle-free as possible.
https://github.com/endeken-com/ofx-php-parser
finance ofx ofx-parser open-financial-exchange
Last synced: 5 months ago
JSON representation
This project consists of a PHP parser for OFX (Open Financial Exchange) files, implemented using PHP 8.2. Our aim is to make the process of importing OFX files as straightforward and hassle-free as possible.
- Host: GitHub
- URL: https://github.com/endeken-com/ofx-php-parser
- Owner: endeken-com
- License: other
- Created: 2024-02-22T14:54:30.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-09-29T13:58:00.000Z (8 months ago)
- Last Synced: 2025-10-03T18:03:27.433Z (8 months ago)
- Topics: finance, ofx, ofx-parser, open-financial-exchange
- Language: PHP
- Homepage:
- Size: 59.6 KB
- Stars: 3
- Watchers: 0
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OFX PHP Parser
This project consists of a PHP parser for OFX (Open Financial Exchange) files, implemented using PHP 8.2. Our aim is to make the process of importing OFX files as straightforward and hassle-free as possible.
[](https://scrutinizer-ci.com/g/endeken-com/ofx-php-parser/build-status/main)
[](https://packagist.org/packages/endeken/ofx-php-parser)
[](https://scrutinizer-ci.com/g/endeken/ofx-php-parser/?branch=master)
[](https://scrutinizer-ci.com/g/endeken/ofx-php-parser/?branch=master)
[](https://packagist.org/packages/endeken/ofx-php-parser)
[](./LICENSE)
## Installation
Simply require the package using [Composer](https://getcomposer.org/):
```bash
$ composer require endeken/ofx-php-parser
```
## Usage
This project primarily revolves around the `OFX` class in the `Endeken\OFX` namespace. This class provides a static function `parse()` which is used to parse OFX data and return the parsed information. Here is a basic usage example:
```php
signOn->status->code;
// Accessing bank accounts data
$bankAccounts = $parsedData->bankAccounts;
foreach($bankAccounts as $account) {
echo 'Account ID: ' .$account->accountNumber . PHP_EOL;
echo 'Bank ID: ' .$account->routingNumber . PHP_EOL;
// Loop through each transaction
foreach ($account->statement->transactions as $transaction) {
echo 'Transaction Type: ' . $transaction->type . PHP_EOL;
echo 'Date: ' . $transaction->date . PHP_EOL;
echo 'Amount: ' . $transaction->amount . PHP_EOL;
}
}
} catch (Exception $e) {
echo 'An error occurred: ' . $e->getMessage();
}
```
## Acknowledgements
This library is a standalone project, however it is heavily influenced by the work done in the [asgrim/ofxparser](https://github.com/asgrim/ofxparser) which itself is a fork of [grimfor/ofxparser](https://github.com/grimfor/ofxparser). We would like to acknowledge the contributions made by the developers of these projects. Our intent was not to simply fork the project, but to build upon their work while taking the library in a slightly different direction to better serve our purposes.