Giter Club home page Giter Club logo

ofx-php-parser's Introduction

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.

Build Status Latest Stable Version Code Coverage Scrutinizer Code Quality Downloads Downloads

Installation

Simply require the package using Composer:

$ 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

require 'vendor/autoload.php';

use Endeken\OFX;

try {
    // Load the OFX data
    $ofxData = file_get_contents('path_to_your_ofx_file.ofx');

    // Parse the OFX data
    $parsedData = OFX::parse($ofxData);

    // $parsedData is an instance of OFXData which gives you access to all parsed data

    // Access the sign-on status code
    $statusCode = $parsedData->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 which itself is a fork of 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.

ofx-php-parser's People

Contributors

wesleyguirra avatar

Stargazers

Pedro Casado avatar  avatar

Forkers

tentwofour

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.