public async Task <IActionResult> DomesticPaymentsPostAsync([FromBody] DomesticPayment request) { DomesticPaymentFluentResponse?resp = await _obRequestBuilder.DomesticPayment() .Data(request) .SubmitAsync(); PaymentResponse?result = new PaymentResponse( messages: resp.ToMessagesResponse(), data: resp.Data); return(resp.HasErrors ? new BadRequestObjectResult(result.Messages) as IActionResult : new ObjectResult(result) { StatusCode = StatusCodes.Status201Created }); }
public static async Task <DomesticPaymentFluentResponse> SubmitAsync(this DomesticPaymentContext context) { context.ArgNotNull(nameof(context)); try { DomesticPayment domesticPayment = context.Data ?? new DomesticPayment( context.ConsentId.ArgNotNullElseInvalidOp("ConsentId not specified")); IList <FluentResponseMessage> validationErrors = new PaymentRequestValidator() .Validate(domesticPayment) .GetOpenBankingResponses(); if (validationErrors.Count > 0) { return(new DomesticPaymentFluentResponse(validationErrors)); } CreateDomesticPayment i = new CreateDomesticPayment( apiClient: context.Context.ApiClient, mapper: context.Context.EntityMapper, openBankingClientRepo: context.Context.ClientProfileRepository, domesticConsentRepo: context.Context.DomesticConsentRepository, apiProfileRepo: context.Context.ApiProfileRepository, softwareStatementProfileService: context.Context.SoftwareStatementProfileService); OBWriteDomesticResponse4 resp = await i.CreateAsync(domesticPayment.ConsentId); return(new DomesticPaymentFluentResponse(resp.Data)); } catch (AggregateException ex) { context.Context.Instrumentation.Exception(ex); return(new DomesticPaymentFluentResponse(ex.CreateErrorMessages())); } catch (Exception ex) { context.Context.Instrumentation.Exception(ex); return(new DomesticPaymentFluentResponse(ex.CreateErrorMessage())); } }
public void UpdatePaymentInformation(DomesticPayment objSaveDetailListModel) { InsuranceContext.DomesticPayments.Update(objSaveDetailListModel); }
public static DomesticPaymentContext Data(this DomesticPaymentContext context, DomesticPayment value) { context.Data = value; return(context); }
public void SavePaymentPaymentInformations(DomesticPayment objSaveDetailListModel) { InsuranceContext.DomesticPayments.Insert(objSaveDetailListModel); }