Download the PHP package carlosupreme/cep-query-payment without Composer
On this page you can find all versions of the php package carlosupreme/cep-query-payment. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download carlosupreme/cep-query-payment
More information about carlosupreme/cep-query-payment
Files in carlosupreme/cep-query-payment
Package cep-query-payment
Short Description Laravel package for querying and verifying SPEI payment status from Banco de México's CEP system using automated browser scraping
License MIT
Informations about the package cep-query-payment
CEP Query Service
A PHP library for querying Banco de México's CEP (Comprobantes Electrónicos de Pago / Electronic Payment Receipts) system using Guzzle HTTP client.
Overview
This library provides a simple interface to query the SPEI payment system through Banco de México's CEP website. It uses Guzzle HTTP client to make direct API requests to the CEP system.
Features
- ✅ Query payment status using tracking key or reference number
- ✅ Retrieve available bank options from CEP system
- ✅ Automatic form validation and data sanitization
- ✅ Lightweight HTTP-based approach (no browser required)
- ✅ Comprehensive error handling and logging
- ✅ Framework-agnostic with Laravel integration
- ✅ Date format normalization
- ✅ Bank code lookup by name
Requirements
- PHP 8.2 or higher
- Laravel 11.x or 12.x
- Guzzle HTTP client (installed automatically via composer)
Installation
For Laravel Projects
-
The package is available in composer. Run composer install:
-
The service provider is already registered via Laravel's package auto-discovery.
- Run:
Usage
Basic Usage (Framework-Agnostic)
Laravel Usage
Get Available Banks
Bank Code Lookup
Date Formatting
Custom Logger
Timeout Options
Form Data Structure
Required Fields
| Field | Type | Description | Example |
|---|---|---|---|
fecha |
string | Payment date in dd-mm-yyyy format | '15-01-2024' |
tipoCriterio |
string | Search criteria type: 'T' (tracking) or 'R' (reference) | 'T' |
criterio |
string | Tracking key (max 30) or reference (max 7) | '1234567890' |
emisor |
string | Sender bank code (numeric) | '40012' |
receptor |
string | Receiver bank code (numeric) | '40002' |
cuenta |
string | Beneficiary CLABE account (18 digits) | '012345678901234567' |
monto |
string | Payment amount | '1500.00' |
Validation Rules
- fecha: Must be dd-mm-yyyy or dd/mm/yyyy format
- tipoCriterio: Must be 'T' or 'R'
- criterio: Max 30 chars for tracking key, max 7 for reference
- emisor/receptor: Must be numeric bank codes
- cuenta: Must be 18 digits for CLABE format
- monto: Must be numeric (commas allowed)
Response Format
Successful Query (Payment Found)
Payment Not Found
No Result
Error Handling
The library throws Exception for various error conditions:
Common exceptions:
Required field missing: {field}Invalid tipoCriterio. Must be 'T' or 'R'Invalid date format. Use dd-mm-yyyy or dd/mm/yyyyInvalid CLABE format. Must be 18 digitsCEP HTTP request failed: {message}
Configuration
Timeout
Default timeout is 60 seconds.
Custom HTTP Client
You can provide a custom Guzzle HTTP client:
Security Considerations
- Form data is sanitized before logging (sensitive fields are masked)
- CLABE accounts show only last 4 digits in logs
- Tracking keys/references show only last 3 characters in logs
- Use environment variables for sensitive configuration
- Consider rate limiting to avoid overloading CEP system
Performance Tips
- Cache Bank Options: Bank codes rarely change, cache them
- Adjust Timeouts: Reduce for faster failures, increase for slow networks
- Queue Jobs: For Laravel, use queues for CEP queries
- Error Monitoring: Log failures for debugging
Troubleshooting
HTTP Request Fails
- Check network connectivity
- Verify CEP website is accessible
- Consider server location (latency)
- Review logs for detailed error messages
Timeout Errors
- Increase timeout in options
- Check network connectivity
- Verify CEP website is accessible
Invalid Response
- CEP website may have changed structure
- Verify form data is correct
No Results Found
- Verify payment date is correct
- Check tracking key/reference number
- Ensure bank codes are correct
- Confirm CLABE account matches
- Payment may not exist in system
Development
Running Tests
License
MIT License - See LICENSE file for details
Support
For issues, questions, or contributions, please feel free to open a GitHub issue.
Credits
Developed for Carlos Sosa.
Changelog
Version 1.0.0 (2025)
- Initial release
- Support for payment queries
- Bank options retrieval
- Laravel integration
- Comprehensive validation
All versions of cep-query-payment with dependencies
illuminate/support Version ^11.0|^12.0
symfony/process Version ^7.0
nesbot/carbon Version ^3.10