Export/Ebics: Implement version customization
Some checks failed
Test / Run tests (push) Failing after 2m22s
Some checks failed
Test / Run tests (push) Failing after 2m22s
This commit is contained in:
@ -66,6 +66,9 @@ namespace Elwig.Helpers {
|
||||
public string? TextEmailSubject;
|
||||
public string? TextEmailBody;
|
||||
|
||||
public int ExportEbicsVersion;
|
||||
public int ExportEbicsAddress;
|
||||
|
||||
public ClientParameters(AppDbContext ctx) : this(ctx.ClientParameters.ToDictionary(e => e.Param, e => e.Value)) { }
|
||||
|
||||
public ClientParameters(Dictionary<string, string?> parameters) {
|
||||
@ -128,6 +131,13 @@ namespace Elwig.Helpers {
|
||||
if (TextEmailSubject == "") TextEmailSubject = null;
|
||||
TextEmailBody = parameters.GetValueOrDefault("TEXT_EMAIL_BODY");
|
||||
if (TextEmailBody == "") TextEmailBody = null;
|
||||
|
||||
ExportEbicsVersion = int.TryParse(parameters.GetValueOrDefault("EXPORT_EBICS_VERSION"), out var v) ? v : 9;
|
||||
switch (parameters.GetValueOrDefault("EXPORT_EBICS_ADDRESS", "FULL")?.ToUpper()) {
|
||||
case "OMIT": ExportEbicsAddress = 0; break;
|
||||
case "LINES": ExportEbicsAddress = 1; break;
|
||||
case "FULL": ExportEbicsAddress = 2; break;
|
||||
}
|
||||
} catch {
|
||||
throw new KeyNotFoundException();
|
||||
}
|
||||
@ -155,6 +165,12 @@ namespace Elwig.Helpers {
|
||||
case 1: orderingMemberList = "NAME"; break;
|
||||
case 2: orderingMemberList = "KG"; break;
|
||||
}
|
||||
string exportEbicsAddress = "FULL";
|
||||
switch (ExportEbicsAddress) {
|
||||
case 0: exportEbicsAddress = "OMIT"; break;
|
||||
case 1: exportEbicsAddress = "LINES"; break;
|
||||
case 2: exportEbicsAddress = "FULL"; break;
|
||||
}
|
||||
return [
|
||||
("CLIENT_NAME_TOKEN", NameToken),
|
||||
("CLIENT_NAME_SHORT", NameShort),
|
||||
@ -180,7 +196,9 @@ namespace Elwig.Helpers {
|
||||
("TEXT_DELIVERYCONFIRMATION", TextDeliveryConfirmation),
|
||||
("TEXT_CREDITNOTE", TextCreditNote),
|
||||
("TEXT_EMAIL_SUBJECT", TextEmailSubject),
|
||||
("TEXT_EMAIL_BODY", TextEmailBody)
|
||||
("TEXT_EMAIL_BODY", TextEmailBody),
|
||||
("EXPORT_EBICS_VERSION", ExportEbicsVersion.ToString()),
|
||||
("EXPORT_EBICS_ADDRESS", exportEbicsAddress),
|
||||
];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user