2017 © Pedro Peláez
 

library laravel-cos-processor

Provides functionality to upload COS (Cheque Outsourcing Services) files.

image

chalcedonyt/laravel-cos-processor

Provides functionality to upload COS (Cheque Outsourcing Services) files.

  • Monday, October 31, 2016
  • by chalcedonyt
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2,126 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

COS Processor for Laravel

Helper functions to deal with COS (Cheque Outsourcing Services). Generates files based on payment entries. UOB and HSBC supported at the moment. Look at the files under the documentation/ folder for the original documents from UOB and HSBC., (*1)

Install

Via Composer, (*2)

``` bash $ composer require chalcedonyt/laravel-cos-processor, (*3)


## Creating an Adapter Create an adapter that implements `Chalcedonyt\\COSProcessor\\Adapter\\BeneficiaryAdapterInterface`. This should translate your model into the attributes that will be used in the COS entries. Refer to `Chalcedonyt\\COSProcessor\\Adapter\\ExampleBeneficiaryAdapter` for an example. ## Configuration `php artisan vendor:publish` should publish a `cos_processor.php` into the config folder. Edit this with the configuration options for your account. Change `"beneficiary_adapter"` to the class of the adapter you created earlier. ## Usage - Generating a file to upload Call the relevant COSUploadProcessorFactory subclass and pass in your data, and the config key. ``` php $beneficiaries = TestPayment::all(); $cos = HSBCCOSUploadProcessorFactory::createCsvString($beneficiaries, 'cos_processor.hsbc_example'); echo $cos;

Usage - Processing a result file from HSBC

HSBC COS will return a csv file with the results of a COS upload. Refer to tests/ifile_result.csv for an example. You can process this file into an array of COSResult with the following code:, (*4)

php //the first line is the Header $handle = fopen( __DIR__ ."/ifile_result.csv", "r"); $index = 0; $results = []; while (($line = fgets($handle)) !== false) { if( $index++ !== 0){ $adapter = new HSBCCOSResultAdapter($line); $results[] = $adapter -> getCosResult(); } } fclose($handle);, (*5)

License

The MIT License (MIT). Please see License File for more information., (*6)

The Versions

31/10 2016

dev-master

9999999-dev https://github.com/chalcedonyt/laravel-cos-processor

Provides functionality to upload COS (Cheque Outsourcing Services) files.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Timothy Teoh

hsbc cheque cos chalcedonyt cheque outsourcing services uob