Class FinSepaOrderBuilder
Abstract base class for single and multiple, postdated and direct SEPA credit transfer and/or SEPA direct debit orders.
public abstract class FinSepaOrderBuilder : FinOrderBuilder
- Inheritance
-
FinSepaOrderBuilder
- Derived
- Inherited Members
Constructors
FinSepaOrderBuilder(FinContact, SepaMessageType, bool)
Creates a new SEPA order builder with the preferred account type class FinAcctTypeClass.Giro.
protected FinSepaOrderBuilder(FinContact aContact, SepaMessageType nMessageType, bool fIsMultOrderBuilder = false)
Parameters
aContact
FinContactThe contact for which the order builder shall create orders. This is used to get the FinTS version, the bank parameter data and the user parameter data that are in effect. This parameter must not be
null
.nMessageType
SepaMessageTypeThe type of the SEPA message which can be embedded within this FinTS order. Messages of this type are expected in the SEPA documents which are processed by Build. Currently SepaMessageType.CreditTransferPaymentInitiation and SepaMessageType.DirectDebitPaymentInitiation are supported.
fIsMultOrderBuilder
boolMust be
true
for multiple SEPA order builders.
Exceptions
- ArgumentNullException
Parameter aContact was
null
.- ArgumentException
The parameter nMessageType is neither SepaMessageType.CreditTransferPaymentInitiation nor SepaMessageType.DirectDebitPaymentInitiation.
Properties
DataElementPosition
Must return the data element position where the actual binary SEPA message is inserted into the order segment.
protected virtual int DataElementPosition { get; }
Property Value
Remarks
If BuildSepaSegment(FinSepaRemitt) is overridden, then this getter must be overridden, too.
IsMultipleOrderBuilder
Is true
if this is a builder for a multiple SEPA order.
protected bool IsMultipleOrderBuilder { get; }
Property Value
MaxLeadTime
Maximum number of days that a postdated order can be scheduled in advance according to the bank parameter data (BPD). The value zero means that an order cannot be scheduled at all..
public virtual int MaxLeadTime { get; }
Property Value
Remarks
The default implementation returns zero.
MaxNumberOfTransactions
Maximum number of allowed transaction information items in the SEPA order.
public int MaxNumberOfTransactions { get; }
Property Value
Remarks
If this parameter does not exist, then this implementation always returns 1.
MessageType
Messages of this type can be embedded into the generated order segment.
public SepaMessageType MessageType { get; }
Property Value
MinLeadDateTimeUtc
Provides the earliest date and time when the order can be scheduled according to the bank parameter data (BPD).
public virtual DateTime MinLeadDateTimeUtc { get; }
Property Value
Remarks
The returned DateTime
is an UTC timestamp. It can be converted into local
time.
For instant payments the minimum lead time may be given in minutes, thus the property MinLeadTime, which provides a number of days, is not good enough.
- See Also
MinLeadTime
Minimum number of days that a postdated order can be scheduled in advance according to the bank parameter data (BPD). The value zero means an order can be scheduled for today.
public virtual int MinLeadTime { get; }
Property Value
- See Also
RequestFallbackAllowed
public bool RequestFallbackAllowed { get; }
Property Value
RequestedExecutionDateOptions
public FinDateOptions RequestedExecutionDateOptions { get; }
Property Value
SingleBookgAllowed
Is single booking of batches allowed?
public bool SingleBookgAllowed { get; }
Property Value
Remarks
The default implementation always returns false. Hence, builders for batch order types must override this property accordingly.
SupportedPainFormats
Returns an array of simple pain identifiers of the supported SEPA pain XML formats.
public string[] SupportedPainFormats { get; }
Property Value
- string[]
The returned array may be empty, but is never
null
.
SupportedPurposeCodes
Optional array of SEPA PurposeCodes supported by this order builder.
public string[] SupportedPurposeCodes { get; }
Property Value
- string[]
The returned array may be empty, but is never
null
.
Remarks
The default implementation in this FinSepaOrderBuilder base class always returns an empty array. Only a few derived specialized builder classes override this property and provide a list of purpose codes from the actual BPD segment.
SupportedSepaFormats
Returns an array with the descriptors (URN) of the SEPA XML formats supported by this builder.
public string[] SupportedSepaFormats { get; }
Property Value
- string[]
Remarks
The data provided by actual banks is widely different and inconclusive. Thus this information is rather worthless and should be ignored. Use the processed SupportedPainFormats instead.
TotalAmountRequired
Must the total amount be specified in a batch order.
public bool TotalAmountRequired { get; }
Property Value
Remarks
The default implementation always returns false. Hence, builders for batch order types must override this property accordingly.
Methods
Build(FinAcct, SepaDocument)
Build a SEPA order from a SepaDocument.
public virtual FinSepaOrder Build(FinAcct aAcct, SepaDocument aSepaDoc)
Parameters
aAcct
FinAcctThe ordering customer account of the order to be built. The given instance must be initialized with a valid IBAN and BIC.
aSepaDoc
SepaDocumentA completely initialized SEPA payment initiation message document. This must have only a single payment information block. The number of transaction information blocks depends on the order type (single order type or multiple order type).
Returns
Remarks
This method should be used if an external SEPA document was loaded and shall be submitted to the bank. In order to create a SEPA payment in code, it is better and easier to create a SepaPaymentInitiation message and use the method Build(FinAcct, SepaPaymentInitiation) instead.
Exceptions
- ArgumentNullException
At least one of the parameters was
null
.- ArgumentException
The given account did not contain a valid IBAN, or did not contain a valid BIC. Or the given SEPA document was not valid. Or the BIC and IBAN of the given account does not match the BIC and IBAN of the initiator in the SEPA document.
- See Also
Build(FinAcct, SepaPaymentInitiation)
Build a SEPA order from a SepaPaymentInitiation that contains payments.
public FinOrder Build(FinAcct aAcct, SepaPaymentInitiation aPainMsg)
Parameters
aAcct
FinAcctThe ordering customer account of the order to be built. The given instance must be initialized with a valid IBAN and BIC.
aPainMsg
SepaPaymentInitiationA completely initialized SEPA payment initiation message. This must have only a single payment information block. The number of transaction information blocks depends on the order type (single order type or multiple order type).
Returns
Remarks
This method automatically finds the highest PAIN version supported by the bank and creates a corresponding SepaDocument.
Exceptions
- ArgumentNullException
At least one of the parameters was
null
.- ArgumentException
The given account did not contain a valid IBAN, or did not contain a valid BIC. Or the given SEPA document was not valid. Or the BIC and IBAN of the given account does not match the BIC and IBAN of the initiator in the SEPA document.
- NotSupportedException
No supported PAIN format could be found. Please check with SupportedPainFormats whether a PAIN format is supported by the bank.
- See Also
BuildSepaOrder(FinSegment, FinSepaRemitt)
protected FinSepaOrder BuildSepaOrder(FinSegment aSegment, FinSepaRemitt aSepaRemitt)
Parameters
aSegment
FinSegmentaSepaRemitt
FinSepaRemitt
Returns
BuildSepaSegment(FinSepaRemitt)
protected virtual FinSegment BuildSepaSegment(FinSepaRemitt aSepaRemitt)
Parameters
aSepaRemitt
FinSepaRemitt
Returns
Exceptions
- ArgumentException
The PAIN format of the given SEPA remittance document is not supported by the bank.
Create(FinContact, string)
Creates a new FinSepaOrderBuilder derived instance that is suitable for submitting orders with the given HBCI segment type.
public static FinSepaOrderBuilder Create(FinContact aContact, string sSegmentType)
Parameters
aContact
FinContactThe contact for which to submit an order.
sSegmentType
stringThe segment type of the requested order.
Returns
- FinSepaOrderBuilder
If a suitable builder for the given segment type is available, then it is created and returned. If the segment type is not supported, then
null
is returned.
FindSepaFormat(string)
Finds the SEPA format descriptor for a given SEPA Pain identifier or a SEPA message XML namespace that contains a Pain identifier.
public string FindSepaFormat(string sSepaFormat)
Parameters
sSepaFormat
stringA SEPA Pain identifier in the format pain.000.000.00, or a SEPA message XML namespace that contains a Pain identifier, or any other string that contains a Pain identifier.
Returns
- string
If found, then the first matching SEPA format descriptor from the parameter segment is returned. If no match was found, then
null
is returned.
Exceptions
- ArgumentNullException
The parameter sSepaFormat was
null
.- ArgumentException
The parameter sSepaFormat was an empty string, or it did not contain a valid Pain identifier.
GetRequestedExecutionTimeConstraints()
public FinTimeConstraints GetRequestedExecutionTimeConstraints()
Returns
OnPreparePaymentInformation(FinAcct, SepaPaymentInformation)
Can be reimplemented by derived classes to do further checks/preparations on the given payment information item.
protected virtual void OnPreparePaymentInformation(FinAcct aAcct, SepaPaymentInformation aPmtInf)
Parameters
aAcct
FinAcctaPmtInf
SepaPaymentInformation