salesking / sepa_king

Ruby gem for creating SEPA XML files
MIT License
150 stars 117 forks source link

Support Swiss Payment Standards #81

Closed tobischo closed 6 years ago

tobischo commented 6 years ago

Switzerland uses pain.001 and pain.008 Formats that are derived from the official SEPA standard. These formats are defined by the SIX Group (https://www.six-group.com/interbank-clearing/de/home/standardization/iso-payments/customer-bank/implementation-guidelines.html).

While Swiss Payment Standards (SPS) are very similar to SEPA, they technically aren't part of it. In order to support it regardless, the following formats would have to be supported:

Would you be willing to accept a PR that adds support for it? (even though it is technically not SEPA)

ledermann commented 6 years ago

Yes, a PR would be fine.

tobischo commented 6 years ago

Great :-) I will try to get a PR ready soon

tobischo commented 6 years ago

I have looked into this some more and I came across the following: There are a number of differences, especially for debits:

Credit Transfers [1]:

Direct Debits [2] for LSV+:

That seems like quite a lot of differences, although some being rather minor. My current approach is to add swiss direct debits into the existing SEPA::DirectDebit class

I am not entirely sure whether this is the best approach though. Alternative I could think of

  1. create a separate class for swiss direct debits within the SEPA namespace
  2. create a separate class for swiss direct debits in a new namespace (e.g. SPS)
  3. create an entirely separate gem which is similar to sepa_king (e.g. sps_king, maintained by Barzahlen)

What do you think?

[1] https://www.six-group.com/interbank-clearing/dam/downloads/de/standardization/iso/swiss-recommendations/implementation-guidelines-ct.pdf [2] https://www.six-group.com/interbank-clearing/dam/downloads/de/standardization/iso/swiss-recommendations/implementation-guidelines-swiss-dd.pdf

tobischo commented 6 years ago

Closed as per discussion on #82

We will create a separate gem that handles this which will probably look very similar to sepa_king.