Search in sources :

Example 1 with OBWriteDomesticStandingOrderResponse5Data

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

the class DomesticStandingOrdersApiController method responseEntity.

private OBWriteDomesticStandingOrderResponse5 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 OBWriteDomesticStandingOrderResponse5().data(new OBWriteDomesticStandingOrderResponse5Data().domesticStandingOrderId(frPaymentSubmission.getId()).initiation(toOBWriteDomesticStandingOrder3DataInitiation(frDomesticStandingOrderConsent.getDomesticStandingOrderConsent().getData().getInitiation())).creationDateTime(frDomesticStandingOrderConsent.getCreated()).statusUpdateDateTime(frDomesticStandingOrderConsent.getStatusUpdate()).status(toOBWriteDomesticStandingOrderResponse5DataStatus(frDomesticStandingOrderConsent.getStatus())).consentId(frDomesticStandingOrderConsent.getId()).refund(refund.map(FRResponseDataRefundConverter::toOBWriteDomesticResponse4DataRefund).orElse(null))).links(resourceLinkService.toSelfLink(frPaymentSubmission, discovery -> getVersion(discovery).getGetDomesticStandingOrder())).meta(new Meta());
}
Also used : Meta(uk.org.openbanking.datamodel.account.Meta) FRWriteDomesticStandingOrderDataInitiation(com.forgerock.openbanking.common.model.openbanking.domain.payment.FRWriteDomesticStandingOrderDataInitiation) FRReadRefundAccount(com.forgerock.openbanking.common.model.openbanking.domain.payment.common.FRReadRefundAccount) OBWriteDomesticStandingOrderResponse5Data(uk.org.openbanking.datamodel.payment.OBWriteDomesticStandingOrderResponse5Data) FRDomesticResponseDataRefund(com.forgerock.openbanking.common.model.openbanking.domain.payment.common.FRDomesticResponseDataRefund) OBWriteDomesticStandingOrderResponse5(uk.org.openbanking.datamodel.payment.OBWriteDomesticStandingOrderResponse5)

Aggregations

FRWriteDomesticStandingOrderDataInitiation (com.forgerock.openbanking.common.model.openbanking.domain.payment.FRWriteDomesticStandingOrderDataInitiation)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 OBWriteDomesticStandingOrderResponse5 (uk.org.openbanking.datamodel.payment.OBWriteDomesticStandingOrderResponse5)1 OBWriteDomesticStandingOrderResponse5Data (uk.org.openbanking.datamodel.payment.OBWriteDomesticStandingOrderResponse5Data)1