-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for direct debit payment means
- Loading branch information
Showing
11 changed files
with
137 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
module Xrechnung | ||
# <cac:PayeeParty> | ||
# <cac:PartyIdentification> | ||
# <cbc:ID schemeID="SEPA">FR932874294</cbc:ID> | ||
# </cac:PartyIdentification> | ||
# <cac:PartyName> | ||
# <cbc:Name>Payee Name Ltd</cbc:Name> | ||
# </cac:PartyName> | ||
# </cac:PayeeParty> | ||
class PayeeParty | ||
include MemberContainer | ||
|
||
# @!attribute id | ||
# @return [String] | ||
member :id, type: String | ||
|
||
# @!attribute name | ||
# @return [String] | ||
member :name, type: String, optional: true | ||
|
||
# noinspection RubyResolve | ||
def to_xml(xml) | ||
xml.cac :PayeeParty do | ||
xml.cac :PartyIdentification do | ||
xml.cbc :ID, id, schemeID: "SEPA" | ||
end | ||
|
||
if name | ||
xml.cac :PartyName do | ||
xml.cbc :Name, name | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
module Xrechnung | ||
# <cac:PaymentMandate> | ||
# <cbc:ID>SEPA-MANDAT-123</cbc:ID> | ||
# <cac:PayerFinancialAccount> | ||
# <cbc:ID>DE02500105170137075030</cbc:ID> | ||
# </cac:PayerFinancialAccount> | ||
# </cac:PaymentMandate> | ||
class PaymentMandate | ||
include MemberContainer | ||
|
||
# @!attribute id | ||
# @return [String] | ||
member :id, type: String | ||
|
||
# @!attribute payer_financial_account_id | ||
# @return [String] | ||
member :payer_financial_account_id, type: String | ||
|
||
# noinspection RubyResolve | ||
def to_xml(xml) | ||
xml.cac :PaymentMandate do | ||
xml.cbc :ID, id | ||
xml.cac :PayerFinancialAccount do | ||
xml.cbc :ID, payer_financial_account_id | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
def build_payee_party | ||
Xrechnung::PayeeParty.new( | ||
id: "FR932874294", | ||
name: "Payee Name Ltd", | ||
) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
def build_payment_mandate | ||
Xrechnung::PaymentMandate.new( | ||
id: "SEPA-MANDAT-123", | ||
payer_financial_account_id: "DE02500105170137075030", | ||
) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<cac:PayeeParty> | ||
<cac:PartyIdentification> | ||
<cbc:ID schemeID="SEPA">FR932874294</cbc:ID> | ||
</cac:PartyIdentification> | ||
<cac:PartyName> | ||
<cbc:Name>Payee Name Ltd</cbc:Name> | ||
</cac:PartyName> | ||
</cac:PayeeParty> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<cac:PaymentMandate> | ||
<cbc:ID>SEPA-MANDAT-123</cbc:ID> | ||
<cac:PayerFinancialAccount> | ||
<cbc:ID>DE02500105170137075030</cbc:ID> | ||
</cac:PayerFinancialAccount> | ||
</cac:PaymentMandate> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require "spec_helper" | ||
load("spec/fixtures/ruby/payee_party.rb") | ||
|
||
RSpec.describe Xrechnung::PayeeParty do | ||
it "generates xml" do | ||
expect_xml_eq_fixture(build_payee_party, "payee_party") | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require "spec_helper" | ||
load("spec/fixtures/ruby/payment_mandate.rb") | ||
|
||
RSpec.describe Xrechnung::PaymentMandate do | ||
it "generates xml" do | ||
expect_xml_eq_fixture(build_payment_mandate, "payment_mandate") | ||
end | ||
end |