Download the PHP package codehouse/payment-invoice-mapper without Composer

On this page you can find all versions of the php package codehouse/payment-invoice-mapper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package payment-invoice-mapper

Status

Build Status GitHub version

When should I use this library?

If You have some kind of e-commerce system that manages orders and You need to match bank transactions with the orders to determine whether order has been paid or not, then You'd want to use this library!

How to use

Prerequisite

This library is Composer friendly, so the most convenient way is to get Composer

curl -sS https://getcomposer.org/installer | php

Get the project from Packagist

php composer.phar require codehouse/payment-invoice-mapper

Pull the library from the internet

php composer.phar update

Dont forget to include vendor/autoload.php in Your bootstrap script, such as index.php

Usage

When the library is loaded, create a entity class that will hold Your invoices from the system so that it will implement \Entities\Invoice interface (You can access PIM classes via namespaces now, since Composer did all the heavy lifting). When the class is ready, create a function that will retrieve all invoices that have not been paid yet and assign them to Your Invoice object. Since You probably have more than 1 invoice, You have to create ArrayObject of them e.g.

By this point Your invoices are ready to be mapped, the next step is to get the payments to map with! In this example, I assume, that user uploads a file that contains the payments from the bank. The uploaded file is in ISO20022 format. For other formats and sources see Extending.

In this example, user posts file from a web page, the file HTML name is import.

The mapper function returns Payments (see \Entities\Payments) that matched with invoices. In order to update Your invoice table, You have to take the return value of map() function and update Your table accordingly

Extending

Basics

If You have a special kind of file format, create a new Parser to mapper/src/Parsers. It has to extend the \Parsers\AbstractParser class and implement \Parsers\Parser interface (see examples like \Parsers\ISO20022Parser). When Your parser is ready, create new entry to \Parsers\ParserFactoryImpl::getParser() method to register Your new parser (add new case statement). Now You can use Your new parser by passing Your parser name to map() functions third argument!

Advanced

If the default extractor doesn't cut it for You, You can create new Extractors. This would happen if You need to read data from a webservice or other source than a file. In this case You'd need to create a new Extractor that implements \Extractors\Extractor interface and then register Your new extractor in \Extractors\ExtractorFactoryImpl::getExtractor() method (add new case statement). The same thing goes for comparison logic. To use other than default comparison method, create new Comparator that extends the \Comparators\Comparator interface and register Your new comparator in \Comparators\ComparatorFactoryImpl::getComparator() method

Now You can use Your new extractor and comparator when invoking Mapper object like this:

The default comparator is IPRNo and extractor is File

Component model

Component diagram

Class diagram

Class diagram

Sequence diagram

Sequence diagram


All versions of payment-invoice-mapper with dependencies

PHP Build Version
Package Version
Requires apache/log4php Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package codehouse/payment-invoice-mapper contains the following files

Loading the files please wait ....