PHP Classes

Multiple country support

Recommend this page to a friend!

      PHP SEPA XML Generator  >  All threads  >  Multiple country support  >  (Un) Subscribe thread alerts  
Subject:Multiple country support
Summary:now available
Messages:9
Author:Stefan Kientzler
Date:2020-05-24 15:31:29
 

  1. Multiple country support   Reply   Report abuse  
Picture of Stefan Kientzler Stefan Kientzler - 2020-05-24 15:31:29
With version 1.1 there is multiple country support available (It's no longer limited to germany).
Some countries are implementet so far and the package can be extended to any of the SEPA participating countries.

Unfortunately I have no valid IC from the different countries for test purposes and I have not found any examples on the Internet. So I could not really test the validation correctly - I am grateful for informations regarding incorrect validation (and as well for cases that work correctly...) - preferably with a corresponding valid number.

I will gradually add validation to further countries as i needed. If someone should create class(es) for additional countries, I would not be mad to receive them by email to include them in the package :-)

  2. Re: Multiple country support   Reply   Report abuse  
Picture of Marco Callegari Marco Callegari - 2020-09-17 15:43:00 - In reply to message 1 from Stefan Kientzler
Hello!
I tried to add the validation for Italy. I took the FR validator, renamed in IT, but I got an error:
Fatal error: class SepaCntryValidationIT must implement SepaCntryValidation interface! in <mypath>/scripts/sepa/SKien/Sepa/Sepa.php on line 224

Am I missing something?

Thanks!

  3. Re: Multiple country support   Reply   Report abuse  
Picture of Marco Callegari Marco Callegari - 2020-09-17 15:52:45 - In reply to message 2 from Marco Callegari
I tried to add in sepa.php, inside the init method, this line:

self::addValidation('IT', 'SKien\Sepa\CntryValidation\SepaCntryValidationIT');

But no luck...

  4. Re: Multiple country support   Reply   Report abuse  
Picture of Marco Callegari Marco Callegari - 2020-09-17 16:19:36 - In reply to message 3 from Marco Callegari
ok, I removed the addValidation from the test page, keeping the added row in the sepa.php.
Actually for my case I've no the BIC of the customers, so I changed the validation for ignoring the BIC code.
It seems working.
Also, I improved a bit my Italian validator as I noticed there are some IBAN with alphanumeric part where I was thinking about only numbers. I'll verify tomorrow about the right IBAN structure for italy for aving a better validator (then I could send it to you!)

Best regards

  5. Re: Multiple country support   Reply   Report abuse  
Picture of Marco Callegari Marco Callegari - 2020-09-18 09:26:05 - In reply to message 4 from Marco Callegari
I got a already generated XML and it differs from the one generated with this library. Not sure if it's a custom XML for that bank, or if it's an older standard, or if it includes optional XML nodes.
I'll try to send the XML generated from this lib and I'll report here the results.

  6. Re: Multiple country support   Reply   Report abuse  
Picture of Stefan Kientzler Stefan Kientzler - 2020-09-21 14:21:03 - In reply to message 5 from Marco Callegari
Hi Marco,
The differences in the files created probably result from the use of different versions of the SEPA specification. This package creates a file of the version 'pain.008.002.02'(Debit)/'pain.001.002.03'(Credit).
You can see the version in the root element of the file:

<Document xmlns = "urn: iso: std: iso: 20022: tech: xsd: ** pain.008.002.02 **" ...

The banks should normally recognize the version used when reading in and process it accordingly.

The structure of an Italian IBAN is as follows:
Length: 27

2-digit country code
2-digit test number
1-digit code for the country code
5 characters from the bank's SWIFT / BIC
5-digit code for the branch of the bank
12-digit code for the account number

valid Example: IT60X0542811101000000123456

I haven't found any information whether the last 22 digits (BIC, branch and account number) are purely numeric or may contain alphanumeric characters (may you can reply more information)

  7. Re: Multiple country support   Reply   Report abuse  
Picture of Marco Callegari Marco Callegari - 2020-09-21 16:20:23 - In reply to message 6 from Stefan Kientzler
well, it seems my bank uses a different version of the standard.
<ns2:CBIBdySDDReq xmlns:ns2="urn:CBI:xsd:CBIBdySDDReq.00.01.00" xmlns="urn:CBI:xsd:CBISDDReqLogMsg.00.01.00" xmlns:SGNT="urn:CBI:xsd:CBISgnInf.001.04">

For the IBAN, there are cases where the account number has characters, not only numbers. So I changed the validation rule.

Your library seems generate an xml for the 85% like the one I need. Unfortunately I need to change some things (like the namespace) So I coded a totally custom routine. I've just to fix the date format as I discovered the date('Y-m-d\TH:i:s:uP') creates 6 digits for the milliseconds and I need just 3 digits.

Anyway, your library is great!

  8. Re: Multiple country support   Reply   Report abuse  
Picture of Stefan Kientzler Stefan Kientzler - 2020-09-22 10:39:49 - In reply to message 7 from Marco Callegari
thanks for the information.
After a little research I found the following wiki page:

wiki.xmldation.com/Support/CBI/Intr ...

on which the differences / extensions of the CBI scheme to the ISO20022 standard are described. I did'nt heared about the CBI scheme so far because it is obviously only used in Italy.
When I find the time, I'll take a closer look at the changes and check whether I can possibly include support for this scheme in the package.

Thanks also for the information about the Italian IBAN - sometimes things can only be found on the Internet if you have mastered the respective country languagge ;-)

  9. Re: Multiple country support   Reply   Report abuse  
Picture of Marco Callegari Marco Callegari - 2020-09-22 11:34:15 - In reply to message 8 from Stefan Kientzler
Well, i got mad with the date format.
The file downloaded from the bank had 3 digits for the milliseconds, but they accepted only dates without milliseconds from the webpage...
Not sure if it’s something related to that bank.
Actually i created everything with my code so I solved my troubles.
Of course, my solution it’s less flexible than your library but i was in hurry ;)

Good luck!