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

Incompatibility to Swiss Banks #42

Closed
dodgeram opened this issue Apr 21, 2015 · 3 comments
Closed

Incompatibility to Swiss Banks #42

dodgeram opened this issue Apr 21, 2015 · 3 comments

Comments

@dodgeram
Copy link

Hi,

I'm not quite familiar with github and don't want be part of this project, but I've made some improvements you might want to include to this.

Swiss Banks are obviously using a special form of the ISO 20022 standard. They partially use limitations to fields and declare some fields as mandatory that are usually optionally and therefore not implemented here in this package.

See here for the implementation recommendations of SIX, that explain the Swiss modifications:
http://www.six-interbank-clearing.com/de/home/standardization/iso-payments/customer-bank/swiss-recommendations.html

I patched the following files to adapt this package, maybe you'd like to take over these changes to this project.

diff -rupN sepa_king-master/lib/sepa_king/message/direct_debit.rb sepa_king-patched/lib/sepa_king/message/direct_debit.rb
--- sepa_king-master/lib/sepa_king/message/direct_debit.rb  2015-03-31 07:44:59.000000000 +0200
+++ sepa_king-patched/lib/sepa_king/message/direct_debit.rb 2015-04-20 18:03:50.313914000 +0200
@@ -86,6 +86,9 @@ module SEPA
     def build_transaction(builder, transaction)
       builder.DrctDbtTxInf do
         builder.PmtId do
+          if transaction.instruction.present?
+            builder.InstrId(transaction.instruction)
+          end
           builder.EndToEndId(transaction.reference)
         end
         builder.InstdAmt('%.2f' % transaction.amount, Ccy: 'EUR')
diff -rupN sepa_king-master/lib/sepa_king/message.rb sepa_king-patched/lib/sepa_king/message.rb
--- sepa_king-master/lib/sepa_king/message.rb   2015-03-31 07:44:59.000000000 +0200
+++ sepa_king-patched/lib/sepa_king/message.rb  2015-04-20 18:17:54.105928000 +0200
@@ -103,6 +103,15 @@ module SEPA
         builder.CtrlSum('%.2f' % amount_total)
         builder.InitgPty do
           builder.Nm(account.name)
+          if account.class == CreditorAccount and account.creditor_identifier.present?
+            builder.Id do
+              builder.OrgId do
+                builder.Othr do
+                  builder.Id(account.creditor_identifier)
+                end
+              end
+            end
+          end
         end
       end
     end

Furthermore I got the following recommendations from our Swiss Bank:

(0001) Der Namespace 'urn:iso:std:iso:20022:tech:xsd:pain.008.003.02' wurde ersetzt durch 'http://www.six-interbank-clearing.com/de/pain.008.001.02.ch.01.xsd', um gegen das XML-Schema testen zu können.

(0001) Hinweis: Statt dem Schweizer XML-Schema wurde das ISO XML-Schema verwendet. Das zu verwendende XML-Schema ist mit den jeweiligen Finanzinstituten abzustimmen.

(0024) Hinweis: <NbOfTxs> wird in der Regel von den Schweizer Instituten nicht geprüft

(0025) Hinweis: <CtrlSum> wird in der Regel von den Schweizer Instituten nicht geprüft.

(0065) Hinweis: <EndToEndId> - In der Schweiz wird die Verwendung von maximal 16 Stellen empfohlen

Only important thing seems to be the change of the namespace, which is currently not possible to set with sepa_king. Maybe you can find a solution to pass it through or set it automatically for Swiss Bank connections.

Cheers,
Markus

@bhh
Copy link

bhh commented Apr 29, 2015

hehe same problem for austria with the schema except its not a warning and a suggestion they refuse it with the non austrian schema. why is there an international standard if every country adapts it anyway? ;)

@sloanecourt
Copy link

Even worse when you get to the Italian CBI* implementation.

@ledermann
Copy link
Member

Seems to me that this issue was fixed by #44, so I'm closing it. Please tell if there are still any problems.

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

4 participants