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

Support SPS-2022 #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

sdespont
Copy link

@sdespont sdespont commented Oct 3, 2023

This PR supports SPS-2022 specifications, issue #10

Delta guide
Specifications

As I have been dealing with several banks for years, I know that there will be a complex transition during 2024 between banks that only accept SPS-2021 files, or only SPS-2022 files, or both. Some banks still provide V11 files instead of CAMT.054 files, for example. I therefore decided to support both formats via the CustomerCreditTransfer constructor parameter, for reasons of flexibility and backwards compatibility.

Changes summary for SPS-2022:

  • Schema name and location
  • Element name changed from BICBICFI
  • Element ReqdExctnDt must have Dt wrapper for dates
  • Texts support new chars €ȘșȚț
  • New CtctDtls elements
  • Exclude transaction types for local instruments CH01, CH02 and CH03
  • Adapt tests

There's a real problem with the file pain.001.001.09.ch.03.xsd on line 1556 with the new RegEx which validates text characters. PHP libxml throw a formatting rules error. After some tests, it works if the lasts rules are inversed.

Official : <xs:pattern value="[\p{IsBasicLatin}\p{IsLatin-1Supplement}\p{IsLatinExtended-A}€ȘșȚț-[\p{C}]]+"/>
Fixed : <xs:pattern value="[\p{IsBasicLatin}\p{IsLatin-1Supplement}\p{IsLatinExtended-A}-\p{C}€ȘșȚț]+"/>

Currently, the file pain.001.001.09.ch.03.xsd contains the fixed pattern. I have contacted SIX to see if it is possible to change this rule. I will post an update here.

@sdespont
Copy link
Author

sdespont commented Oct 4, 2023

Answer from SIX : no XSD update possible. Without being pessimistic, I was expecting an answer like this.

Good Morning,

Thank you for your mail.

Our published XML-Schema is not intended as a universal base for generating or creating models/libraries of any kind.
Due to the many different libraries/systems/languages on the market having different requirements for XSD files used, it is not possible to provide amendments to the published XSD or any special XSDs.

If you would like to use our published XSD, you are more than welcome to do so but you need to make the necessary changes and subsequently necessary testing yourself.
And as we are not familiar with your setup and the tools/libraries used, we unfortunately can not comment on any suggested changes/fixes.

Thank you for your understanding and kind regards,

Best Regards
Iso-payments.ch

@sdespont
Copy link
Author

sdespont commented Oct 4, 2023

And the answer from PHP : it is a known bug not from PHP but libxml library. The bug is fixed since version 2.10.0 and Ubuntu version 20.04 (my dev env and the one used in the github workflow) is shipped with the version 2.9.10.

php/php-src#12353

From my point of view, the XSD should be adapted as I suggested in the first message, at least in this library so that the test suite can validate the XML generated.

By the way, the version of libxml can be known by checking LIBXML_VERSION PHP constant.

@sdespont
Copy link
Author

Is there someone to review / merge this PR in a new major version 3.X ?

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

Successfully merging this pull request may close these issues.

1 participant