定制 endeken/ofx-php-parser 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

endeken/ofx-php-parser

最新稳定版本:0.1.1

Composer 安装命令:

composer require endeken/ofx-php-parser

包简介

OFX PHP parser library

README 文档

README

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\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.

统计信息

  • 总下载量: 1.01k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 0
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-02-25