Download the PHP package mjaschen/collmex without Composer

On this page you can find all versions of the php package mjaschen/collmex. 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 collmex

Collmex API PHP SDK

Latest Stable Version Total Downloads CI Status License

This library provides a wrapper for the Collmex API. It's not complete yet, some record types (and maybe some features) are missing.

Please create a pull request if you have implemented a new type/feature or create issues for bugs/feature requests.

There is (or least should be…) a Type class for every Collmex record type ("Satzart"). Currently, only the base types (MESSAGE, LOGIN, NEW_OBJECT_ID) and a few normal record types are implemented:

Compatibility

The Collmex PHP SDK requires PHP >= 8.1. It's possible to install an older version of the Collmex PHP SDK, if you're still using a no longer supported PHP version:

New features will only go into the main branch and won't be backported.

PHP Version Collmex PHP SDK Version Support Status
8.4 3.x ✅ active (untested)
8.3 3.x ✅ active
8.2 3.x ✅ active
8.1 3.x ✅ active
8.0 2.x ⚠️ security only
7.4 2.x ⚠️ security only
7.3 2.x ⚠️ security only
7.2 1.x ❌ end of life
7.1 1.x ❌ end of life
7.0 1.x ❌ end of life
5.6 0.11.x ❌ end of life

Installation

Using Composer, just add it to your composer.json by running:

If you want to use the included Laravel service provider CollmexServiceProvider, add it to the config/app.php providers array:

Upgrading

Version 2.x to 3.x

  1. Read the change log. You will see the list of everything changed between versions 2 and 3.
  2. Ensure your codebase is compatible with all requirements in composer.json.
  3. Update your composer.json to require version 3.x of the Collmex PHP SDK:

Version 1.x to 2.x

  1. Read the change log. You will see the list of everything changed between versions 1 and 2.
  2. Ensure your codebase is compatible with all requirements in composer.json.
  3. Rename attributes which are used in your codebase. Some attributes in the type classes have been renamed. If you use these attributes, you have to adjust your code as well. A simple search-and-replace is sufficient for this. Below you will find the complete list of renamed attributes:
Class Old Name New Name
Stock charge_number batch_number
Stock charge_description batch_description
StockChange destination_charge destination_batch
StockChange destination_charge_labeling destination_batch_labeling
StockChange source_charge source_batch
AccountDocumentGet only_changed changed_only
CustomerGet only_changed changed_only
MemberGet only_changed changed_only
SalesOrderGet only_changed changed_only
StockGet only_changed changed_only
VoucherGet only_changed changed_only
Customer forename firstname
CustomerOrder forename firstname
Invoice forename firstname
Member forename firstname
Customer firm company
DifferentShippingAddress firm company
Member firm company
CustomerOrder customer_firm customer_company
Invoice customer_firm customer_company
CustomerOrder delivery_firm delivery_company
Invoice delivery_firm delivery_company

Usage/Examples

Fetch from Collmex API

Load a Collmex Customer record:

Fetch a PDF Invoice from Collmex

Send Data to Collmex

Create a new Collmex Customer record and get the Collmex customer ID from the response data:

Send Multiple Records at Once

The Collmex API accepts requests containing multiple records.

For example, a customer order with three line-items is sent as three CSV records/lines within a single request.

The MultiRequest class provides a simple way to send multiple records to Collmex at once. Any valid Type (or an array of valid Type instances) can be added to a queue and eventually sent to the Collmex API.

Notes

Collmex expects all strings encoded in code page 1252 (Windows) while the Collmex PHP SDK expects all inputs as UTF-8 and outputs everything as UTF-8. The conversion of string encodings is done transparently by using the Symfony String Component and PHP's mb_convert_encoding() function before sending a request to the Collmex API and after receiving the response from the API.

Numeric / money values

This SDK does not convert numeric values to the string format required by the Collmex API by default.

For more information on format requirements, see the offical API documentation.

The library provides helpers for simple conversion from several types to the Collmex money format:

type example value call result (string)
float 19.99 Money::fromFloat(19.99) 19,99
integer (cents) 1999 Money::fromCents(1999) 19,99
Money for PHP $money = \Money\Money::EUR(1999) Money::fromMoney($money) 19,99

Fully qualified class name for the helper: \MarcusJaschen\Collmex\CollmexField\Money.

See the unit tests for more examples.

Date Values

Collmex unterstands two different formats for dates:

The library provides a helper to convert DateTime (which covers Carbon instances as well) from and to the Collmex date format:

This will output

To convert a DateTime instance to Collmex format (ISO style):

This will output

List of Supported Types

Development

Run code checks

To run checks and tests, it's the easiest to use the provided Composer scripts:

To run all checks and tests at once, just use composer ci.

Of course, it's possible to use the test runners directly, e.g. for PHPUnit:

Psalm:

Autoformat the code

You can use a Composer script to autoformat the code:

Collmex API Documentation

https://www.collmex.de/cgi-bin/cgi.exe?1005,1,help,api


All versions of collmex with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-curl Version *
ext-fileinfo Version *
ext-json Version *
ext-zip Version *
symfony/finder Version ^5.4 || ^6.4 || ^7.0
symfony/http-foundation Version ^5.4 || ^6.4 || ^7.0
symfony/mime Version ^5.4 || ^6.4 || ^7.0
symfony/string Version ^5.4 || ^6.4 || ^7.0
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 mjaschen/collmex contains the following files

Loading the files please wait ....