定制 midassoft/dominicanbankparser 二次开发

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

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

midassoft/dominicanbankparser

Composer 安装命令:

composer require midassoft/dominicanbankparser

包简介

Dominican Bank parser

README 文档

README

This package allows you to parse files from the major dominican Bank entities.

Scrutinizer Code Quality Code Coverage Build Status Build Status StyleCI

Requirements

PHP ^7.1.3

Installation

composer require "midassoft/dominicanbankparser"

Usage

Just select the parser you want to use and call the parse method with the file content.

use MidasSoft\DominicanBankParser\Files\CSV;
use MidasSoft\DominicanBankParser\Parsers\BHDBankParser;

$parser = new BHDBankParser();
$file = file_get_contents(__DIR__.'/bhd_bank_file.csv');
$result = $parser->parse(new CSV($file));

This will return a collection of Deposit objects.

object(MidasSoft\DominicanBankParser\Collections\DepositCollection)#302 (1) {
  ["items":protected]=>
  array(91) {
    [0]=>
    object(MidasSoft\DominicanBankParser\Deposit)#23 (4) {
      ["amount":"MidasSoft\DominicanBankParser\Deposit":private]=>
      string(7) "4000.00"
      ["date":"MidasSoft\DominicanBankParser\Deposit":private]=>
      string(10) "19/12/2017"
      ["description":"MidasSoft\DominicanBankParser\Deposit":private]=>
      string(15) "DEPOSITO:3228-4"
      ["term":"MidasSoft\DominicanBankParser\Deposit":private]=>
      string(15) "DEPOSITO:3228-4"
    }
    [1]=>
    object(MidasSoft\DominicanBankParser\Deposit)#24 (4) {
      ["amount":"MidasSoft\DominicanBankParser\Deposit":private]=>
      string(8) "11805.00"
      ["date":"MidasSoft\DominicanBankParser\Deposit":private]=>
      string(10) "19/12/2017"
      ["description":"MidasSoft\DominicanBankParser\Deposit":private]=>
      string(19) "DEPOSITO:6051-7/195"
      ["term":"MidasSoft\DominicanBankParser\Deposit":private]=>
      string(19) "DEPOSITO:6051-7/195"
    }
  }
}

You can especify a cache manager in your parser if you want your data to persist , every parse will be automatically cached.

use MidasSoft\DominicanBankParser\Files\CSV;
use MidasSoft\DominicanBankParser\Parsers\BHDBankParser;

$parser = new BHDBankParser(new FileCacheDriver([
    'path' => __DIR__.'/cache',
    'timezone' => 'America/Santo_Domingo',
]));

$file = file_get_contents(__DIR__.'/bhd_bank_file.csv');
$result = $parser->parse(new CSV($file));
$cacheKeys = $parser->getCacheManager()->getKeys();
$parsedFromCache = $parser->getCacheManager()->get(end($cacheKeys));

There's two cache driver available ArrayCacheDriver and FileCacheDriver. When you use the FileCacheDriver you need to specify the path and timezone within your configuration.

Also you can write your own parsers by extending the MidasSoft\DominicanBankParser\Parsers\AbstractParser class, and your own cache drivers by extending MidasSoft\DominicanBankParser\Cache\AbstractCacheDriver.

Supported banks

  • BHD
  • Popular
  • Reservas
  • Santa Cruz

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-10-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固