Download the PHP package webpos/caspos-client without Composer
On this page you can find all versions of the php package webpos/caspos-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download webpos/caspos-client
More information about webpos/caspos-client
Files in webpos/caspos-client
Package caspos-client
Short Description Caspos Mobile API Integration SDK for WebPOS.az
License MIT
Informations about the package caspos-client
Caspos Mobile API SDK for PHP
A hardened, production-ready PHP SDK designed to integrate web applications (such as WebPOS.az) with the Caspos (SUNMI) Mobile API fiscal cash register service. Developed by WebServis.
This package abstractly decouples your core backend architecture from the hardware network layer and provides strict input validation, preventing costly fiscal errors and sync issues.
Key Features
- Strict Precision Formatting: Automatically converts floats to the device's mandatory format (
0.000for quantities,0.00for pricing and discounts). - Client-Side Financial Auditing: Validates that total cash/card/bonus payments perfectly match itemized subtotals before transmitting data, neutralizing Caspos Error 607 (Invalid Total Sum) and Error 611.
- Input Sanitization & Length Guard: Cleans dangerous characters (
",',\, etc.) from item names and clips them to 40 characters to avoid Error 1206 (Illegal Characters) and Error 635. - Idempotency Protection: Forces the use of explicit
documentUUIDidentifiers to block duplicate transactions during local network packet drops. - Full Shift & Diagnostics Management: Supports shift state tracking (
getShiftStatus), opening/closing shifts (Z-Reports), and pulling physical hardware info.
Requirements
- PHP:
^8.0 - Extensions:
ext-curl,ext-json
Installation
Since this library is managed as a localized enterprise package, add it to your main project's composer.json using a local path reference during development:
Then execute the installation command:
Quick Start & Usage
1. Initializing the Client
2. Processing a Fiscal Receipt (Sale)
3. Shift Management Operations
Security & Network Isolation Notice
The Caspos Mobile API operates entirely over unencrypted cleartext HTTP due to device OS constraints. Because username and password credentials are broadcast across the local network in plaintext:
VLAN Isolation: Ensure the SUNMI terminal devices and your local WebPOS processing nodes are restricted to a highly secured, non-public Wi-Fi/VLAN network layer.
Persistent UUID Policy: In the event of an edge network timeout (RuntimeException), do not re-generate a new UUID. Re-attempt the submission with the same identifier; the hardware API uses this token to reject duplicate submissions natively.
License
This project is licensed under the MIT License - see the LICENSE file for details.
All versions of caspos-client with dependencies
ext-curl Version *
ext-json Version *