Restrict validate_request to accept Processor instead of Platform
The validate_request function currently takes a Platform and extracts the Processor from it to validate the merchant ID. This is broader than necessary and allows unintended inputs.
Current:
validate_request(&request, &platform)
Proposed:
validate_request(&request, &processor)
Updating the function signature to accept Processor directly improves type safety, removes unnecessary coupling to Platform, and makes the function’s intent clearer.
Expected outcome
- validate_request takes Processor instead of Platform
- All call sites updated accordingly
- No functional behavior change