{"id":13463206,"url":"https://github.com/salesking/sepa_king","last_synced_at":"2025-05-16T02:10:20.087Z","repository":{"id":9986677,"uuid":"12016329","full_name":"salesking/sepa_king","owner":"salesking","description":"Ruby gem for creating SEPA XML files","archived":false,"fork":false,"pushed_at":"2024-06-04T07:08:40.000Z","size":412,"stargazers_count":152,"open_issues_count":14,"forks_count":122,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-05-09T15:52:53.245Z","etag":null,"topics":["banking","fintech","iban","payment","ruby","rubygems","sepa","xml"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/salesking.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-08-10T05:48:23.000Z","updated_at":"2025-04-24T20:30:12.000Z","dependencies_parsed_at":"2024-01-13T17:50:06.033Z","dependency_job_id":"20b622a0-a195-45a6-a0e0-37574a33a006","html_url":"https://github.com/salesking/sepa_king","commit_stats":{"total_commits":278,"total_committers":38,"mean_commits":7.315789473684211,"dds":0.2553956834532374,"last_synced_commit":"41d561362e7af4bcd7da7bfad97e6e5e2d32f7bb"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salesking%2Fsepa_king","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salesking%2Fsepa_king/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salesking%2Fsepa_king/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salesking%2Fsepa_king/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/salesking","download_url":"https://codeload.github.com/salesking/sepa_king/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254453667,"owners_count":22073618,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["banking","fintech","iban","payment","ruby","rubygems","sepa","xml"],"created_at":"2024-07-31T13:00:48.057Z","updated_at":"2025-05-16T02:10:20.064Z","avatar_url":"https://github.com/salesking.png","language":"Ruby","funding_links":[],"categories":["E-Commerce and Payments","Ruby","Payments and Banking"],"sub_categories":["Payments"],"readme":"# Ruby gem for creating SEPA XML files\n\n[![Build Status](https://github.com/salesking/sepa_king/workflows/Test/badge.svg?branch=master)](https://github.com/salesking/sepa_king/actions)\n[![Code Climate](https://codeclimate.com/github/salesking/sepa_king/badges/gpa.svg)](https://codeclimate.com/github/salesking/sepa_king)\n[![Coverage Status](https://coveralls.io/repos/salesking/sepa_king/badge.svg?branch=master)](https://coveralls.io/r/salesking/sepa_king?branch=master)\n[![Gem Version](https://badge.fury.io/rb/sepa_king.svg)](http://badge.fury.io/rb/sepa_king)\n\nWe love building payment applications! So after developing the [DTAUS library for Ruby](https://github.com/salesking/king_dtaus) we move on with SEPA.\n\n\n## Features\n\nThis gem implements the following two messages out of the ISO 20022 standard:\n\n* Credit Transfer Initiation (`pain.001.003.03`, `pain.001.002.03` and `pain.001.001.03`)\n* Direct Debit Initiation (`pain.008.003.02`, `pain.008.002.02` and `pain.008.001.02`)\n\nIt handles the _Specification of Data Formats_ v3.3 (2019-11-17).\n\nBTW: **pain** is a shortcut for **Pa**yment **In**itiation.\n\n\n## Requirements\n\n* Ruby 2.7 or newer\n* ActiveModel 4.2 or newer (including 7.0)\n\n\n## Installation\n\n    gem install sepa_king\n\n\n## Usage\n\nHow to create the XML for **Direct Debit Initiation** (in German: \"Lastschriften\")\n\n```ruby\n# First: Create the main object\nsdd = SEPA::DirectDebit.new(\n  # Name of the initiating party and creditor, in German: \"Auftraggeber\"\n  # String, max. 70 char\n  name:       'Gläubiger GmbH',\n\n  # OPTIONAL: Business Identifier Code (SWIFT-Code) of the creditor\n  # String, 8 or 11 char\n  bic:        'BANKDEFFXXX',\n\n  # International Bank Account Number of the creditor\n  # String, max. 34 chars\n  iban:       'DE87200500001234567890',\n\n  # Creditor Identifier, in German: Gläubiger-Identifikationsnummer\n  # String, max. 35 chars\n  creditor_identifier: 'DE98ZZZ09999999999'\n)\n\n# Second: Add transactions\nsdd.add_transaction(\n  # Name of the debtor, in German: \"Zahlungspflichtiger\"\n  # String, max. 70 char\n  name:                      'Zahlemann \u0026 Söhne GbR',\n\n  # OPTIONAL: Business Identifier Code (SWIFT-Code) of the debtor's account\n  # String, 8 or 11 char\n  bic:                       'SPUEDE2UXXX',\n\n  # International Bank Account Number of the debtor's account\n  # String, max. 34 chars\n  iban:                      'DE21500500009876543210',\n\n  # Amount\n  # Number with two decimal digit\n  amount:                    39.99,\n\n  # OPTIONAL: Currency, EUR by default (ISO 4217 standard)\n  # String, 3 char\n  currency:                  'EUR',\n\n  # OPTIONAL: Instruction Identification, will not be submitted to the debtor\n  # String, max. 35 char\n  instruction:               '12345',\n\n  # OPTIONAL: End-To-End-Identification, will be submitted to the debtor\n  # String, max. 35 char\n  reference:                 'XYZ/2013-08-ABO/6789',\n\n  # OPTIONAL: Unstructured remittance information, in German \"Verwendungszweck\"\n  # String, max. 140 char\n  remittance_information:    'Vielen Dank für Ihren Einkauf!',\n\n  # Mandate identifikation, in German \"Mandatsreferenz\"\n  # String, max. 35 char\n  mandate_id:                'K-02-2011-12345',\n\n  # Mandate Date of signature, in German \"Datum, zu dem das Mandat unterschrieben wurde\"\n  # Date\n  mandate_date_of_signature: Date.new(2011,1,25),\n\n  # Local instrument, in German \"Lastschriftart\"\n  # One of these strings:\n  #   'CORE' (\"Basis-Lastschrift\")\n  #   'COR1' (\"Basis-Lastschrift mit verkürzter Vorlagefrist\")\n  #   'B2B' (\"Firmen-Lastschrift\")\n  local_instrument: 'CORE',\n\n  # Sequence type\n  # One of these strings:\n  #   'FRST' (\"Erst-Lastschrift\")\n  #   'RCUR' (\"Folge-Lastschrift\")\n  #   'OOFF' (\"Einmalige Lastschrift\")\n  #   'FNAL' (\"Letztmalige Lastschrift\")\n  sequence_type: 'OOFF',\n\n  # OPTIONAL: Requested collection date, in German \"Fälligkeitsdatum der Lastschrift\"\n  # Date\n  requested_date: Date.new(2013,9,5),\n\n  # OPTIONAL: Enables or disables batch booking, in German \"Sammelbuchung / Einzelbuchung\"\n  # True or False\n  batch_booking: true\n\n  # OPTIONAL: Use a different creditor account\n  # CreditorAccount\n  creditor_account: SEPA::CreditorAccount.new(\n    name:                'Creditor Inc.',\n    bic:                 'RABONL2U',\n    iban:                'NL08RABO0135742099',\n    creditor_identifier: 'NL53ZZZ091734220000'\n  )\n\n  # OPTIONAL: Specify the country \u0026 address of the debtor (REQUIRED for SEPA debits outside of EU. The individually required fields depend on the target country)\n  debtor_address: SEPA::DebtorAddress.new(\n    country_code:        'CH',\n    # Not required if individual fields are used\n    address_line1:       'Mustergasse 123a',\n    address_line2:       '1234 Musterstadt'\n    # Not required if address_line1 and address_line2 are used\n    street_name:         'Mustergasse',\n    building_number:     '123a',\n    post_code:           '1234',\n    town_name:           'Musterstadt'\n  )\n)\nsdd.add_transaction ...\n\n# Last: create XML string\nxml_string = sdd.to_xml                    # Use schema pain.008.001.02\nxml_string = sdd.to_xml('pain.008.002.02') # Use schema pain.008.002.02\n```\n\n\nHow to create the XML for **Credit Transfer Initiation** (in German: \"Überweisungen\")\n\n```ruby\n# First: Create the main object\nsct = SEPA::CreditTransfer.new(\n  # Name of the initiating party and debtor, in German: \"Auftraggeber\"\n  # String, max. 70 char\n  name: 'Schuldner GmbH',\n\n  # OPTIONAL: Business Identifier Code (SWIFT-Code) of the debtor\n  # String, 8 or 11 char\n  bic:  'BANKDEFFXXX',\n\n  # International Bank Account Number of the debtor\n  # String, max. 34 chars\n  iban: 'DE87200500001234567890'\n)\n\n# Second: Add transactions\nsct.add_transaction(\n  # Name of the creditor, in German: \"Zahlungsempfänger\"\n  # String, max. 70 char\n  name:                   'Telekomiker AG',\n\n  # OPTIONAL: Business Identifier Code (SWIFT-Code) of the creditor's account\n  # String, 8 or 11 char\n  bic:                    'PBNKDEFF370',\n\n  # International Bank Account Number of the creditor's account\n  # String, max. 34 chars\n  iban:                   'DE37112589611964645802',\n\n  # Amount\n  # Number with two decimal digit\n  amount:                 102.50,\n\n  # OPTIONAL: Currency, EUR by default (ISO 4217 standard)\n  # String, 3 char\n  currency:               'EUR',\n\n  # OPTIONAL: Instruction Identification, will not be submitted to the creditor\n  # String, max. 35 char\n  instruction:               '12345',\n\n  # OPTIONAL: End-To-End-Identification, will be submitted to the creditor\n  # String, max. 35 char\n  reference:              'XYZ-1234/123',\n\n  # OPTIONAL: Unstructured remittance information, in German \"Verwendungszweck\"\n  # String, max. 140 char\n  remittance_information: 'Rechnung vom 22.08.2013',\n\n  # OPTIONAL: Requested execution date, in German \"Ausführungstermin\"\n  # Date\n  requested_date: Date.new(2013,9,5),\n\n  # OPTIONAL: Enables or disables batch booking, in German \"Sammelbuchung / Einzelbuchung\"\n  # True or False\n  batch_booking: true,\n\n  # OPTIONAL: Urgent Payment\n  # One of these strings:\n  #   'SEPA' (\"SEPA-Zahlung\")\n  #   'URGP' (\"Taggleiche Eilüberweisung\")\n  service_level: 'URGP'\n\n  # OPTIONAL: Unstructured information to indicate the purpose of the payment\n  # String, max. 4 char\n  category_purpose:         'SALA',\n\n  # OPTIONAL: Specify the country \u0026 address of the creditor (REQUIRED for SEPA debits outside of EU. The individually required fields depend on the target country)\n  creditor_address: SEPA::CreditorAddress.new(\n    country_code:        'CH',\n    # Not required if individual fields are used\n    address_line1:       'Mustergasse 123a',\n    address_line2:       '1234 Musterstadt'\n    # Not required if address_line1 and address_line2 are used\n    street_name:         'Mustergasse',\n    building_number:     '123a',\n    post_code:           '1234',\n    town_name:           'Musterstadt'\n  )\n)\nsct.add_transaction ...\n\n# Last: create XML string\nxml_string = sct.to_xml                    # Use schema pain.001.001.03\nxml_string = sct.to_xml('pain.001.002.03') # Use schema pain.001.002.03\n```\n\n## Validations\n\nYou can rely on our internal validations, raising errors when needed, during\nmessage creation.\nTo validate your models holding SEPA related information (e.g. BIC, IBAN,\nmandate_id) you can use our validator classes or rely on some constants.\n\nExamples:\n\n```ruby\nclass BankAccount \u003c ActiveRecord::Base\n  # IBAN validation, by default it validates the attribute named \"iban\"\n  validates_with SEPA::IBANValidator, field_name: :iban_the_terrible\n\n  # BIC validation, by default it validates the attribute named \"bic\"\n  validates_with SEPA::BICValidator, field_name: :bank_bic\nend\n\nclass Payment \u003c ActiveRecord::Base\n  validates_inclusion_of :sepa_sequence_type, in: SEPA::DirectDebitTransaction::SEQUENCE_TYPES\n\n  # Mandate ID validation, by default it validates the attribute named \"mandate_id\"\n  validates_with SEPA::MandateIdentifierValidator, field_name: :mandate_id\nend\n```\n\n**Beware:** The SEPA::IBANValidator is strict - e.g. it does not allow any spaces in the IBAN.\n\nAlso see:\n* [lib/sepa_king/validator.rb](https://github.com/salesking/sepa_king/blob/master/lib/sepa_king/validator.rb)\n* [lib/sepa_king/transaction/direct_debit_transaction.rb](https://github.com/salesking/sepa_king/blob/master/lib/sepa_king/transaction/direct_debit_transaction.rb)\n\n\n## Changelog\n\nhttps://github.com/salesking/sepa_king/releases\n\n\n## Contributors\n\nhttps://github.com/salesking/sepa_king/graphs/contributors\n\n\n## Resources\n\n* https://www.ebics.de/de/datenformate\n* SalesKing: http://salesking.eu\n\n\n## License\n\nReleased under the MIT license\n\nCopyright (c) 2013-2022 Georg Leciejewski (SalesKing), Georg Ledermann (https://github.com/ledermann)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalesking%2Fsepa_king","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsalesking%2Fsepa_king","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalesking%2Fsepa_king/lists"}