Skip to content

Commit

Permalink
Rename field to org id
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Schoknecht committed Sep 23, 2024
1 parent a8e54f8 commit 63859f5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ sdd = SEPA::DirectDebit.new(

# Creditor Identifier, in German: Gläubiger-Identifikationsnummer
# String, max. 35 chars
creditor_identifier: 'DE98ZZZ09999999999'
creditor_identifier: 'DE98ZZZ09999999999',

# Optional: Organization ID, in German: Organisationsidentifier
# Can be e.g. an EBICS Account ID
# String
organization_id: 'EXAMPLE1'
)

# Second: Add transactions
Expand Down Expand Up @@ -165,7 +170,12 @@ sct = SEPA::CreditTransfer.new(

# International Bank Account Number of the debtor
# String, max. 34 chars
iban: 'DE87200500001234567890'
iban: 'DE87200500001234567890',

# Optional: Organization ID, in German: Organisationsidentifier
# Can be e.g. an EBICS Account ID
# String
organization_id: 'EXAMPLE1'
)

# Second: Add transactions
Expand Down
2 changes: 1 addition & 1 deletion lib/sepa_king/account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Account
include ActiveModel::Validations
extend Converter

attr_accessor :name, :iban, :bic, :initiating_party
attr_accessor :name, :iban, :bic, :organization_id
convert :name, to: :text

validates_length_of :name, within: 1..70
Expand Down
4 changes: 2 additions & 2 deletions lib/sepa_king/message.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ def build_group_header(builder)
other_id = account.creditor_identifier
end

if account.initiating_party != nil
other_id = account.initiating_party
if account.organization_id != nil
other_id = account.organization_id
end

builder.GrpHdr do
Expand Down
4 changes: 2 additions & 2 deletions spec/direct_debit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -269,11 +269,11 @@
bic: 'BANKDEFFXXX',
iban: 'DE87200500001234567890',
creditor_identifier: 'DE98ZZZ09999999999',
initiating_party: 'EXAMPLE1'
organization_id: 'EXAMPLE1'
end

it 'should have initiating party' do
expect(subject).to have_xml('//Document/CstmrDrctDbtInitn/GrpHdr/InitgPty/Id/OrgId/Othr/Id', direct_debit.account.initiating_party)
expect(subject).to have_xml('//Document/CstmrDrctDbtInitn/GrpHdr/InitgPty/Id/OrgId/Othr/Id', direct_debit.account.organization_id)
end
end

Expand Down

0 comments on commit 63859f5

Please sign in to comment.