Download the PHP package tuurosung/switch8583 without Composer
On this page you can find all versions of the php package tuurosung/switch8583. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tuurosung/switch8583
More information about tuurosung/switch8583
Files in tuurosung/switch8583
Package switch8583
Short Description A clean, well-tested ISO 8583 message library for PHP: construction, parsing, and validation for the 1987 and 1993 standard versions, with BCD/ASCII encoding, LLVAR/LLLVAR fields, and dual bitmaps.
License MIT
Informations about the package switch8583
switch8583
A clean, well-tested ISO 8583 message library for PHP.
Construction, parsing, and validation for the 1987 and 1993 versions of the standard, with correct dual-bitmap handling, BCD and ASCII encoding, and fixed / LLVAR / LLLVAR fields. Zero runtime dependencies. Framework-agnostic, with an optional thin Laravel adapter (A Special Addition For my Laravel Family).
Requires PHP 8.1+ and the mbstring extension.
Why this exists
The PHP ecosystem has no robust, well-maintained, standards-complete ISO 8583 library. Existing options are abandoned, tied to a single gateway, or quietly wrong about the details that actually bite, such as odd-length BCD padding, length prefixes that count characters rather than bytes, the secondary-bitmap boundary. This library is built from the spec, verified against hand-derived wire fixtures, and strict where silence would corrupt data.
Quick start
Build a financial request, put it on the wire, read it back:
Messages are immutable. Every withField() returns a new message; the bitmap is derived from the present fields at serialisation time and can never disagree with them.
Building a response from a request
The MTI knows its own response, and a parsed request transforms straight into its reply:
Mti::response() derives the pair structurally (0100 -> 0110, 0420 -> 0430, 0800 -> 0810), so there is no lookup table to remember. Calling it on a message that is already a response throws, because that is a logic error upstream.
Encoding profiles and network overrides
The built-in catalogues use the ASCII profile by default — the most interoperable, most debuggable baseline. Real networks deviate, and each deviation is a one-line, immutable override rather than a fork.
A network that packs the PAN as BCD with the trailing-F convention:
A network that packs the MTI itself into two BCD bytes:
Laravel (optional)
The library needs no framework. If you are on Laravel, the adapter is auto-discovered — publish the config and resolve a pre-configured factory from the container:
illuminate/support is a suggested dependency, never required. Consumers outside Laravel never load a single framework file, and can construct Iso8583Factory::for('1993', 'bcd') directly.
What's supported
| Area | Detail |
|---|---|
| Versions | ISO 8583:1987 and :1993, all 127 data elements each |
| Bitmaps | Primary and secondary (fields 2–128), binary and hex |
| Field formats | Fixed, LLVAR (2-digit prefix), LLLVAR (3-digit prefix) |
| Encoding | BCD (configurable padding side and nibble) and ASCII; independent data and length-prefix codecs |
| MTI | Semantic accessors, request/response derivation, repeat detection |
| Parsing | Strict: truncation, bitmap/indicator mismatch, unknown fields, and trailing bytes are all rejected |
Design at a glance
A message is assembled through a single contract chain:
Value objects are immutable, monetary and numeric values are logical strings the field definitions validate, and enums carry intrinsic facts (which codec an encoding uses, how many digits a prefix has) but never business logic.
Out of scope (v1)
Network transport (TCP framing, TLS), ISO 8583:2003, MAC generation, and PIN-block handling are deliberately excluded to keep the core focused and trustworthy. Proprietary field definitions are not bundled — they are expressed as catalogue overrides in your own code.
Testing
The integration suite asserts against wire fixtures assembled by hand from the spec, so the parser is proven against bytes the library did not itself produce.
License
MIT.
All versions of switch8583 with dependencies
ext-mbstring Version *