use of uk.org.openbanking.datamodel.payment.OBWriteDomesticStandingOrderResponse6Data in project openbanking-aspsp by OpenBankingToolkit.
the class DomesticStandingOrdersApiController method responseEntity.
private OBWriteDomesticStandingOrderResponse6 responseEntity(FRDomesticStandingOrderPaymentSubmission frPaymentSubmission, FRDomesticStandingOrderConsent frDomesticStandingOrderConsent) {
FRReadRefundAccount readRefundAccount = frDomesticStandingOrderConsent.getDomesticStandingOrderConsent().getData().getReadRefundAccount();
FRWriteDomesticStandingOrderDataInitiation initiation = frPaymentSubmission.getDomesticStandingOrder().getData().getInitiation();
Optional<FRDomesticResponseDataRefund> refund = frDomesticResponseDataRefund(readRefundAccount, initiation);
return new OBWriteDomesticStandingOrderResponse6().data(new OBWriteDomesticStandingOrderResponse6Data().domesticStandingOrderId(frPaymentSubmission.getId()).initiation(toOBWriteDomesticStandingOrderConsentResponse6DataInitiation(initiation)).creationDateTime(frDomesticStandingOrderConsent.getCreated()).statusUpdateDateTime(frDomesticStandingOrderConsent.getStatusUpdate()).status(toOBWriteDomesticStandingOrderResponse6DataStatus(frDomesticStandingOrderConsent.getStatus())).debtor(toOBCashAccountDebtor4(frDomesticStandingOrderConsent.getInitiation().getDebtorAccount())).consentId(frDomesticStandingOrderConsent.getId()).refund(refund.map(FRResponseDataRefundConverter::toOBWriteDomesticResponse5DataRefund).orElse(null))).links(resourceLinkService.toSelfLink(frPaymentSubmission, discovery -> getVersion(discovery).getGetDomesticStandingOrder())).meta(new Meta());
}
Aggregations