Search in sources :

Example 1 with OBWriteInternationalStandingOrderResponse6Data

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

the class InternationalStandingOrdersApiController method responseEntity.

private OBWriteInternationalStandingOrderResponse6 responseEntity(FRInternationalStandingOrderPaymentSubmission frPaymentSubmission, FRInternationalStandingOrderConsent frInternationalStandingOrderConsent) {
    FRReadRefundAccount readRefundAccount = frInternationalStandingOrderConsent.getInternationalStandingOrderConsent().getData().getReadRefundAccount();
    FRWriteInternationalStandingOrderDataInitiation initiation = frPaymentSubmission.getInternationalStandingOrder().getData().getInitiation();
    Optional<FRInternationalResponseDataRefund> refund = frInternationalResponseDataRefund(readRefundAccount, initiation);
    return new OBWriteInternationalStandingOrderResponse6().data(new OBWriteInternationalStandingOrderResponse6Data().internationalStandingOrderId(frPaymentSubmission.getId()).initiation(toOBWriteInternationalStandingOrder4DataInitiation(initiation)).creationDateTime(frInternationalStandingOrderConsent.getCreated()).statusUpdateDateTime(frInternationalStandingOrderConsent.getStatusUpdate()).status(toOBWriteInternationalStandingOrderResponse6DataStatus(frInternationalStandingOrderConsent.getStatus())).consentId(frInternationalStandingOrderConsent.getId()).refund(refund.map(FRResponseDataRefundConverter::toOBWriteInternationalResponse4DataRefund).orElse(null))).links(resourceLinkService.toSelfLink(frPaymentSubmission, discovery -> getVersion(discovery).getGetInternationalStandingOrder())).meta(new Meta());
}
Also used : Meta(uk.org.openbanking.datamodel.account.Meta) OBWriteInternationalStandingOrderResponse6(uk.org.openbanking.datamodel.payment.OBWriteInternationalStandingOrderResponse6) FRReadRefundAccount(com.forgerock.openbanking.common.model.openbanking.domain.payment.common.FRReadRefundAccount) FRInternationalResponseDataRefund(com.forgerock.openbanking.common.model.openbanking.domain.payment.common.FRInternationalResponseDataRefund) OBWriteInternationalStandingOrderResponse6Data(uk.org.openbanking.datamodel.payment.OBWriteInternationalStandingOrderResponse6Data) FRWriteInternationalStandingOrderDataInitiation(com.forgerock.openbanking.common.model.openbanking.domain.payment.FRWriteInternationalStandingOrderDataInitiation)

Aggregations

FRWriteInternationalStandingOrderDataInitiation (com.forgerock.openbanking.common.model.openbanking.domain.payment.FRWriteInternationalStandingOrderDataInitiation)1 FRInternationalResponseDataRefund (com.forgerock.openbanking.common.model.openbanking.domain.payment.common.FRInternationalResponseDataRefund)1 FRReadRefundAccount (com.forgerock.openbanking.common.model.openbanking.domain.payment.common.FRReadRefundAccount)1 Meta (uk.org.openbanking.datamodel.account.Meta)1 OBWriteInternationalStandingOrderResponse6 (uk.org.openbanking.datamodel.payment.OBWriteInternationalStandingOrderResponse6)1 OBWriteInternationalStandingOrderResponse6Data (uk.org.openbanking.datamodel.payment.OBWriteInternationalStandingOrderResponse6Data)1