use of com.forgerock.openbanking.common.model.openbanking.domain.payment.FRWriteDomesticDataInitiation in project openbanking-aspsp by OpenBankingToolkit.
the class DomesticPaymentsApiController method responseEntity.
private OBWriteDomesticResponse4 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 OBWriteDomesticResponse4().data(new OBWriteDomesticResponse4Data().domesticPaymentId(frPaymentSubmission.getId()).initiation(toOBWriteDomestic2DataInitiation(frDomesticConsent.getDomesticConsent().getData().getInitiation())).creationDateTime(frDomesticConsent.getCreated()).statusUpdateDateTime(frDomesticConsent.getStatusUpdate()).status(toOBWriteDomesticResponse4DataStatus(frDomesticConsent.getStatus())).consentId(frDomesticConsent.getId()).refund(refund.map(FRResponseDataRefundConverter::toOBWriteDomesticResponse4DataRefund).orElse(null))).links(resourceLinkService.toSelfLink(frPaymentSubmission, discovery -> getVersion(discovery).getGetDomesticPayment())).meta(new Meta());
}
use of com.forgerock.openbanking.common.model.openbanking.domain.payment.FRWriteDomesticDataInitiation 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