Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add validation functionality #4

Open
judgej opened this issue Jun 28, 2013 · 2 comments
Open

Add validation functionality #4

judgej opened this issue Jun 28, 2013 · 2 comments

Comments

@judgej
Copy link
Member

judgej commented Jun 28, 2013

A means to validate and to transform data (into valid formats) is needed to provide a robust working environment.

Some items, such as basket descriptions, can be truncated and have invalid characters removed, and stuff will still work as expected. Other fields cannot be transformed (munged) in this way, and need to result in a failed payment request so that remedial action can be taken.

The validation actually needs to happen before anything is submitted to SagePay, as the error responses we get back are not technically useful (e.g. they don't make it easy to identify the incorrect field - "the basket format is invalid" is one cringe-worthy example than can mean anything and SagePay will halt at the first error it finds and report only that one error. If every field on my submitted address is invalid, I would want to know about all of them and not have to submit the form once for each error and slowly work through them).

@Patabugen
Copy link
Contributor

As mentioned elsewhere, I'd suggest this be two tools. Validation to report an error about what's not correct, and Filter to try and automatically correct that data. That way the user (the developer, and if they're awesome their end user) can choose to automatically fix the data OR show the errors to be manually corrected. Especially in the case of taking money I'd much prefer manual corrections.

@judgej
Copy link
Member Author

judgej commented Nov 30, 2013

Agreed - validation without changing data.

@judgej judgej changed the title Add validartion functionality Add validation functionality Dec 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants