Closed (fixed)
Project:
Commerce ifthenpay: Multibanco, MB WAY and credit card payments
Version:
2.0.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
4 Oct 2025 at 07:56 UTC
Updated:
10 Nov 2025 at 14:24 UTC
Jump to comment: Most recent
Comments
Comment #3
introfini commentedMajor improvements to Multibanco and MB Way payment gateways:
- Implement hash-based collision prevention for order IDs > 9999
- Add comprehensive webhook validation (entity, anti-phishing, amount)
- Fix order.paid event not firing reliably in webhook context
- Add proper dependency injection and logger service
- Implement collision-aware payment selection by amount matching
- Add configuration form validation
- Fix unnecessary payment saves on admin page loads
- Add Commerce Log integration for collision warnings
Technical changes:
- Replace simple truncation with CRC32 hash algorithm
- Store original order IDs for audit trail
- Validate all webhook parameters with proper HTTP status codes
- Explicitly save orders when balance reaches zero
- Add collision detection with database queries
New methods: processOrderIdForReference(), checkForOrderIdCollisions(),
findAllPaymentsByRemoteId(), selectBestPaymentCandidate()
New files: commerce_ifthenpay.services.yml, commerce_ifthenpay.commerce_log_categories.yml, commerce_ifthenpay.commerce_log_templates.yml
Backward compatible. No breaking changes.
Comment #5
introfini commentedA new mode is planned to use the new Ifthenpay API that doesn't have the order number limitations.
In the meantime, these changes significantly reduce the collision problem by:
- Using hash-based distribution instead of simple truncation
- Implementing collision detection and logging
- Providing intelligent payment selection by amount matching