Download the PHP package heidelpay/php-message-code-mapper without Composer
On this page you can find all versions of the php package heidelpay/php-message-code-mapper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download heidelpay/php-message-code-mapper
More information about heidelpay/php-message-code-mapper
Files in heidelpay/php-message-code-mapper
Package php-message-code-mapper
Short Description A library to convert heidelpay message codes into customer friendly messages.
License proprietary
Homepage http://dev.heidelpay.com
Informations about the package php-message-code-mapper
heidelpay message code mapper
This library provides user-friendly output of (error)-messages coming from the heidelpay API.
1. Installation
Composer
manual Installation
Download the latest release from github and unpack it into a folder of your choice inside your project.
2. Implementation
Composer
manual Installation
Of course, the path needs to match the path from step 1.
3. Usage
Assuming you have received an error code from one of our modules or the
heidelpay PHP API and stored it in a variable called $errorcode
.
To get a message from that code, create a MessageCodeMapper
instance:
The constructor takes two (optional) arguments:
- The locale (e.g. 'en_US', 'de_DE')
- The path to the locales path (for example you want to use your own locale files) containing the .csv files with the codes and messages.
We provide 'de_DE' and 'en_US' locale files with this package. You can find them in the lib/locales folder. If you want to use one of these, the path doesn't need to be provided in the constructor.
By default, 'en_US' is used as the locale.
Now you can return or print out the message by calling the getMessage()
method:
Error codes are accepted in either the 'XXX.XXX.XXX' or 'HP-Error-XXX.XXX.XXX' format.
Support
For any issues or questions please get in touch with our support.
Web page
Phone
+49 (0)6221/6471-100
@devHeidelpay