public static async Task <OpenBankingSoftwareStatementResponse> SubmitAsync( this SoftwareStatementProfileContext context) { context.ArgNotNull(nameof(context)); IList <FluentResponseMessage> validationErrors = Validate(context); if (validationErrors.Count > 0) { return(new OpenBankingSoftwareStatementResponse(messages: validationErrors, data: null)); } CreateSoftwareStatementProfile creator = new CreateSoftwareStatementProfile( softwareStatementProfileService: context.Context.SoftwareStatementProfileService); List <FluentResponseMessage> messages = new List <FluentResponseMessage>(); try { SoftwareStatementProfileResponse response = await creator.CreateAsync(context.Data); return(new OpenBankingSoftwareStatementResponse(messages: messages, data: response)); } catch (Exception ex) { context.Context.Instrumentation.Exception(ex); return(new OpenBankingSoftwareStatementResponse(message: ex.CreateErrorMessage(), data: null)); } }
public static SoftwareStatementProfileContext DefaultFragmentRedirectUrl( this SoftwareStatementProfileContext context, string url) { context.ArgNotNull(nameof(context)) .GetOrCreateDefault(DataLens).DefaultFragmentRedirectUrl = url; return(context); }
public static SoftwareStatementProfileContext SoftwareStatement( this SoftwareStatementProfileContext context, string statement) { context.ArgNotNull(nameof(context)) .GetOrCreateDefault(DataLens).SoftwareStatement = statement; return(context); }
public static SoftwareStatementProfileContext Id( this SoftwareStatementProfileContext context, string id) { context.ArgNotNull(nameof(context)) .GetOrCreateDefault(DataLens).Id = id; return(context); }
public static SoftwareStatementProfileContext Data( this SoftwareStatementProfileContext context, SoftwareStatementProfile value) { context.ArgNotNull(nameof(context)); value.ArgNotNull(nameof(value)); context.Data = value; return(context); }
public static SoftwareStatementProfileContext TransportKeyInfo( this SoftwareStatementProfileContext context, string keySecretName, string certificate) { SoftwareStatementProfile data = context.ArgNotNull(nameof(context)).GetOrCreateDefault(DataLens); data.TransportKey = keySecretName; data.TransportCertificate = certificate; return(context); }
private static IList <FluentResponseMessage> Validate(SoftwareStatementProfileContext context) { return(new SoftwareStatementProfileValidator() .Validate(context.Data) .GetOpenBankingResponses()); }