-
Notifications
You must be signed in to change notification settings - Fork 61
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 support for pain.001.001.09/pain.008.001.08 #68
Conversation
Hey, thanks for the pull request and insights! I think if you add xsd-validator to devDependencies we should be good. What is the license on the xsd files, are they compatible with MPL and free to use? |
The xsd files seem to be free to use, see https://www.iso20022.org/terms-use |
I have added support and schema validation tests for direct debit. To make it work, I had to remove support for some very old formats. This will make the change breaking. |
Nice to see this implemented, I had to manually patch our pain.008.001.08 xml file before 🎉 However, the generated direct debit file from this PR doesn't validate against the pain.008.001.08_GBIC_4.xsd found here in DK-TVS_SEPA_GBIC_4undISO_Originale.zip (checked using xmllint). |
@leMaik thanks for validating! I found the ebics specification is more strict than the ISO one. The |
@fellmann Nice! I can confirm that the file now validates against the EBICS schema when generated with this PR. |
Would it make sense to introduce different validation modes where the consumer can pick iso vs ebics and the code generates slightly different xml? Or is that a non-issue with the current state? |
I am no expert, but I believe it is ok as it is. The xml makes sense now, and validates against both schemas. Including an unused field is not desirable in any scenario. |
seems I forgot to remove the outdated tests |
At least our bank seems to validate against the ebics schema and declines files that are valid iso but not valid ebics. So imho this library should aim to support both schemas by omitting fields that are optional in one schema and disallowed in the other. |
I'm going to merge this for now, but wouldn't be opposed to different validation settings and then including the optional field if it is helpful for some scenarios. @leMaik is that maybe something you'd be willing to contribute? |
@kewisch Tbh I don't have a use case for the less strict (ie. invalid according to our bank) schema. Would it be useful to add validation against the ebics specification, additionally to the ISO one? We could then add a toggle for which target specification the XML should match, if there are any differences in the future. That would also allow to support multiple SEPA versions at the same time (if that's a use-case). |
Yes, this is what I meant, a toggle for the target specification between iso and ebics. If there are use cases for the addtional fields in iso and someone's bank supports iso, having a toggle would be useful. |
Closes #66 and #67