use of uk.org.openbanking.datamodel.payment.OBWriteDomesticResponse5Data in project openbanking-aspsp by OpenBankingToolkit.
the class DomesticPaymentsApiController method responseEntity.
private OBWriteDomesticResponse5 responseEntity(FRDomesticPaymentSubmission frPaymentSubmission, FRDomesticConsent frDomesticConsent) {
FRReadRefundAccount readRefundAccount = frDomesticConsent.getDomesticConsent().getData().getReadRefundAccount();
FRWriteDomesticDataInitiation initiation = frPaymentSubmission.getDomesticPayment().getData().getInitiation();
Optional<FRDomesticResponseDataRefund> refund = frDomesticResponseDataRefund(readRefundAccount, initiation);
return new OBWriteDomesticResponse5().data(new OBWriteDomesticResponse5Data().domesticPaymentId(frPaymentSubmission.getId()).initiation(toOBWriteDomestic2DataInitiation(frDomesticConsent.getDomesticConsent().getData().getInitiation())).creationDateTime(frDomesticConsent.getCreated()).statusUpdateDateTime(frDomesticConsent.getStatusUpdate()).status(toOBWriteDomesticResponse5DataStatus(frDomesticConsent.getStatus())).consentId(frDomesticConsent.getId()).debtor(toOBCashAccountDebtor4(frDomesticConsent.getDomesticConsent().getData().getInitiation().getDebtorAccount())).refund(refund.map(FRResponseDataRefundConverter::toOBWriteDomesticResponse5DataRefund).orElse(null))).links(resourceLinkService.toSelfLink(frPaymentSubmission, discovery -> getVersion(discovery).getGetDomesticPayment())).meta(new Meta());
}
Aggregations