+sub _specified_trade_settlement_payment_means {
+ my ($self, %params) = @_;
+
+ # <ram:SpecifiedTradeSettlementPaymentMeans>
+ $params{xml}->startTag('ram:SpecifiedTradeSettlementPaymentMeans');
+ $params{xml}->dataElement('ram:TypeCode', $self->direct_debit ? 59 : 58); # 59 = SEPA direct debit, 58 = SEPA credit transfer
+
+ if ($self->direct_debit) {
+ $params{xml}->startTag('ram:PayerPartyDebtorFinancialAccount');
+ $params{xml}->dataElement('ram:IBANID', $self->customer->iban);
+ $params{xml}->endTag;
+
+ } else {
+ $params{xml}->startTag('ram:PayeePartyCreditorFinancialAccount');
+ $params{xml}->dataElement('ram:IBANID', $params{bank_account}->iban);
+ $params{xml}->endTag;
+ }
+
+ $params{xml}->endTag;
+ # </ram:SpecifiedTradeSettlementPaymentMeans>
+}
+