Search in sources :

Example 1 with OBWriteDomesticScheduledResponse5Data

use of uk.org.openbanking.datamodel.payment.OBWriteDomesticScheduledResponse5Data in project openbanking-aspsp by OpenBankingToolkit.

the class DomesticScheduledPaymentsApiController method responseEntity.

private OBWriteDomesticScheduledResponse5 responseEntity(FRDomesticScheduledPaymentSubmission frPaymentSubmission, FRDomesticScheduledConsent frDomesticScheduledConsent) {
    FRReadRefundAccount readRefundAccount = frDomesticScheduledConsent.getDomesticScheduledConsent().getData().getReadRefundAccount();
    FRWriteDomesticScheduledDataInitiation initiation = frPaymentSubmission.getDomesticScheduledPayment().getData().getInitiation();
    Optional<FRDomesticResponseDataRefund> refund = frDomesticResponseDataRefund(readRefundAccount, initiation);
    return new OBWriteDomesticScheduledResponse5().data(new OBWriteDomesticScheduledResponse5Data().domesticScheduledPaymentId(frPaymentSubmission.getId()).initiation(toOBWriteDomesticScheduled2DataInitiation(frDomesticScheduledConsent.getInitiation())).creationDateTime(frDomesticScheduledConsent.getCreated()).statusUpdateDateTime(frDomesticScheduledConsent.getStatusUpdate()).status(toOBWriteDomesticScheduledResponse5DataStatus(frDomesticScheduledConsent.getStatus())).debtor(toOBCashAccountDebtor4(frDomesticScheduledConsent.getInitiation().getDebtorAccount())).consentId(frDomesticScheduledConsent.getId()).refund(refund.map(FRResponseDataRefundConverter::toOBWriteDomesticResponse5DataRefund).orElse(null))).links(resourceLinkService.toSelfLink(frPaymentSubmission, discovery -> getVersion(discovery).getGetDomesticScheduledPayment())).meta(new Meta());
}
Also used : Meta(uk.org.openbanking.datamodel.account.Meta) FRWriteDomesticScheduledDataInitiation(com.forgerock.openbanking.common.model.openbanking.domain.payment.FRWriteDomesticScheduledDataInitiation) OBWriteDomesticScheduledResponse5Data(uk.org.openbanking.datamodel.payment.OBWriteDomesticScheduledResponse5Data) FRReadRefundAccount(com.forgerock.openbanking.common.model.openbanking.domain.payment.common.FRReadRefundAccount) OBWriteDomesticScheduledResponse5(uk.org.openbanking.datamodel.payment.OBWriteDomesticScheduledResponse5) FRDomesticResponseDataRefund(com.forgerock.openbanking.common.model.openbanking.domain.payment.common.FRDomesticResponseDataRefund)

Aggregations

FRWriteDomesticScheduledDataInitiation (com.forgerock.openbanking.common.model.openbanking.domain.payment.FRWriteDomesticScheduledDataInitiation)1 FRDomesticResponseDataRefund (com.forgerock.openbanking.common.model.openbanking.domain.payment.common.FRDomesticResponseDataRefund)1 FRReadRefundAccount (com.forgerock.openbanking.common.model.openbanking.domain.payment.common.FRReadRefundAccount)1 Meta (uk.org.openbanking.datamodel.account.Meta)1 OBWriteDomesticScheduledResponse5 (uk.org.openbanking.datamodel.payment.OBWriteDomesticScheduledResponse5)1 OBWriteDomesticScheduledResponse5Data (uk.org.openbanking.datamodel.payment.OBWriteDomesticScheduledResponse5Data)1